Changeset 6914
- Timestamp:
- 12/11/07 10:18:48 (7 months ago)
- Files:
-
- django/branches/gis/django/contrib/gis/gdal/libgdal.py (modified) (3 diffs)
- django/branches/gis/django/contrib/gis/gdal/prototypes/ds.py (modified) (2 diffs)
- django/branches/gis/django/contrib/gis/gdal/prototypes/geom.py (modified) (3 diffs)
- django/branches/gis/django/contrib/gis/gdal/prototypes/srs.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/gdal/libgdal.py
r6862 r6914 8 8 from django.conf import settings 9 9 lib_name = settings.GDAL_LIBRARY_PATH 10 except (AttributeError, EnvironmentError ):10 except (AttributeError, EnvironmentError, ImportError): 11 11 lib_name = None 12 12 … … 16 16 # Windows NT shared library 17 17 lib_name = 'libgdal-1.dll' 18 errcheck_flag = False19 18 elif os.name == 'posix': 20 19 platform = os.uname()[0] … … 25 24 # Attempting to use .so extension for all other platforms. 26 25 lib_name = 'libgdal.so' 27 errcheck_flag = True28 26 else: 29 27 raise OGRException('Unsupported OS "%s"' % os.name) django/branches/gis/django/contrib/gis/gdal/prototypes/ds.py
r6707 r6914 6 6 from ctypes import c_char_p, c_int, c_long, c_void_p, POINTER 7 7 from django.contrib.gis.gdal.envelope import OGREnvelope 8 from django.contrib.gis.gdal.libgdal import lgdal , errcheck_flag8 from django.contrib.gis.gdal.libgdal import lgdal 9 9 from django.contrib.gis.gdal.prototypes.generation import \ 10 10 const_string_output, double_output, geom_output, int_output, \ … … 48 48 ### Feature Routines ### 49 49 clone_feature = voidptr_output(lgdal.OGR_F_Clone, [c_void_p]) 50 destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck= errcheck_flag)50 destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=False) 51 51 feature_equal = int_output(lgdal.OGR_F_Equal, [c_void_p, c_void_p]) 52 52 get_feat_geom_ref = geom_output(lgdal.OGR_F_GetGeometryRef, [c_void_p]) django/branches/gis/django/contrib/gis/gdal/prototypes/geom.py
r6707 r6914 1 1 from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER 2 2 from django.contrib.gis.gdal.envelope import OGREnvelope 3 from django.contrib.gis.gdal.libgdal import lgdal , errcheck_flag3 from django.contrib.gis.gdal.libgdal import lgdal 4 4 from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope 5 5 from django.contrib.gis.gdal.prototypes.generation import \ … … 73 73 get_point_count = int_output(lgdal.OGR_G_GetPointCount, [c_void_p]) 74 74 get_point = void_output(lgdal.OGR_G_GetPoint, [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double)], errcheck=False) 75 geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck= errcheck_flag)75 geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck=False) 76 76 77 77 # Topology routines. … … 86 86 87 87 # Transformation routines. 88 geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p] , errcheck=True)89 geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p] , errcheck=True)88 geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p]) 89 geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p]) 90 90 91 91 # For retrieving the envelope of the geometry. django/branches/gis/django/contrib/gis/gdal/prototypes/srs.py
r6707 r6914 1 1 from ctypes import c_char_p, c_int, c_void_p, POINTER 2 from django.contrib.gis.gdal.libgdal import lgdal , errcheck_flag2 from django.contrib.gis.gdal.libgdal import lgdal 3 3 from django.contrib.gis.gdal.prototypes.generation import \ 4 4 const_string_output, double_output, int_output, \ … … 23 23 clone_srs = srs_output(lgdal.OSRClone, [c_void_p]) 24 24 new_srs = srs_output(lgdal.OSRNewSpatialReference, [c_char_p]) 25 release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck= errcheck_flag)26 destroy_srs = void_output(lgdal.OSRDestroySpatialReference, [c_void_p], errcheck= errcheck_flag)25 release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck=False) 26 destroy_srs = void_output(lgdal.OSRDestroySpatialReference, [c_void_p], errcheck=False) 27 27 srs_validate = void_output(lgdal.OSRValidate, [c_void_p]) 28 28 … … 69 69 # Coordinate transformation 70 70 new_ct= srs_output(lgdal.OCTNewCoordinateTransformation, [c_void_p, c_void_p]) 71 destroy_ct = void_output(lgdal.OCTDestroyCoordinateTransformation, [c_void_p], errcheck= errcheck_flag)71 destroy_ct = void_output(lgdal.OCTDestroyCoordinateTransformation, [c_void_p], errcheck=False)
