[Qgis-user] Problems with transformation including height values

Nyall Dawson nyall.dawson at gmail.com
Tue Mar 21 03:13:36 PDT 2023


On Tue, 21 Mar 2023, 8:06 pm Bo Victor Thomsen via QGIS-User, <
qgis-user at lists.osgeo.org> wrote:

> Hi list -
>
> I have a problem with transforming a csv file containing x,y *and *z
> values from EPSG:4326 to EPSG:7416, i.e I want to transform the height
> value from LongLat/ WGS84 ellipsoid height to UTM32/Etrs89 with vertical
> reference DVR90.
>
> The file look like this:
>
> *== data.csv, EPSG:4326 id: col1, x: col3, y: col2, z: col4 ==*
> a;55.0;12.0;42.0
> b;55.05;12.0;43.0
> c;55.10;12.0;44.0
> d;55.15;12.0;45.0
> e;55.20;12.0;46.0
> *=======================*
>
> *Step 1*: I import the file into QGIS using the Data Source Manager -->
> "Delimited Text" and define the projection to be EPSG:4326 *and* to
> include z values. This works and the points are shown on my map where I
> expect them to be (Somewhere in the middle of Zealand, Denmark)
>
> *Step 2*: I export the layer as a geojson file using "Export" --> "Save
> features as.." from the layer manager and choose EPSG:7416 (UTM32/ETRS89
> with DVR90 as vertical reference. And to include z-values
>
> The resulting file looks like this:
>
> *== data.geojson, EPSG:7416 ==*
> {
> "type": "FeatureCollection",
> "name": "data",
> "crs": { "type": "name", "properties": { "name":
> "urn:ogc:def:crs:EPSG::4979" } },
> "features": [
> { "type": "Feature", "properties": { "field_1": "a", "field_2": 55.0,
> "field_3": 12.0, "field_4": 42.0 }, "geometry": { "type": "Point",
> "coordinates": [ 12.0, 55.0, 42.0 ] } },
> { "type": "Feature", "properties": { "field_1": "b", "field_2": 55.05,
> "field_3": 12.0, "field_4": 43.0 }, "geometry": { "type": "Point",
> "coordinates": [ 12.0, 55.05, 43.0 ] } },
> { "type": "Feature", "properties": { "field_1": "c", "field_2": 55.1,
> "field_3": 12.0, "field_4": 44.0 }, "geometry": { "type": "Point",
> "coordinates": [ 12.0, 55.1, 44.0 ] } },
> { "type": "Feature", "properties": { "field_1": "d", "field_2": 55.15,
> "field_3": 12.0, "field_4": 45.0 }, "geometry": { "type": "Point",
> "coordinates": [ 12.0, 55.15, 45.0 ] } },
> { "type": "Feature", "properties": { "field_1": "e", "field_2": 55.2,
> "field_3": 12.0, "field_4": 46.0 }, "geometry": { "type": "Point",
> "coordinates": [ 12.0, 55.2, 46.0 ] } }
> ]
> }
> *=======================*
>
> The new file is shown in my map exactly on top of the original point
> layer, meaning the horizontal projection is accurate. However, my z
> coordinates are not reprojected to the new vertical reference. All the
> z-values are exactly the same as the values in the .csv - file.
>
> After some digging through Google and other places, I discover that
> EPSG:4326 *doesn't* have a z component. Surprise ! You have to use
> EPSG:4979, which is the same as EPSG:4326 with ellipsoid height.
>
> But, *after *repeating *step 1*, *but* using EPSG:4979 as CRS during
> import, and subsequently repeating *step 2*, I get the exact same result:
> No transformation of height values.
>
> So, what is not working ? Am I doing something wrong ?? Or is QGIS
> incapable of transforming z values ???
>

The second -- qgis currently doesn't handle vertical crs at all. My
recommendation is to use gdal utilities to do a transform respecting
vertical datums.

Nyall

>
> --
> Med venlig hilsen / Best regards
>
> Bo Victor Thomsen
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230321/c6d55387/attachment.htm>


More information about the QGIS-User mailing list