twpayne / go-geom

Package geom implements efficient geometry types for geospatial applications.
BSD 2-Clause "Simplified" License
852 stars 105 forks source link

encoding/wkt: expose maxDecimalDigits as an option #166

Closed otan closed 4 years ago

otan commented 4 years ago

This commit adds support for maximum decimal digits in WKT encoding, similar to the way PostGIS handles ST_AsText(, ). We have to do extra processing to remove trailing 0 and . marks.

To make this change, we also expose "Encoder" as a struct, with the Encode object made public. This can take in EncodeOptions which allow an arbitrary amount of options in a clean way.

twpayne commented 4 years ago

This is really nice, thank you!