mapbox / geojson-vt

Slice GeoJSON into vector tiles on the fly in the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rounding to the nearest integer

captain-igloo opened this issue · comments

Why are points rounded here? Aren't the rounded numbers are less accurate?

Could a configuration option be added to control this behaviour?

My use case - I have a circle as a polygon, when I draw the result from geojson-vt on the canvas it is not as smooth due to the rounding. See screenshot, the circle on the left is the original, the one on the right has had its coordinates rounded.

geojson-vt-screenshot

They are rounded because they should be integers according to the vector tile specification. To increase precision, you need to make the layer extent bigger (in geojson-vt, it's 4096 for a tile by default).