Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect geometry decoding in bing tiles #184

Closed
springmeyer opened this issue Jun 21, 2024 · 3 comments · Fixed by #193
Closed

Incorrect geometry decoding in bing tiles #184

springmeyer opened this issue Jun 21, 2024 · 3 comments · Fixed by #193
Labels
bug Something isn't working

Comments

@springmeyer
Copy link
Collaborator

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
@springmeyer springmeyer added the bug Something isn't working label Jun 21, 2024
springmeyer added a commit to springmeyer/maplibre-tile-spec that referenced this issue Jun 21, 2024
@springmeyer
Copy link
Collaborator Author

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

@springmeyer
Copy link
Collaborator Author

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

@springmeyer
Copy link
Collaborator Author

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]]]}

springmeyer pushed a commit that referenced this issue Jun 25, 2024
springmeyer added a commit to springmeyer/maplibre-tile-spec that referenced this issue Jun 25, 2024
springmeyer added a commit that referenced this issue Jun 25, 2024
Currently we do not fully test all these combinations:

 - Vectorized path + advanced encodings
 - Vectorized path + without advanced encodings
 - Non-Vectorized path + advanced encodings
 - Non-Vectorized path + without advanced encodings
 
This PR starts testing all those paths.

The code coverage changes are:

 - **overall:** `36%`to `45%`
 - **mlt.converter:** `64%` to `85%`
 - **mlt.decoder:** `55%` to `71%`

In addition this PR includes:

- Some refactoring in TestUtils.java to share more code between
vectorized and non-vectorized
- Improvements to TestUtils.java around geometry comparisons (refs #178)
 - Improvements to TestUtils.java around property comparisons

Finally, this PR does not attempt to solve any bugs. Rather it finds,
isolates, and writes tests harnesses to capture them in code. Once bugs
are solved in the future it should be easy to update the tests
accordingly.

TODO:
- [x] ~This PR uncovered a number of bugs that do not have open issues
and did not have tests that hit them until now. So I need to create
following issues to capture fixing these.~
     - Added:
        - #181
        - #182 
        - #183 
        - #184
        - #185
        - #186
- [ ] Property nesting in MLT makes comparison to MVT difficult so I
disabled it in this test refactor because comparison to MVT is what the
decoder tests rely on. My sense is that standalone unit tests of nesting
might be more appropriate than including nesting in the decoder tests.
Do others agree?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant