rgeo/rgeo-geojson

set default precision for coordinates?

Closed this issue · 1 comments

Is it possible to set a default max number of decimal places to include in latitude/longitude values being serialized?

@drewda we could do that, however I think this should be part of RGeo rather than RGeo::GeoJSON. Using GEOS' GeometryPrecisionReducer.

This could look like:

RGeo::GeoJSON.decode(some_geojson).geometry.update_precision(6)

There are also postgis functions for that. For instance ST_Force2D will remove extra coordinates and round to 6 digits.

I'm closing the current issue. If you still want such a feature, please mention this issue in a new one directly in https://github.com/rgeo/rgeo.