[postgis-tickets] [PostGIS] #2182: raster: Possible issue with resize function outdb rasters

PostGIS trac at osgeo.org
Sat Jan 19 16:44:32 PST 2013


#2182: raster: Possible issue with resize function outdb rasters
--------------------+-------------------------------------------------------
 Reporter:  robe    |       Owner:  dustymugs    
     Type:  defect  |      Status:  assigned     
 Priority:  medium  |   Milestone:  PostGIS 2.1.0
Component:  raster  |     Version:  trunk        
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by dustymugs):

 I did some quick checking of the good vs bad pictures with gdalinfo.  What
 is very strange is the following.  For your good pics, the output looks
 something like...

 {{{
 Driver: BMP/MS Windows Device Independent Bitmap
 Files: GOOD FILE.bmp
 Size is 200, 140
 Coordinate System is `'
 Corner Coordinates:
 Upper Left  (    0.0,    0.0)
 Lower Left  (    0.0,  140.0)
 Upper Right (  200.0,    0.0)
 Lower Right (  200.0,  140.0)
 Center      (  100.0,   70.0)
 Band 1 Block=200x1 Type=Byte, ColorInterp=Red
 Band 2 Block=200x1 Type=Byte, ColorInterp=Green
 Band 3 Block=200x1 Type=Byte, ColorInterp=Blue
 }}}

 For the bad pics...

 {{{
 Driver: BMP/MS Windows Device Independent Bitmap
 Files: BAD FILE.bmp
 Size is 269, 187
 Coordinate System is `'
 Origin = (-1890.000000000000000,1890.000000000000000)
 Pixel Size = (3780.000000000000000,-3780.000000000000000)
 Corner Coordinates:
 Upper Left  (   -1890.000,    1890.000)
 Lower Left  (   -1890.000, -704970.000)
 Upper Right ( 1014930.000,    1890.000)
 Lower Right ( 1014930.000, -704970.000)
 Center      (  506520.000, -351540.000)
 Band 1 Block=269x1 Type=Byte, ColorInterp=Red
 Band 2 Block=269x1 Type=Byte, ColorInterp=Green
 Band 3 Block=269x1 Type=Byte, ColorInterp=Blue
 }}}

 So for some crazy reason, the bad pics have some sort of geotransform set.
 For one of the bad pictures loaded in the database, try

 {{{
 UPDATE foo SET rast = ST_SetGeoReference(rast, '1 0 0 -1 0 0', 'GDAL')
 WHERE rid = BAD_PIC_RID
 }}}

 And rerun the ST_Resize().

 The error should be present regardless of out-db or in-db.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2182#comment:4>
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-tickets mailing list