app/django/contrib/gis/utils/__init__.py
author Daniel Diniz <ajaksu@gmail.com>
Fri, 03 Jul 2009 14:35:03 +0200
changeset 2502 2e096acc8720
parent 323 ff1a9aa48cfd
permissions -rw-r--r--
Surveys can now have required questions and comments can be turned on/off. Storing comments is now working. However some issues arise when form errors occur, like missing context and the errors also trigger before a form has been submitted. Reviewed by: Lennard de Rijk

"""
 This module contains useful utilities for GeoDjango.
"""
# Importing the utilities that depend on GDAL, if available.
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
    from django.contrib.gis.utils.ogrinfo import ogrinfo, sample
    from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect
    from django.contrib.gis.utils.srs import add_postgis_srs
    try:
        # LayerMapping requires DJANGO_SETTINGS_MODULE to be set, 
        # so this needs to be in try/except.
        from django.contrib.gis.utils.layermapping import LayerMapping
    except:
        pass
    
# Attempting to import the GeoIP class.
try:
    from django.contrib.gis.utils.geoip import GeoIP, GeoIPException
    HAS_GEOIP = True
except:
    HAS_GEOIP = False

from django.contrib.gis.utils.wkt import precision_wkt