[postgis-users] Slope calculation by intersection between points and DTM

ced Cedric.DUPREZ at ign.fr
Wed Mar 19 06:29:22 PDT 2014

Hi all,

I try to calculate the slope at precise points by intersection between a
vector layer of points and a raster DEM (both with the same SRID).
I would like to get the result in percent, giving the slope on each point of
my vector layer.

Here is the query I use :

SELECT p.id, p.x, p.y, ST_Value(ST_Slope(m.rast, 1, '32BF', 'PERCENT'),
p.geom, TRUE)::FLOAT8 AS slope
FROM mypoints p
INNER JOIN myDTM m ON ST_Intersects(m.rast, p.geom)
ORDER BY p.id;

Is this query OK ?
When I compare its results with the same intersection in Arcgis 9, I get a
bias showing 5% between Arcgis and PostGIS 2.1 (Arcgis gives higher slopes
than PostGIS, the highest gap being 97%).

Thanks for you help.


View this message in context: http://postgis.17.x6.nabble.com/Slope-calculation-by-intersection-between-points-and-DTM-tp5005934.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

More information about the postgis-users mailing list