[postgis-devel] [PostGIS] #1207: Can't compile under Windows mingw since raster commit
PostGIS
trac at osgeo.org
Fri Sep 23 11:55:26 PDT 2011
#1207: Can't compile under Windows mingw since raster commit
----------------------------+-----------------------------------------------
Reporter: robe | Owner: pracine
Type: defect | Status: new
Priority: blocker | Milestone: PostGIS 2.0.0
Component: postgis raster | Version: trunk
Keywords: |
----------------------------+-----------------------------------------------
Comment(by dustymugs):
The ST_Intersects function does not use any GDAL functionality. The
lwgeom_geos.h is used for testing the convex hulls of the two rasters for
intersection and if one raster is completely within the other.
The relevant bit of code that needs lwgeom_geos.h is on line 8350 and in
the code block below.
{{{
do {
int rtn;
initGEOS(lwnotice, lwgeom_geos_error);
rtn = 1;
for (i = 0; i < 2; i++) {
hull[i] = rt_raster_get_convex_hull(i < 1 ? rast1
: rast2);
if (NULL == hull[i]) {
for (j = 0; j < i; j++) {
GEOSGeom_destroy(ghull[j]);
lwpoly_free(hull[j]);
}
rtn = 0;
break;
}
ghull[i] = (GEOSGeometry *) LWGEOM2GEOS((LWGEOM *)
hull[i]);
if (NULL == ghull[i]) {
for (j = 0; j < i; j++) {
GEOSGeom_destroy(ghull[j]);
lwpoly_free(hull[j]);
}
lwpoly_free(hull[i]);
rtn = 0;
break;
}
}
if (!rtn) break;
/* test to see if raster within the other */
within = 0;
if (GEOSWithin(ghull[0], ghull[1]) == 1)
within = -1;
else if (GEOSWithin(ghull[1], ghull[0]) == 1)
within = 1;
if (within != 0)
rtn = 1;
else
rtn = GEOSIntersects(ghull[0], ghull[1]);
for (i = 0; i < 2; i++) {
GEOSGeom_destroy(ghull[i]);
lwpoly_free(hull[i]);
}
if (rtn != 2) {
RASTER_DEBUGF(4, "convex hulls of rasters do
%sintersect", rtn != 1 ? "NOT " : "");
if (rtn != 1) {
*intersects = 0;
return 1;
}
/* band isn't specified */
else if (nband1 < 0) {
*intersects = 1;
return 1;
}
}
}
while (0);
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1207#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list