Dropped support for GDAL 1.6

This commit is contained in:
Claude Paroz 2014-03-27 23:02:28 +01:00
parent c5d1df70a4
commit 41903d025a
5 changed files with 8 additions and 67 deletions

View File

@ -1,6 +1,6 @@
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
from django.contrib.gis.db import models
@ -123,14 +123,8 @@ class GeoModelAdmin(ModelAdmin):
}
return OLMap
from django.contrib.gis import gdal
if gdal.HAS_GDAL:
# Use the official spherical mercator projection SRID on versions
# of GDAL that support it; otherwise, fallback to 900913.
if gdal.GDAL_VERSION >= (1, 7):
spherical_mercator_srid = 3857
else:
spherical_mercator_srid = 900913
if HAS_GDAL:
spherical_mercator_srid = 3857
class OSMGeoAdmin(GeoModelAdmin):
map_template = 'gis/admin/osm.html'

View File

@ -112,9 +112,9 @@ class OSMWidget(BaseGeometryWidget):
@property
def map_srid(self):
# Use the official spherical mercator projection SRID on versions
# of GDAL that support it; otherwise, fallback to 900913.
if gdal.HAS_GDAL and gdal.GDAL_VERSION >= (1, 7):
# Use the official spherical mercator projection SRID when GDAL is
# available; otherwise, fallback to 900913.
if gdal.HAS_GDAL:
return 3857
else:
return 900913

View File

@ -391,14 +391,6 @@ class OGRGeometry(GDALBase):
klone.transform(coord_trans)
return klone
# Have to get the coordinate dimension of the original geometry
# so it can be used to reset the transformed geometry's dimension
# afterwards. This is done because of GDAL bug (in versions prior
# to 1.7) that turns geometries 3D after transformation, see:
# http://trac.osgeo.org/gdal/changeset/17792
if GDAL_VERSION < (1, 7):
orig_dim = self.coord_dim
# Depending on the input type, use the appropriate OGR routine
# to perform the transformation.
if isinstance(coord_trans, CoordTransform):
@ -412,20 +404,6 @@ class OGRGeometry(GDALBase):
raise TypeError('Transform only accepts CoordTransform, '
'SpatialReference, string, and integer objects.')
# Setting with original dimension, see comment above.
if GDAL_VERSION < (1, 7):
if isinstance(self, GeometryCollection):
# With geometry collections have to set dimension on
# each internal geometry reference, as the collection
# dimension isn't affected.
for i in xrange(len(self)):
internal_ptr = capi.get_geom_ref(self.ptr, i)
if orig_dim != capi.get_coord_dim(internal_ptr):
capi.set_coord_dim(internal_ptr, orig_dim)
else:
if self.coord_dim != orig_dim:
self.coord_dim = orig_dim
def transform_to(self, srs):
"For backwards-compatibility."
self.transform(srs)

View File

@ -12,7 +12,7 @@ Program Description Required
======================== ==================================== ================================ ==========================
:ref:`GEOS <ref-geos>` Geometry Engine Open Source Yes 3.4, 3.3, 3.2
`PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 4.8, 4.7, 4.6, 4.5, 4.4
:ref:`GDAL <ref-gdal>` Geospatial Data Abstraction Library No (but, required for SQLite) 1.9, 1.8, 1.7, 1.6
:ref:`GDAL <ref-gdal>` Geospatial Data Abstraction Library No (but, required for SQLite) 1.9, 1.8, 1.7
:ref:`GeoIP <ref-geoip>` IP-based geolocation library No 1.4
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.0, 1.5, 1.4, 1.3
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.1, 4.0, 3.0, 2.4, 2.3
@ -26,7 +26,6 @@ totally fine with GeoDjango. Your mileage may vary.
GEOS 3.2.0 2009-12-14
GEOS 3.3.0 2011-05-30
GEOS 3.4.0 2013-08-11
GDAL 1.6.0 2008-12-04
GDAL 1.7.1 2010-02-08
GDAL 1.8.0 2011-01-13
GDAL 1.9.0 2012-01-03
@ -263,34 +262,6 @@ the GDAL library. For example:
GDAL_LIBRARY_PATH = '/home/sue/local/lib/libgdal.so'
.. _gdaldata:
Can't find GDAL data files (``GDAL_DATA``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When installed from source, GDAL versions 1.5.1 and below have an autoconf bug
that places data in the wrong location. [#]_ This can lead to error messages
like this:
.. code-block:: text
ERROR 4: Unable to open EPSG support file gcs.csv.
...
OGRException: OGR failure.
The solution is to set the ``GDAL_DATA`` environment variable to the location of the
GDAL data files before invoking Python (typically ``/usr/local/share``; use
``gdal-config --datadir`` to find out). For example::
$ export GDAL_DATA=`gdal-config --datadir`
$ python manage.py shell
If using Apache, you may need to add this environment variable to your configuration
file:
.. code-block:: apache
SetEnv GDAL_DATA /usr/local/share
.. rubric:: Footnotes
.. [#] The datum shifting files are needed for converting data to and from
@ -302,5 +273,3 @@ file:
problem caused by their absence later.
.. [#] Specifically, GeoDjango provides support for the `OGR
<http://gdal.org/ogr>`_ library, a component of GDAL.
.. [#] See `GDAL ticket #2382 <http://trac.osgeo.org/gdal/ticket/2382>`_.

View File

@ -175,7 +175,7 @@ Miscellaneous
* ``URLField.to_python`` no longer adds a trailing slash to pathless URLs.
* ``django.contrib.gis`` dropped support for GEOS 3.1.
* ``django.contrib.gis`` dropped support for GEOS 3.1 and GDAL 1.6.
.. _deprecated-features-1.8: