603 GEOSGeometry *g1, *g2, *g3 ;
616 srid = (int)(geom1->
srid);
623 LWDEBUG(3,
"intersection() START");
635 lwerror(
"Second argument geometry could not be converted to GEOS.");
636 GEOSGeom_destroy(g1);
640 LWDEBUG(3,
" constructed geometrys - calling geos");
641 LWDEBUGF(3,
" g1 = %s", GEOSGeomToWKT(g1));
642 LWDEBUGF(3,
" g2 = %s", GEOSGeomToWKT(g2));
646 g3 = GEOSIntersection(g1,g2);
648 LWDEBUG(3,
" intersection finished");
652 GEOSGeom_destroy(g1);
653 GEOSGeom_destroy(g2);
654 lwerror(
"Error performing intersection: %s",
659 LWDEBUGF(3,
"result: %s", GEOSGeomToWKT(g3) ) ;
661 GEOSSetSRID(g3, srid);
667 GEOSGeom_destroy(g1);
668 GEOSGeom_destroy(g2);
669 GEOSGeom_destroy(g3);
670 lwerror(
"Error performing intersection: GEOS2LWGEOM: %s",
675 GEOSGeom_destroy(g1);
676 GEOSGeom_destroy(g2);
677 GEOSGeom_destroy(g3);
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
#define LWDEBUG(level, msg)
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
void error_if_srid_mismatch(int srid1, int srid2)
void lwgeom_geos_error(const char *fmt,...)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.