__init__.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. """
  2. The GeoDjango GEOS module. Please consult the GeoDjango documentation
  3. for more details:
  4. http://geodjango.org/docs/geos.html
  5. """
  6. __all__ = ['HAS_GEOS']
  7. try:
  8. from .libgeos import geos_version, geos_version_info # NOQA: flake8 detects only the last __all__
  9. HAS_GEOS = True
  10. __all__ += ['geos_version', 'geos_version_info']
  11. except ImportError:
  12. HAS_GEOS = False
  13. if HAS_GEOS:
  14. from .geometry import GEOSGeometry, wkt_regex, hex_regex
  15. from .point import Point
  16. from .linestring import LineString, LinearRing
  17. from .polygon import Polygon
  18. from .collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon
  19. from .error import GEOSException, GEOSIndexError
  20. from .io import WKTReader, WKTWriter, WKBReader, WKBWriter
  21. from .factory import fromfile, fromstr
  22. __all__ += [
  23. 'GEOSGeometry', 'wkt_regex', 'hex_regex', 'Point', 'LineString',
  24. 'LinearRing', 'Polygon', 'GeometryCollection', 'MultiPoint',
  25. 'MultiLineString', 'MultiPolygon', 'GEOSException', 'GEOSIndexError',
  26. 'WKTReader', 'WKTWriter', 'WKBReader', 'WKBWriter', 'fromfile',
  27. 'fromstr',
  28. ]