On Thu, Dec 10, 2020 at 01:35:17AM +0100, Even Rouault wrote: > On mercredi 9 décembre 2020 12:13:17 CET Sandro Santilli wrote: > > I found out that GEOSMakeValid will remove EMPTY components from > > collections. The PostGIS implementation of it does not do this. > > > > The rationale was that a collection with EMPTY component is NOT > > invalid as per OGC specification, so why removing them ? Isn't > > that a job for CollectionHomogenize or similar ? > > Actually the unit tests have checks for this. > > See tests/xmltester/tests/misc/makevalid.xml > > <case> > <desc>makevalid/geometry_collection</desc> > <a>GEOMETRYCOLLECTION(POINT EMPTY,LINESTRING EMPTY,POLYGON((0 0,0 1,1 1,1 > 0,0 0),(0 0.5,0.5 0.1,1 0.5,0 0.5)))</a> > <test> > <op name="makevalid" arg1="a"> > GEOMETRYCOLLECTION (MULTIPOLYGON (((0.0 0.0, 0.0 0.5, 0.5 0.1, 1.0 > 0.5, 1.0 0.0, 0.0 0.0)), ((0.0 0.5, 0.0 1.0, 1.0 1.0, 1.0 0.5, 0.0 > 0.5))),LINESTRING EMPTY, POINT EMPTY) > </op> > </test> > </case>
Odd, for a MULTIPOINT with empty components it seems to strip it. But I cannot add the test because it looks like EMPTY is not accepted in WKT: MULTIPOINT(EMPTY,1 1,EMPTY,0 0) ParseException: Expected number but encountered word: 'EMPTY') --strk; _______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/geos-devel