[postgis-devel] [PostGIS] #629: Raster ST_Contains

PostGIS trac at osgeo.org
Sun Oct 17 05:08:15 PDT 2010


#629: Raster ST_Contains
----------------------------+-----------------------------------------------
 Reporter:  andrewsimpson   |       Owner:  pracine      
     Type:  defect          |      Status:  new          
 Priority:  medium          |   Milestone:  PostGIS 1.5.3
Component:  postgis raster  |     Version:  1.5.X        
 Keywords:                  |  
----------------------------+-----------------------------------------------
 Greetings,

 I have loaded 1 band 8bit data to a raster table with tile size 500x500,
 and am trying to render through MapServer/GDAL.
 Some of the tiles render, but most do not.
 After turning logging verbose on PostgreSQL I see that GDAL
 wktrasterraterband.cpp is calling for data a tile at a time, and many of
 the calls are not returning any data.

 Below is the metadata for one such tile, and the SQL that GDAL executes.
 It appears the ST_Contains thinks some part of the Box2D is outside the
 rast.
 I modified the wktrasterraterband.cpp IReadBlock function to
 buffer(Box2d,-1) and the all the tiles render.

 I know this is not a good solution, any information on what I may do to
 remedy this would be great.

 Thanks,
 Drew

 PostgreSQL 8.4.4 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2
 20080704 (Red Hat 4.1.2-48), 32-bit
 Postgis-1.5.1
 WKTRaster-0.1.6d
 GDAL-1.7.2
 Python-2.7
 Proj-4.7.0
 Geos-3.2.2

 SELECT rid, (md).*, (bmd).*
     FROM (SELECT rid, ST_Metadata(rast) AS md,
                  ST_BandMetadata(rast) AS bmd
           FROM psi_tiled where rid in ( 87 )
          ) foo;


  rid |  upperleftx   |   upperlefty   | width | height | pixelsizex |
 pixelsizey | skewx | skewy | srid  | numbands | pixeltype | hasnodatavalue
 |

 nodatavalue | isoutdb | path
 -----+---------------+----------------+-------+--------+------------+------------+-------+-------+-------+----------+-----------+----------------

 +-------------+---------+------
   87 | 504979.725998 | 2929894.254002 |   500 |    500 |     0.1016 |
 -0.1016 |     0 |     0 | 26917 |        1 | 8BUI      | f              |

 0 | f       |
 (1 row)


 SELECT rid, rast FROM public.psi_tiled
 WHERE _ST_Contains(rast,
 ST_SetSRID(  ST_MakeBox2D(ST_Point(504979.725998, 2929843.454002),
 ST_Point(505030.525998, 2929894.254002)), 26917))

  rid | rast
 -----+------
 (0 rows)

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/629>
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