** WKT input and output functions */
| 599 | ** WKT input and output functions |
| 600 | */ |
| 601 | shapeObj *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 */ |
| 624 | char *msGEOSShapeToWKT(shapeObj *shape) |
no test coverage detected