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

Add new Conversion "Local Orthographic" #4228

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jjimenezshaw
Copy link
Contributor

As mentioned in #4226, this "new" conversion (added in EPSG v11.015) is an extension of the Orthographic, extending proj=ortho with azimuth and scale.

Notice that the example in Guidance Note 7 part 2, section 3.6.6 uses the parameters of the CRS NAD83(2011) / San Francisco SFO B18. However the parameters are not exactly the same values as in the database for EPSG:10622.

Fun fact: EPSG:10622 is aligned with the main runway (10L/28R) of San Francisco Airport, going (positive) straight to the east in that local system. The end of the runway is aprox. at coordinates (11740, 0) feet.

@jjimenezshaw
Copy link
Contributor Author

When it is ok I can merge the commits in one.

@jjimenezshaw
Copy link
Contributor Author

Outputs of EPSG:10622

PROJ_DATA=data bin/projinfo EPSG:10622 -o proj
PROJ.4 string:
+proj=ortho +lat_0=37.6289686531 +lon_0=-122.3939412704 +alpha=27.7928209333 
+k=0.9999968 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs +type=crs
PROJ_DATA=data bin/projinfo EPSG:10622 -o wkt1_esri
WKT1:ESRI string:
PROJCS["NAD83_2011_San_Francisco_SFO-B18(ftUS)",GEOGCS["GCS_NAD_1983_2011",DATUM["D_NAD_1983_2011",
SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],
PROJECTION["Local"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],
PARAMETER["Scale_Factor",0.9999968],PARAMETER["Azimuth",27.7928209333],
PARAMETER["Longitude_Of_Center",-122.3939412704],PARAMETER["Latitude_Of_Center",37.6289686531],
UNIT["US survey foot",0.304800609601219]]
PROJ_DATA=data bin/projinfo EPSG:10622 -o wkt1_gdal
WKT1:GDAL string:
PROJCS["NAD83(2011) / San Francisco SFO-B18 (ftUS)",
    GEOGCS["NAD83(2011)",
        DATUM["NAD83_National_Spatial_Reference_System_2011",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","1116"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","6318"]],
    PROJECTION["Local Orthographic"],
    PARAMETER["latitude_of_origin",37.6289686531],
    PARAMETER["central_meridian",-122.3939412704],
    PARAMETER["azimuth",27.7928209333],
    PARAMETER["scale_factor",0.9999968],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["US survey foot",0.304800609601219,
        AUTHORITY["EPSG","9003"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","10622"]]

@jjimenezshaw
Copy link
Contributor Author

With the code from master, without this changes, the WKT1_GDAL is like this:

PROJ_DATA=data bin/projinfo EPSG:10622 -o wkt1_gdal
WKT1:GDAL string:
PROJCS["NAD83(2011) / San Francisco SFO-B18 (ftUS)",
    GEOGCS["NAD83(2011)",
        DATUM["NAD83_National_Spatial_Reference_System_2011",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","1116"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","6318"]],
    PROJECTION["Local_Orthographic"],
    PARAMETER["Latitude of projection centre",37.6289686531],
    PARAMETER["Longitude of projection centre",-122.3939412704],
    PARAMETER["Azimuth at projection centre",27.7928209333],
    PARAMETER["Scale factor at projection centre",0.9999968],
    PARAMETER["Easting at projection centre",0],
    PARAMETER["Northing at projection centre",0],
    UNIT["US survey foot",0.304800609601219,
        AUTHORITY["EPSG","9003"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","10622"]]

Is the name of the projection PROJECTION["Local Orthographic"] correct with this PR? (see previous comment)

Copy link
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

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

LGTM !
One point to check though is that projinfo "+proj=ortho +k_0=0.9 +type=crs" (or with +alpha != 0) instantiates a Local Orthographic projection and not a regular Orthographic.
You may need to fine tune PROJStringParser::Private::buildProjectedCRS() to add a special case, and a test for that in test_io.cpp

@rouault
Copy link
Member

rouault commented Aug 16, 2024

without this changes, the WKT1_GDAL is like this:

I believe we should rather fail. WKT1_GDAL is for what GDAL <= 2.4 and PROJ <= 5.x understood. Although it is not the end of the world if we generate that WKT1...

@jjimenezshaw
Copy link
Contributor Author

instantiates a Local Orthographic projection and not a regular Orthographic.

Your are right. It is currently creating a METHOD["Orthographic", ID["EPSG",9840]],. Let me see how can I fine tune it.

@jjimenezshaw
Copy link
Contributor Author

Doing the test in test_io.cpp, I noticed that the proj string is this

PROJ_DATA=data bin/projinfo EPSG:10622 -o proj
PROJ.4 string:
+proj=ortho +lat_0=37.6289686531 +lon_0=-122.3939412704 +alpha=27.7928209333 
+k=0.9999968 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs +type=crs

using k instead of k_0.
What is the correct key to use there (as output)? if it is k_0, how can I force it?

The documentation I wrote is all with k_0, and the parameter works. Well, apparently both work in the input, but as output it is giving k.

@rouault
Copy link
Member

rouault commented Aug 16, 2024

What is the correct key to use there (as output)? if it is k_0, how can I force it?

This is due to

common::UnitOfMeasure::Type::SCALE, k};
. I remember to have also wondered about k vs k_0 difference in the past and obviously can't remember the conclusion. Probably there isn't a clear one. Yes PROJ parser ( at least the one used to build PJ* object in src/init.cpp line 666) indifferently parses k and k_0, so that doesn't matter much ( in the context of PROJStringParser::Private::buildProjectedCRS() , you can use getParamValueK() to recognize both alternatives )

@jjimenezshaw jjimenezshaw changed the title Add new Conversion "Local Geographic" Add new Conversion "Local Orthographic" Aug 16, 2024
with code 1130 from updated EPSG v11.015
with azimuth and scale factor in proj=ortho projection
@rouault rouault added this to the 9.5.0 milestone Aug 16, 2024
@rouault rouault merged commit c83e18e into OSGeo:master Aug 16, 2024
22 of 23 checks passed
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.

prj with "local" projection from ArcGIS
2 participants