Skip to content

Commit

Permalink
Null VerticalCRS to VerticalCRS: optimize as +proj=noop instead of +p…
Browse files Browse the repository at this point in the history
…roj=geogoffset +dh=0
  • Loading branch information
rouault authored and github-actions[bot] committed Oct 13, 2024
1 parent f118bd2 commit aa8e518
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/iso19111/operation/singleoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4009,8 +4009,10 @@ bool SingleOperation::exportToPROJStringGeneric(
sourceCRSVert->addLinearUnitConvert(formatter);
formatter->stopInversion();

formatter->addStep("geogoffset");
formatter->addParam("dh", offsetHeight);
if (offsetHeight != 0) {
formatter->addStep("geogoffset");
formatter->addParam("dh", offsetHeight);
}

targetCRSVert->addLinearUnitConvert(formatter);

Expand Down
4 changes: 4 additions & 0 deletions test/cli/test_projinfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1834,3 +1834,7 @@ tests:
out: |
Candidate operations found: 1
unknown id, Null geographic offset from NAD83(CSRS)v7 (geog2D) to NAD83(CSRS)v7 (geog3D) + Canada velocity grid v7 from epoch 1997 to epoch 2010 + Null geographic offset from NAD83(CSRS)v7 (geog3D) to NAD83(CSRS)v7 (geog2D), 0.01 m, Canada - onshore - Alberta; British Columbia (BC); Manitoba; New Brunswick (NB); Newfoundland and Labrador; Northwest Territories (NWT); Nova Scotia (NS); Nunavut; Ontario; Prince Edward Island (PEI); Quebec; Saskatchewan; Yukon.
- comment: >
Test that "CGVD28 height" to "CGVD28(HTv2.0) height" is a no-op
args: -s "CGVD28 height" -t "CGVD28(HTv2.0) height" -o PROJ -q
out: +proj=noop

0 comments on commit aa8e518

Please sign in to comment.