PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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 | 3 complexity | 19c6c43bd0af1e12f813f43a25ea1459 MD5 | raw file
Possible License(s): BSD-3-Clause
  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
  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. # Attempting to import the GeoIP class.
  17. try:
  18. from django.contrib.gis.utils.geoip import GeoIP, GeoIPException
  19. HAS_GEOIP = True
  20. except:
  21. HAS_GEOIP = False
  22. from django.contrib.gis.utils.wkt import precision_wkt