Changeset 7665
- Timestamp:
- 06/16/08 11:39:36 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/gdal/geomtype.py
r6686 r7665 6 6 7 7 # Ordered array of acceptable strings and their corresponding OGRwkbGeometryType 8 __ogr_str = [' Point', 'LineString', 'Polygon', 'MultiPoint',8 __ogr_str = ['Unknown', 'Point', 'LineString', 'Polygon', 'MultiPoint', 9 9 'MultiLineString', 'MultiPolygon', 'GeometryCollection', 10 10 'LinearRing'] 11 __ogr_int = [ 1, 2, 3, 4, 5, 6, 7, 101]11 __ogr_int = [0, 1, 2, 3, 4, 5, 6, 7, 101] 12 12 13 13 def __init__(self, type_input): … … 48 48 raise TypeError('Cannot compare with type: %s' % str(type(other))) 49 49 50 def __ne__(self, other): 51 return not (self == other) 52 50 53 def _has_str(self, arr, s): 51 54 "Case-insensitive search of the string array for the given pattern." django/branches/gis/django/contrib/gis/gdal/__init__.py
r7113 r7665 1 1 """ 2 2 This module houses ctypes interfaces for GDAL objects. The following GDAL 3 objects are supported:3 objects are supported: 4 4 5 5 CoordTransform: Used for coordinate transformations from one spatial … … 20 20 21 21 SpatialReference: Represents OSR Spatial Reference objects. 22 23 The GDAL library will be imported from the system path using the default 24 library name for the current OS. The default library path may be overridden 25 by setting `GDAL_LIBRARY_PATH` in your settings with the path to the GDAL C 26 library on your system. 27 28 GDAL links to a large number of external libraries that consume RAM when 29 loaded. Thus, it may desirable to disable GDAL on systems with limited 30 RAM resources -- this may be accomplished by setting `GDAL_LIBRARY_PATH` 31 to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; 32 setting to None/False/'' will not work as a string must be given). 22 33 """ 23 34 # Attempting to import objects that depend on the GDAL library. The django/branches/gis/django/contrib/gis/tests/test_gdal_geom.py
r7441 r7665 18 18 g = OGRGeomType('GeometrycollectioN') 19 19 g = OGRGeomType('LINearrING') 20 g = OGRGeomType('Unknown') 20 21 except: 21 22 self.fail('Could not create an OGRGeomType object!') … … 31 32 self.assertEqual(True, OGRGeomType('point') == 'POINT') 32 33 self.assertEqual(False, OGRGeomType('point') == 2) 34 self.assertEqual(True, OGRGeomType('unknown') == 0) 33 35 self.assertEqual(True, OGRGeomType(6) == 'MULtiPolyGON') 34 36 self.assertEqual(False, OGRGeomType(1) != OGRGeomType('point')) 37 self.assertEqual(True, OGRGeomType('POINT') != OGRGeomType(6)) 38 35 39 def test01a_wkt(self): 36 40 "Testing WKT output."
