TransWikia.com

QGIS average/mean Z-value of polygon

Geographic Information Systems Asked by Niels Sommers on January 27, 2021

I am trying to derive an average/mean Z-value of the GPS measured polygons. The standard z($geometry) I use for point layers doesn’t work obviously. I could use z(start_point($geometry)), but that is only the first point.

Is this possible to derive directly from the polygons, thus without converting the polygones to points? And how would this be possible?

One Answer

I recommend Extract Z values tool in the Processing Toolbox > Vector geometry.

(As a sample I created a brown polygon geom_from_wkt('POLYGON((4 5 2, 4 6 2.5, 7 6 1, 7 5 1))')

  1. Execute Extract Z values tool.
  2. Click on a small ellipsis button [...] of the Summaries to calculate list.
  3. Select Mean and run the tool.

The tool will produce an Extracted layer with which attribute table contains the mean of Z value. (In this example mean of {2.5, 1.0, 2.0, 1.0} is 1.625).

enter image description here

Answered by Kazuhito on January 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP