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

Parse compound id with two authorities, like ESRI:103668+EPSG:5703 #2669

Merged
merged 3 commits into from Apr 13, 2021

Conversation

jjimenezshaw
Copy link
Contributor

  • Tests added
  • Added clear title that can be used to generate release notes

Following the suggestion here, https://lists.osgeo.org/pipermail/proj/2021-April/010166.html
this PR parses an identifier that combines two authorities.

Useful to add NAVD88 to many ESRI crs not defined in EPSG.

if (ci_equal(authCandidate, authName1)) {
auto factory =
AuthorityFactory::create(dbContextNNPtr, authCandidate);
crs1 =
Copy link
Member

Choose a reason for hiding this comment

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

some compilers require an explict .as_nullable() to cast from a non-null shared pointed to a regular one. But here the best option would probably be to just assign the real authority names to a std::string and then do like the tokens.size() == 2 case avoid the non-null test on crs1 / crs2.
Actually you could skip the ci_equal() test and just use what the user provides. The case-insensitive comparison in the tokens.size() == 2 case was done because of legacy practice of using "epsg:XXXX", but here for a new supported syntax we can be stricter. That will make the code simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Without ci_equal the code is much simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, projinfo esri:103668+epsg:5703 does work perfectly. However projinfo ogc:CRS84+EPSG:5773 fails. (something that somehow I noticed with --list-crs)

AuthorityFactory::create does a ci_equal for EPSG, ESRI and PROJ.

@rouault
Copy link
Member

rouault commented Apr 13, 2021

could you document the new syntax around https://github.com/OSGeo/PROJ/blob/master/src/iso19111/io.cpp#L6805 ?

@rouault rouault added this to the 8.1.0 milestone Apr 13, 2021
@rouault rouault merged commit a850aac into OSGeo:master Apr 13, 2021
@jjimenezshaw jjimenezshaw deleted the compound-two-auth-identifier branch April 13, 2021 12:52
@tonianr
Copy link

tonianr commented Sep 28, 2021

Hi, I'm very new to GDAL and would like to understand how to convert my tif file from NAVD88 to the WGS84 ellipsoid height?

Using gdalwarp -overwrite Hernando_2007_FDEM_WGS84_NAVD88.tif Hernando_2007_FDEM_WGS84_WGS84.tif -s_srs EPSG:3857+5703 -t_srs EPSG:4979 did not work for me; any ideas on the necessary steps and syntax?

@rouault
Copy link
Member

rouault commented Sep 28, 2021

any ideas on the necessary steps and syntax?

see point B of https://lists.osgeo.org/pipermail/gdal-dev/2021-August/054531.html

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