~ubuntu-branches/ubuntu/jaunty/python-django/jaunty-updates

« back to all changes in this revision

Viewing changes to django/contrib/gis/geos/base.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2008-11-15 19:15:33 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20081115191533-xbt1ut2xf4fvwtvc
Tags: 1.0.1-0ubuntu1
* New upstream release:
  - Bug fixes.

* The tests/ sub-directory appaers to have been dropped upstream, so pull
  our patch to workaround the tests and modify the rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# try/except since this package may be used outside GeoDjango.
22
22
try:
23
23
    from django.contrib.gis.gdal import OGRGeometry, SpatialReference, GEOJSON
 
24
    from django.contrib.gis.gdal.geometries import json_regex
24
25
    HAS_GDAL = True
25
26
except:
26
27
    HAS_GDAL, GEOJSON = False, False
30
31
# library.  Not a substitute for good web security programming practices.
31
32
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
32
33
wkt_regex = re.compile(r'^(SRID=(?P<srid>\d+);)?(?P<wkt>(POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)[ACEGIMLONPSRUTY\d,\.\-\(\) ]+)$', re.I)
33
 
json_regex = re.compile(r'^\{.+\}$')
34
34
 
35
35
class GEOSGeometry(object):
36
36
    "A class that, generally, encapsulates a GEOS geometry."