[Qgis-user] Elevation Profiles

Andrea Giudiceandrea andreaerdna at libero.it
Sun Mar 6 04:49:10 PST 2022


> *krishna Ayyala*
> /Sat Mar 5 22:06:54 PST 2022/
> ------------------------------------------------------------------------
> Nicolas, I ran the Drape tool as shown below. It resulted in a new  line
> feature called "Draped" and added to my map. But this new feature has
> exactly same attributes as that of "Lines" feature. i.e. it does not have
> any new field such as Z added to the attribute table.

Hi krishna Ayyala,
please read the tool documentation at 
https://docs.qgis.org/3.22/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#qgissetzfromraster

As written in the documentation, the "Drape" tool does not add a new 
field with the Z coordinate value to the attribute table. It adds the Z 
coordinate value to each vertex in each feature geometry of the vector 
layer overlapping the raster layer.

In general, if you need to copy the Z coordinate value of the feature 
geometry in a field of the attribute table, you can use the "Extract Z 
values" tool with the layer containing the feature geometries with 
vertices that have the Z coordinate value.

Anyway, consider that a line type feature geometry is made by more than 
one vertex, and that the "Extract Z values" tool stores only one value 
for each input feature, so if you want to store the Z coordinate value 
for each vertex of each line type feature geometry in a field of the 
attribute table, then you would probably need to first extract the 
vertices of the line layer to a point layer and after that extract the Z 
value of each point.

Alternatively you could use the field calculator to perform more complex 
different calculation, or you could afterward perform other data 
processing such as e.g. aggregate the Z values of the vertices of each 
input line feature.

Regards.

Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220306/a482f78b/attachment-0001.html>


More information about the Qgis-user mailing list