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

User isn't informed that information from proj4 string has been ignored in making CRS #3170

Open
wjbenfold opened this issue Apr 20, 2022 · 4 comments

Comments

@wjbenfold
Copy link

Example of problem

from pyproj.crs import CRS

crss = [
    CRS.from_user_input("+proj=merc +datum=WGS84 +ellps=WGS84 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +units=m +no_defs +type=crs"),
    CRS.from_user_input("+proj=merc +a=6378137.0 +rf=298.257223563 +datum=WGS84 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +units=m +no_defs +type=crs"),
]

for crs in crss:
    print(crs)
    print(crs.datum)
    print()
+proj=merc +datum=WGS84 +ellps=WGS84 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +units=m +no_defs +type=crs
World Geodetic System 1984

+proj=merc +a=6378137.0 +rf=298.257223563 +datum=WGS84 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +units=m +no_defs +type=crs
unknown

Problem description

Currently, information (the datum) is dropped in the second example. I'm informed (pyproj4/pyproj#1061) that this is because the string parsing in proj has identified that the ellipse information conflicts with the datum and thus chosen to drop the datum.

The lack of warning that this has been done (along with pyproj's choice to show the string used to create the crs even though it's inaccurate) makes it harder to decode what's gone wrong. I think that proj should warn or error on provision of strings that make it drop data like this.

Environment Information

  • PROJ version (proj)
    Rel. 8.2.0, November 1st, 2021
  • Operation System Information
    System:
    python: 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) [GCC 9.4.0]
    executable: .../.conda/envs/iris-dev/bin/python
    machine: Linux-3.10.0-1160.62.1.el7.x86_64-x86_64-with-glibc2.10

Installation method

  • conda
@wjbenfold wjbenfold added the bug label Apr 20, 2022
@wjbenfold wjbenfold changed the title Inform user that information from proj4 string has been ignored in making CRS User isn't informed that information from proj4 string has been ignored in making CRS Apr 20, 2022
@kbevers kbevers removed the bug label Apr 20, 2022
@kbevers
Copy link
Member

kbevers commented Apr 20, 2022

How do you propose we issue such a warning? Currently we don't really have a mechanism for that

@rouault
Copy link
Member

rouault commented Apr 20, 2022

Proposed resolution in #3171

@wjbenfold
Copy link
Author

I don't know enough to tell everything that's going on in #3171 but the stated intent seems like a good resolution

@USGSExplorer1

This comment was marked as off-topic.

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 a pull request may close this issue.

4 participants