[Django] #32670: django.contrib.gis.GDALRaster support for vsi filesystems

13 views
Skip to first unread message

Django

unread,
Apr 21, 2021, 5:03:22 AM4/21/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
------------------------------------------+--------------------------
Reporter: Jordi Castells | Owner: nobody
Type: New feature | Status: assigned
Component: GIS | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+--------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32670>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 21, 2021, 5:10:42 AM4/21/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
--------------------------------+------------------------------------

Reporter: Jordi Castells | Owner: nobody
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* cc: Daniel Wiesmann (added)
* keywords: => raster
* version: 3.2 => 4.0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:1>

Django

unread,
Apr 21, 2021, 5:11:50 AM4/21/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
--------------------------------+------------------------------------

Reporter: Jordi Castells | Owner: nobody
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

[https://github.com/django/django/pull/14268 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:2>

Django

unread,
Apr 21, 2021, 7:13:20 AM4/21/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
--------------------------------+------------------------------------------
Reporter: Jordi Castells | Owner: Jordi Castells

Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Jordi Castells


--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:3>

Django

unread,
Apr 22, 2021, 2:53:45 AM4/22/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
--------------------------------+------------------------------------------
Reporter: Jordi Castells | Owner: Jordi Castells
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Mariusz Felisiak):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:4>

Django

unread,
Apr 30, 2021, 3:55:53 AM4/30/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
--------------------------------+------------------------------------------
Reporter: Jordi Castells | Owner: Jordi Castells
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:5>

Django

unread,
May 7, 2021, 7:01:49 AM5/7/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
-------------------------------------+-------------------------------------

Reporter: Jordi Castells | Owner: Jordi
| Castells
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: raster | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:6>

Django

unread,
May 7, 2021, 2:25:16 PM5/7/21
to django-...@googlegroups.com
#32670: django.contrib.gis.GDALRaster support for vsi filesystems
-------------------------------------+-------------------------------------
Reporter: Jordi Castells | Owner: Jordi
| Castells
Type: New feature | Status: closed
Component: GIS | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: raster | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"205c36b58fed5a1a0ff462593fc61b58189027d8" 205c36b5]:
{{{
#!CommitTicketReference repository=""
revision="205c36b58fed5a1a0ff462593fc61b58189027d8"
Fixed #32670 -- Allowed GDALRasters to use any GDAL virtual filesystem.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32670#comment:7>

Reply all
Reply to author
Forward
0 new messages