Closed CGL5230 closed 6 months ago
As you can see the geometry touched the grid. But still report "No data in bounds"
I meet the same error again. I think the point is cropped_ds.coords[self.x_dim].size < 1 or cropped_ds.coords[self.y_dim].size < 1
. You can see the boundary for another shape file. Is there anyway to return the touched cells for rio.clip method?
By the way, can I use the clip.box to clip? How can I pass my shape file boundary to this?
I meet a werid problem... The length of boundary is more than cropped_ds.coords[self.x_dim].size < 1 or cropped_ds.coords[self.y_dim].size < 1
. But still report "No data in Bounds" error.
I think the reason is the longitude of the dataset. It's range is 0-360 degree. So I minus 180 with the lon parameter. It work!
Problem description
Hi,all! I try to clip the netcdf files with the shape files. It is worth noting that this shp file contains a number of sub-regions within it. The code above is cropping all the sub-regions. But again, this results in the boundaries of the crop becoming very small. As a result, the error was report:“NoDataInBounds: No data found in bounds.”
I think the small boundary will the core of problem and related to this post. It is Archipiélago de Revillagigedo(location) and the resolution of cmip6 is 0.9 degree.
Expected Output
I set the all_touched=True that means I'll get at least one like grid point value.
Environment Information
python -c "import rioxarray; rioxarray.show_versions()"
Installation method
pip