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

Function msGEOSShapeFromWKT

mapgeos.c:601–621  ·  view source on GitHub ↗

** WKT input and output functions */

Source from the content-addressed store, hash-verified

599** WKT input and output functions
600*/
601shapeObj *msGEOSShapeFromWKT(const char *wkt)
602{
603#ifdef USE_GEOS
604 GEOSGeom g;
605
606 if(!wkt)
607 return NULL;
608
609 g = GEOSGeomFromWKT(wkt);
610 if(!g) {
611 msSetError(MS_GEOSERR, "Error reading WKT geometry \"%s\".", "msGEOSShapeFromWKT()", wkt);
612 return NULL;
613 } else {
614 return msGEOSGeometry2Shape(g);
615 }
616
617#else
618 msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSShapeFromWKT()");
619 return NULL;
620#endif
621}
622
623/* Return should be freed with msGEOSFreeWKT */
624char *msGEOSShapeToWKT(shapeObj *shape)

Callers 1

msShapeFromWKTFunction · 0.85

Calls 2

msSetErrorFunction · 0.85
msGEOSGeometry2ShapeFunction · 0.85

Tested by

no test coverage detected