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

C++ API: add methods to build Geographic/Vertical Offset conversions #3413

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

rouault
Copy link
Member

@rouault rouault commented Oct 23, 2022

Cf #3411 (comment)

@hernando Please report if it works. I've just compiled tested this

@hernando
Copy link
Contributor

Yes, this works.

@hernando
Copy link
Contributor

hernando commented Oct 24, 2022

I have a question though. I tried to create a ProjectedCRS of a DerivedGeographicCRS to use the same technique for the vertical offset but even if the construction didn't fail, the deriving conversion was stripped.
I tried to pass this WKT2 string to projinfo and it didn't like it:

PROJCRS["CH1903+ / LV95 with height offset",
    BASEGEOGCRS["CH1903+ with height offset",
        BASEGEOGCRS["CH1903+",
            DATUM["CH1903+",
                ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]]],
        DERIVINGCONVERSION["Ellipsoidal to gravity related height",
            METHOD["Geographic3D offsets",
                ID["EPSG",9660]],
            PARAMETER["Latitude offset",0,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8601]],
            PARAMETER["Longitude offset",0,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8602]],
            PARAMETER["Vertical Offset",0,
                LENGTHUNIT["metre",1],
                ID["EPSG",8603]]],
        CS[ellipsoidal,3],
            AXIS["geodetic latitude (Lat)",north,
                ORDER[1],
                ANGLEUNIT["degree",0.0174532925199433,
                    ID["EPSG",9122]]],
            AXIS["geodetic longitude (Lon)",east,
                ORDER[2],
                ANGLEUNIT["degree",0.0174532925199433,
                    ID["EPSG",9122]]],
            AXIS["custom height (H)",up,
                ORDER[3],
                LENGTHUNIT["metre",1,
                    ID["EPSG",9001]]]],
    CONVERSION["Swiss Oblique Mercator 1995",
        METHOD["Hotine Oblique Mercator (variant B)",
            ID["EPSG",9815]],
        PARAMETER["Latitude of projection centre",46.9524055555556,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8811]],
        PARAMETER["Longitude of projection centre",7.43958333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8812]],
        PARAMETER["Azimuth of initial line",90,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8813]],
        PARAMETER["Angle from Rectified to Skew Grid",90,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8814]],
        PARAMETER["Scale factor on initial line",1,
            SCALEUNIT["unity",1],
            ID["EPSG",8815]],
        PARAMETER["Easting at projection centre",2600000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8816]],
        PARAMETER["Northing at projection centre",1200000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8817]]],
    CS[Cartesian,3],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
        AXIS["custom height (H)",up,
            ORDER[3],
            LENGTHUNIT["metre",1]]]

Is this not allowed?

@hernando
Copy link
Contributor

I have a similar problem if I try to created a derived geographic from a bound (although this one doesn't surprise me as much).

@rouault
Copy link
Member Author

rouault commented Oct 24, 2022

I tried to create a ProjectedCRS of a DerivedGeographicCRS to use the same technique for the vertical offset but even if the construction didn't fail, the deriving conversion was stripped.
I tried to pass this WKT2 string to projinfo and it didn't like it:

I don't see anything obvious in OGC Abstract Topic 2 spec (https://docs.opengeospatial.org/as/18-005r4/18-005r4.html ) that would be forbid this, but the WKT2 spec at http://docs.opengeospatial.org/is/18-010r7/18-010r7.html#74 clearly has no provision for this. You could ask https://lists.ogc.org/mailman/listinfo/coordtran.wg if it is intended or not.

@rouault rouault merged commit b655125 into OSGeo:master Oct 24, 2022
github-actions bot pushed a commit that referenced this pull request Oct 24, 2022
C++ API: add methods to build Geographic/Vertical Offset conversions
@hernando
Copy link
Contributor

hernando commented Nov 2, 2022

I tried to subscribe to the mailing list, but I'm still waiting for a confirmation. In the meantime I tried something different that seemed to unveil a bug in PROJ. I will submit another issue with the details.

@rouault
Copy link
Member Author

rouault commented Nov 2, 2022

but I'm still waiting for a confirmation

check your spam folder

@hernando
Copy link
Contributor

hernando commented Nov 2, 2022

but I'm still waiting for a confirmation

check your spam folder

That was it, thanks!

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.

2 participants