Skip to content

Commit e7fd69d

Browse files
committed
Fixed #30166 -- Dropped support for GDAL 1.11.
1 parent 6eb4996 commit e7fd69d

File tree

7 files changed

+11
-19
lines changed

7 files changed

+11
-19
lines changed

django/contrib/gis/gdal/geometries.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
4747
from django.contrib.gis.gdal.error import GDALException, SRSException
4848
from django.contrib.gis.gdal.geomtype import OGRGeomType
49-
from django.contrib.gis.gdal.libgdal import GDAL_VERSION
5049
from django.contrib.gis.gdal.prototypes import geom as capi, srs as srs_api
5150
from django.contrib.gis.gdal.srs import CoordTransform, SpatialReference
5251
from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex
@@ -140,14 +139,7 @@ def _from_wkb(cls, geom_input):
140139

141140
@staticmethod
142141
def _from_json(geom_input):
143-
ptr = capi.from_json(geom_input)
144-
if GDAL_VERSION < (2, 0):
145-
try:
146-
capi.get_geom_srs(ptr)
147-
except SRSException:
148-
srs = SpatialReference(4326)
149-
capi.assign_srs(ptr, srs.ptr)
150-
return ptr
142+
return capi.from_json(geom_input)
151143

152144
@classmethod
153145
def from_bbox(cls, bbox):

django/contrib/gis/gdal/libgdal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
lib_names = None
2121
elif os.name == 'nt':
2222
# Windows NT shared libraries
23-
lib_names = ['gdal203', 'gdal202', 'gdal201', 'gdal20', 'gdal111']
23+
lib_names = ['gdal203', 'gdal202', 'gdal201', 'gdal20']
2424
elif os.name == 'posix':
2525
# *NIX library names.
26-
lib_names = ['gdal', 'GDAL', 'gdal2.3.0', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0', 'gdal1.11.0']
26+
lib_names = ['gdal', 'GDAL', 'gdal2.3.0', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0']
2727
else:
2828
raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)
2929

django/contrib/gis/gdal/prototypes/ds.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
)
6969
get_field_as_double = double_output(lgdal.OGR_F_GetFieldAsDouble, [c_void_p, c_int])
7070
get_field_as_integer = int_output(lgdal.OGR_F_GetFieldAsInteger, [c_void_p, c_int])
71-
if GDAL_VERSION >= (2, 0):
72-
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
71+
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
7372
if GDAL_VERSION >= (2, 2):
7473
is_field_set = bool_output(lgdal.OGR_F_IsFieldSetAndNotNull, [c_void_p, c_int])
7574
else:

docs/ref/contrib/gis/install/geolibs.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Program Description Required
1010
======================== ==================================== ================================ ===================================
1111
:doc:`GEOS <../geos>` Geometry Engine Open Source Yes 3.7, 3.6, 3.5, 3.4
1212
`PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 5.2, 5.1, 5.0, 4.x
13-
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.3, 2.2, 2.1, 2.0, 1.11
13+
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.3, 2.2, 2.1, 2.0
1414
:doc:`GeoIP <../geoip2>` IP-based geolocation library No 2
1515
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.5, 2.4, 2.3, 2.2
1616
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3
@@ -25,7 +25,6 @@ totally fine with GeoDjango. Your mileage may vary.
2525
GEOS 3.5.0 2015-08-15
2626
GEOS 3.6.0 2016-10-25
2727
GEOS 3.7.0 2018-09-10
28-
GDAL 1.11.0 2014-04-25
2928
GDAL 2.0.0 2015-06
3029
GDAL 2.1.0 2016-04
3130
GDAL 2.2.0 2017-05

docs/releases/3.0.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ backends.
229229

230230
* Support for SpatiaLite 4.1 and 4.2 is removed.
231231

232+
* Support for GDAL 1.11 is removed.
233+
232234
Dropped support for PostgreSQL 9.4
233235
----------------------------------
234236

tests/gis_tests/gdal_tests/test_ds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from datetime import datetime
44

55
from django.contrib.gis.gdal import (
6-
GDAL_VERSION, DataSource, Envelope, GDALException, OGRGeometry,
6+
DataSource, Envelope, GDALException, OGRGeometry,
77
)
88
from django.contrib.gis.gdal.field import (
99
OFTDateTime, OFTInteger, OFTReal, OFTString,
@@ -38,7 +38,7 @@
3838
),
3939
TestDS(
4040
'test_vrt', ext='vrt', nfeat=3, nfld=3, geom='POINT', gtype='Point25D',
41-
driver='OGR_VRT' if GDAL_VERSION >= (2, 0) else 'VRT',
41+
driver='OGR_VRT',
4242
fields={
4343
'POINT_X': OFTString,
4444
'POINT_Y': OFTString,

tests/gis_tests/inspectapp/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_poly(self):
7474
'',
7575
'class MyModel(models.Model):',
7676
' float = models.FloatField()',
77-
' int = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
77+
' int = models.BigIntegerField()',
7878
' str = models.CharField(max_length=80)',
7979
' geom = models.PolygonField(%s)' % self.expected_srid,
8080
]
@@ -102,7 +102,7 @@ def test_date_field(self):
102102
'',
103103
'class City(models.Model):',
104104
' name = models.CharField(max_length=80)',
105-
' population = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
105+
' population = models.BigIntegerField()',
106106
' density = models.FloatField()',
107107
' created = models.DateField()',
108108
' geom = models.PointField(%s)' % self.expected_srid,

0 commit comments

Comments
 (0)