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: import scope/remarks for coordinate operation and add C API #1537

Merged

Conversation

@rouault
Copy link
Member

commented Jun 29, 2019

  • Import scope and remarks for coordinate operations of the EPSG dataset.
    Database size goes from 5.2 MB to 5.55 MB
  • Add proj_get_scope() and proj_get_remarks()
@jmckenna

This comment has been minimized.

Copy link

commented Jun 29, 2019

I personally think the benefit of adding the remarks is worth the increase in file size. (even as a packager) +1

src/iso19111/c_api.cpp Outdated Show resolved Hide resolved
src/iso19111/c_api.cpp Outdated Show resolved Hide resolved
@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2019

Wow, thanks for the fast response here!

Database: import scope/remarks for coordinate operation and add C API
- Import scope and remarks for coordinate operations of the EPSG dataset.
  Database size goes from 5.2 MB to 5.55 MB
- Add proj_get_scope() and proj_get_remarks()

@rouault rouault force-pushed the rouault:add_scope_remarks_for_coordinate_operation branch from abab3b8 to a9c3567 Jun 30, 2019

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2019

@rouault Been giving this a test run, and I think some information is missing.

E.g.:

./projinfo -s EPSG:28356 -t EPSG:7856 --spatial-test intersects

gives:

...
Operation n°2:

unknown id, Inverse of Map Grid of Australia zone 56 + GDA94 to GDA2020 (2) + Map Grid of Australia zone 56, 0.05 m, Australia - onshore, at least one grid missing
...
   STEP[
        COORDINATEOPERATION["GDA94 to GDA2020 (2)",
            VERSION["ICSM-Aus Conf and Dist"],
            SOURCECRS[
                GEOGCRS["GDA94",
                    DATUM["Geocentric Datum of Australia 1994",
                        ELLIPSOID["GRS 1980",6378137,298.257222101,
                            LENGTHUNIT["metre",1]]],
                    PRIMEM["Greenwich",0,
                        ANGLEUNIT["degree",0.0174532925199433]],
                    CS[ellipsoidal,2],
                        AXIS["geodetic latitude (Lat)",north,
                            ORDER[1],
                            ANGLEUNIT["degree",0.0174532925199433]],
                        AXIS["geodetic longitude (Lon)",east,
                            ORDER[2],
                            ANGLEUNIT["degree",0.0174532925199433]],
                    ID["EPSG",4283]]],
            TARGETCRS[
                GEOGCRS["GDA2020",
                    DATUM["Geocentric Datum of Australia 2020",
                        ELLIPSOID["GRS 1980",6378137,298.257222101,
                            LENGTHUNIT["metre",1]]],
                    PRIMEM["Greenwich",0,
                        ANGLEUNIT["degree",0.0174532925199433]],
                    CS[ellipsoidal,2],
                        AXIS["geodetic latitude (Lat)",north,
                            ORDER[1],
                            ANGLEUNIT["degree",0.0174532925199433]],
                        AXIS["geodetic longitude (Lon)",east,
                            ORDER[2],
                            ANGLEUNIT["degree",0.0174532925199433]],
                    ID["EPSG",7844]]],
            METHOD["NTv2",
                ID["EPSG",9615]],
            PARAMETERFILE["Latitude and longitude difference file","GDA94_GDA2020_conformal_and_distortion.gsb"],
            OPERATIONACCURACY[0.05],
            ID["EPSG",8447],
            REMARK["See GDA94 to GDA2020 (1) or (3) (codes 8048 and 8446) for alternative conformal-only transformation without local distortion modelling. GDA2020 Technical Manual and fact sheet T1 give guidance on which to use."]]],
...

There's no SCOPE information here - yet the EPSG registry has "Transformation of GDA94 coordinates when localised distortion needs to be taken into account, e.g. if GDA94 coordinates were derived survey control monuments." as the scope for EPSG:8447. (And I do see this scope information when running ./projinfo EPSG:8447 -k operation)

@rouault

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2019

Been giving this a test run, and I think some information is missing.

Yes, this is a consequence of the coordinate operation being integrated in a concatenatedoperation and some formatting rules of WKT export to try to reduce the amount of text generated. There are a number of prescriptions in the WKT standard, in particular regarding when to put ID or not. I can't find anything for USAGE[] so this is probably my own decision (the rule being that if the concatenatedoperation has a USAGE[] node, then the ones of the steps are omitted), based on examples in the WKT standard actually which seem to follow that rule.
The information should still be there if you inspect the steps of the concatenated operation with the C API.
In that particular case where the concatenatedoperation chains "boring" conversions and just a single coordinateoperation, one could probably "import" the scope and remark from that coordinateoperation to the concatenatedoperation itself, but that starts to becoming tricky...

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

@rouault thanks for the clarification

So what I was thinking (for QGIS) was to iterate through the steps of the coordinate operation (what's the c api for doing this? I can't work it out from the docs), and collecting a list of remarks and scope. I'll then concatenate all these into a list to display to users. It's not perfect, but should give enough clues regarding the limitations/scope of a particular coordinate operation to help users make informed decisions...

@rouault

This comment has been minimized.

Copy link
Member Author

commented Jul 1, 2019

what's the c api for doing this?

was missing. Just added it per 8b11663

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

Thanks, looks good to me

@rouault rouault force-pushed the rouault:add_scope_remarks_for_coordinate_operation branch from 8b11663 to f46de26 Jul 1, 2019

@rouault rouault force-pushed the rouault:add_scope_remarks_for_coordinate_operation branch from f46de26 to 7493200 Jul 1, 2019

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

Ok, this is MUCH better, thank you very much!

image

image

image

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

QGIS PR which uses this new API at qgis/QGIS#30501

@rduivenvoorde

This comment has been minimized.

Copy link

commented Jul 2, 2019

THANKS @rouault @nyalldawson !! Nice work!

@nyalldawson I've seen this dialog popup now on a couple of incidents, and I think the 'average' user is now aware of these 'details'. What about adding Help button in that dialog pointing to:
https://docs.qgis.org/testing/en/docs/user_manual/working_with_projections/working_with_projections.html ?

Even better: if we add a chapter there which explains defines the differences between crs, projection, transformation, datum etc etc. Anybody a good primer for that? Personally I found the Esri page https://pro.arcgis.com/en/pro-app/help/mapping/properties/coordinate-systems-and-projections.htm a nice intro, though I do not know if we use the exact same definitions..

@nyalldawson

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

@rduivenvoorde do you mean "not aware"? (Let's move the QGIS specific conversation to qgis/QGIS#30501 to avoid spamming the proj maintainers )

@rouault rouault added this to the 6.2.0 milestone Jul 2, 2019

@rouault rouault merged commit 3ae09c3 into OSGeo:master Jul 2, 2019

3 of 4 checks passed

FreeBSD
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage increased (+0.02%) to 85.931%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.