mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Dropped support for GDAL 1.9 and 1.10.
This commit is contained in:
parent
e8531cc89c
commit
860903b261
@ -21,10 +21,10 @@ if lib_path:
|
|||||||
lib_names = None
|
lib_names = None
|
||||||
elif os.name == 'nt':
|
elif os.name == 'nt':
|
||||||
# Windows NT shared libraries
|
# Windows NT shared libraries
|
||||||
lib_names = ['gdal202', 'gdal201', 'gdal20', 'gdal111', 'gdal110', 'gdal19']
|
lib_names = ['gdal202', 'gdal201', 'gdal20', 'gdal111']
|
||||||
elif os.name == 'posix':
|
elif os.name == 'posix':
|
||||||
# *NIX library names.
|
# *NIX library names.
|
||||||
lib_names = ['gdal', 'GDAL', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0', 'gdal1.11.0', 'gdal1.10.0', 'gdal1.9.0']
|
lib_names = ['gdal', 'GDAL', 'gdal2.2.0', 'gdal2.1.0', 'gdal2.0.0', 'gdal1.11.0']
|
||||||
else:
|
else:
|
||||||
raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)
|
raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)
|
||||||
|
|
||||||
|
@ -51,10 +51,7 @@ set_ds_geotransform = void_output(std_call('GDALSetGeoTransform'), [c_void_p, PO
|
|||||||
|
|
||||||
get_ds_metadata = chararray_output(std_call('GDALGetMetadata'), [c_void_p, c_char_p], errcheck=False)
|
get_ds_metadata = chararray_output(std_call('GDALGetMetadata'), [c_void_p, c_char_p], errcheck=False)
|
||||||
set_ds_metadata = void_output(std_call('GDALSetMetadata'), [c_void_p, POINTER(c_char_p), c_char_p])
|
set_ds_metadata = void_output(std_call('GDALSetMetadata'), [c_void_p, POINTER(c_char_p), c_char_p])
|
||||||
if GDAL_VERSION >= (1, 11):
|
get_ds_metadata_domain_list = chararray_output(std_call('GDALGetMetadataDomainList'), [c_void_p], errcheck=False)
|
||||||
get_ds_metadata_domain_list = chararray_output(std_call('GDALGetMetadataDomainList'), [c_void_p], errcheck=False)
|
|
||||||
else:
|
|
||||||
get_ds_metadata_domain_list = None
|
|
||||||
get_ds_metadata_item = const_string_output(std_call('GDALGetMetadataItem'), [c_void_p, c_char_p, c_char_p])
|
get_ds_metadata_item = const_string_output(std_call('GDALGetMetadataItem'), [c_void_p, c_char_p, c_char_p])
|
||||||
set_ds_metadata_item = const_string_output(std_call('GDALSetMetadataItem'), [c_void_p, c_char_p, c_char_p, c_char_p])
|
set_ds_metadata_item = const_string_output(std_call('GDALSetMetadataItem'), [c_void_p, c_char_p, c_char_p, c_char_p])
|
||||||
free_dsl = void_output(std_call('CSLDestroy'), [POINTER(c_char_p)], errcheck=False)
|
free_dsl = void_output(std_call('CSLDestroy'), [POINTER(c_char_p)], errcheck=False)
|
||||||
|
@ -13,9 +13,6 @@ class GDALRasterBase(GDALBase):
|
|||||||
nested dictionary, where the first-level key is the metadata domain and
|
nested dictionary, where the first-level key is the metadata domain and
|
||||||
the second-level is the metadata item names and values for that domain.
|
the second-level is the metadata item names and values for that domain.
|
||||||
"""
|
"""
|
||||||
if not capi.get_ds_metadata_domain_list:
|
|
||||||
raise ValueError('GDAL ≥ 1.11 is required for using the metadata property.')
|
|
||||||
|
|
||||||
# The initial metadata domain list contains the default domain.
|
# The initial metadata domain list contains the default domain.
|
||||||
# The default is returned if domain name is None.
|
# The default is returned if domain name is None.
|
||||||
domain_list = ['DEFAULT']
|
domain_list = ['DEFAULT']
|
||||||
|
@ -10,7 +10,7 @@ Program Description Required
|
|||||||
======================== ==================================== ================================ ===================================
|
======================== ==================================== ================================ ===================================
|
||||||
:doc:`GEOS <../geos>` Geometry Engine Open Source Yes 3.6, 3.5, 3.4
|
:doc:`GEOS <../geos>` Geometry Engine Open Source Yes 3.6, 3.5, 3.4
|
||||||
`PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 4.9, 4.8, 4.7, 4.6, 4.5, 4.4
|
`PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 4.9, 4.8, 4.7, 4.6, 4.5, 4.4
|
||||||
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.2, 2.1, 2.0, 1.11, 1.10, 1.9
|
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.2, 2.1, 2.0, 1.11
|
||||||
:doc:`GeoIP <../geoip2>` IP-based geolocation library No 2
|
:doc:`GeoIP <../geoip2>` IP-based geolocation library No 2
|
||||||
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.4, 2.3, 2.2, 2.1
|
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.4, 2.3, 2.2, 2.1
|
||||||
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3, 4.2, 4.1
|
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3, 4.2, 4.1
|
||||||
@ -24,8 +24,6 @@ totally fine with GeoDjango. Your mileage may vary.
|
|||||||
GEOS 3.4.0 2013-08-11
|
GEOS 3.4.0 2013-08-11
|
||||||
GEOS 3.5.0 2015-08-15
|
GEOS 3.5.0 2015-08-15
|
||||||
GEOS 3.6.0 2016-10-25
|
GEOS 3.6.0 2016-10-25
|
||||||
GDAL 1.9.0 2012-01-03
|
|
||||||
GDAL 1.10.0 2013-04-29
|
|
||||||
GDAL 1.11.0 2014-04-25
|
GDAL 1.11.0 2014-04-25
|
||||||
GDAL 2.0.0 2015-06
|
GDAL 2.0.0 2015-06
|
||||||
GDAL 2.1.0 2016-04
|
GDAL 2.1.0 2016-04
|
||||||
|
@ -207,7 +207,7 @@ Database backend API
|
|||||||
:mod:`django.contrib.gis`
|
:mod:`django.contrib.gis`
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
* ...
|
* Support for GDAL 1.9 and 1.10 is dropped.
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
@ -277,13 +277,6 @@ class GDALRasterTests(SimpleTestCase):
|
|||||||
self.assertEqual(result, [0] * 4)
|
self.assertEqual(result, [0] * 4)
|
||||||
|
|
||||||
def test_raster_metadata_property(self):
|
def test_raster_metadata_property(self):
|
||||||
# Check for required gdal version.
|
|
||||||
if GDAL_VERSION < (1, 11):
|
|
||||||
msg = 'GDAL ≥ 1.11 is required for using the metadata property.'
|
|
||||||
with self.assertRaisesMessage(ValueError, msg):
|
|
||||||
self.rs.metadata
|
|
||||||
return
|
|
||||||
|
|
||||||
data = self.rs.metadata
|
data = self.rs.metadata
|
||||||
self.assertEqual(data['DEFAULT'], {'AREA_OR_POINT': 'Area'})
|
self.assertEqual(data['DEFAULT'], {'AREA_OR_POINT': 'Area'})
|
||||||
self.assertEqual(data['IMAGE_STRUCTURE'], {'INTERLEAVE': 'BAND'})
|
self.assertEqual(data['IMAGE_STRUCTURE'], {'INTERLEAVE': 'BAND'})
|
||||||
@ -378,37 +371,36 @@ class GDALRasterTests(SimpleTestCase):
|
|||||||
compressed = self.rs.warp({'papsz_options': {'compress': 'packbits'}, 'name': rstfile.name})
|
compressed = self.rs.warp({'papsz_options': {'compress': 'packbits'}, 'name': rstfile.name})
|
||||||
# Check physically if compression worked.
|
# Check physically if compression worked.
|
||||||
self.assertLess(os.path.getsize(compressed.name), os.path.getsize(self.rs.name))
|
self.assertLess(os.path.getsize(compressed.name), os.path.getsize(self.rs.name))
|
||||||
if GDAL_VERSION > (1, 11):
|
# Create file-based raster with options from scratch.
|
||||||
# Create file-based raster with options from scratch.
|
compressed = GDALRaster({
|
||||||
compressed = GDALRaster({
|
'datatype': 1,
|
||||||
'datatype': 1,
|
'driver': 'tif',
|
||||||
'driver': 'tif',
|
'name': rstfile.name,
|
||||||
'name': rstfile.name,
|
'width': 40,
|
||||||
'width': 40,
|
'height': 40,
|
||||||
'height': 40,
|
'srid': 3086,
|
||||||
'srid': 3086,
|
'origin': (500000, 400000),
|
||||||
'origin': (500000, 400000),
|
'scale': (100, -100),
|
||||||
'scale': (100, -100),
|
'skew': (0, 0),
|
||||||
'skew': (0, 0),
|
'bands': [{
|
||||||
'bands': [{
|
'data': range(40 ^ 2),
|
||||||
'data': range(40 ^ 2),
|
'nodata_value': 255,
|
||||||
'nodata_value': 255,
|
}],
|
||||||
}],
|
'papsz_options': {
|
||||||
'papsz_options': {
|
'compress': 'packbits',
|
||||||
'compress': 'packbits',
|
'pixeltype': 'signedbyte',
|
||||||
'pixeltype': 'signedbyte',
|
'blockxsize': 23,
|
||||||
'blockxsize': 23,
|
'blockysize': 23,
|
||||||
'blockysize': 23,
|
}
|
||||||
}
|
})
|
||||||
})
|
# Check if options used on creation are stored in metadata.
|
||||||
# Check if options used on creation are stored in metadata.
|
# Reopening the raster ensures that all metadata has been written
|
||||||
# Reopening the raster ensures that all metadata has been written
|
# to the file.
|
||||||
# to the file.
|
compressed = GDALRaster(compressed.name)
|
||||||
compressed = GDALRaster(compressed.name)
|
self.assertEqual(compressed.metadata['IMAGE_STRUCTURE']['COMPRESSION'], 'PACKBITS',)
|
||||||
self.assertEqual(compressed.metadata['IMAGE_STRUCTURE']['COMPRESSION'], 'PACKBITS',)
|
self.assertEqual(compressed.bands[0].metadata['IMAGE_STRUCTURE']['PIXELTYPE'], 'SIGNEDBYTE')
|
||||||
self.assertEqual(compressed.bands[0].metadata['IMAGE_STRUCTURE']['PIXELTYPE'], 'SIGNEDBYTE')
|
if GDAL_VERSION >= (2, 1):
|
||||||
if GDAL_VERSION >= (2, 1):
|
self.assertIn('Block=40x23', compressed.info)
|
||||||
self.assertIn('Block=40x23', compressed.info)
|
|
||||||
|
|
||||||
def test_raster_warp(self):
|
def test_raster_warp(self):
|
||||||
# Create in memory raster
|
# Create in memory raster
|
||||||
|
Loading…
x
Reference in New Issue
Block a user