-
Notifications
You must be signed in to change notification settings - Fork 399
Open
Description
I see a few inconsistencies with GEOSGeom_setPrecision. For example:
-
$ ./bin/geosop -a "LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)" reducePrecision 1 LINEARRING Z EMPTY -
$ ./bin/geosop -a "LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)" reducePrecisionKeepCollapsed 1 LINESTRING (0 0, 0 0, 0 0) -
$ ./bin/geosop -a "LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)" reducePrecisionPointwise 1 LINEARRING (0 0, 0 0, 0 0, 0 0, 0 0)
Here are my guesses for better answers:
- Should be
LINEARRING EMPTY(without Z dimension) - Should not be LINESTRING, but perhaps be
LINEARRING (0 0, 0 0, 0 0) - Probably fine?
More on case 1, GEOSGeom_setPrecision test<10> doesn't fail because ensure_geometry_equals ignores Z/M dims, thus LINEARRING Z EMPTY == LINEARRING EMPTY. There is a similar issue with GEOSGeom_transformXY test<10> where POINT Z EMPTY is returned and compared equal to POINT EMPTY. I'd like ensure_geometry_equals to check if (GEOSHasZ(g1) != GEOSHasZ(g2)) || (GEOSHasM(g1) != GEOSHasM(g2)).
The issue is probably related to GeometryTransformer / GeometryFactory::createLinearRing().
See also trac #1135