Closed laonahongchen closed 4 days ago
This is due to your clipped raster resulting in a single point in either the x or y coordinate. That is an invalid raster and as such an error is raised.
Got it, thanks! I thought it was due to one of the windows having only one coordinate, which then will belong to a bug since the window should be self-adapted and not exposed to us users.
In this case, is there any suggestion on what I should use instead of the clip_box if it cannot guarantee it has more than a single point but just wants to get it as a dataset?
Thanks ahead!
In this case, is there any suggestion on what I should use instead of the clip_box if it cannot guarantee it has more than a single point but just wants to get it as a dataset?
Without changing any code, you could try use xarray.sel
to pull out the data using the coordinate ranges.
If you want to use rio.clip_box
, you could add an argument to allow returning a dataset that is an invalid raster.
Got it, thank you very much!
Reopening as it seems you can have a single point raster now. Can re-project and write to file ...
Hi,
I am a beginner using the package to read rasters in a lazy mode.
I ran into this error message that seems should only occur when doing the integration test instead of general usage: "At least one of the clipped raster x,y coordinates has only one point."
Is there any guideline that I can refer to solve this problem? Many thanks!
The function is here: