Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantization of lon/lat coordinates #50

Open
gmaclennan opened this issue Apr 11, 2017 · 1 comment
Open

Quantization of lon/lat coordinates #50

gmaclennan opened this issue Apr 11, 2017 · 1 comment

Comments

@gmaclennan
Copy link
Member

We should quantize the coordinates to a fixed precision to avoid database bloat and potential floating point rounding errors at the spatial index. Decimal degrees precision:

decimal degree @ 0° Lat @ 30° Lat @ 60° Lat
2 0.01° ~ 1 km ~ 0.9 km ~ 0.5 km
3 0.001° ~ 100 m ~ 90 m ~ 50 m
4 0.0001° ~ 10 m ~ 9 m ~ 5 m
5 0.00001° ~ 1 m ~ 0.9 m ~ 0.5 m
6 0.000001° ~ 0.1 m ~ 0.09 m ~ 0.05 m
7 0.0000001° ~ 0.01 m ~ 0.009 m ~ 0.005 m
8 0.00000001° ~ 0.001 m ~ 0.0009 m ~ 0.0005 m

8 decimal places would get us 1mm precision, I think that's more than enough. The GeoJSON Spec recommends 6 decimal places for <10cm precision. There may be use-cases for greater precision, e.g. drawing precise building footprints. I think 8 decimal places (1mm precision) would be more than enough. Perhaps configurable at a DB level? Would it need to be kept consistent across the whole db?

@hackergrrl
Copy link
Contributor

I think as long as all levels of quantization fit into the chosen datatype in kdb-tree-store it will be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants