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

Function msGEOSDifference

mapgeos.c:852–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852shapeObj *msGEOSDifference(shapeObj *shape1, shapeObj *shape2)
853{
854#ifdef USE_GEOS
855 GEOSGeom g1, g2, g3;
856
857 if(!shape1 || !shape2)
858 return NULL;
859
860 if(!shape1->geometry) /* if no geometry for the shape then build one */
861 shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1);
862 g1 = (GEOSGeom) shape1->geometry;
863 if(!g1) return NULL;
864
865 if(!shape2->geometry) /* if no geometry for the shape then build one */
866 shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2);
867 g2 = (GEOSGeom) shape2->geometry;
868 if(!g2) return NULL;
869
870 g3 = GEOSDifference(g1, g2);
871 return msGEOSGeometry2Shape(g3);
872#else
873 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSDifference()");
874 return NULL;
875#endif
876}
877
878shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2)
879{

Callers 1

shapeObj_differenceFunction · 0.85

Calls 3

msGEOSShape2GeometryFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected