145 GEOSGeometry *geom1 = NULL;
146 GEOSGeometry *geom2 = NULL;
152 assert(NULL != rast1);
153 assert(NULL != rast2);
154 assert(NULL != testresult);
156 if (nband1 < 0 && nband2 < 0) {
170 rterror(
"rt_raster_geos_spatial_relationship: The two rasters provided have different SRIDs");
178 rterror(
"rt_raster_geos_spatial_relationship: Could not get surface of the specified band from the first raster");
182 rterror(
"rt_raster_geos_spatial_relationship: Could not get surface of the specified band from the second raster");
188 if (surface1 == NULL || surface2 == NULL) {
198 rterror(
"rt_raster_geos_spatial_relationship: Could not convert surface of the specified band from the first raster to a GEOSGeometry");
206 rterror(
"rt_raster_geos_spatial_relationship: Could not convert surface of the specified band from the second raster to a GEOSGeometry");
213 rtn = GEOSOverlaps(geom1, geom2);
216 rtn = GEOSTouches(geom1, geom2);
219 rtn = GEOSContains(geom1, geom2);
222 rtn = GEOSRelatePattern(geom1, geom2,
"T**FF*FF*");
225 rtn = GEOSRelatePattern(geom1, geom2,
"******FF*");
228 rtn = GEOSRelatePattern(geom1, geom2,
"**F**F***");
231 rterror(
"rt_raster_geos_spatial_relationship: Unknown or unsupported GEOS spatial relationship test");
235 GEOSGeom_destroy(geom1);
236 GEOSGeom_destroy(geom2);
240 rterror(
"rt_raster_geos_spatial_relationship: Could not run the appropriate GEOS spatial relationship test");
244 else if (flag >= 0) {
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_geos_error(const char *fmt,...)
void lwmpoly_free(LWMPOLY *mpoly)
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
#define RASTER_DEBUG(level, msg)
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
void rtinfo(const char *fmt,...)
rt_errorstate rt_raster_surface(rt_raster raster, int nband, LWMPOLY **surface)
Get a raster as a surface (multipolygon).
uint16_t rt_raster_get_num_bands(rt_raster raster)