[GRASS-user] rasterize 3d line

Vincent Bain bain at toraval.fr
Fri Apr 7 04:37:31 PDT 2023


Hi Franck,

I would suggest you to do sth as follows :

- if necessary add vertice along your 3d lines (v.split ?) so their
"density" is roughly equivalent to (or better smaller than) your target
raster resolution ;
- turn your vector lines to points using v.to.points (with use=vertex
argument) ;
- convert this vector point map to a raster with v.to.rast (with use=z
argument) ;
- depending on what you do afterwards with that map, you can have a
look at r.null to manage null raster cells (e.g. setnull=0).

Hope this helps,

V.

Le vendredi 07 avril 2023 à 12:45 +0200, Frank David a écrit :
> Hello,
> 
> Thank you for your message. But I don't think it helps me.
> 
> I want to add a bridge elevation to my DEM. So if I create a 3d
> vector 
> line (my bridge) with two vertex at x,y,z coordinates, and is it 
> possible to convert in a raster where each cells crossed by the line 
> inherits of his extrapolated altitude ? If no module exists to do
> that, 
> what would be the operations necessary to achieve this result ? I
> hope 
> it is clearer.
> 
> Frank
> 
> Le 07/04/2023 à 10:16, Helmut Kudrnovsky a écrit :
> > > Is there a way to rasterize a 3d line to get altitude on raster
> > > cells
> > > crossed by the line ?
> > not quite sure what are you trying to do?
> > 
> > maybe:
> > 
> > v.drape:
> > 
> > Converts 2D vector features to 3D by sampling of elevation raster
> > map. (https://grass.osgeo.org/grass82/manuals/v.drape.html)
> > Additional vertices can be added to the input 2D vector map with
> > v.split.
> > 
> > or the something like:
> > 
> > v.fixed.segmentpoints - segment points along a vector line with
> > fixed distances
> > (https://grass.osgeo.org/grass82/manuals/addons/v.fixed.segmentpoints.html
> > ) followed by
> > v.what.rast - Uploads raster values at positions of vector points
> > to the table
> > (https://grass.osgeo.org/grass82/manuals/v.what.rast.html) or
> > v.sample - Samples a raster map at vector point locations
> > (https://grass.osgeo.org/grass82/manuals/v.sample.html).
> > 
> > 
> > kind regards
> > helmut
> > 
> > 
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user



More information about the grass-user mailing list