| 681 | } |
| 682 | |
| 683 | shapeObj *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 | |
| 705 | shapeObj *msGEOSTopologyPreservingSimplify(shapeObj *shape, double tolerance) |
| 706 | { |
no test coverage detected