Author: jbronn
Date: 2007-07-24 18:53:35 -0500 (Tue, 24 Jul 2007)
New Revision: 5755
Modified:
django/branches/gis/django/contrib/gis/utils/LayerMapping.py
django/branches/gis/django/contrib/gis/utils/inspect_data.py
Log:
gis: fixed utils bugs related to gdal module name changes.
Modified: django/branches/gis/django/contrib/gis/utils/LayerMapping.py
===================================================================
--- django/branches/gis/django/contrib/gis/utils/LayerMapping.py
2007-07-24 03:20:42 UTC (rev 5754)
+++ django/branches/gis/django/contrib/gis/utils/LayerMapping.py
2007-07-24 23:53:35 UTC (rev 5755)
@@ -81,17 +81,18 @@
LayerMapping just transformed the three geometries from the SHP file from
their
source spatial reference system (WGS84) to the spatial reference system of
- the GeoDjango model (NAD83). Further, data is selectively imported from
- the given
+ the GeoDjango model (NAD83). If no spatial reference system is defined for
+ the layer, use the `source_srs` keyword with a SpatialReference object to
+ specify one. Further, data is selectively imported from the given data
source
+ fields into the model fields.
"""
from types import StringType, TupleType
from datetime import datetime
from django.contrib.gis.gdal import \
OGRGeometry, OGRGeomType, SpatialReference, CoordTransform, \
- DataSource, Layer, Feature, OGRException
-from django.contrib.gis.gdal.Field import Field, OFTInteger, OFTReal,
OFTString, OFTDateTime
+ DataSource, OGRException
+from django.contrib.gis.gdal.field import Field, OFTInteger, OFTReal,
OFTString, OFTDateTime
from django.contrib.gis.models import GeometryColumns, SpatialRefSys
-
from django.db import connection, transaction
from django.core.exceptions import ObjectDoesNotExist
@@ -257,7 +258,7 @@
try:
geo_col =
GeometryColumns.objects.get(f_table_name=self.model._meta.db_table)
except:
- raise Exception, 'Geometry column "%s" does not exist. (did you
run syncdb?)'
+ raise Exception, 'Geometry column does not exist. (did you run
syncdb?)'
# Getting the coordinate system needed for transformation (with
CoordTransform)
try:
@@ -336,4 +337,4 @@
raise
except Exception, e:
print "Failed to save %s\n Continuing" % kwargs
-
+
Modified: django/branches/gis/django/contrib/gis/utils/inspect_data.py
===================================================================
--- django/branches/gis/django/contrib/gis/utils/inspect_data.py
2007-07-24 03:20:42 UTC (rev 5754)
+++ django/branches/gis/django/contrib/gis/utils/inspect_data.py
2007-07-24 23:53:35 UTC (rev 5755)
@@ -3,7 +3,7 @@
of a gdal.DataSource.
"""
-from django.contrib.gis.gdal.OGRGeometry import GEO_CLASSES
+from django.contrib.gis.gdal.geometries import GEO_CLASSES
def sample(data_source, num_features=10, gcs_file=None):
"""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---