#2327 closed enhancement (duplicate)
[raster] ST_Drape
Reported by: | Bborie Park | Owned by: | Bborie Park |
---|---|---|---|
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...
- 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?
- 3D geometry with rasters: The geometry is treated as 2D. Should pixel values be put into Z or M?
- 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.
- Polygons: How to handle the interior of the polygon? Boundary is easy. Multipolygon? TIN?
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 10 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 , 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 , 10 years ago
Cc: | added |
---|
comment:6 by , 2 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This was done in PostGIS 3.2 and is called ST_SetM http://postgis.net/docs/manual-3.2/RT_ST_SetM.html
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.