[PROJ] Need help for proper way to construct a 3d wkt
Shuo Zhong
shuo at strayos.com
Fri Feb 28 10:00:55 PST 2025
Hi,
I'm very confused about how 3d conversion exactly works. Especially with
compound crs. The translation is from epsg:32634 to epsg:2100, with
altitude translation included.
1. By default, without any specification, the translation will ignore
elevation.
```
projinfo -s EPSG:32634 -t EPSG:2100 -o proj
Candidate operations found: 1
-------------------------------------
Operation No. 1:
unknown id, Inverse of UTM zone 34N + Inverse of GGRS87 to WGS 84 (1) +
Greek Grid, 1 m, Greece - onshore.
PROJ string:
+proj=pipeline
+step +inv +proj=utm +zone=34 +ellps=WGS84
+step +proj=push +v_3
+step +proj=cart +ellps=WGS84
+step +proj=helmert +x=199.87 +y=-74.79 +z=-246.62
+step +inv +proj=cart +ellps=GRS80
+step +proj=pop +v_3
+step +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0
+ellps=GRS80
```
2. With --3d, the translation will include elevation
```
projinfo -s EPSG:32634 -t EPSG:2100 -o proj --3d
Candidate operations found: 1
-------------------------------------
Operation No. 1:
unknown id, Inverse of UTM zone 34N + Inverse of GGRS87 to WGS 84 (1) +
Greek Grid, 1 m, Greece - onshore.
PROJ string:
+proj=pipeline
+step +inv +proj=utm +zone=34 +ellps=WGS84
+step +proj=cart +ellps=WGS84
+step +proj=helmert +x=199.87 +y=-74.79 +z=-246.62
+step +inv +proj=cart +ellps=GRS80
+step +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0
+ellps=GRS80
```
This is the expected translation with altitude
```
echo 21 38 0 | cct +proj=pipeline +step +proj=axisswap +order=2,1 +step
+proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m +step +proj=cart
+ellps=WGS84 +step +proj=helmert +x=199.87 +y=-74.79 +z=-246.62 +step +inv
+proj=cart +ellps=GRS80 +step +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996
+x_0=500000 +y_0=0 +ellps=GRS80
1965754.3416 2386940.5077 15.6793 inf
```
3. I tested by creating wkt with 3rd(up) axis, which also matches with 2
```
PROJCRS["GGRS87 / Greek Grid",
BASEGEOGCRS["GGRS87",
DATUM["Greek Geodetic Reference System 1987",
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]],
ID["EPSG",6121]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8901]]],
CONVERSION["Greek Grid",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",24,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]],
ID["EPSG",19930]],
CS[Cartesian,3],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["ellipsoidal height (h)",up,
ORDER[3],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
USAGE[
SCOPE["unknown"],
AREA["Greece - onshore."],
BBOX[34.88,19.57,41.75,28.3]],
REMARK["Promoted to 3D from EPSG:2100"]]
```
```
PROJCRS["WGS 84 / UTM zone 34N",
BASEGEOGCRS["WGS 84",
ENSEMBLE["World Geodetic System 1984 ensemble",
MEMBER["World Geodetic System 1984 (Transit)"],
MEMBER["World Geodetic System 1984 (G730)"],
MEMBER["World Geodetic System 1984 (G873)"],
MEMBER["World Geodetic System 1984 (G1150)"],
MEMBER["World Geodetic System 1984 (G1674)"],
MEMBER["World Geodetic System 1984 (G1762)"],
MEMBER["World Geodetic System 1984 (G2139)"],
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ENSEMBLEACCURACY[2.0]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4979]],
CONVERSION["UTM zone 34N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",21,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]],
ID["EPSG",16034]],
CS[Cartesian,3],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["ellipsoidal height (h)",up,
ORDER[3],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
USAGE[
SCOPE["unknown"],
AREA["Between 18°E and 24°E, northern hemisphere between equator
and 84°N, onshore and offshore. Albania. Belarus. Bosnia and Herzegovina.
Bulgaria. Central African Republic. Chad. Croatia. Democratic Republic of
the Congo (Zaire). Estonia. Finland. Greece. Hungary. Italy. Kosovo.
Latvia. Libya. Lithuania. Montenegro. North Macedonia. Norway, including
Svalbard and Bjornoys. Poland. Romania. Russian Federation. Serbia.
Slovakia. Sudan. Sweden. Ukraine."],
BBOX[0,18,84,24]],
REMARK["Promoted to 3D from EPSG:32634"]]
```
```
projinfo -s 'PROJCRS["GGRS87 / Greek
Grid",BASEGEOGCRS["GGRS87",DATUM["Greek Geodetic Reference System
1987",ELLIPSOID["GRS
1980",6378137,298.257222101,LENGTHUNIT["metre",1]],ID["EPSG",6121]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8901]]],CONVERSION["Greek
Grid",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of
natural
origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude
of natural
origin",24,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale
factor at natural
origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False
easting",500000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False
northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]],ID["EPSG",19930]],CS[Cartesian,3],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["ellipsoidal
height
(h)",up,ORDER[3],LENGTHUNIT["metre",1,ID["EPSG",9001]]],USAGE[SCOPE["unknown"],AREA["Greece
- onshore."],BBOX[34.88,19.57,41.75,28.3]],REMARK["Promoted to 3D from
EPSG:2100"]]' -t 'PROJCRS["WGS 84 / UTM zone 34N",BASEGEOGCRS["WGS
84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic
System 1984 (Transit)"],MEMBER["World Geodetic System 1984
(G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic
System 1984 (G1150)"],MEMBER["World Geodetic System 1984
(G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World
Geodetic System 1984 (G2139)"],ELLIPSOID["WGS
84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4979]],CONVERSION["UTM
zone 34N",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude
of natural
origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude
of natural
origin",21,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale
factor at natural
origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False
easting",500000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False
northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]],ID["EPSG",16034]],CS[Cartesian,3],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["ellipsoidal
height
(h)",up,ORDER[3],LENGTHUNIT["metre",1,ID["EPSG",9001]]],USAGE[SCOPE["unknown"],AREA["Between
18°E and 24°E, northern hemisphere between equator and 84°N, onshore and
offshore. Albania. Belarus. Bosnia and Herzegovina. Bulgaria. Central
African Republic. Chad. Croatia. Democratic Republic of the Congo (Zaire).
Estonia. Finland. Greece. Hungary. Italy. Kosovo. Latvia. Libya. Lithuania.
Montenegro. North Macedonia. Norway, including Svalbard and Bjornoys.
Poland. Romania. Russian Federation. Serbia. Slovakia. Sudan. Sweden.
Ukraine."],BBOX[0,18,84,24]],REMARK["Promoted to 3D from EPSG:32634"]]' -o
proj
Candidate operations found: 1
-------------------------------------
Operation No. 1:
unknown id, Inverse of Greek Grid + GGRS87 to WGS 84 (1) + UTM zone 34N, 1
m, Greece - onshore.
PROJ string:
+proj=pipeline
+step +inv +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0
+ellps=GRS80
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-199.87 +y=74.79 +z=246.62
+step +inv +proj=cart +ellps=WGS84
+step +proj=utm +zone=34 +ellps=WGS84
```
4. The EPSG:2100 is actually obtained from one gis software, it exported
the 3d crs as one compound crs, essentially combined wkt of epsg:2100 and
one vertical datum, but using this will give me the pipeline that ignores
elevation. Matching 1
```
projinfo -s 'COMPD_CS["unknown",PROJCS["GGRS87 / Greek
Grid",GEOGCS["GGRS87",DATUM["Greek_Geodetic_Reference_System_1987",SPHEROID["GRS
1980",6378137,298.257222101004,AUTHORITY["EPSG","7019"]],TOWGS84[-199.87,74.79,246.62,0,0,0,0],AUTHORITY["EPSG","6121"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4121"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","2100"]],VERT_CS["unknown",VERT_DATUM["unknown",2005],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP]]]'
-t 'PROJCRS["WGS 84 / UTM zone 34N",BASEGEOGCRS["WGS 84",ENSEMBLE["World
Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984
(Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World
Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984
(G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World
Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984
(G2139)"],ELLIPSOID["WGS
84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4979]],CONVERSION["UTM
zone 34N",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude
of natural
origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude
of natural
origin",21,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale
factor at natural
origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False
easting",500000,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False
northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]],ID["EPSG",16034]],CS[Cartesian,3],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["ellipsoidal
height
(h)",up,ORDER[3],LENGTHUNIT["metre",1,ID["EPSG",9001]]],USAGE[SCOPE["unknown"],AREA["Between
18°E and 24°E, northern hemisphere between equator and 84°N, onshore and
offshore. Albania. Belarus. Bosnia and Herzegovina. Bulgaria. Central
African Republic. Chad. Croatia. Democratic Republic of the Congo (Zaire).
Estonia. Finland. Greece. Hungary. Italy. Kosovo. Latvia. Libya. Lithuania.
Montenegro. North Macedonia. Norway, including Svalbard and Bjornoys.
Poland. Romania. Russian Federation. Serbia. Slovakia. Sudan. Sweden.
Ukraine."],BBOX[0,18,84,24]],REMARK["Promoted to 3D from EPSG:32634"]]' -o
proj
Candidate operations found: 1
-------------------------------------
Operation No. 1:
unknown id, Inverse of unnamed + Transformation from GGRS87 to WGS84 +
Transformation from unknown to WGS 84 (ballpark vertical transformation,
without ellipsoid height to vertical height correction) + UTM zone 34N,
unknown accuracy, World, has ballpark transformation
PROJ string:
+proj=pipeline
+step +inv +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0
+ellps=GRS80
+step +proj=push +v_3
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-199.87 +y=74.79 +z=246.62 +rx=0 +ry=0 +rz=0 +s=0
+convention=position_vector
+step +inv +proj=cart +ellps=WGS84
+step +proj=pop +v_3
+step +proj=utm +zone=34 +ellps=WGS84
```
This behavior really confuses me. Is it because the compound crs is not
created the right way? I couldn't find any vertical datum/crs represenint
ellipsoid height, the vert\_datum code 2005 here seems invalid
VERT\_CS\["unknown",VERT\_DATUM\["unknown",2005\],UNIT\["metre",1,AUTHORITY\["EPSG","9001"\]\],AXIS\["Up",UP\]\].
And is there any simplified way to force a ellisoidal crs to be 3d? I know
wgs84 has 4979 but not many other crs have such definition, like utm zone
codes 326xx. And no vert\_cs for ellisoidal height. But it's quite common
for me to translate between different ellipsoidal datums.
Sorry for the long texts, trying to explain the question in a clearer way.
Many thanks
[image: photo-logo]
<https://t.sidekickopen79.com/s1t/c/5/f18dQhb0S7lM8dDMPbW2n0x6l2B9nMJN7t5XWPf4Yc8W5vg7PT7dWWcgW7rw6TC11fj5b0?te=W3R5hFj4cm2zwW4mKLS-4cQh_BW4rCvKl3Fbt5S0&si=8000000000094793&pi=a0861c5c-dfb3-45c7-86f5-d3183234d987>
Thor Zhong
Computer Vision & AI Engineer
Web www.strayos.com
Follow us
[image: facebook]
<https://t.sidekickopen79.com/s1t/c/5/f18dQhb0S7lM8dDMPbW2n0x6l2B9nMJN7t5XWPf4Yc8W5vg7PT7dWWcgW7rw6TC11fj5b0?te=W3R5hFj4cm2zwW3T0WGd41RkQ9W3ZTQ-j3zdyqqW3Fbt5S49hYhgW1X07J_3M0g69f3CcXQf04&si=8000000000094793&pi=a0861c5c-dfb3-45c7-86f5-d3183234d987>
[image:
twitter]
<https://t.sidekickopen79.com/s1t/c/5/f18dQhb0S7lM8dDMPbW2n0x6l2B9nMJN7t5XWPf4Yc8W5vg7PT7dWWcgW7rw6TC11fj5b0?te=W3R5hFj4cm2zwW3T0WGd41RkQ9W3ZTQ-j3zdyqqW3Fbt5S49hYhgW1X07J_4fQ47l4VD0M1&si=8000000000094793&pi=a0861c5c-dfb3-45c7-86f5-d3183234d987>
[image:
linkedin]
<https://t.sidekickopen79.com/s1t/c/5/f18dQhb0S7lM8dDMPbW2n0x6l2B9nMJN7t5XWPf4Yc8W5vg7PT7dWWcgW7rw6TC11fj5b0?te=W3R5hFj4cm2zwW3T0WGd41RkQ9W3ZTQ-j3zdyqqW3Fbt5S49hYhgW1X07J_3ZWVWBf3K2-zv04&si=8000000000094793&pi=a0861c5c-dfb3-45c7-86f5-d3183234d987>
[image:
ghost]
<https://t.sidekickopen79.com/s1t/c/5/f18dQhb0S7lM8dDMPbW2n0x6l2B9nMJN7t5XWPf4Yc8W5vg7PT7dWWcgW7rw6TC11fj5b0?te=W3R5hFj4cm2zwW3T0WGd41RkQ9W3ZTQ-j3zdyqqW3Fbt5S49hYhgW1X07J_3P1L_X2283&si=8000000000094793&pi=a0861c5c-dfb3-45c7-86f5-d3183234d987>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20250228/88b69b10/attachment-0001.htm>
More information about the PROJ
mailing list