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

Function msGEOSIntersection

mapgeos.c:826–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824}
825
826shapeObj *msGEOSIntersection(shapeObj *shape1, shapeObj *shape2)
827{
828#ifdef USE_GEOS
829 GEOSGeom g1, g2, g3;
830
831 if(!shape1 || !shape2)
832 return NULL;
833
834 if(!shape1->geometry) /* if no geometry for the shape then build one */
835 shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1);
836 g1 = (GEOSGeom) shape1->geometry;
837 if(!g1) return NULL;
838
839 if(!shape2->geometry) /* if no geometry for the shape then build one */
840 shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2);
841 g2 = (GEOSGeom) shape2->geometry;
842 if(!g2) return NULL;
843
844 g3 = GEOSIntersection(g1, g2);
845 return msGEOSGeometry2Shape(g3);
846#else
847 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSIntersection()");
848 return NULL;
849#endif
850}
851
852shapeObj *msGEOSDifference(shapeObj *shape1, shapeObj *shape2)
853{

Callers 1

shapeObj_intersectionFunction · 0.85

Calls 3

msGEOSShape2GeometryFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected