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

Database: update to EPSG 10.088 #3731

Merged
merged 2 commits into from
May 16, 2023
Merged

Database: update to EPSG 10.088 #3731

merged 2 commits into from
May 16, 2023

Conversation

rouault
Copy link
Member

@rouault rouault commented May 13, 2023

The import script has been modified to avoid import errors on the following Danish CRS:

  • Skipping EPSG:10258 GS reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)
  • Skipping EPSG:10262 GSB reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)
  • Skipping EPSG:10266 KK reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)

CC @busstoptaktik Looking at EPSG revision history, it appears you're the one having submitted the above CRS to IOGP. Currently we don't import them into proj.d as the projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B) is not mapped to a PROJ map projection. Do you have a plan doing that ?
I also see new grids being added. I guess you'll submit them to PROJ-data ?

The import script has been modified to avoid import errors on the
following Danish CRS:
- Skipping EPSG:10258 GS reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)
- Skipping EPSG:10262 GSB reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)
- Skipping EPSG:10266 KK reconstruction east-orientated as we do not handle yet projection method EPSG:1102 / Lambert Conic Conformal (1SP variant B)
@busstoptaktik
Copy link
Member

busstoptaktik commented May 14, 2023

EPSG:1102 / Lambert Conic Conformal (1SP variant B) is not mapped to a PROJ map projection

The expected PROJ expressions are:

GS:  proj=lcc   ellps=danish lon_0=10.37775   lat_0=55   lat_1=56
GSB: proj=lcc   ellps=danish lon_0=14.92775   lat_0=55   lat_1=56 x_0=-18831.460 y_0=5614.621
KK:  proj=lcc   ellps=danish lon_0=10.37775   lat_0=55   lat_1=56

If the problem relates to whether PROJ implements Variant A (EPSG:9801) or Variant B (EPSG:1102), I did actually check whether PROJ implements one or the other prior to submitting the material to EPSG. I did so by checking the examples from the IOGP Guidance Note 7.2, and as shown below, PROJ implements Variant B (EPSG:1102).

LCC 1SP, Variant B: Example from "IOGP Publication 373-7-2 – Geomatics Guidance Note number 7, part 2 – May 2022, section 3.4.1.3, p. 23"

Parameters

Latitude  of natural origin: 44+(22+45/60)/60 = 44.37916666666666667
Latitude  of false   origin: 45+11/60         = 45.18333333333333333
Longitude of false   origin:  6+49/60         =  6.81666666666666667

Easting at false origin: 150000 m
Northing at false origin: 50000 m

Test point

Latitude: 47 N
Longitude: 7 E

PROJ implementation:

echo 47 7 | proj -srf %.4f +proj=lcc +ellps=GRS80 +lat_1=44.37916666666666667 +lat_0=45.1833333333333333 +lon_0=6.816666666666666667 +x_0=150000 +y_0=50000

Result N,E:   252043.3067 163958.3661
Expected N,E: 252043.307  163958.366

Conformance! - i.e. PROJ implements variant B

LCC 1SP, Variant A: Example from "IOGP Publication 373-7-2 – Geomatics Guidance Note number 7, part 2 – May 2022, section 3.4.1.2, p. 22"

Parameters

Latitude  of natural origin: 18 N
Longitude of natural origin: 77 W
False easting  250000 m
False northing 150000 m

Test point

Latitude:  17+(55+55.80/60)/60 = 17.932166666666666667 N
Longitude: 76+(56+37.26/60)/60 = 76.943683333333333333 W

PROJ implementation:

echo 17.932166666666666667 76.943683333333333333 | proj -srf %.4f +proj=lcc +ellps=clrk66 +lat_1=18 +lat_0=18 +lon_0=-77 +x_0=250000 +y_0=150000

Result N,E:  6533195.6266   14749527.0037
Expected N,E: 142493.51       255966.58

Discrepancy - i.e. PROJ does not implement "Variant A"

I also see new grids being added. I guess you'll submit them to PROJ-data ?

Your guess is correct :-)

The process with registering old Danish systems with EPSG has been extremely long an winded, but the grids have already been available from the SDFI ftp-server for some time now.

@rouault
Copy link
Member Author

rouault commented May 14, 2023

Discrepancy - i.e. PROJ does not implement "Variant A"

Ouch, I almost had a heart attack reading this given this is a widely used method, but you just got the numerical application wrong, with the sign of the input longitude :-) Here's the correct input that shows we are conformant:

$ echo 17.932166666666666667 -76.943683333333333333 | bin/proj -srf %.4f +proj=lcc +ellps=clrk66 +lat_1=18 +lat_0=18 +lon_0=-77 +x_0=250000 +y_0=150000
142493.5110	255966.5818

The good news is that the mapping of LCC_1SP variant B to +proj=lcc is trivial. I'll look at adding the mapping part

@busstoptaktik
Copy link
Member

numerical application wrong,

Thanks for noticing - never a good idea trying to reconstruct year-old computations at 6 in the morning after a sleepless night :-) ... the sheer amount of offset should obviously have told me, especially since it is just a few days ago, I diagnosed a similar case in connection with some old Greenlandic Systems.

In other words, the PROJ implementation is conforming for both Variant A and B, the difference is exclusively in the selection of parameters.

Originally, I probably tried variant B only, concluded it was PROJ compatible, then proceeded using it for the relevant parts of the "reconstruction of old Danish systems" project.

@rouault
Copy link
Member Author

rouault commented May 14, 2023

Support for LCC 1SP Variant B added in extra commit:

$ PROJ_DATA=data bin/projinfo EPSG:10262
PROJ.4 string:
+proj=lcc +lat_1=56 +k_0=1 +lat_0=55 +lon_0=14.92775 +x_0=-18831.46 +y_0=5614.621 +a=6377019.27 +rf=300 +units=m +no_defs +type=crs

WKT2:2019 string:
PROJCRS["GSB reconstruction east-orientated",
    BASEGEOGCRS["GSB-IRF",
        DATUM["Generalstabens System Bornholm Intermediate Datum",
            ELLIPSOID["Danish 1876",6377019.27,300,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",10260]],
    CONVERSION["GSB-reconstruction",
        METHOD["Lambert Conic Conformal (1SP variant B)",
            ID["EPSG",1102]],
        PARAMETER["Latitude of natural origin",56,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Scale factor at natural origin",1,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["Latitude of false origin",55,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",14.92775,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Easting at false origin",-18831.46,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",5614.621,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Geodesy, topographic mapping."],
        AREA["Denmark - Bornholm onshore."],
        BBOX[54.94,14.59,55.38,15.25]],
    ID["EPSG",10262]]

Copy link
Member

@kbevers kbevers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'll add the grids to PROJ-data within the next couple of days.

@rouault rouault merged commit 852f3c4 into OSGeo:master May 16, 2023
23 checks passed
@kbevers
Copy link
Member

kbevers commented May 16, 2023

@rouault the first commit can be backported, right?

@rouault
Copy link
Member Author

rouault commented May 16, 2023

the first commit can be backported, right?

yes, I see I forgot to add the backport tag. Will do manually. actually I intended to backport both commits, unless you want otherwise.

@kbevers
Copy link
Member

kbevers commented May 16, 2023

actually I intended to backport both commits, unless you want otherwise.

I think it's fine. I figured you didn't add the backport tag because the second commit sort of introduces new functionality. I agree that backporting both is suitable.

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.

None yet

3 participants