django/contrib/gis/geos/__init__.py
branchtrunk
changeset 138 466bece04a15
parent 1 911c7e1d6ffe
child 141 3282e3926790
     1.1 --- a/django/contrib/gis/geos/__init__.py	Wed Nov 19 19:33:14 2008 -0600
     1.2 +++ b/django/contrib/gis/geos/__init__.py	Sat Jan 31 15:18:50 2009 -0600
     1.3 @@ -1,40 +1,10 @@
     1.4 -"""
     1.5 - The goal of this module is to be a ctypes wrapper around the GEOS library
     1.6 - that will work on both *NIX and Windows systems.  Specifically, this uses
     1.7 - the GEOS C api.
     1.8 -
     1.9 - I have several motivations for doing this:
    1.10 -  (1) The GEOS SWIG wrapper is no longer maintained, and requires the
    1.11 -      installation of SWIG.
    1.12 -  (2) The PCL implementation is over 2K+ lines of C and would make
    1.13 -      PCL a requisite package for the GeoDjango application stack.
    1.14 -  (3) Windows and Mac compatibility becomes substantially easier, and does not
    1.15 -      require the additional compilation of PCL or GEOS and SWIG -- all that
    1.16 -      is needed is a Win32 or Mac compiled GEOS C library (dll or dylib)
    1.17 -      in a location that Python can read (e.g. 'C:\Python25').
    1.18 -
    1.19 - In summary, I wanted to wrap GEOS in a more maintainable and portable way using
    1.20 - only Python and the excellent ctypes library (now standard in Python 2.5).
    1.21 -
    1.22 - In the spirit of loose coupling, this library does not require Django or
    1.23 - GeoDjango.  Only the GEOS C library and ctypes are needed for the platform
    1.24 - of your choice.
    1.25 -
    1.26 - For more information about GEOS:
    1.27 -  http://geos.refractions.net
    1.28 -  
    1.29 - For more info about PCL and the discontinuation of the Python GEOS
    1.30 - library see Sean Gillies' writeup (and subsequent update) at:
    1.31 -  http://zcologia.com/news/150/geometries-for-python/
    1.32 -  http://zcologia.com/news/429/geometries-for-python-update/
    1.33 -"""
    1.34  from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex
    1.35  from django.contrib.gis.geos.point import Point
    1.36  from django.contrib.gis.geos.linestring import LineString, LinearRing
    1.37  from django.contrib.gis.geos.polygon import Polygon
    1.38  from django.contrib.gis.geos.collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon
    1.39  from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
    1.40 -from django.contrib.gis.geos.libgeos import geos_version, geos_version_info
    1.41 +from django.contrib.gis.geos.libgeos import geos_version, geos_version_info, GEOS_PREPARE
    1.42  
    1.43  def fromfile(file_name):
    1.44      """