Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenated operation with height reversal fails #4116

Closed
barry-gallagher opened this issue Apr 12, 2024 · 2 comments · Fixed by #4120
Closed

Concatenated operation with height reversal fails #4116

barry-gallagher opened this issue Apr 12, 2024 · 2 comments · Fixed by #4120
Labels

Comments

@barry-gallagher
Copy link

Example of problem

Using the attached proj.db including custom NOAA tidal CRS and transform records

projinfo --hide-ballpark -s EPSG:8542 -t NOAA:8509 --spatial-test intersects
createOperations() failed with: cannot build transformation NOAA:14434: Inconsistent chaining of CRS in operations

Problem description

The concatenated_operation 14434 is supposed to perform these steps:

  • EPSG:9168 -- NAD83(FBN) 3D to NAD83(FBN)+NAVD88 height
  • EPSG:7989 -- NAVD88 height to NAVD88 depth
  • NOAA:11492 -- NAD83(FBN)+LMSL to NAD83(FBN)+NAVD88 depth
  • NOAA:11490 -- NAD83(FBN)+MLLW to NAD83(FBN)+LMSL

In the function ConcatenatedOperation::fixStepsDirection the second step is recognized as a conversion and then assumes the target of the first operation is the same as the source of the third operation, rather than checking if the third operation needs an op->inverse() like the rest of the function does.

If I reverse the source and target of the NOAA:11492 operation then the call results in my expected output below.

Expected Output

Candidate operations found: 1
-------------------------------------
Operation No. 1:

NOAA:14434, Inverse of 'Inverse of 'NAD83(FBN) to NAD83(FBN) + MLLW (WAjuandefuca01/vdatum_3.4_20141224/1983-2001) depth'', 0.1 m, 17203 Washington - Strait of Juan de Fuca Local Mean Sea Level 1983-2001

PROJ string:
+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +xy_out=rad
  +step +inv +proj=vgridshift +grids=us_noaa_geoid03_conus.tif +multiplier=1
  +step +proj=unitconvert +xy_in=rad +xy_out=deg
  +step +proj=axisswap +order=2,1
  +step +proj=axisswap +order=1,2,-3
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +xy_out=rad
  +step +inv +proj=vgridshift
        +grids=us_noaa_nos_NAD83(FBN)_LMSL_NAVD88_(WAjuandefuca01_vdatum_3.4_20141224_1983-2001).tif
        +multiplier=1
  +step +proj=axisswap +order=1,2,-3
  +step +proj=axisswap +order=1,2,-3
  +step +proj=vgridshift
        +grids=us_noaa_nos_NAD83(FBN)_MLLW_LMSL_(WAjuandefuca01_vdatum_3.4_20141224_1983-2001).tif
        +multiplier=1
  +step +proj=unitconvert +xy_in=rad +xy_out=deg
  +step +proj=axisswap +order=2,1

Environment Information

  • PROJ version 9.4 (and 9.3.1)
  • Operation System Information - Windows 11

Installation method

@rouault
Copy link
Member

rouault commented Apr 16, 2024

Fix for the specific issue of solving the inconsistent chaining in #4120 . However the resulting pipeline is likely wrong because of #4118

@barry-gallagher
Copy link
Author

Thanks @rouault for the quick fix!

rouault added a commit that referenced this issue Apr 17, 2024
…ion is chained with transformation that must be reversed

Fixes #4116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants