mapbox / mapnik-omnivore

Node module that returns metadata about spatial files.
45 stars 19 forks source link

getZooms inconsistent when longitudes exceed +-180 #147

Open davidtheclark opened 8 years ago

davidtheclark commented 8 years ago

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.

davidtheclark commented 8 years ago

I created some test cases to illustrate in https://github.com/mapbox/mapnik-omnivore/pull/148.