-
Notifications
You must be signed in to change notification settings - Fork 7
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
Design for CRS extension #9
Comments
A couple questions/clarifications if you could:
My understanding was that geoxarray would be providing utilities for creating the |
Ideally, it would be best for the CRS to be pulled from the current Dataset/DataArray expected attributes. However, there are so many different ways that this data is stored that it is likely going to fail if it is on a non-standard location or format. With this line of thinking, it would be nice to have multiple methods for setting the CRS as a backup. For example, if you already have a geo.crs = CRS("epsg:4326") I guess you could do: geo.crs_from_cf(crs_wkt=CRS("epsg:4326").to_wkt()) But, it is not as clean IMO.
This can work for both data arrays and datasets. If it is a data array, then it is much simpler as you only have one location to search for the CRS. Whereas if it is a dataset, then some logic needs to be added to determine which CRS is used by which variable if there are more then one (or just assume that there is only one CRS for the entire dataset).
Yes, this is what I am thinking is the end goal. But, until it is ready in |
So is Looking at the |
That is the general idea. I am not sure about the CF dict as there can also be PROJ dicts. So, you would need a way to differentiate. Maybe look for |
I'd say that wouldn't be a bad idea if the property is already magic-ish. |
Okay, sounds good to me 👍 |
Hi. I'd been poised a couple of days ago to generalise some of my existing code from a couple of years ago for writing CF-compliant netcdfs using xarray, but some searching revealed this project. I can give some time to helping with getting and setting CRS info on xarray Datasets, especially in creating functionality to write CF-compliant netCDFs. Before I start anything though, is there any local development of the CRS extension happening at the moment that hasn't made it to Github? |
Yes! I was just about to push the changes even though I wasn't happy with everything. I'd also check out @snowman2's progress on rioxarray. |
@atedstone FYI #13 |
Closing this as the initial support in #26 is merged and mimics rioxarray's support. That is, |
Continuation from: corteva/rioxarray#4 (comment)
Related to #2 & #8
Here are the basic needs for
rioxarray
and probably other geospatial projects as well:A way to retrieve a
pyproj.CRS
based on the information in the file. (I thinkpyproj.CRS.from_cf()
will be useful here)It would be useful to have an attribute such as:
See:
A way to set a
pyproj.CRS
if it does not exist/is incorrect. (I thinkpyproj.CRS.from_cf()
andpyproj.CRS.from_user_input()
will be useful here)It would be useful to be able to set the attribute such as:
See xgeo projection setter
A way to update the
CRS
information on the Dataset/DataArray in a CF compliant way. (I thinkpyproj.CRS.to_cf()
will be useful here)Something like:
Also see add_spatial_ref
The text was updated successfully, but these errors were encountered: