~ubuntu-branches/ubuntu/maverick/python-django/maverick

« back to all changes in this revision

Viewing changes to django/contrib/gis/gdal/geomtype.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.1.10 upstream) (4.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100521075255-i1zpeyc0k8512pd7
Tags: 1.2-1
New upstream stable release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
class OGRGeomType(object):
5
5
    "Encapulates OGR Geometry Types."
6
6
 
 
7
    wkb25bit = -2147483648
 
8
 
7
9
    # Dictionary of acceptable OGRwkbGeometryType s and their string names.
8
10
    _types = {0 : 'Unknown',
9
11
              1 : 'Point',
15
17
              7 : 'GeometryCollection',
16
18
              100 : 'None',
17
19
              101 : 'LinearRing',
 
20
              1 + wkb25bit: 'Point25D',
 
21
              2 + wkb25bit: 'LineString25D',
 
22
              3 + wkb25bit: 'Polygon25D',
 
23
              4 + wkb25bit: 'MultiPoint25D',
 
24
              5 + wkb25bit : 'MultiLineString25D',
 
25
              6 + wkb25bit : 'MultiPolygon25D',
 
26
              7 + wkb25bit : 'GeometryCollection25D',
18
27
              }
19
28
    # Reverse type dictionary, keyed by lower-case of the name.
20
29
    _str_types = dict([(v.lower(), k) for k, v in _types.items()])
68
77
    @property
69
78
    def django(self):
70
79
        "Returns the Django GeometryField for this OGR Type."
71
 
        s = self.name
 
80
        s = self.name.replace('25D', '')
72
81
        if s in ('LinearRing', 'None'):
73
82
            return None
74
83
        elif s == 'Unknown':