2008-08-06 02:13:06 +08:00
|
|
|
"""
|
|
|
|
This module contains useful utilities for GeoDjango.
|
|
|
|
"""
|
|
|
|
from django.contrib.gis.gdal import HAS_GDAL
|
2015-06-16 02:07:31 +08:00
|
|
|
from django.contrib.gis.utils.wkt import precision_wkt # NOQA
|
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
if HAS_GDAL:
|
2013-10-18 19:25:30 +08:00
|
|
|
from django.contrib.gis.utils.ogrinfo import ogrinfo, sample # NOQA
|
|
|
|
from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect # NOQA
|
|
|
|
from django.contrib.gis.utils.srs import add_postgis_srs, add_srs_entry # NOQA
|
2013-09-30 23:55:14 +08:00
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
2008-08-06 02:13:06 +08:00
|
|
|
try:
|
2011-09-11 02:04:27 +08:00
|
|
|
# LayerMapping requires DJANGO_SETTINGS_MODULE to be set,
|
2008-08-06 02:13:06 +08:00
|
|
|
# so this needs to be in try/except.
|
2013-10-18 19:25:30 +08:00
|
|
|
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError # NOQA
|
2013-09-30 23:55:14 +08:00
|
|
|
except ImproperlyConfigured:
|
2008-08-06 02:13:06 +08:00
|
|
|
pass
|