Opened 12 years ago

Closed 12 years ago

#1312 closed defect (fixed)

[raster] ST_MapAlgebraExpr mode UNION, incorrect Y-extent

Reported by: tilt Owned by: Bborie Park
Priority: critical Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc: steven.ottens@…

Description

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

Change History (3)

comment:1 by Bborie Park, 12 years ago

Owner: changed from pracine to Bborie Park
Priority: highcritical
Status: newassigned
Summary: ST_MapAlgebraExpr mode UNION, incorrect Y-extent[raster] ST_MapAlgebraExpr mode UNION, incorrect Y-extent
Version: 1.5.Xtrunk

comment:2 by Bborie Park, 12 years ago

Should be fixed in r8215.

comment:3 by Bborie Park, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.