From d4c583682e7afc2b4e953b8c85af17f1c1514ba9 Mon Sep 17 00:00:00 2001 From: Nicolas Lupien Date: Wed, 6 Dec 2023 12:58:59 -0500 Subject: [PATCH 1/3] Fixed #35015 -- Updated MySQL notes in migrations topic. --- docs/topics/migrations.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt index 248a7addbe4e..9e339852b674 100644 --- a/docs/topics/migrations.txt +++ b/docs/topics/migrations.txt @@ -77,16 +77,17 @@ meaning that if a migration fails to apply you will have to manually unpick the changes in order to try again (it's impossible to roll back to an earlier point). -In addition, MySQL will fully rewrite tables for almost every schema operation -and generally takes a time proportional to the number of rows in the table to -add or remove columns. On slower hardware this can be worse than a minute per -million rows - adding a few columns to a table with just a few million rows -could lock your site up for over ten minutes. - -Finally, MySQL has relatively small limits on name lengths for columns, tables -and indexes, as well as a limit on the combined size of all columns an index -covers. This means that indexes that are possible on other backends will -fail to be created under MySQL. +MySQL 8.0 introduced significant performance enhancements for +`DDL operations`_, making them more efficient and reducing the need for full +table rebuilds. However, it cannot guarantee a complete absence of locks or +interruptions. In situations where locks are still necessary, the duration of +these operations will be proportionate to the number of rows involved. + +Finally, MySQL has a relatively small limit on the combined size of all columns +an index covers. This means that indexes that are possible on other backends +will fail to be created under MySQL. + +.. _DDL operations: https://dev.mysql.com/doc/refman/en/innodb-online-ddl-operations.html SQLite ------ From fa1d0b11e4cd5e54bdd9bdce99fbf0efff948ece Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 20 Dec 2023 18:15:10 +0000 Subject: [PATCH 2/3] Fixed #35048 -- Dropped support for PROJ 5.x. --- docs/ref/contrib/gis/install/geolibs.txt | 6 ++---- docs/releases/5.1.txt | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index ca47981f9590..079737191257 100644 --- a/docs/ref/contrib/gis/install/geolibs.txt +++ b/docs/ref/contrib/gis/install/geolibs.txt @@ -9,7 +9,7 @@ geospatial libraries: Program Description Required Supported Versions ======================== ==================================== ================================ =========================================== :doc:`GEOS <../geos>` Geometry Engine Open Source Yes 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, 5.x +`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.7, 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.4, 3.3, 3.2, 3.1, 3.0 @@ -45,7 +45,6 @@ totally fine with GeoDjango. Your mileage may vary. PROJ 8.0.0 2021-03-01 PROJ 7.0.0 2020-02-25 PROJ 6.0.0 2019-02-26 - PROJ 5.0.0 2018-03-01 SpatiaLite 4.3.0 2015-09-07 SpatiaLite 5.0.0 2020-08-23 SpatiaLite 5.1.0 2023-08-04 @@ -191,8 +190,7 @@ PROJ < 7.x) [#]_: $ wget https://download.osgeo.org/proj/proj-data-X.Y.tar.gz Next, untar the source code archive, and extract the datum shifting files in the -``data`` subdirectory (use ``nad`` subdirectory for PROJ < 6.x). This must be -done *prior* to configuration: +``data`` subdirectory. This must be done *prior* to configuration: .. code-block:: shell diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 1009ffe73969..6aeee65e90d5 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -271,6 +271,8 @@ backends. * Support for PostGIS 2.5 is removed. +* Support for PROJ < 6 is removed. + Dropped support for MariaDB 10.4 -------------------------------- From c709a748ce6e0759e415a0e3544e0f4ad3d30f8b Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 20 Dec 2023 18:05:40 +0000 Subject: [PATCH 3/3] Fixed #35049 -- Dropped support for GDAL 2.4. --- django/contrib/gis/gdal/libgdal.py | 2 -- django/contrib/gis/gdal/prototypes/srs.py | 10 ++++------ django/contrib/gis/gdal/srs.py | 9 ++------- docs/ref/contrib/gis/install/geolibs.txt | 9 ++++----- docs/releases/5.1.txt | 2 ++ tests/gis_tests/gdal_tests/test_srs.py | 10 ---------- 6 files changed, 12 insertions(+), 30 deletions(-) diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py index 30cba0f14f63..e3beb62a7922 100644 --- a/django/contrib/gis/gdal/libgdal.py +++ b/django/contrib/gis/gdal/libgdal.py @@ -30,7 +30,6 @@ "gdal302", "gdal301", "gdal300", - "gdal204", ] elif os.name == "posix": # *NIX library names. @@ -45,7 +44,6 @@ "gdal3.2.0", "gdal3.1.0", "gdal3.0.0", - "gdal2.4.0", ] else: raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name) diff --git a/django/contrib/gis/gdal/prototypes/srs.py b/django/contrib/gis/gdal/prototypes/srs.py index 721eba86223f..82d91bd3119e 100644 --- a/django/contrib/gis/gdal/prototypes/srs.py +++ b/django/contrib/gis/gdal/prototypes/srs.py @@ -1,6 +1,6 @@ from ctypes import POINTER, c_char_p, c_int, c_void_p -from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal, std_call +from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, @@ -36,11 +36,9 @@ def units_func(f): std_call("OSRDestroySpatialReference"), [c_void_p], errcheck=False ) srs_validate = void_output(lgdal.OSRValidate, [c_void_p]) - -if GDAL_VERSION >= (3, 0): - set_axis_strategy = void_output( - lgdal.OSRSetAxisMappingStrategy, [c_void_p, c_int], errcheck=False - ) +set_axis_strategy = void_output( + lgdal.OSRSetAxisMappingStrategy, [c_void_p, c_int], errcheck=False +) # Getting the semi_major, semi_minor, and flattening functions. semi_major = srs_double(lgdal.OSRGetSemiMajor) diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py index cd0554eb1201..9417c6684d13 100644 --- a/django/contrib/gis/gdal/srs.py +++ b/django/contrib/gis/gdal/srs.py @@ -32,7 +32,6 @@ from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import SRSException -from django.contrib.gis.gdal.libgdal import GDAL_VERSION from django.contrib.gis.gdal.prototypes import srs as capi from django.utils.encoding import force_bytes, force_str @@ -66,10 +65,8 @@ def __init__(self, srs_input="", srs_type="user", axis_order=None): if srs_type == "wkt": self.ptr = capi.new_srs(c_char_p(b"")) self.import_wkt(srs_input) - if self.axis_order == AxisOrder.TRADITIONAL and GDAL_VERSION >= (3, 0): + if self.axis_order == AxisOrder.TRADITIONAL: capi.set_axis_strategy(self.ptr, self.axis_order) - elif self.axis_order != AxisOrder.TRADITIONAL and GDAL_VERSION < (3, 0): - raise ValueError("%s is not supported in GDAL < 3.0." % self.axis_order) return elif isinstance(srs_input, str): try: @@ -104,10 +101,8 @@ def __init__(self, srs_input="", srs_type="user", axis_order=None): else: self.ptr = srs - if self.axis_order == AxisOrder.TRADITIONAL and GDAL_VERSION >= (3, 0): + if self.axis_order == AxisOrder.TRADITIONAL: capi.set_axis_strategy(self.ptr, self.axis_order) - elif self.axis_order != AxisOrder.TRADITIONAL and GDAL_VERSION < (3, 0): - raise ValueError("%s is not supported in GDAL < 3.0." % self.axis_order) # Importing from either the user input string or an integer SRID. if srs_type == "user": self.import_user_input(srs_input) diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index 079737191257..46cf04c422a3 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.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.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.4 +:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0 :doc:`GeoIP <../geoip2>` IP-based geolocation library No 2 `PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 3.4, 3.3, 3.2, 3.1, 3.0 `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. @@ -26,7 +26,6 @@ totally fine with GeoDjango. Your mileage may vary. GEOS 3.10.0 2021-10-20 GEOS 3.11.0 2022-07-01 GEOS 3.12.0 2023-06-27 - GDAL 2.4.0 2018-12 GDAL 3.0.0 2019-05 GDAL 3.1.0 2020-05-07 GDAL 3.2.0 2020-11-02 diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 6aeee65e90d5..fffaec21c614 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -273,6 +273,8 @@ backends. * Support for PROJ < 6 is removed. +* Support for GDAL 2.4 is removed. + Dropped support for MariaDB 10.4 -------------------------------- diff --git a/tests/gis_tests/gdal_tests/test_srs.py b/tests/gis_tests/gdal_tests/test_srs.py index 9bfe5680daba..5d82a8175aab 100644 --- a/tests/gis_tests/gdal_tests/test_srs.py +++ b/tests/gis_tests/gdal_tests/test_srs.py @@ -1,7 +1,4 @@ -from unittest import skipIf - from django.contrib.gis.gdal import ( - GDAL_VERSION, AxisOrder, CoordTransform, GDALException, @@ -358,7 +355,6 @@ def test_unicode(self): self.assertIn("Langschoß", srs.pretty_wkt) self.assertIn("Langschoß", srs.xml) - @skipIf(GDAL_VERSION < (3, 0), "GDAL >= 3.0 is required") def test_axis_order(self): wgs84_trad = SpatialReference(4326, axis_order=AxisOrder.TRADITIONAL) wgs84_auth = SpatialReference(4326, axis_order=AxisOrder.AUTHORITY) @@ -380,12 +376,6 @@ def test_axis_order_invalid(self): with self.assertRaisesMessage(ValueError, msg): SpatialReference(4326, axis_order="other") - @skipIf(GDAL_VERSION > (3, 0), "GDAL < 3.0 doesn't support authority.") - def test_axis_order_non_traditional_invalid(self): - msg = "AxisOrder.AUTHORITY is not supported in GDAL < 3.0." - with self.assertRaisesMessage(ValueError, msg): - SpatialReference(4326, axis_order=AxisOrder.AUTHORITY) - def test_esri(self): srs = SpatialReference("NAD83") pre_esri_wkt = srs.wkt