Opened 4 years ago
Closed 4 years ago
#32670 closed New feature (fixed)
django.contrib.gis.GDALRaster support for vsi filesystems
Reported by: | Jordi Castells | Owned by: | Jordi Castells |
---|---|---|---|
Component: | GIS | Version: | 4.0 |
Severity: | Normal | Keywords: | raster |
Cc: | Daniel Wiesmann | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The GDAL library has out of the box support for different kinds of virtual filesystems (directly accessing data on ZIP, or networked filesystems).
https://gdal.org/user/virtual_file_systems.html
Those specific filesystems are enabled with a string prefix to the path sent to GDAL when instantiating a new raster.
django.contrib.gis.GDALRaster
does not support any of this special cases since it forces any string to either be an in memory gdal vsi path (strating with /vsimem
) or an existing path in the filesystem.
So for example, gdal will happily open /vsizip//tmp/raster.zip
but django.contrib.gis.GDALRaster
will refuse to do so even though the underlying library supports it.
There are other specific cases that might benefit from it, for example a Cloud Optimized GeoTiff (COG) stored in an S3 file service. To read that raster into Django one has to download it first to the filesystem (or memory) and then pass it to GDALRaster
beating the purpose of the COG in S3, while a /vsis3
path can instantiate that COG file and just retrieve the data as needed thus reducing network usage.
This could probably be a whole other discussion here on how to treat those kind of files in a less "gdaly" way (for example with specific django.contrib.gis.GDALRaster
driver
option, similar to the current driver=MEM
). But a first straightforward step that would open those functionalities to djangogis is simply to let those /vsi*
paths through instead of failing.
Change History (7)
comment:1 by , 4 years ago
Cc: | added |
---|---|
Keywords: | raster added |
Triage Stage: | Unreviewed → Accepted |
Version: | 3.2 → 4.0 |
comment:2 by , 4 years ago
comment:3 by , 4 years ago
Owner: | changed from | to
---|
comment:4 by , 4 years ago
Needs documentation: | set |
---|
comment:5 by , 4 years ago
Needs documentation: | unset |
---|---|
Patch needs improvement: | set |
comment:6 by , 4 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
PR