georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
321 stars 30 forks source link

Support for writing WKT with precision #199

Open kylebarron opened 4 months ago

kylebarron commented 4 months ago

It doesn't appear that there's currently a way to write WKT values with a given precision?

I'm implementing "display methods" in geoarrow so that Python users can have a better display in a terminal than

<geoarrow.rust.core._rust.MultiPolygonArray at 0x10a12e9a0>

and in this use case, having too many decimals of precision is distracting. E.g. shapely gives a "repr" of

image

It looks like this format! would have to be changed? https://github.com/georust/geozero/blob/52a4d2d3c11f02e734274fcb6ee4b88b94b5b53d/geozero/src/wkt/wkt_writer.rs#L104

Ref https://stackoverflow.com/a/49778870