mapbox / mapbox/supermercado

burn doesn't handle antimeridian crossings

Open
#58 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
132
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Given a polygon which crosses the antimeridian, `burn` returns the wrong tileset.

Image

at zoom=3, `burn` returns the following instead of the correct set of 4 tiles:
```
array([[0, 4, 3],
[1, 4, 3],
[2, 4, 3],
[3, 4, 3],
[4, 4, 3],
[5, 4, 3],
[6, 4, 3],
[7, 4, 3],
[0, 5, 3],
[1, 5, 3],
[2, 5, 3],
[3, 5, 3],
[4, 5, 3],
[5, 5, 3],
[6, 5, 3],
[7, 5, 3]], dtype=int64)
```
I think the fundamental problem is that `find_extrema()` just does a min/max operation which ignores the crossing.

rename to antimeridian.geojson:
[antimeridian.txt](https://github.com/user-attachments/files/23945408/antimeridian.txt)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting `burn` and the reported `find_extrema()` min/max logic, then reproduce the issue with the supplied antimeridian GeoJSON at zoom 3. Compare the result with the expected four-tile set and verify that antimeridian-crossing polygons no longer produce the full world-width tileset.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.