MCPcopy Index your code
hub / github.com/MapServer/MapServer / msGEOSSymDifference

Function msGEOSSymDifference

mapgeos.c:878–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2)
879{
880#ifdef USE_GEOS
881 GEOSGeom g1, g2, g3;
882
883 if(!shape1 || !shape2)
884 return NULL;
885
886 if(!shape1->geometry) /* if no geometry for the shape then build one */
887 shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1);
888 g1 = (GEOSGeom) shape1->geometry;
889 if(!g1) return NULL;
890
891 if(!shape2->geometry) /* if no geometry for the shape then build one */
892 shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2);
893 g2 = (GEOSGeom) shape2->geometry;
894 if(!g2) return NULL;
895
896 g3 = GEOSSymDifference(g1, g2);
897 return msGEOSGeometry2Shape(g3);
898#else
899 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSSymDifference()");
900 return NULL;
901#endif
902}
903
904/*
905** Binary predicates exposed to MapServer/MapScript

Callers 1

shapeObj_symdifferenceFunction · 0.85

Calls 3

msGEOSShape2GeometryFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected