Hi Bo,

I think you can do it with cs2cs. cs2cs can read a file.

As an example, the first coordinates seems to be transformed with:

echo 55 12 42 | cs2cs --3d epsg:4326 epsg:7416
691875.63    6098907.83 4.39

Regards from south,

Jorge

On 21/03/23 10:06, Bo Victor Thomsen via QGIS-User 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 ???


--
Med venlig hilsen / Best regards

Bo Victor Thomsen

_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user

--
Jorge Gustavo Rocha
Geomaster, LDA
"Take the open source journey with us"

VAT/NIF: PT 510 906 109
Phone: +351 253 257 173 (landline)
Mobile: +351 910 333 888 (cellular)

Rua Afonso Palmeira, 31, 7 D
4715-278 Braga
PORTUGAL
GPS 41.54627, -8.40432
_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to