Browse Source

Fixed #34684 -- Dropped support for GDAL 2.2 and 2.3.

Mariusz Felisiak 1 year ago
parent
commit
6a523500af

+ 0 - 4
django/contrib/gis/gdal/libgdal.py

@@ -30,8 +30,6 @@ elif os.name == "nt":
         "gdal301",
         "gdal300",
         "gdal204",
-        "gdal203",
-        "gdal202",
     ]
 elif os.name == "posix":
     # *NIX library names.
@@ -46,8 +44,6 @@ elif os.name == "posix":
         "gdal3.1.0",
         "gdal3.0.0",
         "gdal2.4.0",
-        "gdal2.3.0",
-        "gdal2.2.0",
     ]
 else:
     raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)

+ 4 - 6
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.11, 3.10, 3.9, 3.8, 3.7, 3.6
 `PROJ`_                   Cartographic Projections library      Yes (PostgreSQL and SQLite only)  9.x, 8.x, 7.x, 6.x, 5.x
-:doc:`GDAL <../gdal>`     Geospatial Data Abstraction Library   Yes                               3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.4, 2.3, 2.2
+:doc:`GDAL <../gdal>`     Geospatial Data Abstraction Library   Yes                               3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.4
 :doc:`GeoIP <../geoip2>`  IP-based geolocation library          No                                2
 `PostGIS`__               Spatial extensions for PostgreSQL     Yes (PostgreSQL only)             3.3, 3.2, 3.1, 3.0, 2.5
 `SpatiaLite`__            Spatial extensions for SQLite         Yes (SQLite only)                 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.
@@ -27,8 +27,6 @@ totally fine with GeoDjango. Your mileage may vary.
     GEOS 3.9.0 2020-12-14
     GEOS 3.10.0 2021-10-20
     GEOS 3.11.0 2022-07-01
-    GDAL 2.2.0 2017-05
-    GDAL 2.3.0 2018-05
     GDAL 2.4.0 2018-12
     GDAL 3.0.0 2019-05
     GDAL 3.1.0 2020-05-07

+ 5 - 0
docs/releases/5.0.txt

@@ -417,6 +417,11 @@ backends.
   ``False`` if the database doesn't support the ``DEFAULT`` keyword in bulk
   ``INSERT`` queries.
 
+:mod:`django.contrib.gis`
+-------------------------
+
+* Support for GDAL 2.2 and 2.3 is removed.
+
 Using ``create_defaults__exact`` may now be required with ``QuerySet.update_or_create()``
 -----------------------------------------------------------------------------------------
 

+ 1 - 2
tests/gis_tests/inspectapp/tests.py

@@ -89,8 +89,7 @@ class OGRInspectTest(SimpleTestCase):
         # Same test with a 25D-type geometry field
         shp_file = os.path.join(TEST_DATA, "gas_lines", "gas_leitung.shp")
         model_def = ogrinspect(shp_file, "MyModel", multi_geom=True)
-        srid = "-1" if GDAL_VERSION < (2, 3) else "31253"
-        self.assertIn("geom = models.MultiLineStringField(srid=%s)" % srid, model_def)
+        self.assertIn("geom = models.MultiLineStringField(srid=31253)", model_def)
 
     def test_date_field(self):
         shp_file = os.path.join(TEST_DATA, "cities", "cities.shp")