mapbox / mapnik-omnivore

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

Zoom detection is bad on sparse datasets #140

Open rclark opened 8 years ago

rclark commented 8 years ago

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 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