Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gis: gdal: removed errcheck_flag, not needed after all (I misread the…

… C header file).

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6914 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6349985e70411445589bb420dba54e0853f8ff75 1 parent fae19f8
@jbronn jbronn authored
View
4 django/contrib/gis/gdal/libgdal.py
@@ -7,7 +7,7 @@
try:
from django.conf import settings
lib_name = settings.GDAL_LIBRARY_PATH
-except (AttributeError, EnvironmentError):
+except (AttributeError, EnvironmentError, ImportError):
lib_name = None
if lib_name:
@@ -15,7 +15,6 @@
elif os.name == 'nt':
# Windows NT shared library
lib_name = 'libgdal-1.dll'
- errcheck_flag = False
elif os.name == 'posix':
platform = os.uname()[0]
if platform == 'Darwin':
@@ -24,7 +23,6 @@
else:
# Attempting to use .so extension for all other platforms.
lib_name = 'libgdal.so'
- errcheck_flag = True
else:
raise OGRException('Unsupported OS "%s"' % os.name)
View
4 django/contrib/gis/gdal/prototypes/ds.py
@@ -5,7 +5,7 @@
"""
from ctypes import c_char_p, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
-from django.contrib.gis.gdal.libgdal import lgdal, errcheck_flag
+from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, geom_output, int_output, \
srs_output, void_output, voidptr_output
@@ -47,7 +47,7 @@
### Feature Routines ###
clone_feature = voidptr_output(lgdal.OGR_F_Clone, [c_void_p])
-destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=errcheck_flag)
+destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=False)
feature_equal = int_output(lgdal.OGR_F_Equal, [c_void_p, c_void_p])
get_feat_geom_ref = geom_output(lgdal.OGR_F_GetGeometryRef, [c_void_p])
get_feat_field_count = int_output(lgdal.OGR_F_GetFieldCount, [c_void_p])
View
8 django/contrib/gis/gdal/prototypes/geom.py
@@ -1,6 +1,6 @@
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
-from django.contrib.gis.gdal.libgdal import lgdal, errcheck_flag
+from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, geom_output, int_output, \
@@ -72,7 +72,7 @@ def topology_func(f):
get_geom_type = int_output(lgdal.OGR_G_GetGeometryType, [c_void_p])
get_point_count = int_output(lgdal.OGR_G_GetPointCount, [c_void_p])
get_point = void_output(lgdal.OGR_G_GetPoint, [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double)], errcheck=False)
-geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck=errcheck_flag)
+geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck=False)
# Topology routines.
ogr_contains = topology_func(lgdal.OGR_G_Contains)
@@ -85,8 +85,8 @@ def topology_func(f):
ogr_within = topology_func(lgdal.OGR_G_Within)
# Transformation routines.
-geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p], errcheck=True)
-geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p], errcheck=True)
+geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p])
+geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p])
# For retrieving the envelope of the geometry.
get_envelope = lgdal.OGR_G_GetEnvelope
View
8 django/contrib/gis/gdal/prototypes/srs.py
@@ -1,5 +1,5 @@
from ctypes import c_char_p, c_int, c_void_p, POINTER
-from django.contrib.gis.gdal.libgdal import lgdal, errcheck_flag
+from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, int_output, \
srs_output, string_output, void_output
@@ -22,8 +22,8 @@ def units_func(f):
# Creation & destruction.
clone_srs = srs_output(lgdal.OSRClone, [c_void_p])
new_srs = srs_output(lgdal.OSRNewSpatialReference, [c_char_p])
-release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck=errcheck_flag)
-destroy_srs = void_output(lgdal.OSRDestroySpatialReference, [c_void_p], errcheck=errcheck_flag)
+release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck=False)
+destroy_srs = void_output(lgdal.OSRDestroySpatialReference, [c_void_p], errcheck=False)
srs_validate = void_output(lgdal.OSRValidate, [c_void_p])
# Getting the semi_major, semi_minor, and flattening functions.
@@ -68,4 +68,4 @@ def units_func(f):
# Coordinate transformation
new_ct= srs_output(lgdal.OCTNewCoordinateTransformation, [c_void_p, c_void_p])
-destroy_ct = void_output(lgdal.OCTDestroyCoordinateTransformation, [c_void_p], errcheck=errcheck_flag)
+destroy_ct = void_output(lgdal.OCTDestroyCoordinateTransformation, [c_void_p], errcheck=False)
Please sign in to comment.
Something went wrong with that request. Please try again.