Replies: 2 comments
-
Thanks for opening this discussion @maxrjones, and sorry for answering only today, yesterday was quite a busy day. For reading/writing, we rely on Rasterio/GeoPandas, so it should normally work similarly. It looks like the issue here comes from the delayed loading step of src = f"NETCDF:/vsis3/{bucket}/{input_uri}:analysed_sst"
da = rio.open(src)
da = Raster(da, load_data=True)
return da or shorter but equivalent: src = f"NETCDF:/vsis3/{bucket}/{input_uri}:analysed_sst"
da = Raster(src, load_data=True)
return da In any case, you make a good point. I'll add an issue to find the necessary fixes for remote files, and setup additional tests + a couple documentation examples. Tell me if you find anything else while further developing your materials! Maybe @erikmannerfelt has more insights for working with remote files? |
Beta Was this translation helpful? Give feedback.
-
Hello! I expected it to be as simple as just passing any URL/URI that is accepted by rasterio or a rio dataset and it should work. @maxrjones, what version of geoutils are you running? And can you test the two suggestions by @rhugonnet? If that doesn't work I'll try it myself. Either way, I'd classify this as a bug because I see no reason why this shouldn't work! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your work on GeoUtils! I don't have much experiences with the API yet, but the documentation is super impressive and well organized!
Are there any examples of using geoutils to load files in cloud object storage? I have a notebook using rasterio with the netcdf driver and vsis3 to open a NASA dataset in https://github.com/developmentseed/warp-resample-profiling/blob/main/examples/load-rasterio-netcdf-vsis3.ipynb. I tried to modify it to create a GeoUtils Raster object in https://github.com/developmentseed/warp-resample-profiling/blob/main/examples/future-load-geoutils-netcdf-vsis3.ipynb, but received
IndexError: band index 1 out of range (not in ())
. I'm not sure if it's due to using vsis3, the args in the vrt:// syntax, or some other problem. I'd love to include geoutils in a last minute talk I'm giving tomorrow on different resampling methods in Python, so if you have any tips or tricks I would greatly appreciate it! I'll likely still continue developing the materials after the talk as well if this timing doesn't work out.Beta Was this translation helpful? Give feedback.
All reactions