diff --git a/django/contrib/gis/gdal/datasource.py b/django/contrib/gis/gdal/datasource.py index 5e644c142c..168481e993 100644 --- a/django/contrib/gis/gdal/datasource.py +++ b/django/contrib/gis/gdal/datasource.py @@ -4,8 +4,7 @@ an interface for reading vector geometry data from many different file formats (including ESRI shapefiles). When instantiating a DataSource object, use the filename of a -GDAL-supported data source. For example, an SHP file or a -TIGER/Line file from the government. +GDAL-supported data source. For example, an SHP file. The ds_driver keyword is used internally when a ctypes pointer is passed in directly. diff --git a/django/contrib/gis/gdal/driver.py b/django/contrib/gis/gdal/driver.py index 1d4ca4c07a..0fb93501a8 100644 --- a/django/contrib/gis/gdal/driver.py +++ b/django/contrib/gis/gdal/driver.py @@ -2,6 +2,7 @@ from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException +from django.contrib.gis.gdal.libgdal import GDAL_VERSION from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_bytes, force_str @@ -23,8 +24,6 @@ class Driver(GDALBase): "esri": "ESRI Shapefile", "shp": "ESRI Shapefile", "shape": "ESRI Shapefile", - "tiger": "TIGER", - "tiger/line": "TIGER", # raster "tiff": "GTiff", "tif": "GTiff", @@ -32,6 +31,14 @@ class Driver(GDALBase): "jpg": "JPEG", } + if GDAL_VERSION[:2] <= (3, 10): + _alias.update( + { + "tiger": "TIGER", + "tiger/line": "TIGER", + } + ) + def __init__(self, dr_input): """ Initialize an GDAL/OGR driver on either a string or integer input. diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py index 6a942fb630..f92a1cdea0 100644 --- a/django/contrib/gis/gdal/libgdal.py +++ b/django/contrib/gis/gdal/libgdal.py @@ -22,6 +22,7 @@ if lib_path: elif os.name == "nt": # Windows NT shared libraries lib_names = [ + "gdal311", "gdal310", "gdal309", "gdal308", @@ -38,6 +39,7 @@ elif os.name == "posix": lib_names = [ "gdal", "GDAL", + "gdal3.11.0", "gdal3.10.0", "gdal3.9.0", "gdal3.8.0", diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index 502e687796..eedf11f83c 100644 --- a/docs/ref/contrib/gis/install/geolibs.txt +++ b/docs/ref/contrib/gis/install/geolibs.txt @@ -5,16 +5,16 @@ Installing Geospatial libraries GeoDjango uses and/or provides interfaces for the following open source geospatial libraries: -======================== ==================================== ================================ ================================================= +======================== ==================================== ================================ ======================================================= Program Description Required Supported Versions -======================== ==================================== ================================ ================================================= +======================== ==================================== ================================ ======================================================= :doc:`GEOS <../geos>` Geometry Engine Open Source Yes 3.13, 3.12, 3.11, 3.10, 3.9, 3.8 `PROJ`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 9.x, 8.x, 7.x, 6.x -:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 3.10, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1 +:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 3.11, 3.10, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1 :doc:`GeoIP <../geoip2>` IP-based geolocation library No 2 `PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 3.5, 3.4, 3.3, 3.2, 3.1 `SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 5.1, 5.0, 4.3 -======================== ==================================== ================================ ================================================= +======================== ==================================== ================================ ======================================================= Note that older or more recent versions of these libraries *may* also work totally fine with GeoDjango. Your mileage may vary. @@ -37,6 +37,7 @@ totally fine with GeoDjango. Your mileage may vary. GDAL 3.8.0 2023-11-13 GDAL 3.9.0 2024-05-10 GDAL 3.10.0 2024-11-06 + GDAL 3.11.0 2025-05-09 PostGIS 3.1.0 2020-12-18 PostGIS 3.2.0 2021-12-18 PostGIS 3.3.0 2022-08-27 diff --git a/tests/gis_tests/gdal_tests/test_driver.py b/tests/gis_tests/gdal_tests/test_driver.py index 0d9423bc85..4bcea5f16c 100644 --- a/tests/gis_tests/gdal_tests/test_driver.py +++ b/tests/gis_tests/gdal_tests/test_driver.py @@ -1,13 +1,12 @@ import unittest from unittest import mock -from django.contrib.gis.gdal import Driver, GDALException +from django.contrib.gis.gdal import GDAL_VERSION, Driver, GDALException valid_drivers = ( # vector "ESRI Shapefile", "MapInfo File", - "TIGER", "S57", "DGN", "Memory", @@ -25,7 +24,6 @@ invalid_drivers = ("Foo baz", "clucka", "ESRI Shp", "ESRI rast") aliases = { "eSrI": "ESRI Shapefile", - "TigER/linE": "TIGER", "SHAPE": "ESRI Shapefile", "sHp": "ESRI Shapefile", "tiFf": "GTiff", @@ -34,6 +32,14 @@ aliases = { "jpG": "JPEG", } +if GDAL_VERSION[:2] <= (3, 10): + aliases.update( + { + "tiger": "TIGER", + "tiger/line": "TIGER", + } + ) + class DriverTest(unittest.TestCase): def test01_valid_driver(self):