Opened 12 years ago

Closed 2 years ago

Last modified 2 years ago

#2327 closed enhancement (duplicate)

[raster] ST_Drape

Reported by: dustymugs Owned by: dustymugs
Priority: medium Milestone: PostGIS Fund Me
Component: raster Version: master
Keywords: Cc: dmcclean

Description

Taking a geometry and a raster, return a new XYM geometry resulting from overlaying the geometry on the raster and populating M with values from the raster.

Reference:

http://vterrain.org/Misc/draping.html

geometry ST_Drape(
  rast raster, nband int,
  geom geometry,
  computed_vertices boolean DEFAULT TRUE
)

Some things to think about before implementing…

  1. XYM or XYZ output geometry: Assuming the raster is DEM, units are typically meter or foot. If X/Y are degrees, populating Z in the DEM's units don't make sense. Maybe a function parameter flag indicating output should be XYZ or XYM?
  1. 3D geometry with rasters: The geometry is treated as 2D. Should pixel values be put into Z or M?
  1. computed_vertices: The returning geometry should be as detailed as the input raster. So, returning geometry will have the same vertices of the input geometry and possibly.
  1. Polygons: How to handle the interior of the polygon? Boundary is easy. Multipolygon? TIN?

Change History (6)

comment:1 by dustymugs, 11 years ago

For polygons, use Delaunay Triangles capability from GEOS. Should have something similar to how ST_DelaunayTriangles() allows the user to control output between a TIN, MULTILINESTRING or COLLECTION of polygons.

comment:2 by smathermather, 11 years ago

Also relevant: http://blog.mathieu-leplatre.info/drape-lines-on-a-dem-with-postgis.html

Re: 2) I'd say keep 3D, add M, and if the user wants to make it Z, then they should convert to 2D before draping.

comment:3 by dmcclean, 10 years ago

Amen. It would be nice to have a tolerance parameter like the one to ST_Simplify that adaptively downsamples from the full DEM-resolution/input-resolution result.

comment:4 by dmcclean, 10 years ago

Cc: dmcclean added

comment:5 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

comment:6 by robe, 2 years ago

Resolution: duplicate
Status: newclosed

This was done in PostGIS 3.2 and is called ST_SetM http://postgis.net/docs/manual-3.2/RT_ST_SetM.html

Last edited 2 years ago by robe (previous) (diff)
Note: See TracTickets for help on using tickets.