| 798 | } |
| 799 | |
| 800 | shapeObj *msGEOSUnion(shapeObj *shape1, shapeObj *shape2) |
| 801 | { |
| 802 | #ifdef USE_GEOS |
| 803 | GEOSGeom g1, g2, g3; |
| 804 | |
| 805 | if(!shape1 || !shape2) |
| 806 | return NULL; |
| 807 | |
| 808 | if(!shape1->geometry) /* if no geometry for the shape then build one */ |
| 809 | shape1->geometry = (GEOSGeom) msGEOSShape2Geometry(shape1); |
| 810 | g1 = (GEOSGeom) shape1->geometry; |
| 811 | if(!g1) return NULL; |
| 812 | |
| 813 | if(!shape2->geometry) /* if no geometry for the shape then build one */ |
| 814 | shape2->geometry = (GEOSGeom) msGEOSShape2Geometry(shape2); |
| 815 | g2 = (GEOSGeom) shape2->geometry; |
| 816 | if(!g2) return NULL; |
| 817 | |
| 818 | g3 = GEOSUnion(g1, g2); |
| 819 | return msGEOSGeometry2Shape(g3); |
| 820 | #else |
| 821 | msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSUnion()"); |
| 822 | return NULL; |
| 823 | #endif |
| 824 | } |
| 825 | |
| 826 | shapeObj *msGEOSIntersection(shapeObj *shape1, shapeObj *shape2) |
| 827 | { |
no test coverage detected