Replies: 3 comments 5 replies
-
I believe it is related to: If you use |
Beta Was this translation helpful? Give feedback.
1 reply
-
It seems the root of the issue is rasterio/GDAL is unable to determine the transform: >>> rds = rasterio.open("netcdf:pr_hyras_1_2022_v3-0_de_monsum.nc:pr")
>>> rds.crs
CRS.from_wkt('PROJCS["ETRS89 / LCC Europe",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980 ",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",35],PARAMETER["standard_parallel_2",65],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",10],PARAMETER["false_easting",4000000],PARAMETER["false_northing",2800000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","3034"]]')
>>> rds.transform
Affine(1.0, 0.0, 0.0,
0.0, 1.0, 0.0) |
Beta Was this translation helpful? Give feedback.
0 replies
-
>>> from osgeo import gdal
>>> ds = gdal.Open("netcdf:pr_hyras_1_2022_v3-0_de_monsum.nc:pr")
>>> ds.GetGeoTransform()
(0.0, 1.0, 0.0, 0.0, 0.0, 1.0) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having problems processing NetCDF files.
This a sample file: https://opendata.dwd.de/climate_environment/CDC/grids_germany/monthly/hyras_de/precipitation/pr_hyras_1_2022_v3-0_de_monsum.nc
It uses EPSG:3034 as the coordinate system.
This is the code I am using to open the file:
This produces the following warning: "NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned."
The read x and y coordinates are not correct, as can be seen in the following screenshot (they are just cell indices offset by half a cell):
My goal is to use
xds.rio.clip()
but that always fails with the message "NoDataInBounds: No data found in bounds.", I presume because the coordinates were not read/interpreted correctly.I am using
on Windows
This used to work just fine for me, but unfortunately after some software problems I recently had to reinstall everything from scratch. Unfortunately, I do not know which package versions I was working with when it worked.
So i presume something has changed in either rioxarray or some of its dependencies that is now causing this problem.
I saw here #454 (reply in thread) that someone suggested using
xarray.open_dataset()
instead ofrioxarray.open_rasterio()
and that actually solves my problem. But why doesrioxarray.open_rasterio()
not work as it used to before?Beta Was this translation helpful? Give feedback.
All reactions