[QGIS-Developer] Where can I find the Z-values?

Casper Børgesen caboe at sdfe.dk
Thu Nov 2 00:24:01 PDT 2017


Hi Nyall

I have one of several features in an ESRI FileGDB:

MultiLineStringZ ((706969.83589982986450195 6203593.05810022354125977 46.92369999999937136, 706955.03999996185302734 6203604.32000017166137695 47.05999999999767169, 706951.05999994277954102 6203607.34000015258789062 47.05000000000291038, 706949.42999982833862305 6203608.59999990463256836 47.03999999999359716, 706934.7797999382019043 6203619.71430015563964844 46.66000000000349246))

Running your python snippet gives the following result on the FileGDB: -2147483643

Identify results on the FileGDB:
    (Derived): (clicked coordinate X), (clicked coordinate Y), Length, Part number, Parts, Feature id

Exporting the layer to SHAPE (in QGIS):

Running your python snippet gives the following result on the SHAPE: -2147483646

Identify results on the SHAPE:
    (Derived): (clicked coordinate X), (clicked coordinate Y), Closest vertex X, Closest vertex Y, Closest vertex Z, Closest vertex number, Length, Vertices, feature id, firstX, firstY, lastX, lastY 

So quite a difference between two (identical I hope) data sets.

The above is made in QGIS 2.18.14 x64, Windows 10.

Regards, Casper

-----Original Message-----
From: Nyall Dawson [mailto:nyall.dawson at gmail.com] 
Sent: 1. november 2017 22:03
To: Casper Børgesen <caboe at sdfe.dk>
Cc: Salvatore Larosa <lrssvtml at gmail.com>; qgis-developer at lists.osgeo.org
Subject: Re: [QGIS-Developer] Where can I find the Z-values?

On 31 October 2017 at 20:10, Casper Børgesen <caboe at sdfe.dk> wrote:

> I now see that it is format (driver?) dependent. I was looking at a file
> geodatabase but exporting it to SHAPE then I can see the “Closest vertex Z”
> under  derived.

This sounds odd to me - either the layer in QGIS has a Z value, or it
doesn't. Exporting to another format should not be adding z values
which QGIS could not read in other circumstances.

What do you get if you run:

[f.geometry().wkbType() for f in iface.activeLayer().getFeatures()][0]

in the Python console after selecting your geodatabase layer?

Nyall


More information about the QGIS-Developer mailing list