maplibre/maplibre-tile-spec

Incorrect geometry decoding in bing tiles

springmeyer opened this issue · 3 comments

After #180, we can see incorrect decoding of tiles in this test:

./gradlew test --tests com.mlt.decoder.MltDecoderTest.decodeBingTiles

The MVT geometry is:

mvtGeometry: POLYGON ((0 0, 4096 0, 4096 4096, 0 4096, 0 0))

While the MLT geometry is:

POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0))

This impacts both the vectorized and non-vectorized paths. It only impacts the non-advanced encoding path.

This problem manifests in these tiles:

  • 7-66-44
  • 7-66-43
  • 7-66-42
  • 7-65-42
  • 6-32-21
  • 6-32-23
  • 6-33-22
  • 5-17-10
  • 5-17-11
  • 5-16-11
  • 4-13-6
  • 4-9-5
  • 4-12-6
  • 4-8-5

@mactrem do you have any ideas for where this problem is happening? Perhaps something in the Hilbert code?

Or, since it only impacts the non-advanced path, perhaps some geometry decoding code is just out of date compared to the advanced path?

I think this bug is happening in the vector_background layer of bing tiles. I'm seeing it in the JS decoder when GeoJSON is output.

The expected output (from vector-tile-js) is:

{"type":"Polygon","coordinates":[[[0,55.776573018667705],[22.5,55.776573018667705],[22.5,40.979898069620134],[0,40.979898069620134],[0,55.776573018667705]]]}

But the actual output is:

{"type":"Polygon","coordinates":[[[0,55.776573018667705],[0,55.776573018667705],[0,55.776573018667705],[0,55.776573018667705],[0,55.776573018667705]]]}