mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
gis: fixed OGR bug and removed unnecessary imports from GeoMixin.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@5661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
abccccc095
commit
8162e3543c
@ -1,6 +1,6 @@
|
|||||||
# GEOS Routines
|
# GEOS Routines
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
from django.contrib.gis.geos import GEOSGeometry, hex_to_wkt, centroid, area
|
from django.contrib.gis.geos import GEOSGeometry
|
||||||
from django.contrib.gis.gdal import OGRGeometry, SpatialReference
|
from django.contrib.gis.gdal import OGRGeometry, SpatialReference
|
||||||
|
|
||||||
# Until model subclassing is a possibility, a mixin class is used to add
|
# Until model subclassing is a possibility, a mixin class is used to add
|
||||||
@ -17,7 +17,7 @@ class GeoMixin:
|
|||||||
|
|
||||||
def _get_GEOM_ogr(self, field, srid):
|
def _get_GEOM_ogr(self, field, srid):
|
||||||
"Returns an OGR Python object for the geometry."
|
"Returns an OGR Python object for the geometry."
|
||||||
return OGRGeometry(hex_to_wkt(getattr(self, field.attname)),
|
return OGRGeometry(getattr(self, field.attname).wkt,
|
||||||
SpatialReference('EPSG:%d' % srid))
|
SpatialReference('EPSG:%d' % srid))
|
||||||
|
|
||||||
def _get_GEOM_srid(self, srid):
|
def _get_GEOM_srid(self, srid):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user