mirror of
https://github.com/django/django.git
synced 2025-11-24 12:51:44 +00:00
OGRGeomType now recognizes 2.5D types, and removes need for unnecessary workaround in Layer.geom_type; corrected geometry type in test VRT file. Refs #11433.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
04f869a80c
commit
c169f8cb17
5 changed files with 38 additions and 10 deletions
|
|
@ -214,13 +214,7 @@ class OGRGeometry(GDALBase):
|
|||
@property
|
||||
def geom_type(self):
|
||||
"Returns the Type for this Geometry."
|
||||
try:
|
||||
return OGRGeomType(capi.get_geom_type(self.ptr))
|
||||
except OGRException:
|
||||
# VRT datasources return an invalid geometry type
|
||||
# number, but a valid name -- we'll try that instead.
|
||||
# See: http://trac.osgeo.org/gdal/ticket/2491
|
||||
return OGRGeomType(capi.get_geom_name(self.ptr))
|
||||
return OGRGeomType(capi.get_geom_type(self.ptr))
|
||||
|
||||
@property
|
||||
def geom_name(self):
|
||||
|
|
@ -684,4 +678,11 @@ GEO_CLASSES = {1 : Point,
|
|||
6 : MultiPolygon,
|
||||
7 : GeometryCollection,
|
||||
101: LinearRing,
|
||||
1 + OGRGeomType.wkb25bit : Point,
|
||||
2 + OGRGeomType.wkb25bit : LineString,
|
||||
3 + OGRGeomType.wkb25bit : Polygon,
|
||||
4 + OGRGeomType.wkb25bit : MultiPoint,
|
||||
5 + OGRGeomType.wkb25bit : MultiLineString,
|
||||
6 + OGRGeomType.wkb25bit : MultiPolygon,
|
||||
7 + OGRGeomType.wkb25bit : GeometryCollection,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue