All Questions
25
questions
0
votes
0
answers
76
views
rioxarray.open_rasterio() won't close a file when using it with a context manager
I am writing some unit tests to test reading in raster data into an xr.Dataset data structure via the rioxarray.open_rasterio() method. The code creates a test raster to read into rioxarray....
1
vote
1
answer
132
views
While exporting the rasters using rioxarray, nodata value is undefined after the mask
I have used xarray to open the netcdf file, and using rioxarray exported the raster as a .tif file. However, the exported raster doesn't have definition for nodata value, and hence, the GIS software ...
1
vote
0
answers
387
views
Loading geospatial datasets with rioxarray
I'm using xarray to open and reproject some .grib files. The files have x, y, and time dimensions and contain several data variables. However, I have some issues with loading the data.
Loading them ...
1
vote
0
answers
158
views
Convert the netcdf file to geotiff with chosen coordinate system
I have a nc file retrieved from the following link https://www.globsnow.info/swe/nrt/2020/data/GlobSnow_SWE_L3A_20200110_v.1.0.nc.gz. I am trying to convert this file to geotiff in wgs 1984 coordinate ...
0
votes
1
answer
406
views
Error reading variables from NetCDF file with Xarray when there are multiple variable layers
I get an error reading variables from NetCDF file with Xarray when there are multiple variable layers
Data:
The netCDF file that I have has multiple layers:
/Geophysical_Data/...
1
vote
2
answers
1k
views
Fixing the flipped/inverted Y axis in the xarray with rasterio
The data I read with xarray with rasterio engine is inverted along Y axis (This is SMAPL4 data). The correct dimension values are y=ds.y*(-1).
ds = xr.open_mfdataset(file_paths, engine="rasterio&...
0
votes
1
answer
337
views
How to apply a function on two rasters in Python?
I would like to cell-wise function operation on two rasters. While I saw some examples of adding or subtracting two rasters, I'm yet to come across a complex example of how to manipulate rasters using ...
1
vote
1
answer
3k
views
How to deal with Nan value when using rioxarray rio.reproject()?
I was trying to use rio.reproject_match() to match the resolution of two xarray datasets. However, when I used resample methods like Resampling.bilinear or Resampling.average, a large area would ...
2
votes
1
answer
2k
views
Xarray Dataset to raster - ValueError: failed to prevent overwriting existing key grid_mapping in attrs
I have a netcdf file located here http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html?dataset=TERRACLIMATE_ALL_SCAN/data/TerraClimate_tmin_1958.nc.
I am ...
0
votes
1
answer
1k
views
Why do rioxarray reprojection and pyproj transform give different values when selecting a pixel by point coordinates?
I'm opening this grib file using rioxarray and reprojecting to WGS84 in the following manner with the goal of grabbing pixel values by coordinates.
import rioxarray
url = 'https://noaa-hrrr-bdp-pds....
0
votes
0
answers
63
views
Transforms from the same file are different
Reading a NetCDF file in two ways:
src = rasterio.open(f'NetCDF:{url}:Rad', 'r') and doing src.transform gives:
Affine(2004.017315487541, 0.0, -5434894.700982174, 0.0, -2004.017315487541, 5434894....
0
votes
0
answers
540
views
Different elevation values between using rasterio, xarray, rioxarray, gdal and QGIS
I am trying to extract elevation values from a DEM raster under array format by using some packages (rasterio, xarray, rioxarray, and gdal). However, they seemed to give me a different results from ...
0
votes
1
answer
1k
views
Rioxarray.merge.merge_datasets unable to merge xarray datasets [closed]
I am working with geospatial data and have been previously using rasterio's merge function to join adjacent tiles together. For memory reasons I have switched from using in-memory rasters to xarray ...
0
votes
2
answers
1k
views
How to mask and scale raster using rasterio?
I have been trying to read a raster file in netcdf format which I will later on sample. I need to read using the DatasetReader as float.
When I read:
ds = rasterio.open(f'netcdf:{file}:AOT_L2_Mean', ...
2
votes
2
answers
4k
views
Open and plot a large raster with Python xarray
I have an ASCII Esri file of the type:
ncols 5201
nrows 4001
xllcorner -65
yllcorner -35
cellsize 0.025
NODATA_value -9999
-9999 -9999 -9999 255 256 -9999 -9999 ...
-9999 -9999 -9999 -9999 -9999 -9999 ...