[postgis-tickets] [PostGIS] #2920: ST_Union(raster): ERROR: rt_raster_from_two_rasters: The two rasters provided do not have the same alignment

PostGIS trac at osgeo.org
Tue Sep 2 02:25:15 PDT 2014


#2920: ST_Union(raster): ERROR:  rt_raster_from_two_rasters: The two rasters
provided do not have the same alignment
----------------------+-----------------------------------------------------
 Reporter:  strk      |       Owner:  dustymugs    
     Type:  defect    |      Status:  new          
 Priority:  critical  |   Milestone:  PostGIS 2.1.4
Component:  raster    |     Version:  2.1.x        
 Keywords:            |  
----------------------+-----------------------------------------------------
 The PostGIS manual does not say anything about ST_Union argument need to
 be aligned:
 http://postgis.net/docs/RT_ST_Union.html

 But ST_Union() errors out complaining about the provided rasters not being
 aligned here:

 {{{
 WITH inp AS (
  SELECT
 '0100000100000000000000104000000000000010C00000000000003E4000000000000044C00000000000000000000000000000000000000000030003004400000000000000000000'
 ::raster r
 UNION ALL SELECT
 '0100000100000000000000104000000000000010C00000000000003E4000000000000049C00000000000000000000000000000000000000000030003004400000000000000000000'
 ::raster
 )
 SELECT ST_Union(r) FROM inp;
 }}}

 Is it a bug in the implementation or in the manual ? I'd guess the former.

 The rasters metadata show they have the same scale, size and upper-left X
 ordinate, while Y ordinate is 10 units apart (not representable with a
 pixel height of 4):

 {{{
 strk=# WITH inp AS (
  SELECT
 '0100000100000000000000104000000000000010C00000000000003E4000000000000044C00000000000000000000000000000000000000000030003004400000000000000000000'
 ::raster r
 UNION ALL SELECT
 '0100000100000000000000104000000000000010C00000000000003E4000000000000049C00000000000000000000000000000000000000000030003004400000000000000000000'
 ::raster
 )
 SELECT (ST_Metadata(r)).* FROM inp;
  upperleftx | upperlefty | width | height | scalex | scaley | skewx |
 skewy | srid | numbands
 ------------+------------+-------+--------+--------+--------+-------+-------+------+----------
          30 |        -40 |     3 |      3 |      4 |     -4 |     0 |
 0 |    0 |        1
          30 |        -50 |     3 |      3 |      4 |     -4 |     0 |
 0 |    0 |        1
 (2 rows)
 }}}

 Failure is both in trunk and 2.1.4dev r12924.

 Tested with "GDAL 2.0.0dev, released 2014/04/16"

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