Is it possible for the simplification - as performed by GEOS - to fail for some geometries? If so, is there a need to return that information with the Simplify API? In other words, is there a difference between simplification returning an empty geometry vs. it failing? The former might be a valid result, while the latter is not.
From: mapguide-internals [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Thursday, November 19, 2015 1:15 AM
To: [hidden email] Subject: [mapguide-internals] Review/Discuss: MapGuide RFC 153 (Geometry Simplification APIs)
In GEOS, failure to simplify is denoted by an empty geometry instance being returned, which in WKT (since that's what is used to move between MgGeometry <-> GEOS geometry forms) is being rendered out as
The MapGuide WKT parser doesn't recognize the EMPTY part so NULL is returned on empty GEOS geometries. There's existing code in MgGeosUtil that follows similar logic (return NULL MgGeometry on "<GEOMTYPE> EMPTY" WKT text.
If a simplification operation is a "no-op", GEOS actually returns the same geometry (same in the sense that its output WKT would be the same as its input WKT)
So returning NULL should be an acceptable indication of simplification failure.