[GIS] Simplify polygon in OGR

gdalogr

We use ArcObjects pretty heavily and simplify polygons using something similar to the ITopologicalOperation::Simplify(void). No tolerance is passed in as the parameter (it uses the XY tolerance of the associated spatial reference).

Now, we're using OGR for some functionality and would like to simplify using this library. What's the equivalent? I'm aware of OGRGeometry::SimplifyPreserveTopology(double dTolerance) but I'm not sure where to get the tolerance from the in OGR library.

Best Answer

You must supply the tolerance, whether in Arc or OGR. It is the measure of your simplification operation and is just a decimal number in the the same units as the SRS of your data.

In Arc ESRI stores an XY tolerance as a separate value. This is proprietary to ESRI and not inherent in the SRS. Either you specify it or ESRI supplies a default - either way it is the same thing as you explicitly supplying a value to OGR. ESRI calculates the default but there is nothing sacred about the value. It's just a suggestion and may not be relevant to your particular data depending on its provenance, collection methods etc.