Opened 4 years ago

Last modified 2 years ago

#2327 new enhancement

[raster] ST_Drape

Reported by: dustymugs Owned by: dustymugs
Priority: medium Milestone: PostGIS Future
Component: raster Version: trunk
Keywords: Cc: dmcclean


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.


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 (4)

comment:1 Changed 4 years ago by dustymugs

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 Changed 3 years ago by smathermather

Also relevant:

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 Changed 2 years ago by dmcclean

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 Changed 2 years ago by dmcclean

Cc: dmcclean added
Note: See TracTickets for help on using tickets.