PageRenderTime 76ms CodeModel.GetById 73ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/django/contrib/gis/utils/__init__.py

https://code.google.com/p/mango-py/
Python | 25 lines | 15 code | 3 blank | 7 comment | 1 complexity | 19c6c43bd0af1e12f813f43a25ea1459 MD5 | raw file
 1"""
 2 This module contains useful utilities for GeoDjango.
 3"""
 4# Importing the utilities that depend on GDAL, if available.
 5from django.contrib.gis.gdal import HAS_GDAL
 6if HAS_GDAL:
 7    from django.contrib.gis.utils.ogrinfo import ogrinfo, sample
 8    from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect
 9    from django.contrib.gis.utils.srs import add_postgis_srs, add_srs_entry
10    try:
11        # LayerMapping requires DJANGO_SETTINGS_MODULE to be set, 
12        # so this needs to be in try/except.
13        from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError
14    except:
15        pass
16    
17# Attempting to import the GeoIP class.
18try:
19    from django.contrib.gis.utils.geoip import GeoIP, GeoIPException
20    HAS_GEOIP = True
21except:
22    HAS_GEOIP = False
23
24from django.contrib.gis.utils.wkt import precision_wkt
25