Skip to content

Commit

Permalink
createOperations(): fix 'WGS 84 (Gxxx) + EGM2008 height' to 'WGS 84 (…
Browse files Browse the repository at this point in the history
…Gyyy) + EGM2008 height'
  • Loading branch information
rouault committed Jan 2, 2025
1 parent b9b84c9 commit b769746
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/iso19111/operation/singleoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3482,8 +3482,28 @@ bool SingleOperation::exportToPROJStringGeneric(

auto sourceCRSGeod =
dynamic_cast<const crs::GeodeticCRS *>(sourceCRS().get());
if (!sourceCRSGeod) {
auto sourceCRSCompound =
dynamic_cast<const crs::CompoundCRS *>(sourceCRS().get());
if (sourceCRSCompound) {
sourceCRSGeod = dynamic_cast<const crs::GeodeticCRS *>(
sourceCRSCompound->componentReferenceSystems()
.front()
.get());
}
}
auto targetCRSGeod =
dynamic_cast<const crs::GeodeticCRS *>(targetCRS().get());
if (!targetCRSGeod) {
auto targetCRSCompound =
dynamic_cast<const crs::CompoundCRS *>(targetCRS().get());
if (targetCRSCompound) {
targetCRSGeod = dynamic_cast<const crs::GeodeticCRS *>(
targetCRSCompound->componentReferenceSystems()
.front()
.get());
}
}
if (sourceCRSGeod && targetCRSGeod) {
auto sourceCRSGeog =
dynamic_cast<const crs::GeographicCRS *>(sourceCRSGeod);
Expand Down
14 changes: 14 additions & 0 deletions test/cli/test_projinfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1853,3 +1853,17 @@ tests:
+step +inv +proj=cart +ellps=WGS84
+step +proj=unitconvert +xy_in=rad +xy_out=deg
+step +proj=axisswap +order=2,1
- comment: >
Test 'WGS 84 (Gxxx) + EGM2008 height' to 'WGS 84 (Gyyy) + EGM2008 height'
args: -s "WGS 84 (G1150) + EGM2008 height" -t "WGS 84 (G1674) + EGM2008 height" -o PROJ -q
out: |
+proj=pipeline
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +xy_out=rad
+step +proj=cart +ellps=WGS84
+step +proj=helmert +x=-0.0024 +y=0.0016 +z=0.0232 +rx=-0.00027 +ry=0.00027
+rz=-0.00038 +s=0.00208 +dx=-0.0001 +dy=-0.0001 +dz=0.0018 +drx=0 +dry=0
+drz=0 +ds=-8e-05 +t_epoch=2005 +convention=coordinate_frame
+step +inv +proj=cart +ellps=WGS84
+step +proj=unitconvert +xy_in=rad +xy_out=deg
+step +proj=axisswap +order=2,1

0 comments on commit b769746

Please sign in to comment.