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

WKT import: 3D-promote base CRS of 3D DerivedProjectedCRS (fixes #3340) #3342

Merged
merged 1 commit into from
Sep 25, 2022

Conversation

rouault
Copy link
Member

@rouault rouault commented Sep 24, 2022

With the fix

$ projinfo -s  EPSG:6318+6360 -t @derivedproj3D.wkt --spatial-test intersects -o PROJ -q

+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad +z_out=m
  +step +proj=vgridshift +grids=us_noaa_g2018u0.tif +multiplier=1
  +step +proj=tmerc +lat_0=41 +lon_0=-73 +k=1 +x_0=0 +y_0=0 +ellps=GRS80
  +step +proj=unitconvert +xy_in=m +xy_out=us-ft +z_in=m +z_out=us-ft
  +step +proj=affine +xoff=5 +yoff=52 +zoff=10
  +step +proj=unitconvert +xy_in=us-ft +xy_out=m +z_in=us-ft +z_out=m
  +step +proj=unitconvert +xy_in=m +z_in=m +xy_out=us-ft +z_out=us-ft
  +step +proj=axisswap +order=2,1

where derivedproj3D.wkt is

DERIVEDPROJCRS["Custom Site Calibrated 3D CRS",
    BASEPROJCRS["Transverse Mercator centered in area of interest",
        BASEGEOGCRS["NAD83(2011)",
            DATUM["NAD83 (National Spatial Reference System 2011)",
                ELLIPSOID["GRS 1980",6378137,298.257222101,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]]],
        CONVERSION["Transverse Mercator",
            METHOD["Transverse Mercator",
                ID["EPSG",9807]],
            PARAMETER["Latitude of natural origin",41,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8801]],
            PARAMETER["Longitude of natural origin",-73,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8802]],
            PARAMETER["Scale factor at natural origin",1,
                SCALEUNIT["unity",1],
                ID["EPSG",8805]],
            PARAMETER["False easting",0,
                LENGTHUNIT["US survey foot",0.304800609601219],
                ID["EPSG",8806]],
            PARAMETER["False northing",0,
                LENGTHUNIT["US survey foot",0.304800609601219],
                ID["EPSG",8807]]]],
    DERIVINGCONVERSION["Affine transformation as PROJ-based",
        METHOD["PROJ-based operation method: +proj=pipeline  +step +proj=unitconvert +xy_in=m +xy_out=us-ft +z_in=m +z_out=us-ft +step +proj=affine +xoff=5 +yoff=52 +zoff=10 +step +proj=unitconvert +xy_in=us-ft +xy_out=m +z_in=us-ft +z_out=m"]],
    CS[Cartesian,3],
        AXIS["(Y)",north,
            ORDER[1],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]],
        AXIS["(X)",east,
            ORDER[2],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]],
        AXIS["(Z)",up,
            ORDER[3],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]]]

Possible workarounds:

  • add a non conformant CS[] definition with 3 axis to the BASEPROJCRS[] and BASEGEOGCRS[]
  • export the WTK to PROJJSON and edit the coordinate_system of the 2 base_crs to have a Z axis

…o#3340)

With the fix
```
$ projinfo -s  EPSG:6318+6360 -t @derivedproj3D.wkt --spatial-test intersects -o PROJ -q

+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad +z_out=m
  +step +proj=vgridshift +grids=us_noaa_g2018u0.tif +multiplier=1
  +step +proj=tmerc +lat_0=41 +lon_0=-73 +k=1 +x_0=0 +y_0=0 +ellps=GRS80
  +step +proj=unitconvert +xy_in=m +xy_out=us-ft +z_in=m +z_out=us-ft
  +step +proj=affine +xoff=5 +yoff=52 +zoff=10
  +step +proj=unitconvert +xy_in=us-ft +xy_out=m +z_in=us-ft +z_out=m
  +step +proj=unitconvert +xy_in=m +z_in=m +xy_out=us-ft +z_out=us-ft
  +step +proj=axisswap +order=2,1
```

where derivedproj3D.wkt is
```
DERIVEDPROJCRS["Custom Site Calibrated 3D CRS",
    BASEPROJCRS["Transverse Mercator centered in area of interest",
        BASEGEOGCRS["NAD83(2011)",
            DATUM["NAD83 (National Spatial Reference System 2011)",
                ELLIPSOID["GRS 1980",6378137,298.257222101,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]]],
        CONVERSION["Transverse Mercator",
            METHOD["Transverse Mercator",
                ID["EPSG",9807]],
            PARAMETER["Latitude of natural origin",41,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8801]],
            PARAMETER["Longitude of natural origin",-73,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8802]],
            PARAMETER["Scale factor at natural origin",1,
                SCALEUNIT["unity",1],
                ID["EPSG",8805]],
            PARAMETER["False easting",0,
                LENGTHUNIT["US survey foot",0.304800609601219],
                ID["EPSG",8806]],
            PARAMETER["False northing",0,
                LENGTHUNIT["US survey foot",0.304800609601219],
                ID["EPSG",8807]]]],
    DERIVINGCONVERSION["Affine transformation as PROJ-based",
        METHOD["PROJ-based operation method: +proj=pipeline  +step +proj=unitconvert +xy_in=m +xy_out=us-ft +z_in=m +z_out=us-ft +step +proj=affine +xoff=5 +yoff=52 +zoff=10 +step +proj=unitconvert +xy_in=us-ft +xy_out=m +z_in=us-ft +z_out=m"]],
    CS[Cartesian,3],
        AXIS["(Y)",north,
            ORDER[1],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]],
        AXIS["(X)",east,
            ORDER[2],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]],
        AXIS["(Z)",up,
            ORDER[3],
            LENGTHUNIT["US survey foot",0.304800609601219,
                ID["EPSG",9003]]]]
```
@rouault rouault merged commit 56b3de5 into OSGeo:master Sep 25, 2022
github-actions bot pushed a commit that referenced this pull request Sep 25, 2022
WKT import: 3D-promote base CRS of 3D DerivedProjectedCRS (fixes #3340)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant