mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
gis: fixed utils bugs related to gdal module name changes.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@5755 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
179a2c45c3
commit
add0689d56
@ -81,17 +81,18 @@ Example:
|
||||
|
||||
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 @@ class LayerMapping:
|
||||
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 @@ class LayerMapping:
|
||||
raise
|
||||
except Exception, e:
|
||||
print "Failed to save %s\n Continuing" % kwargs
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ This module includes some utility functions for inspecting the layout
|
||||
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):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user