-
Notifications
You must be signed in to change notification settings - Fork 214
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
API: CRS.datum being a CRS itself ? #262
Comments
You bring up a good question. It was done this way as it is a |
This is a great place for the questions you are asking. Maybe in the future a gitter thread can be created for a forum for pyproj users. |
Also, maybe adding access to: |
It's maybe a bit broader discussion than just Datum. Also the CoordinateSystem and CoordinateOperation might deserve its class (there is also a |
I think each one having a class with targeted functionality is a good idea. |
I think the general question is to what extent we want to model the different types in the C++ ISO-19111 API. One could imagine a class hierarchy as:
(that seems a lot, but we already have the majority of them) Of course, one could also go a step further, and define a bunch of subclasses for each of them to completely follow the ISO-19111, but that might be too much. As an external user (in my case from GeoPandas), I mainly care about a good user-friendly CRS class (and maybe a CoordinateOperionan class, although not sure how that would relate to the existing Proj / Transformer classes). |
I am going to close this as the solution is merged into master. Thanks for bringing up the idea! |
(this might be more a question on why this was implemented like this, but since I don't know of a better place to ask, opening an issue here. If there is a better venue to ask such questions, let me know!)
So if you define a CRS, eg Web Mercator here, and get the
datum
property, you get back a CRS object:but, since this is a Datum, it is not a complete CRS object. For example, it has no AxisInfo (by definition I think, as only a CoordinateSystem has that), it also has no proj4 string representation (
crs.datum.to_proj4()
returns None), etcI know that from the proj4 side, both CRS and Datum are
PJ
objects. So it can make sense to have them in a single class in the python wrapper. But, we already don't allow all types ofPJ
objects in thepyproj.CRS
class (eg an Ellipsoid is also a PJ object and can have a EPSG number, but for Ellipsoid we have a separate class).And moreover, I think from a user perspective, it might be useful and clearer that a
CRS
class always is a CRS (and not Datum, Ellipsoid, ..)The text was updated successfully, but these errors were encountered: