Changeset 5755
- Timestamp:
- 07/24/07 18:53:35 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/utils/inspect_data.py
r5605 r5755 4 4 """ 5 5 6 from django.contrib.gis.gdal. OGRGeometryimport GEO_CLASSES6 from django.contrib.gis.gdal.geometries import GEO_CLASSES 7 7 8 8 def sample(data_source, num_features=10, gcs_file=None): django/branches/gis/django/contrib/gis/utils/LayerMapping.py
r5742 r5755 82 82 LayerMapping just transformed the three geometries from the SHP file from their 83 83 source spatial reference system (WGS84) to the spatial reference system of 84 the GeoDjango model (NAD83). Further, data is selectively imported from 85 the given 84 the GeoDjango model (NAD83). If no spatial reference system is defined for 85 the layer, use the `source_srs` keyword with a SpatialReference object to 86 specify one. Further, data is selectively imported from the given data source 87 fields into the model fields. 86 88 """ 87 89 from types import StringType, TupleType … … 89 91 from django.contrib.gis.gdal import \ 90 92 OGRGeometry, OGRGeomType, SpatialReference, CoordTransform, \ 91 DataSource, Layer, Feature,OGRException92 from django.contrib.gis.gdal. Field import Field, OFTInteger, OFTReal, OFTString, OFTDateTime93 DataSource, OGRException 94 from django.contrib.gis.gdal.field import Field, OFTInteger, OFTReal, OFTString, OFTDateTime 93 95 from django.contrib.gis.models import GeometryColumns, SpatialRefSys 94 95 96 from django.db import connection, transaction 96 97 from django.core.exceptions import ObjectDoesNotExist … … 258 259 geo_col = GeometryColumns.objects.get(f_table_name=self.model._meta.db_table) 259 260 except: 260 raise Exception, 'Geometry column "%s"does not exist. (did you run syncdb?)'261 raise Exception, 'Geometry column does not exist. (did you run syncdb?)' 261 262 262 263 # Getting the coordinate system needed for transformation (with CoordTransform) … … 337 338 except Exception, e: 338 339 print "Failed to save %s\n Continuing" % kwargs 339 340
