-
Notifications
You must be signed in to change notification settings - Fork 4
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
CRS #19
Comments
Yes, I agree that this would be very useful. I have a slight preference for a separate package ("light on dependencies") like CFCRS.jl or CFCoordinateReferenceSystem.jl... that CommonDataModel.jl could depend on (either a normal or weak dependency). I am not too familiar with coordinate systems, so I guess that a small package with a narrow focus would be easier for other users to contribute to. As far as I know, Well Know Text is an OGC standard and we have already the attribute In TIFFDatasets.jl there is also some code that could be useful, where ArchGDAL is used to make the projection information accessible using the CF convention: If such a TIFF file is loaded using TIFFDatasets.jl, there is this "pseudo" variable
(so far only It would be quite helpful for me if somebody can show me how the WKT string can be used to initialise a I am a bit confused how this works in GeoArrays currently: using GeoInterface, GeoFormatTypes, GeoArrays
fn = download("https://github.com/yeesian/ArchGDALDatasets/blob/master/data/utmsmall.tif?raw=true");
geoarray = GeoArrays.read(fn);
GeoInterface.crs(geoarray) isa GeoFormatTypes.CoordinateReferenceSystemFormat
# returns false
# expected true from the docs of GeoInterface.crs Maybe @evetion has an idea what I am doing wrong? |
Can't check it myself right now, but it might just return nothing? |
In fact,
|
Ok the confusion is that Mostly that doesnt matter, we mark it as |
According to the CF conventions, |
In both GRIBB and NetCDF there is a need to extract CRS data. e.g:
https://discourse.julialang.org/t/extracting-projection-from-grib-files/109818/3
It would be good if CommonDataModel.jl handled this, probably adding methods to
GeoInterface.crs
as function to retrieve it.I am aware of the difficulty (and in edge-cases actual impossibility) of converting CF standard crs data to Well Known Text or Proj. But we should try. Currently the workaround is to load and call ArchGDAL.jl or GMT.jl to get the crs manually, but an additional large binary dependency for this small task is less than ideal.
I made an attempt at starting this a few years ago:
https://github.com/rafaqz/Rasters.jl/blob/netcdf_crs/src/sources/ncdatasets.jl#L407-L508
But really something like that should live here or in a package similar to CFTime.jl - like CFCRS.jl... that CommonDataModel.jl could also depend on.
This is a good guideline for an implementation:
https://trac.osgeo.org/gdal/wiki/NetCDF_ProjectionTestingStatus
(notice even GDAL has an incomplete implementation - but it should take care of 99.9% of the use cases)
One stop-gap solution is to add an extension for ArchGDAL here and just call it on the files when
GeoInterface.crs
is called on anyAbstractVariable
.The text was updated successfully, but these errors were encountered: