mapbox / mapbox/mapnik-omnivore
max zoom selection uses unconverted source units
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 44
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/raster.js at the resolution conversion around line 162 and the max-zoom calculation around line 173. Compare the converted pixel size with the value used for zoom selection, then verify that non-meter source data uses the mercator-meter thresholds and produces the correct max zoom.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100