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

Function msGEOSUnion

mapgeos.c:800–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800shapeObj *msGEOSUnion(shapeObj *shape1, shapeObj *shape2)
801{
802#ifdef USE_GEOS
803 GEOSGeom g1, g2, g3;
804
805 if(!shape1 || !shape2)
806 return NULL;
807
808 if(!shape1->geometry) /* if no geometry for the shape then build one */
809 shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1);
810 g1 = (GEOSGeom) shape1->geometry;
811 if(!g1) return NULL;
812
813 if(!shape2->geometry) /* if no geometry for the shape then build one */
814 shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2);
815 g2 = (GEOSGeom) shape2->geometry;
816 if(!g2) return NULL;
817
818 g3 = GEOSUnion(g1, g2);
819 return msGEOSGeometry2Shape(g3);
820#else
821 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSUnion()");
822 return NULL;
823#endif
824}
825
826shapeObj *msGEOSIntersection(shapeObj *shape1, shapeObj *shape2)
827{

Callers 1

shapeObj_UnionFunction · 0.85

Calls 3

msGEOSShape2GeometryFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected