Bug report #17290

field calculator: extract Z coord does not work

Added by salvatore fiandaca about 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Field calculator
Affected QGIS version:master Regression?:Yes
Operating System:win 10 64 bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25188

Description

field calculator: extract Z coord does not work

given a 3D shapefile, the field calculator does not extract the Z coord.
used expression: z ($ geometry)

tests performed on OSGeo4W, does not work on: 2.14.19, 2.18.13 and 2.99 (ae4d26a675)
machine win 10 64 bit

estraiZ.7z - shapefile 3D (8.09 KB) salvatore fiandaca, 2017-10-16 07:53 PM

History

#1 Updated by salvatore fiandaca about 7 years ago

salvatore fiandaca wrote:

field calculator: extract Z coord does not work

given a 3D shapefile, the field calculator does not extract the Z coord.
used expression: z ($ geometry)

tests performed on OSGeo4W, does not work on: 2.14.19, 2.18.13 and 2.99 (ae4d26a675)
machine win 10 64 bit

geometry is lineStringZ

#2 Updated by salvatore fiandaca about 7 years ago

from other tests, it is known that to extract the coordZ just do z (point_n ($ geometry, 1))
the question remains whether it is a bug or not

#3 Updated by Nyall Dawson about 7 years ago

What z value would you expect it to give for a linestring? I'd say current behavior is correct, OR returning an array of all z values for the nodes in the line.

#4 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

#5 Updated by salvatore fiandaca about 7 years ago

Nyall Dawson wrote:

What z value would you expect it to give for a linestring? I'd say current behavior is correct, OR returning an array of all z values for the nodes in the line.

for an isoipse i would expect the z value that is equal for all nodes.
But I realized that it would only be a special case with Z = constant
thank you

#6 Updated by Giovanni Manghi about 7 years ago

salvatore fiandaca wrote:

Nyall Dawson wrote:

What z value would you expect it to give for a linestring? I'd say current behavior is correct, OR returning an array of all z values for the nodes in the line.

for an isoipse i would expect the z value that is equal for all nodes.
But I realized that it would only be a special case with Z = constant
thank you

I suggest to close this ticket (behavior correct) or add a feature request (array with all the values of the nodes).

#7 Updated by salvatore fiandaca about 7 years ago

Giovanni Manghi wrote:

salvatore fiandaca wrote:

Nyall Dawson wrote:

What z value would you expect it to give for a linestring? I'd say current behavior is correct, OR returning an array of all z values for the nodes in the line.

for an isoipse i would expect the z value that is equal for all nodes.
But I realized that it would only be a special case with Z = constant
thank you

I suggest to close this ticket (behavior correct) or add a feature request (array with all the values of the nodes).

yes, close as well.
thank you

#8 Updated by Giovanni Manghi about 7 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF