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