| 850 | } |
| 851 | |
| 852 | shapeObj *msGEOSDifference(shapeObj *shape1, shapeObj *shape2) |
| 853 | { |
| 854 | #ifdef USE_GEOS |
| 855 | GEOSGeom g1, g2, g3; |
| 856 | |
| 857 | if(!shape1 || !shape2) |
| 858 | return NULL; |
| 859 | |
| 860 | if(!shape1->geometry) /* if no geometry for the shape then build one */ |
| 861 | shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1); |
| 862 | g1 = (GEOSGeom) shape1->geometry; |
| 863 | if(!g1) return NULL; |
| 864 | |
| 865 | if(!shape2->geometry) /* if no geometry for the shape then build one */ |
| 866 | shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2); |
| 867 | g2 = (GEOSGeom) shape2->geometry; |
| 868 | if(!g2) return NULL; |
| 869 | |
| 870 | g3 = GEOSDifference(g1, g2); |
| 871 | return msGEOSGeometry2Shape(g3); |
| 872 | #else |
| 873 | msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSDifference()"); |
| 874 | return NULL; |
| 875 | #endif |
| 876 | } |
| 877 | |
| 878 | shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2) |
| 879 | { |
no test coverage detected