wavded / ogr2ogr

An ogr2ogr wrapper library
MIT License
214 stars 46 forks source link

precision? #84

Closed zoobot closed 2 years ago

zoobot commented 2 years ago

How are you doing the lng/lat precision? Is there a way to set the precision in ogr2ogr? We are doing a form of geohashing and the precision is causing some collisions, could use one more digit of precision to avoid the collisions. Thanks!

zoobot commented 2 years ago

@wavded wavded Hi! Is there a way to set precision? I tried -co DECIMAL_PRECISION=8 but that failed on shapefiles... Thanks

wavded commented 2 years ago

Hey @zoobot, sorry but I do not know offhand. I know you can pass any of the available ogr2ogr vector options in this tool. I would try your question on https://gis.stackexchange.com unless you can find more information in the driver documentation -> https://gdal.org/drivers/vector/index.html

zoobot commented 2 years ago

Hi @wavded Thanks for your response!! I asked on the spatial community slack and someone there was able to point me in the right direction: -lco COORDINATE_PRECISION=8 I ended up having to set it a higher than 8, as it rounds to ceiling instead of truncates. geojson spec

wavded commented 2 years ago

Thanks for the follow up @zoobot ! Ok to close this?

zoobot commented 2 years ago

Yes thanks!