mapbox / mapnik-omnivore

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

max zoom selection uses unconverted source units #174

Open dnomadb opened 6 years ago

dnomadb commented 6 years ago

The source's resolution is converted to meters here: https://github.com/mapbox/mapnik-omnivore/blob/29ead3673df622c773f334ec555d3d749a9c673f/lib/raster.js#L162

But then the resolution in native units is then used to calculate the max zoom: https://github.com/mapbox/mapnik-omnivore/blob/29ead3673df622c773f334ec555d3d749a9c673f/lib/raster.js#L173

This results in incorrect maxzoom selection for non-meter source data, as the thresholds for zoom levels are defined in mercator meters. This can be fixed by simply swapping out _this.details.pixelSize[0] for pixelSize[0] above.

cc @pratikyadav