[postgis-devel] [PostGIS] #1312: ST_MapAlgebraExpr mode UNION, incorrect Y-extent
PostGIS
trac at osgeo.org
Mon Nov 21 06:34:45 PST 2011
#1312: ST_MapAlgebraExpr mode UNION, incorrect Y-extent
----------------------------+-----------------------------------------------
Reporter: tilt | Owner: pracine
Type: defect | Status: new
Priority: high | Milestone: PostGIS 2.0.0
Component: postgis raster | Version: 1.5.X
Keywords: |
----------------------------+-----------------------------------------------
When using ST_MapAlgebraExpr in UNION mode, the expected behavior is to
return the minimum lower Y coordinate and maximum upper Y coordinate of
both rasters.
Instead, for the lowest upper Y is returned and for lower Y a value even
below the lowest.
If this sounds confusing, just check the output of this code:
{{{
WITH
raster1 As (
SELECT ST_MakeEmptyRaster( 100, 100, 19000, 40000, 1, -1, 0, 0,
28992) As rast
)
,raster2 As (
SELECT ST_MakeEmptyRaster( 100, 100, 19200, 40200, 1, -1, 0, 0,
28992) As rast
)
, combi As (
SELECT
ST_MapAlgebraExpr(
raster1.rast,
raster2.rast,
'rast1+rast2',
NULL,
'UNION'
) As rast
FROM
raster1, raster2
)
SELECT
ST_Ymin(ST_Envelope(raster1.rast)),
ST_Ymax(ST_Envelope(raster1.rast)),
ST_Ymin(ST_Envelope(raster2.rast)),
ST_Ymax(ST_Envelope(raster2.rast)),
ST_Ymin(ST_Envelope(combi.rast)),
ST_Ymax(ST_Envelope(combi.rast))
FROM raster1, raster2, combi;
}}}
Output:
{{{
39900;40000;40100;40200;39700;40000
}}}
EXPECTED output:
{{{
39900;40000;40100;40200;39900;40200
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1312>
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