Opened 7 years ago

Closed 7 years ago

#2078 closed enhancement (fixed)

[raster] add extent parameter to ST_Slope, ST_Aspect and ST_Hillshade

Reported by: Bborie Park Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.1.0
Component: raster Version: trunk
Keywords: history Cc:

Description

This will allow passing a unioned set of tiles (of tiles intersecting tile of interest) into the function and constrain the extent to just the tile of interest.

Something like the following would be awesome. Exact signature is currently unknown.

WITH foo AS (
	SELECT 0 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '16BUI', 1, 0) AS rast UNION ALL
	SELECT 1, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, 0, 1, -1, 0, 0, 0), 1, '16BUI', 2, 0) AS rast UNION ALL
	SELECT 2, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, 0, 1, -1, 0, 0, 0), 1, '16BUI', 3, 0) AS rast UNION ALL

	SELECT 3, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -2, 1, -1, 0, 0, 0), 1, '16BUI', 10, 0) AS rast UNION ALL
	SELECT 4, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -2, 1, -1, 0, 0, 0), 1, '16BUI', 20, 0) AS rast UNION ALL
	SELECT 5, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -2, 1, -1, 0, 0, 0), 1, '16BUI', 30, 0) AS rast UNION ALL

	SELECT 6, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -4, 1, -1, 0, 0, 0), 1, '16BUI', 100, 0) AS rast UNION ALL
	SELECT 7, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -4, 1, -1, 0, 0, 0), 1, '16BUI', 200, 0) AS rast UNION ALL
	SELECT 8, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -4, 1, -1, 0, 0, 0), 1, '16BUI', 300, 0) AS rast
)
SELECT
	t1.rid,
	ST_Slope(
		ST_Union(t2.rast),
		1,
		t1.rast,
		'32BF'
	) AS rast
FROM foo t1
CROSS JOIN foo t2
WHERE t1.rid = 4
	AND t2.rid BETWEEN 0 AND 8
	AND ST_Intersects(t1.rast, t2.rast)
GROUP BY t1.rid, t1.rast

Change History (2)

comment:1 Changed 7 years ago by Bborie Park

Status: newassigned

comment:2 Changed 7 years ago by Bborie Park

Keywords: history added
Resolution: fixed
Status: assignedclosed

Added in r10688

Note: See TracTickets for help on using tickets.