geocompx / geocompy

Geocomputation with Python: an open source book and online resource for getting started in this space
https://py.geocompx.org/
Other
259 stars 47 forks source link

Switch rasterio and fiona URIs for GDAL /vsicurl/ #215

Closed sgillies closed 9 months ago

sgillies commented 9 months ago

Since this book uses Rasterio extensively, it makes sense to align with Rasterio usage and show how to access online resources via standard internet URIs (see https://rasterio.readthedocs.io/en/latest/topics/vsi.html#virtual-filesystems) instead of odd GDAL /vsicurl/ filenames. 99% of the time, a Python user is better off passing URIs to rasterio.open() and never thinking about GDAL VSI details.

sgillies commented 9 months ago

@anitagraser @Robinlovelace @Nowosad @michaeldorman 👋 I think these changes can simplify your examples. Someone new to geocomputing with Python doesn't need to think about GDAL's virtual filesystems. Rasterio and GeoPandas will allow them to use standard URIs to address datasets.

Robinlovelace commented 9 months ago

Thanks for the input and agreed the example with the shorter URL is easier to read. And it aligns with the docs:

The prefixes on which GDAL filesystem handlers are registered are considered by Rasterio to be an implementation detail. You shouldn’t need to think about them when using Rasterio. Use familiar and standard URIs instead, like elsewhere on the internet.

Will let Michael and others comment but it's a :+1: from me.

Nowosad commented 9 months ago

Thanks @sgillies -- I also like the change.

michaeldorman commented 9 months ago

Thanks @sgillies !

michaeldorman commented 9 months ago

That's great, and good to know it works that way!