2008-08-06 02:13:06 +08:00
|
|
|
"""
|
Refactored the GEOS interface. Improvements include:
* Geometries now allow list-like manipulation, e.g., can add, insert, delete vertexes (or other geometries in collections) like Python lists. Thanks, Aryeh Leib Taurog.
* Added support for GEOS prepared geometries via `prepared` property. Prepared geometries significantly speed up certain operations.
* Added support for GEOS cascaded union as `MultiPolygon.cascaded_union` property.
* Added support for GEOS line merge as `merged` property on `LineString`, and `MultiLineString` geometries. Thanks, Paul Smith.
* No longer use the deprecated C API for serialization to/from WKB and WKT. Now use the GEOS I/O classes, which are now exposed as `WKTReader`, `WKTWriter`, `WKBReader`, and `WKBWriter` (which supports 3D and SRID inclusion)
* Moved each type of geometry to their own module, eliminating the cluttered `geometries.py`.
* Internally, all C API methods are explicitly called from a module rather than a star import.
Fixed #9557, #9877, #10222
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-24 08:12:21 +08:00
|
|
|
The GeoDjango GEOS module. Please consult the GeoDjango documentation
|
2013-10-11 04:42:30 +08:00
|
|
|
for more details:
|
Refactored the GEOS interface. Improvements include:
* Geometries now allow list-like manipulation, e.g., can add, insert, delete vertexes (or other geometries in collections) like Python lists. Thanks, Aryeh Leib Taurog.
* Added support for GEOS prepared geometries via `prepared` property. Prepared geometries significantly speed up certain operations.
* Added support for GEOS cascaded union as `MultiPolygon.cascaded_union` property.
* Added support for GEOS line merge as `merged` property on `LineString`, and `MultiLineString` geometries. Thanks, Paul Smith.
* No longer use the deprecated C API for serialization to/from WKB and WKT. Now use the GEOS I/O classes, which are now exposed as `WKTReader`, `WKTWriter`, `WKBReader`, and `WKBWriter` (which supports 3D and SRID inclusion)
* Moved each type of geometry to their own module, eliminating the cluttered `geometries.py`.
* Internally, all C API methods are explicitly called from a module rather than a star import.
Fixed #9557, #9877, #10222
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-24 08:12:21 +08:00
|
|
|
http://geodjango.org/docs/geos.html
|
2008-08-06 02:13:06 +08:00
|
|
|
"""
|
2013-10-18 19:25:30 +08:00
|
|
|
__all__ = ['HAS_GEOS']
|
|
|
|
|
2013-05-11 11:08:45 +08:00
|
|
|
try:
|
2013-10-18 19:25:30 +08:00
|
|
|
from .libgeos import geos_version, geos_version_info, GEOS_PREPARE # NOQA: flake8 detects only the last __all__
|
2013-05-11 11:08:45 +08:00
|
|
|
HAS_GEOS = True
|
2013-10-18 19:25:30 +08:00
|
|
|
__all__ += ['geos_version', 'geos_version_info', 'GEOS_PREPARE']
|
2013-05-11 11:08:45 +08:00
|
|
|
except ImportError:
|
|
|
|
HAS_GEOS = False
|
|
|
|
|
|
|
|
if HAS_GEOS:
|
|
|
|
from .geometry import GEOSGeometry, wkt_regex, hex_regex
|
|
|
|
from .point import Point
|
|
|
|
from .linestring import LineString, LinearRing
|
|
|
|
from .polygon import Polygon
|
|
|
|
from .collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon
|
|
|
|
from .error import GEOSException, GEOSIndexError
|
|
|
|
from .io import WKTReader, WKTWriter, WKBReader, WKBWriter
|
|
|
|
from .factory import fromfile, fromstr
|
2013-10-18 19:25:30 +08:00
|
|
|
|
|
|
|
__all__ += [
|
|
|
|
'GEOSGeometry', 'wkt_regex', 'hex_regex', 'Point', 'LineString',
|
|
|
|
'LinearRing', 'Polygon', 'GeometryCollection', 'MultiPoint',
|
|
|
|
'MultiLineString', 'MultiPolygon', 'GEOSException', 'GEOSIndexError',
|
|
|
|
'WKTReader', 'WKTWriter', 'WKBReader', 'WKBWriter', 'fromfile',
|
|
|
|
'fromstr',
|
|
|
|
]
|