mapbox / mapbox/mapnik-omnivore
Zoom detection is bad on sparse datasets
- Dominant language
- JavaScript
- Stars
- 44
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
The zoom level detection logic for vector data makes an implicit assumption that data is evenly distributed across the dataset's extent. By [considering the average tile size as the metric](https://github.com/mapbox/mapnik-omnivore/blob/d2a41818d7e0de2953f47729c16ed32a16f1ebb4/lib/utils.js#L35) for determining a valid zoom, datasets with very large extents and very little data (e.g. two points halfway across the world from each other), will end up with very low max zoom values.
Issues arise in the case of two points with very low max zoom. At such a low zoom level the vector-tile's encoding of either feature's geometry is very geographically imprecise, but that's ok at low zooms where you can't see the lack of precision. But if you overzoom the low-z tiles in order to portray those points at higher zoom levels, you'll get to a point where you can clearly see the imprecision -- the points will appear to be in the wrong place.
cc @GretaCB
Contributor guide
Research direction
Start in lib/utils.js at the linked zoom-detection logic and inspect how average tile size determines a valid zoom. Reproduce the sparse-dataset case described with two distant points, then define completion as avoiding an excessively low max zoom while preserving accurate point placement when tiles are overzoomed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100