| 876 | } |
| 877 | |
| 878 | shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2) |
| 879 | { |
| 880 | #ifdef USE_GEOS |
| 881 | GEOSGeom g1, g2, g3; |
| 882 | |
| 883 | if(!shape1 || !shape2) |
| 884 | return NULL; |
| 885 | |
| 886 | if(!shape1->geometry) /* if no geometry for the shape then build one */ |
| 887 | shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1); |
| 888 | g1 = (GEOSGeom) shape1->geometry; |
| 889 | if(!g1) return NULL; |
| 890 | |
| 891 | if(!shape2->geometry) /* if no geometry for the shape then build one */ |
| 892 | shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2); |
| 893 | g2 = (GEOSGeom) shape2->geometry; |
| 894 | if(!g2) return NULL; |
| 895 | |
| 896 | g3 = GEOSSymDifference(g1, g2); |
| 897 | return msGEOSGeometry2Shape(g3); |
| 898 | #else |
| 899 | msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSSymDifference()"); |
| 900 | return NULL; |
| 901 | #endif |
| 902 | } |
| 903 | |
| 904 | /* |
| 905 | ** Binary predicates exposed to MapServer/MapScript |
no test coverage detected