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

Freeze hard-coded prime meridians and note they are no longer updated #4042

Merged
merged 3 commits into from
Feb 15, 2024

Conversation

mwtoews
Copy link
Member

@mwtoews mwtoews commented Feb 8, 2024

This PR "freezes" hard-coded prime meridians that are listed in src/datums.cpp's PJ_PRIME_MERIDIANS struct. This has only had a few modifications since it was added 22 years ago (27c197f), but has some omissions (#4031) and some values conflict with other sources (#4029, #4030). Also, there are potentially many other prime meridians that users may want to choose from.

This PR doesn't go as far as deprecating cs2cs -lm, actually it adds this missing doc item. However, a message is sent to stderr:

Hard-coded prime meridians are a legacy PROJ.4 feature.
This list is no longer updated, and some values may conflict with other sources.

Suggestions in rewording or changing tone are welcome.

This also updates docs/source/usage/projections.rst with a few corrections. The example is changed from madrid (which "has had various determinations", including 84b8264) to lisbon which I assume has stayed put there for a while now.

Closes #4031, #4029

@@ -580,8 +580,11 @@ int main(int argc, char **argv) {
}
proj_unit_list_destroy(units);
} else if (arg[1] == 'm') { /* list prime meridians */
(void)fprintf(stderr,
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't emit a warning. If we want to emit one, then we should also do it for datum, ellipsoid, units, etc

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with the second sentence "This list is no longer updated, and some values may conflict with other sources"

Copy link
Member Author

Choose a reason for hiding this comment

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

Listing datums was already removed (e9605e4).
Listing ellipsoids could potentially show a similar message.
Listing units uses proj_get_units_from_database so is fine.

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to disregard my comments. I'm not that strong about them.

The only thing that is a bit weird is that internally PROJ still creates PROJ pipeline strings with those deprecated features, but one could argue that is an implementation detail. Well, actually not completely true, as we also export that to the sight of the advanced user...)

$ bin/projinfo -s "NTF (Paris)" -t "NTF" -o PROJ -q
+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=grad +xy_out=rad
  +step +inv +proj=longlat +ellps=clrk80ign +pm=paris
  +step +proj=unitconvert +xy_in=rad +xy_out=deg
  +step +proj=axisswap +order=2,1

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's fine to have a short list of hard-coded of prime meridians (e.g. where paris ↔ 2.33722917) with the caveat that it doesn't change. It's a bit deprecated, but I wasn't planning to establish this as a deprecated feature. But yes, I can tone down the "legacy PROJ.4" wording throughout.

Copy link
Member

Choose a reason for hiding this comment

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

The above pipeline could also have +pm expressed in decimal degrees, so the PROJ internals could be changed to do that in the future, should we decide to drop support for these hard-coded lists.

@mwtoews mwtoews force-pushed the freeze-prime-meridians branch 2 times, most recently from 8092d6c to 036f034 Compare February 8, 2024 21:23
@mwtoews mwtoews force-pushed the freeze-prime-meridians branch from 036f034 to f69e987 Compare February 8, 2024 22:17
@mwtoews mwtoews changed the title Legacy hard-coded prime meridians are no longer updated Freeze hard-coded prime meridians and note they are no longer updated Feb 8, 2024
@mwtoews mwtoews requested a review from kbevers February 11, 2024 20:02
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.

I've added a few comments with suggestions but in general I am happy with this PR

docs/source/usage/projections.rst Show resolved Hide resolved
@@ -580,8 +580,11 @@ int main(int argc, char **argv) {
}
proj_unit_list_destroy(units);
} else if (arg[1] == 'm') { /* list prime meridians */
(void)fprintf(stderr,
Copy link
Member

Choose a reason for hiding this comment

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

The above pipeline could also have +pm expressed in decimal degrees, so the PROJ internals could be changed to do that in the future, should we decide to drop support for these hard-coded lists.

docs/source/apps/cs2cs.rst Outdated Show resolved Hide resolved
@mwtoews
Copy link
Member Author

mwtoews commented Feb 15, 2024

Thanks for feedback @kbevers. I've taken the moment to further expand the docs on angular inputs too, which I wouldn't mind a bit of review on too.

@kbevers
Copy link
Member

kbevers commented Feb 15, 2024

which I wouldn't mind a bit of review on too.

Looks great. Good job!

@mwtoews mwtoews merged commit 6e0c182 into OSGeo:master Feb 15, 2024
23 checks passed
@mwtoews mwtoews deleted the freeze-prime-meridians branch February 15, 2024 20:18
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.

Missing Paris RGS prime meridian?
3 participants