MCPcopy Create free account
hub / github.com/MapServer/MapServer / msGEOSShapeToWKT

Function msGEOSShapeToWKT

mapgeos.c:624–644  ·  view source on GitHub ↗

Return should be freed with msGEOSFreeWKT */

Source from the content-addressed store, hash-verified

622
623/* Return should be freed with msGEOSFreeWKT */
624char *msGEOSShapeToWKT(shapeObj *shape)
625{
626#ifdef USE_GEOS
627 GEOSGeom g;
628
629 if(!shape)
630 return NULL;
631
632 /* if we have a geometry, we should update it*/
633 msGEOSFreeGeometry(shape);
634
635 shape->geometry = (GEOSGeom) msGEOSShape2Geometry(shape);
636 g = (GEOSGeom) shape->geometry;
637 if(!g) return NULL;
638
639 return GEOSGeomToWKT(g);
640#else
641 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSShapeToWKT()");
642 return NULL;
643#endif
644}
645
646void msGEOSFreeWKT(char* pszGEOSWKT)
647{

Callers 2

msShapeToWKTFunction · 0.85

Calls 3

msGEOSFreeGeometryFunction · 0.85
msGEOSShape2GeometryFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected