[Qgis-user] Z($geometry), CRS and transforms: buggy?
Greg Troxel
gdt at lexort.com
Mon Sep 2 06:24:36 PDT 2024
Andrea Giudiceandrea via QGIS-User <qgis-user at lists.osgeo.org> writes:
>> Greg Troxel gdt at lexort.com
>> Sun Sep 1 16:14:34 PDT 2024
>
>> The TL:DR: is that I believe
>> Z($geometry) returns the Z value from the geometry in the layer,
>> without regard to the CRS. It *should* return the Z component after
>> transforming from layer CRS to project CRS. (qgis 3.34.10)
>
> Hi Greg,
Thanks for writing; I felt there was a good chance this was in the
geodesy weeds enough that I wouldn't hear back!
> the z(@geometry) function as well as both x(@geometry) and
> y(@geometry) functions always return the actual geometry's x, y, z
> coordinate regardless of the layer's CRS or the project's CRS.
I think that's unfortunate, or that the other way being missing is a bug.
> I.e. @geometry (or the deprecated $geometry) returns only a geometry
> object that doesn't contain any info about the CRS.
I can see that, but I feel that when you have a layer with a CRS and you
access it you should see values that are in the project CRS. So still
without a label, but having been transformed. This feels like carving
out "get me the height of this point" from the entire CRS-aware
processing chain.
(I'm not arguing that there shouldn't be a way to inspect the original.)
Is there a way to say ZP($geometry), for Z value in the
transformed-to-project geometry? I know the geometry is getting
transformed because the XY values (E,N, whatever you want to call them)
are being produced, so that the point can be put on the canvas in the
correct place.
My current workaround is to transform the gpkg layer to the project CRS
(well, to a geographic3D with the base datum of the project Crs which is
a UTM zone), and then look at that.
Personally, this isn't really a practical problem, as I try to do
everything in 6319 ( NAD83(2011) ), and heights from non-RTK GPS are
vastly off anyway (7.5m, for my one datapoint -- but I am not
surprised).
But, if I try to convert from 6319 HAE to NAVD88, and integrate with
state LIDAR, it's going to be messy.
More information about the QGIS-User
mailing list