Skip to content

Commit

Permalink
Fixed #30166 -- Dropped support for GDAL 1.11.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Feb 8, 2019
1 parent 6eb4996 commit e7fd69d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 19 deletions.
10 changes: 1 addition & 9 deletions django/contrib/gis/gdal/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import GDALException, SRSException
from django.contrib.gis.gdal.geomtype import OGRGeomType
from django.contrib.gis.gdal.libgdal import GDAL_VERSION
from django.contrib.gis.gdal.prototypes import geom as capi, srs as srs_api
from django.contrib.gis.gdal.srs import CoordTransform, SpatialReference
from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex
Expand Down Expand Up @@ -140,14 +139,7 @@ def _from_wkb(cls, geom_input):

@staticmethod
def _from_json(geom_input):
ptr = capi.from_json(geom_input)
if GDAL_VERSION < (2, 0):
try:
capi.get_geom_srs(ptr)
except SRSException:
srs = SpatialReference(4326)
capi.assign_srs(ptr, srs.ptr)
return ptr
return capi.from_json(geom_input)

@classmethod
def from_bbox(cls, bbox):
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/gis/gdal/libgdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
lib_names = None
elif os.name == 'nt':
# Windows NT shared libraries
lib_names = ['gdal203', 'gdal202', 'gdal201', 'gdal20', 'gdal111']
lib_names = ['gdal203', 'gdal202', 'gdal201', 'gdal20']
elif os.name == 'posix':
# *NIX library names.
lib_names = ['gdal', 'GDAL', 'gdal2.3.0', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0', 'gdal1.11.0']
lib_names = ['gdal', 'GDAL', 'gdal2.3.0', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0']
else:
raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)

Expand Down
3 changes: 1 addition & 2 deletions django/contrib/gis/gdal/prototypes/ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
)
get_field_as_double = double_output(lgdal.OGR_F_GetFieldAsDouble, [c_void_p, c_int])
get_field_as_integer = int_output(lgdal.OGR_F_GetFieldAsInteger, [c_void_p, c_int])
if GDAL_VERSION >= (2, 0):
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
if GDAL_VERSION >= (2, 2):
is_field_set = bool_output(lgdal.OGR_F_IsFieldSetAndNotNull, [c_void_p, c_int])
else:
Expand Down
3 changes: 1 addition & 2 deletions docs/ref/contrib/gis/install/geolibs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Program Description Required
======================== ==================================== ================================ ===================================
:doc:`GEOS <../geos>` Geometry Engine Open Source Yes 3.7, 3.6, 3.5, 3.4
`PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 5.2, 5.1, 5.0, 4.x
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.3, 2.2, 2.1, 2.0, 1.11
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.3, 2.2, 2.1, 2.0
:doc:`GeoIP <../geoip2>` IP-based geolocation library No 2
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.5, 2.4, 2.3, 2.2
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3
Expand All @@ -25,7 +25,6 @@ totally fine with GeoDjango. Your mileage may vary.
GEOS 3.5.0 2015-08-15
GEOS 3.6.0 2016-10-25
GEOS 3.7.0 2018-09-10
GDAL 1.11.0 2014-04-25
GDAL 2.0.0 2015-06
GDAL 2.1.0 2016-04
GDAL 2.2.0 2017-05
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/3.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ backends.

* Support for SpatiaLite 4.1 and 4.2 is removed.

* Support for GDAL 1.11 is removed.

Dropped support for PostgreSQL 9.4
----------------------------------

Expand Down
4 changes: 2 additions & 2 deletions tests/gis_tests/gdal_tests/test_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime

from django.contrib.gis.gdal import (
GDAL_VERSION, DataSource, Envelope, GDALException, OGRGeometry,
DataSource, Envelope, GDALException, OGRGeometry,
)
from django.contrib.gis.gdal.field import (
OFTDateTime, OFTInteger, OFTReal, OFTString,
Expand Down Expand Up @@ -38,7 +38,7 @@
),
TestDS(
'test_vrt', ext='vrt', nfeat=3, nfld=3, geom='POINT', gtype='Point25D',
driver='OGR_VRT' if GDAL_VERSION >= (2, 0) else 'VRT',
driver='OGR_VRT',
fields={
'POINT_X': OFTString,
'POINT_Y': OFTString,
Expand Down
4 changes: 2 additions & 2 deletions tests/gis_tests/inspectapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_poly(self):
'',
'class MyModel(models.Model):',
' float = models.FloatField()',
' int = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
' int = models.BigIntegerField()',
' str = models.CharField(max_length=80)',
' geom = models.PolygonField(%s)' % self.expected_srid,
]
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_date_field(self):
'',
'class City(models.Model):',
' name = models.CharField(max_length=80)',
' population = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
' population = models.BigIntegerField()',
' density = models.FloatField()',
' created = models.DateField()',
' geom = models.PointField(%s)' % self.expected_srid,
Expand Down

0 comments on commit e7fd69d

Please sign in to comment.