jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
898 stars 120 forks source link

to_instance precision #133

Open jornedeblaere opened 4 years ago

jornedeblaere commented 4 years ago

Due to the update of v2.4.1 to v2.5.0 the signature of the Geometry.init has changed by adding the precision parameter. As we work with precision=7 this causes some troubles with the base.to_instance() function as here no precision parameter is provided and thus in the parsing precision 6 is used. Although this can be overcome by injecting the precission in the input feature.geometry proptery, I think it would be a nice improvement if this precision parameter could be added in the to_instance() call as well.

mbway commented 4 years ago

in addition, it would be nice to either have some way of passing parameters from the load() and loads() functions to the geometry objects, such as precision. If the parameters were exposed to to_instance() then a partially applied call could be passed as the object_hook parameter to load() but this isn't very user friendly.

klausmyrseth commented 4 years ago

We have the same problem, we need to be able to set presicion on to_instance aswell. We are working with high precision devices also in research and need to be able to override the default also in to_presision.

So +1

aj-hitchins commented 4 years ago

You can set the defaults as per this response until there is a fix: https://github.com/jazzband/geojson/issues/135#issuecomment-596509669

hhowe29 commented 3 years ago

+1. Working with precision AG data where the GPS coordinates were corrected with RTK down to 1 inch accuracy. Need a clean way to override the default precision of 6. The workaround is getting us by.

rayrrr commented 2 years ago

This is fixed on the master branch thanks to #177. DEFAULT_PRECISION can now be set at the package level. This feature will become available in the next release, sometime this month.