[postgis-devel] [PostGIS] #1792: [raster] ST_Intersect returns false positives (was: [raster] ST_Intersection returns false positives)

PostGIS trac at osgeo.org
Thu Apr 26 12:35:41 PDT 2012

#1792: [raster] ST_Intersect returns false positives
 Reporter:  febus982  |       Owner:  pramsey      
     Type:  defect    |      Status:  new          
 Priority:  high      |   Milestone:  PostGIS 2.0.1
Component:  postgis   |     Version:  2.0.x        
 Keywords:            |  

Comment(by dustymugs):

 Since you're using points, the point is being converted to a raster for
 ST_Intersects(raster, band, geometry).  Hence the point becomes an area
 which may intersect with a raster that the point itself wouldn't.

 As for ST_Intersects(geometry, raster, band), the raster is converted to
 polygons before running a geometry, geometry intersects test.

 So by the looks of it, the problem is that in your query the
 ST_Intersects(raster, band, geometry) is operating by pixel (an "area")
 while ST_Value(raster, geometry) is essentially sticking a pin (your
 point) through the raster.  The ST_Intersects returns true while ST_Value
 returns NULL.

 You may want to use ST_Intersection(raster, band, geometry) instead of

Ticket URL: <http://trac.osgeo.org/postgis/ticket/1792#comment:1>
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