I have a shapefile exported from a hydraulics software that I use. The file is exported as polylines. I convert it to a point layer using the "Extract Nodes" function. The remaining piece of information I need is the elevation (z value) of each point. I know they exist because I can see them, in the Vertex editor and the wkt_geom column when I copy paste to Excel. I see the "z()" function but can't figure out the appropriate syntax.

I tried this: z(geom_from_wkt( [shapefile_name]))

Is there a function, or a work-around, similar to the $x and $y functions to extract the z value from the geometry and display it in the attribute table?

I am talking about a point shapefile, and using QGIS 2.18.


Try the following expression :


The help says "z(geom)" geom being a point geometry ... so i don't think there's any benefit trying to play with wkt expressions ....

| improve this answer | |
  • That worked Thank you! I had tried that already but wouldn't you know when i bring it down to 1000 pts instead of 37,000 it works just fine. – AdrianJ May 2 '19 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.