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

Function msGEOSSimplify

mapgeos.c:683–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683shapeObj *msGEOSSimplify(shapeObj *shape, double tolerance)
684{
685#ifdef USE_GEOS
686 GEOSGeom g1, g2;
687
688 if(!shape)
689 return NULL;
690
691 if(!shape->geometry) /* if no geometry for the shape then build one */
692 shape->geometry = (GEOSGeom) msGEOSShape2Geometry(shape);
693
694 g1 = (GEOSGeom) shape->geometry;
695 if(!g1) return NULL;
696
697 g2 = GEOSSimplify(g1, tolerance);
698 return msGEOSGeometry2Shape(g2);
699#else
700 msSetError(MS_GEOSERR, "GEOS Simplify support is not available.", "msGEOSSimplify()");
701 return NULL;
702#endif
703}
704
705shapeObj *msGEOSTopologyPreservingSimplify(shapeObj *shape, double tolerance)
706{

Callers 1

shapeObj_simplifyFunction · 0.85

Calls 3

msGEOSShape2GeometryFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected