Comments (4)
@adriantre after some reflection, I'm inclined not to do this. First of all, the workaround isn't terrible, and not adding a new feature to fiona (or rasterio) saves us testing, documentation, &c. But mostly I don't want fiona and rasterio to become cloud storage APIs. GDAL's VSI system has a whole cloud storage API, but I believe Python developers are much better off using their cloud's Python SDK (boto3, for example) or a dedicated cross-cloud library like https://libcloud.apache.org/.
from fiona.
@adriantre I'm interested. Can you tell me more about how you would use this?
from fiona.
Thanks Sean!
I started using TorchGeo and found that there were only some minor blockers for it to be able to read files directly from cloud storage through GDAL VSI. The only blocker is they are pattern-matching files using glob
.
root = "/vsigs/my_bucket'
filename_glob = "T*_B02_10m.tif"
pathname = os.path.join(root, "**", filename_glob)
for filepath in glob.iglob(pathname, recursive=True):
...
I don't know how easy it would be to mirror the behaviour of glob
, allowing wildcards, but it would then be a very easy fix in that repo :P
A similar option is Pathlib.rglob.
Another approach would be to create a fiona.walk
which mirrors os.walk
.
for root, subdirs, files in os.walk(walk_dir):
for file in files:
asb_path_for_file = os.path.join(root, file
#file is filenames only but os.path.join will magically yield the abs path
I created a PR to TorchGeo with the above workaround. But I think swapping out the usage of glob
would be a cleaner solution.
from fiona.
I understand. Cross-cloud is why I was looking to GDAL/Fiona, to have a platform-agnostic solution. libcloud looks promising.
from fiona.
Related Issues (20)
- Minor readthedocs formatting issue
- Change examples in manual to use web-hosted coutwildrnp.zip HOT 1
- New CRS class incompatible with rasterio HOT 2
- Fiona sdist has incorrect metadata and fails to pip install on arm64 HOT 4
- date could not be parsed from gpx HOT 10
- Vendor munch HOT 1
- 1.9.4 release HOT 3
- How to get the list of feature dataset
- Fiona allows bytes type properties but can't serialize them
- No ARM wheel for linux
- Fiona 1.9.4 segmentation fault on macOS HOT 5
- Unable to do round trip IO with GPKG files in geopandas HOT 10
- 1.9.4.post1 release HOT 1
- Test "test_append_memoryfile_drivers[Parquet]" is failing with Fiona 1.9.4 HOT 5
- Problem reading geopackage with NAD83 CRS HOT 1
- Type issue when saving a GeoDataFrame object to file using driver="OGR_GMT" HOT 1
- Expand keys in schema mismatch exception
- Can't load file with `include_fields` parameter set HOT 1
- Better documentation about ignore_fields, include_fields
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiona.