Question: django.contrib.gis GDAL support of /vsi*

89 views
Skip to first unread message

Jordi Castells

unread,
Apr 13, 2021, 5:26:23 PM4/13/21
to Django developers (Contributions to Django itself)
Hi,

I'm Jordi, long time user of the Django framework, and a first time poster to this mailing list after dabbling a bit into the Django implementation for a specific problem in my project.

I found out that the support for GDAL virtual filesystems in Django is limited to  `/vsimem/` forced via a constant in `django.contrib.gis.gdal.raster.source`

VSI_FILESYSTEM_BASE_PATH = '/vsimem/'

The constant is both used to check if the input string is a virtual filesystem raster and to properly create a vsi path if the user sends bytes.

GDAL itself supports more types of virtual filesystems. /vsis3 is the one of interest to me in particular, so I monkey patched my local Django to just skip that check and accept any /vsi* string inputs with no apparent error.
I cloned the latest main and ran the test suite just in case, but the gis_tests don't run by default.

So, I was wondering, is there any reason why django.*.GDALRaster is limited to vsimem? And how should I properly enable the `gis_tests` to confirm everything works as expected?

Salut!

Claude Paroz

unread,
Apr 14, 2021, 2:39:50 AM4/14/21
to Django developers (Contributions to Django itself)
Hi Jordi,

Our GDAL Raster expert is Daniel Wiesmann (https://github.com/yellowcap), you may try to ping him somehow so that he can give his lights on the subject here.

And how should I properly enable the `gis_tests` to confirm everything works as expected?

If you use settings configured  with a spatially-enabled database, the gis_tests should run (runtests.py --settings=...).

Claude

Jordi Castells

unread,
Apr 14, 2021, 12:36:04 PM4/14/21
to Django developers (Contributions to Django itself)
Hi Claude,

Today I contacted Daniel and commented a bit with him. I opened a PR to discuss/review.

Thanks for your help and directions.

Salut!

El dia dimecres, 14 d’abril de 2021 a les 8:39:50 UTC+2, Claude Paroz va escriure:
Reply all
Reply to author
Forward
0 new messages