mapbox / mapbox/mapnik-omnivore

getZooms inconsistent when longitudes exceed +-180

Open
#147 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
44
Forks
17
PR merge metrics
No merged PRs in 30d

Description

I've only been looking into GeoJSON, so I don't know if the same thing stretches to other data types.

If the data is entirely contained in longitudes more negative than `-180` (e.g. a point at `[-222, 30]`), I see `Error calculating min/max zoom: Bounds invalid`. If it is entirely contained in longitudes more positive than `+180`, though, I see no error.

If the data stretches from one world into another, e.g. an extent `[-21.796875, 31.952162238024975, 444.03125, 33.137551192346145]`, `getZooms()` returns the minimum zoom levels, `0 6`. That zoom level would not capture the feature on a map, though.

I'm just trying to get to the bottom of what the expectation is here concerning longitudes +-180.

Contributor guide

Open the contributing guide

Research direction

Start at the getZooms entry point and reproduce the reported GeoJSON cases: longitudes below -180, above +180, and an extent crossing worlds. Clarify the expected handling of out-of-range longitudes, then make the minimum and maximum zoom behavior consistent and verify each case no longer produces an invalid or unusable result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.