-
Notifications
You must be signed in to change notification settings - Fork 216
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
raise exception on invalid authority for Datum, Ellipsoid, CoordinateOperation, PrimeMeridian #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: you only update tests that use from_epsg
, while the code change is in from_authority
. I suppose that from_epsg
uses from_authority
under the hood, but that means we have no direct test for from_authority
?
I am unfamiliar with another authority other than EPSG, so I wasn't sure about how to test from_authority with another authority. However, it may be good to just test from_authority to ensure it does not change even if from_epsg does. |
197f923
to
6803ba2
Compare
|
Whenever I need some kind of crs of a specific type that I don't know about (while doing the reviews and testing here), I look at the new proj.db sources: https://github.com/OSGeo/proj.4/tree/master/data/sql (and eg this one has extra authority codes for IGNF: https://github.com/OSGeo/proj.4/blob/master/data/sql/ignf.sql) (but testing it with EPSG as you did now is also perfectly fine of course!) |
Actually, it is not :-) The other authorities don't necessarily have integer codes:
So we need to remove that restriction in |
Indeed we do. Good catch and thanks for digging into it 👍 |
Okay, so I made a few changes to get it to work and pulled in a commit from #289 as it was needed as well (maybe #289 can be closed and just merge in this MR when ready), and I think we need a
|
Maybe in the repr, instead of |
Even better, have to_authority return both auth_name and auth_code and use NULL for auth name to query all auth names for the best match. |
Current iteration has the desired behavior now:
|
c72d385
to
e285d47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some usage feedback:
- filtering by authority does not work:
In [11]: crs = pyproj.CRS.from_authority("IGNF", "ETRS89UTM28")
In [12]: crs.to_authority()
Out[12]: ('IGNF', 'ETRS89UTM28')
In [13]: crs.to_authority('epsg')
Out[13]: ('IGNF', 'ETRS89UTM28')
+1 |
I raised an issue about this in OSGeo/PROJ#1465 |
Even fixed it on the master branch:
|
e285d47
to
da2f71a
Compare
…Operation, PrimeMeridian
Co-Authored-By: Joris Van den Bossche <jorisvandenbossche@gmail.com>
da2f71a
to
3f0bc38
Compare
Will have to wait for 6.1.0 release for tests to pass on this one. |
3ef652b
to
bca63d0
Compare
Looks like the |
#293