<html><head></head><body style="zoom: 0%;"><div dir="auto">Hi<br></div>
<div dir="auto">Could you use the line to select the raster dem cells, then use the center of the selected cells to snap back to your line and use these snap coordinates to proportion the zvalue of the snapped line segment?<br><br></div>
<div dir="auto">HTH<br></div>
<div dir="auto">Zoltan <br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Sent from Blue <!-- tmjah_g_1299e --></div>
<div class="gmail_quote" >On 07 Apr 2023, at 14:47, Vincent Bain <<a href="mailto:bain@toraval.fr" target="_blank">bain@toraval.fr</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">Hi Franck,<br><br>I would suggest you to do sth as follows :<br><br>- if necessary add vertice along your 3d lines (v.split ?) so their<br>"density" is roughly equivalent to (or better smaller than) your target<br>raster resolution ;<br>- turn your vector lines to points using <a href="http://v.to">v.to</a>.points (with use=vertex<br>argument) ;<br>- convert this vector point map to a raster with <a href="http://v.to">v.to</a>.rast (with use=z<br>argument) ;<br>- depending on what you do afterwards with that map, you can have a<br>look at r.null to manage null raster cells (e.g. setnull=0).<br><br>Hope this helps,<br><br>V.<br><br>Le vendredi 07 avril 2023 à 12:45 +0200, Frank David a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hello,<br> <br> Thank you for your message. But I don't think it helps me.<br> <br> I want to add a bridge elevation to my DEM. So if I create a 3d<br> vector <br> line (my bridge) with two vertex at x,y,z coordinates, and is it <br> possible to convert in a raster where each cells crossed by the line <br> inherits of his extrapolated altitude ? If no module exists to do<br> that, <br> what would be the operations necessary to achieve this result ? I<br> hope <br> it is clearer.<br> <br> Frank<br> <br> Le 07/04/2023 à 10:16, Helmut Kudrnovsky a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> Is there a way to rasterize a 3d line to get altitude on raster<br> cells<br> crossed by the line ?<br></blockquote> not quite sure what are you trying to do?<br> <br> maybe:<br> <br> v.drape:<br> <br> Converts 2D vector features to 3D by sampling of elevation raster<br> map. (<a href="https://grass.osgeo.org/grass82/manuals/v.drape.html">https://grass.osgeo.org/grass82/manuals/v.drape.html</a>)<br> Additional vertices can be added to the input 2D vector map with<br> v.split.<br> <br> or the something like:<br> <br> v.fixed.segmentpoints - segment points along a vector line with<br> fixed distances<br> (<a href="https://grass.osgeo.org/grass82/manuals/addons/v.fixed.segmentpoints.html">https://grass.osgeo.org/grass82/manuals/addons/v.fixed.segmentpoints.html</a><br> ) followed by<br> v.what.rast - Uploads raster values at positions of vector points<br> to the table<br> (<a href="https://grass.osgeo.org/grass82/manuals/v.what.rast.html">https://grass.osgeo.org/grass82/manuals/v.what.rast.html</a>) or<br> v.sample - Samples a raster map at vector point locations<br> (<a href="https://grass.osgeo.org/grass82/manuals/v.sample.html">https://grass.osgeo.org/grass82/manuals/v.sample.html</a>).<br> <br> <br> kind regards<br> helmut<br> <br> <br></blockquote><hr><br> grass-user mailing list<br> grass-user@lists.osgeo.org<br> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote><br><hr><br>grass-user mailing list<br>grass-user@lists.osgeo.org<br><a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br></pre></blockquote></div></body></html>