[SCM] geos branch, master, updated. upstream/3.3.3-64-gbed8af5

Jerome Villeneuve Larouche jlarouche at mapgears.com
Wed Jun 12 18:25:46 UTC 2013


The following commit has been merged in the master branch:
commit 893f64b181700f5c3f566c44f2163df5060ffe71
Author: Jerome Villeneuve Larouche <jlarouche at mapgears.com>
Date:   Thu Apr 25 18:17:39 2013 +0000

    Imported Upstream version 3.3.8

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7eb596..53ccffd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,4 @@
 #################################################################################
-# $Id: CMakeLists.txt 3564 2012-01-08 13:46:07Z strk $
 #
 # Main GEOS build configuration file for CMake build system
 #
@@ -30,7 +29,7 @@ set(CMAKE_MODULE_PATH "${geos_SOURCE_DIR}/cmake/modules")
 # GEOS C++ library SONAME will use these encoding ABI break at every release
 set(VERSION_MAJOR 3)
 set(VERSION_MINOR 3)
-set(VERSION_PATCH 2dev)
+set(VERSION_PATCH 6dev)
 set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 
 # JTS_PORT is the version of JTS this release is bound to
@@ -39,7 +38,7 @@ message(STATUS "Setting GEOS version ${VERSION} as port of JTS ${JTS_PORT}")
 
 # GEOS C API version
 set(CAPI_INTERFACE_CURRENT 8)
-set(CAPI_INTERFACE_REVISION 2)
+set(CAPI_INTERFACE_REVISION 6)
 set(CAPI_INTERFACE_AGE 7)
 
 math(EXPR CAPI_VERSION_MAJOR "${CAPI_INTERFACE_CURRENT} - ${CAPI_INTERFACE_AGE}")
@@ -47,6 +46,10 @@ set(CAPI_VERSION_MINOR ${CAPI_INTERFACE_AGE})
 set(CAPI_VERSION_PATCH ${CAPI_INTERFACE_REVISION})
 set(CAPI_VERSION "${CAPI_VERSION_MAJOR}.${CAPI_VERSION_MINOR}.${CAPI_VERSION_PATCH}")
 message(STATUS "Setting GEOS C API version ${CAPI_VERSION}")
+if (NOT WIN32)
+  set(CAPI_SOVERSION ${CAPI_VERSION_MAJOR})
+  message(STATUS "Setting GEOS C API soversion ${CAPI_SOVERSION}")
+endif()
 
 #################################################################################
 # Check custom global options
@@ -70,7 +73,7 @@ endif()
 
 if(APPLE)
   option(GEOS_ENABLE_MACOSX_FRAMEWORK
-    "Set to OFF|ON (default) to build GEOS as a Mac OS X framework" ON)
+    "Set to ON|OFF (default) to build GEOS as a Mac OS X framework" OFF)
   option(GEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT
     "Set to ON|OFF (default) to add Unix compatibility to the Mac OS X framework" OFF)
 endif()
diff --git a/ChangeLog b/ChangeLog
index 37b940f..f67d0c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,366 @@
+2013-02-28 09:45  Sandro Santilli <strk at keybit.net>
+
+	* [r3774] NEWS, src/algorithm/CentroidArea.cpp,
+	  tests/xmltester/Makefile.am,
+	  tests/xmltester/tests/ticket/bug582.xml: Fix centroid computation
+	  for collections with empty components
+	  
+	  Fixes bug #582
+
+2013-02-21 10:25  Sandro Santilli <strk at keybit.net>
+
+	* [r3766] NEWS, src/io/WKTWriter.cpp: WKTWriter::appendCoordinate
+	  optimisation
+	  
+	  Modified the WKTWriter::appendCoordinate method to not create an
+	  intermediate std::string, but instead write directly into the
+	  Writer
+	  object. The result is a small performance improvement.
+	  
+	  Patch by Mats Taraldsvik <mats.taraldsvik at norkart.no>
+
+2013-02-01 06:37  Sandro Santilli <strk at keybit.net>
+
+	* [r3764] NEWS: Add header guard news
+
+2013-02-01 06:34  Sandro Santilli <strk at keybit.net>
+
+	* [r3763] include/geos/io/CLocalizer.h: Add header guard to
+	  CLocalizer (#619)
+
+2013-02-01 06:31  Sandro Santilli <strk at keybit.net>
+
+	* [r3761] include/geos/linearref/LocationIndexOfLine.h,
+	  src/linearref/LocationIndexOfLine.cpp: Fix header guard and port
+	  info in LocatioNIndexOfLine (#618)
+
+2013-02-01 06:27  Sandro Santilli <strk at keybit.net>
+
+	* [r3759] include/geos/geom/util/GeometryExtracter.h: Fix header
+	  guard in GeometryExtracter (#617)
+
+2013-01-25 17:29  Sandro Santilli <strk at keybit.net>
+
+	* [r3757] capi/geos_c.h.in, configure.in,
+	  include/geos/version.h.vc: Prepare codebase for next 3.3 release
+	  (3.3.8)
+
+2013-01-25 17:26  Sandro Santilli <strk at keybit.net>
+
+	* [r3756] NEWS, src/operation/valid/IsValidOp.cpp: IsValidOp: throw
+	  proper error on nested shells (#608)
+	  
+	  Thanks geomworx
+
+2013-01-22 18:39  Sandro Santilli <strk at keybit.net>
+
+	* [r3753] ChangeLog: Updated for 3.3.7 release
+
+2013-01-22 18:21  Sandro Santilli <strk at keybit.net>
+
+	* [r3752] NEWS, configure.in, swig/python/geos.py,
+	  swig/python/geos_wrap.cxx: Set version to 3.3.7
+
+2013-01-17 12:04  Sandro Santilli <strk at keybit.net>
+
+	* [r3750] NEWS, include/geos/geom/BinaryOp.h,
+	  tests/xmltester/Makefile.am,
+	  tests/xmltester/tests/ticket/bug615.xml: Only attempt to fix
+	  self-intersection between multiple components
+	  
+	  Doing this reduces the likelyhood of entering an infinite
+	  recursion
+	  whereas UnaryUnion (meant to fix that) would enter the
+	  self-intersection
+	  attempt again. Fixes #615 for which a test is added.
+	  
+	  This also gives us back an exception with the input of ticket
+	  #488,
+	  which is the same behavior JTS exposes. The (bogus) test for it
+	  is disabled by this commit.
+
+2013-01-14 11:08  Sandro Santilli <strk at keybit.net>
+
+	* [r3746] NEWS, include/geos/algorithm/InteriorPointArea.h,
+	  src/algorithm/InteriorPointArea.cpp,
+	  tests/xmltester/tests/general/TestInteriorPoint.xml: Fix EMPTY
+	  return from zero-area polygon (#613)
+
+2013-01-14 11:05  Sandro Santilli <strk at keybit.net>
+
+	* [r3745] tests/xmltester/XMLTester.cpp: Have XMLTester use POINT
+	  EMPTY for a null return from getInteriorPoint
+
+2013-01-11 14:25  Sandro Santilli <strk at keybit.net>
+
+	* [r3739] NEWS, src/algorithm/InteriorPointLine.cpp,
+	  tests/unit/capi/GEOSPointOnSurfaceTest.cpp: Fix
+	  GEOSPointOnSurface with zero-length linestring (#609)
+
+2012-12-06 17:44  Sandro Santilli <strk at keybit.net>
+
+	* [r3738] tests/unit/capi/GEOSisValidDetailTest.cpp: Accept weird
+	  NAN values in testcase, sometimes seen on windows...
+
+2012-12-05 11:00  Sandro Santilli <strk at keybit.net>
+
+	* [r3735] swig/python/geos.py, swig/python/geos_wrap.cxx:
+	  Regenerate swig wrappers (due to version change)
+
+2012-12-05 07:41  Sandro Santilli <strk at keybit.net>
+
+	* [r3732] NEWS, src/operation/buffer/BufferOp.cpp: Do not reduce
+	  precision below 6 significant digits.
+	  
+	  Avoids gross results (preferring an exception)
+	  See http://trac.osgeo.org/geos/ticket/605
+
+2012-12-04 21:43  Sandro Santilli <strk at keybit.net>
+
+	* [r3730] NEWS, src/operation/buffer/RightmostEdgeFinder.cpp: Fix
+	  abort in Buffer op (RightmostEdgeFinder)
+	  
+	  Rather than aborting we throw a TopologyException,
+	  because the problem occurs when noding isn't correct.
+	  See http://trac.osgeo.org/geos/ticket/605
+
+2012-12-04 21:39  Sandro Santilli <strk at keybit.net>
+
+	* [r3729] src/operation/buffer/BufferSubgraph.cpp: typo in comment
+
+2012-11-15 17:35  Sandro Santilli <strk at keybit.net>
+
+	* [r3725] HOWTO_RELEASE, capi/geos_c.h.in, configure.in,
+	  include/geos/version.h.vc: Prepare codebase for next 3.3 release
+	  (3.3.7)
+
+2012-11-15 16:37  Sandro Santilli <strk at keybit.net>
+
+	* [r3723] ChangeLog: Updated ChangeLog for 3.3.6 release
+
+2012-11-15 16:31  Sandro Santilli <strk at keybit.net>
+
+	* [r3722] NEWS, configure.in, swig/python/geos.py,
+	  swig/python/geos_wrap.cxx: Set version to 3.3.6
+
+2012-11-15 15:59  Sandro Santilli <strk at keybit.net>
+
+	* [r3721] tests/xmltester/Makefile.am,
+	  tests/xmltester/tests/ticket/bug599.xml: Add automated test for
+	  #599 (succeeds)
+
+2012-09-10 09:17  Sandro Santilli <strk at keybit.net>
+
+	* [r3714] tests/xmltester/tests/ticket/bug586.xml: Tweak the test
+	  for bug 586 to succeed while still being small
+
+2012-09-10 08:05  Sandro Santilli <strk at keybit.net>
+
+	* [r3713] NEWS, include/geos/geom/BinaryOp.h,
+	  tests/xmltester/Makefile.am,
+	  tests/xmltester/tests/ticket/bug586.xml: Do not try to fix valid
+	  geometries (#586)
+	  
+	  Fixes a stack overflow in BinaryOp, includes testcase
+
+2012-09-07 11:26  Sandro Santilli <strk at keybit.net>
+
+	* [r3709] swig/python/geos.py, swig/python/geos_wrap.cxx:
+	  Regenerate swig files with swig 2.0.4
+
+2012-09-06 18:15  Sandro Santilli <strk at keybit.net>
+
+	* [r3707] php/test/test.php: Use version_compare to compare
+	  versions...
+
+2012-09-06 18:05  Sandro Santilli <strk at keybit.net>
+
+	* [r3706] NEWS, php/README, php/test/test.php: Add support for
+	  phpunit 3.6 (not loosing support for 3.4)
+	  
+	  I don't have phpunit-3.4 anymore so if anyone does please see
+	  if "make check" still works (with php enabled)
+	  
+	  NOTE: Ubuntu 10.04 ships phpunit 3.4
+
+2012-06-26 20:42  Mateusz Loskot <mateusz at loskot.net>
+
+	* [r3698] CMakeLists.txt, cmake/cmake_uninstall.cmake.in,
+	  include/CMakeLists.txt, src/CMakeLists.txt: [CMake] Merged recent
+	  fixes from trunk. Updated version numbers according to
+	  configure.in
+
+2012-06-25 15:15  Sandro Santilli <strk at keybit.net>
+
+	* [r3690] HOWTO_RELEASE: Add tarball verification step
+
+2012-06-25 11:59  Sandro Santilli <strk at keybit.net>
+
+	* [r3689] NEWS, capi/geos_c.h.in, configure.in,
+	  include/geos/version.h.vc: Set 3.3 branch ready for work on 3.3.6
+	  release.
+
+2012-06-25 10:50  Sandro Santilli <strk at keybit.net>
+
+	* [r3687] ChangeLog: Update ChangeLog for release 3.3.5
+
+2012-06-25 10:49  Sandro Santilli <strk at keybit.net>
+
+	* [r3686] NEWS, configure.in: Set version to 3.3.5 final, and
+	  release date
+
+2012-06-25 10:20  Sandro Santilli <strk at keybit.net>
+
+	* [r3685] NEWS, capi/geos_ts_c.cpp, tests/unit/Makefile.am,
+	  tests/unit/capi/GEOSPointOnSurfaceTest.cpp: Always return POINT
+	  from GEOSPointOnSurface, even for EMPTY (#561)
+
+2012-06-24 15:16  Sandro Santilli <strk at keybit.net>
+
+	* [r3682] configure.in: 3.3.5 isn't final yet
+
+2012-06-22 15:46  Sandro Santilli <strk at keybit.net>
+
+	* [r3681] include/geos/algorithm/CentroidArea.h: Add note about
+	  handling of degenerate polygons
+
+2012-06-22 15:31  Sandro Santilli <strk at keybit.net>
+
+	* [r3678] NEWS, capi/geos_ts_c.cpp,
+	  tests/unit/capi/GEOSGetCentroidTest.cpp: Always return POINT from
+	  GEOSGetCentroid, even for EMPTY (#560)
+
+2012-06-22 15:02  Sandro Santilli <strk at keybit.net>
+
+	* [r3676] NEWS, include/geos/algorithm/CentroidArea.h,
+	  src/algorithm/CentroidArea.cpp, tests/unit/Makefile.am,
+	  tests/unit/capi/GEOSGetCentroidTest.cpp: Port robustness fix to
+	  CentroidArea (#559)
+
+2012-06-22 11:47  Sandro Santilli <strk at keybit.net>
+
+	* [r3675] capi/geos_c.h.in: Update version also for MSVC... (#558)
+
+2012-06-22 11:07  Sandro Santilli <strk at keybit.net>
+
+	* [r3674] NEWS, configure.in: Set CAPI interface revision to 5
+	  (#558)
+	  
+	  This is to resolve a problem with versioning of the CAPI library
+	  shipped with 3.3.3 (1.7.4) and 3.3.4 (1.7.3). So 3.3.5 will ship
+	  with 1.7.5 (ASAP).
+
+2012-06-06 07:04  Sandro Santilli <strk at keybit.net>
+
+	* [r3664] README, src/Makefile.am: Clarify problems with linking
+	  against C++ api (#553)
+	  
+	  Path by Greg Troxel.
+
+2012-05-31 19:16  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r3662] capi/geos_c.h.in, configure.in,
+	  include/geos/version.h.vc: Bump versions to 3.3.5
+
+2012-05-31 18:41  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r3661] ChangeLog: Update for 3.3.4
+
+2012-05-30 07:04  Sandro Santilli <strk at keybit.net>
+
+	* [r3659] ChangeLog: ChangeLog updated for 3.3.4
+
+2012-05-30 06:42  Sandro Santilli <strk at keybit.net>
+
+	* [r3658] NEWS, capi/geos_c.h.in, configure.in,
+	  include/geos/version.h.vc, swig/python/geos.py,
+	  swig/python/geos_wrap.cxx: Fix release date and version for 3.3.4
+
+2012-05-21 14:12  Sandro Santilli <strk at keybit.net>
+
+	* [r3634] include/geos/geom/Geometry.h, src/geom/Geometry.cpp:
+	  Don't call GeometryFactory::getDefaultInstance() at startup
+	  (#540)
+
+2012-05-14 19:00  Sandro Santilli <strk at keybit.net>
+
+	* [r3628] NEWS, src/operation/polygonize/EdgeRing.cpp: Reduce calls
+	  to ptNotInList, greatly speeding up Polygonizer (#545)
+
+2012-05-09 18:02  Sandro Santilli <strk at keybit.net>
+
+	* [r3626] NEWS, include/geos/simplify/TaggedLineStringSimplifier.h,
+	  include/geos/simplify/TopologyPreservingSimplifier.h,
+	  src/simplify/TaggedLineStringSimplifier.cpp,
+	  src/simplify/TopologyPreservingSimplifier.cpp,
+	  tests/unit/simplify/TopologyPreservingSimplifierTest.cpp: Fix
+	  TopologyPreservingSimplifier invalid output on closed line (#508)
+
+2012-05-09 16:28  Sandro Santilli <strk at keybit.net>
+
+	* [r3624] NEWS, php/geos.c: Add support for PHP 5.4 (#513) --
+	  thanks voxik
+
+2012-05-08 18:23  Sandro Santilli <strk at keybit.net>
+
+	* [r3622] NEWS, src/geom/Geometry.cpp: Envelope-based short-circuit
+	  for Geometry->symDifference (#543)
+
+2012-05-08 17:35  Sandro Santilli <strk at keybit.net>
+
+	* [r3620] NEWS, capi/geos_ts_c.cpp, tests/xmltester/XMLTester.cpp:
+	  Geometry methods do use BinaryOp internally + shortcuts (#542)
+	  
+	  This commit changes both XMLTester and C-API to not use BinaryOp
+	  directly but rather rely on geometry methods to do that.
+
+2012-05-04 08:13  Sandro Santilli <strk at keybit.net>
+
+	* [r3617] NEWS, acsite.m4: Update PGAC_TYPE_64BIT_INT for better
+	  cross-compiler support (#534)
+
+2012-04-12 09:05  Sandro Santilli <strk at keybit.net>
+
+	* [r3613] NEWS, src/geomgraph/Node.cpp,
+	  tests/unit/capi/GEOSUnaryUnionTest.cpp: Throw an exception rather
+	  than aborting on NaN overlay input (#530)
+
+2012-04-10 15:32  Sandro Santilli <strk at keybit.net>
+
+	* [r3610] tests/xmltester/Makefile.am,
+	  tests/xmltester/tests/ticket/bug527.xml: Add test for bug #527
+
+2012-04-10 15:16  Sandro Santilli <strk at keybit.net>
+
+	* [r3608] include/geos/operation/union/UnaryUnionOp.h: Have
+	  UnaryUnion use BinaryOp for the simple case
+	  
+	  See ticket #527 -- there's no infinite loop triggered by our
+	  testsuite...
+
+2012-04-10 15:02  Sandro Santilli <strk at keybit.net>
+
+	* [r3606] NEWS, include/geos/geom/BinaryOp.h: Reduce
+	  CommonBitsRemover harmful effects during overlay op (#527)
+
+2012-04-05 16:49  Sandro Santilli <strk at keybit.net>
+
+	* [r3600] swig/python/geos.py, swig/python/geos_wrap.cxx:
+	  Regenerate swig wrappers with SWIG 1.3.40
+
+2012-04-01 20:50  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r3584] HOWTO_RELEASE: Update howto release
+
+2012-04-01 20:42  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r3581] capi/geos_c.h.in, configure.in: Update version numbers
+	  after tag
+
+2012-04-01 20:33  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r3577] ChangeLog, NEWS: Update for 3.3.3 release
+
 2012-03-22 08:34  Sandro Santilli <strk at keybit.net>
 
 	* [r3574] NEWS, src/simplify/TaggedLineString.cpp,
diff --git a/Makefile.in b/Makefile.in
index 198132c..f727877 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -79,9 +79,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -568,6 +570,10 @@ dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
 	$(am__remove_distdir)
 
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__remove_distdir)
+
 dist-lzma: distdir
 	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
 	$(am__remove_distdir)
@@ -604,6 +610,8 @@ distcheck: dist
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -788,18 +796,18 @@ uninstall-am:
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am am--refresh check check-am clean clean-generic \
 	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distclean-libtool \
-	distclean-tags distcleancheck distdir distuninstallcheck dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am
+	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic \
+	distclean-libtool distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 cl:
diff --git a/NEWS b/NEWS
index 1e6380c..9d03df3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,52 @@
+Changes in 3.3.8
+2013-02-28
+
+- Bug fixes / improvements
+    - IsValidOp: throw proper error on nested shells (#608)
+    - Fix header guards (#617, #618, #619)
+    - WKTWriter::appendCoordinate optimisation
+    - Fix centroid computation for collections with empty components (#582)
+
+Changes in 3.3.7
+2013-01-22 
+
+- Bug fixes / improvements
+    - Fix abort in RightmostEdgeFinder (#605)
+    - Do not force precision reduction below 6 significant digits
+      while trying to obtain a valid Buffer output (#605)
+    - Fix GEOSPointOnSurface with zero-length linestring (#609)
+    - Fix EMPTY return from zero-area polygon (#613)
+    - Segfault from symdifference (#615)
+
+Changes in 3.3.6
+2012-11-15 -- that's Post-GIS day !
+
+- Bug fixes / improvements
+    - Add support for testing with phpunit 3.6 (not loosing support for 3.4)
+    - Segfault from intersection (#586, #598, #599)
+
+Changes in 3.3.5
+2012-06-25
+
+- Bug fixes / improvements
+    - Correctly increment CAPI lib version from 3.3.3 (#558)
+    - Port robustness fix to CentroidArea (#559)
+    - Always return POINT from GEOSGetCentroid, even for EMPTY (#560)
+    - Always return POINT from GEOSPointOnSurface, even for EMPTY (#561)
+
+Changes in 3.3.4
+2012-05-31
+
+- Bug fixes / improvements
+    - Do not abort on NaN overlay input (#530)
+    - Reduce CommonBitsRemover harmful effects during overlay op (#527)
+    - Better cross-compiler support (#534)
+    - Enable overlay ops short-circuits (#542)
+    - Envelope-based short-circuit for symDifference (#543)
+    - Fix support for PHP 5.4 (#513)
+    - Fix TopologyPreservingSimplifier invalid output on closed line (#508)
+    - Reduce calls to ptNotInList, greatly speeding up Polygonizer (#545)
+
 Changes in 3.3.3
 2012-04-01
 
diff --git a/README b/README
index 24d68af..fd51430 100644
--- a/README
+++ b/README
@@ -57,6 +57,15 @@ Example usage:
 Using the C++ interface (discouraged)
 -------------------------------------
 
+NB: The C++ interface should not be used directly; the geos project
+views it as a bug for another program to use the C++ interface or even
+to directly link against the C++ library.  The C++ library name will
+change on every minor release because it is too hard to know if there
+have been ABI changes.  (The C libary uses the C++ interface, but the
+C library follows normal ABI-change-sensitive versioning, so programs
+that link only against the C library should work without relinking
+when geos is upgraded.)
+
 To compile programs against the C++ lib:
 
   CFLAGS += `geos-config --cflags`
diff --git a/aclocal.m4 b/aclocal.m4
index 869ba91..fb60c8f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -38,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.2], [],
+m4_if([$1], [1.11.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -54,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.2])dnl
+[AM_AUTOMAKE_VERSION([1.11.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -926,7 +926,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,10 +948,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
diff --git a/acsite.m4 b/acsite.m4
index e7e2bad..50bf876 100644
--- a/acsite.m4
+++ b/acsite.m4
@@ -1,6 +1,6 @@
-# This has been taken from postgres-7.3.4 local macros
-#
-#
+# This has been taken from postgres-9.1+ local macros
+# ( REL9_1_BETA2-1484-g293ec33 )
+
 # PGAC_TYPE_64BIT_INT(TYPE)
 # -------------------------
 # Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
@@ -10,24 +10,20 @@ AC_DEFUN([PGAC_TYPE_64BIT_INT],
 define([Ac_cachevar], [translit([pgac_cv_type_$1_64], [ *], [_p])])dnl
 AC_CACHE_CHECK([whether $1 is 64 bits], [Ac_cachevar],
 [AC_TRY_RUN(
-[
-
-#include <inttypes.h>
-
-typedef $1 int64;
+[typedef $1 ac_int64;
 
 /*
  * These are globals to discourage the compiler from folding all the
  * arithmetic tests down to compile-time constants.
  */
-int64 a = 20000001;
-int64 b = 40000005;
+ac_int64 a = 20000001;
+ac_int64 b = 40000005;
 
 int does_int64_work()
 {
-  int64 c,d;
+  ac_int64 c,d;
 
-  if (sizeof(int64) != 8)
+  if (sizeof(ac_int64) != 8)
     return 0;			/* definitely not the right size */
 
   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
@@ -42,15 +38,16 @@ main() {
 }],
 [Ac_cachevar=yes],
 [Ac_cachevar=no],
-[Ac_cachevar=no
-dnl We will do better here with Autoconf 2.50
-AC_MSG_WARN([64 bit arithmetic disabled when cross-compiling])])])
+[# If cross-compiling, check the size reported by the compiler and
+# trust that the arithmetic works.
+AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [sizeof($1) == 8])],
+                  Ac_cachevar=yes,
+                  Ac_cachevar=no)])])
 
 Ac_define=$Ac_cachevar
 if test x"$Ac_cachevar" = xyes ; then
-  AC_DEFINE(Ac_define,, [Set to 1 if `]$1[' is 64 bits])
+  AC_DEFINE(Ac_define, 1, [Define to 1 if `]$1[' works and is 64 bits.])
 fi
 undefine([Ac_define])dnl
 undefine([Ac_cachevar])dnl
 ])# PGAC_TYPE_64BIT_INT
-
diff --git a/capi/Makefile.in b/capi/Makefile.in
index 5fb98be..08b4b99 100644
--- a/capi/Makefile.in
+++ b/capi/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -374,7 +374,7 @@ clean-libLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeos_c.la: $(libgeos_c_la_OBJECTS) $(libgeos_c_la_DEPENDENCIES) 
+libgeos_c.la: $(libgeos_c_la_OBJECTS) $(libgeos_c_la_DEPENDENCIES) $(EXTRA_libgeos_c_la_DEPENDENCIES) 
 	$(libgeos_c_la_LINK) -rpath $(libdir) $(libgeos_c_la_OBJECTS) $(libgeos_c_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/capi/geos_c.h b/capi/geos_c.h
index d4b34fa..4a904ea 100644
--- a/capi/geos_c.h
+++ b/capi/geos_c.h
@@ -1,6 +1,6 @@
 /************************************************************************
  *
- * $Id: geos_c.h.in 3582 2012-04-01 20:42:27Z pramsey $
+ * $Id: geos_c.h.in 3757 2013-01-25 17:29:36Z strk $
  *
  * C-Wrapper for GEOS library
  *
@@ -56,8 +56,8 @@ extern "C" {
 #include <geos/version.h>
 #define GEOS_CAPI_VERSION_MAJOR 1
 #define GEOS_CAPI_VERSION_MINOR 7
-#define GEOS_CAPI_VERSION_PATCH 1
-#define GEOS_CAPI_VERSION "3.3.3-CAPI-1.7.1"
+#define GEOS_CAPI_VERSION_PATCH 8
+#define GEOS_CAPI_VERSION "3.3.8-CAPI-1.7.8"
 #else
 #ifndef GEOS_VERSION_MAJOR
 #define GEOS_VERSION_MAJOR 3
@@ -66,10 +66,10 @@ extern "C" {
 #define GEOS_VERSION_MINOR 3
 #endif
 #ifndef GEOS_VERSION_PATCH
-#define GEOS_VERSION_PATCH 3
+#define GEOS_VERSION_PATCH 8
 #endif
 #ifndef GEOS_VERSION
-#define GEOS_VERSION "3.3.3"
+#define GEOS_VERSION "3.3.8"
 #endif
 #ifndef GEOS_JTS_PORT
 #define GEOS_JTS_PORT "1.12.0"
@@ -77,8 +77,8 @@ extern "C" {
 
 #define GEOS_CAPI_VERSION_MAJOR 1
 #define GEOS_CAPI_VERSION_MINOR 7
-#define GEOS_CAPI_VERSION_PATCH 4
-#define GEOS_CAPI_VERSION "3.3.3-CAPI-1.7.4"
+#define GEOS_CAPI_VERSION_PATCH 8
+#define GEOS_CAPI_VERSION "3.3.8-CAPI-1.7.8"
 #endif
 
 #define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR 
diff --git a/capi/geos_c.h.in b/capi/geos_c.h.in
index bd5807b..a7ae634 100644
--- a/capi/geos_c.h.in
+++ b/capi/geos_c.h.in
@@ -1,6 +1,6 @@
 /************************************************************************
  *
- * $Id: geos_c.h.in 3582 2012-04-01 20:42:27Z pramsey $
+ * $Id: geos_c.h.in 3757 2013-01-25 17:29:36Z strk $
  *
  * C-Wrapper for GEOS library
  *
@@ -56,8 +56,8 @@ extern "C" {
 #include <geos/version.h>
 #define GEOS_CAPI_VERSION_MAJOR 1
 #define GEOS_CAPI_VERSION_MINOR 7
-#define GEOS_CAPI_VERSION_PATCH 1
-#define GEOS_CAPI_VERSION "3.3.3-CAPI-1.7.1"
+#define GEOS_CAPI_VERSION_PATCH 8
+#define GEOS_CAPI_VERSION "3.3.8-CAPI-1.7.8"
 #else
 #ifndef GEOS_VERSION_MAJOR
 #define GEOS_VERSION_MAJOR @VERSION_MAJOR@
diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index dbb9c3c..e4683f2 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -1,6 +1,6 @@
 /************************************************************************
  *
- * $Id: geos_ts_c.cpp 3322 2011-05-03 02:27:00Z sgillies $
+ * $Id: geos_ts_c.cpp 3685 2012-06-25 10:20:08Z strk $
  *
  * C-Wrapper for GEOS library
  *
@@ -50,6 +50,7 @@
 #include <geos/operation/polygonize/Polygonizer.h>
 #include <geos/operation/linemerge/LineMerger.h>
 #include <geos/operation/overlay/OverlayOp.h>
+#include <geos/operation/overlay/snap/GeometrySnapper.h>
 #include <geos/operation/union/CascadedPolygonUnion.h>
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/operation/buffer/BufferParameters.h>
@@ -57,7 +58,6 @@
 #include <geos/operation/relate/RelateOp.h>
 #include <geos/operation/sharedpaths/SharedPathsOp.h>
 #include <geos/linearref/LengthIndexedLine.h>
-#include <geos/geom/BinaryOp.h>
 #include <geos/util/IllegalArgumentException.h>
 #include <geos/util/UniqueCoordinateArrayFilter.h>
 #include <geos/util/Machine.h>
@@ -1605,12 +1605,7 @@ GEOSIntersection_r(GEOSContextHandle_t extHandle, const Geometry *g1, const Geom
 
     try
     {
-        GeomAutoPtr g3(BinaryOp(g1, g2, overlayOp(OverlayOp::opINTERSECTION)));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->intersection(g2);
-        //return g3;
+        return g1->intersection(g2);
     }
     catch (const std::exception &e)
     {
@@ -1850,12 +1845,7 @@ GEOSDifference_r(GEOSContextHandle_t extHandle, const Geometry *g1, const Geomet
 
     try
     {
-        GeomAutoPtr g3(BinaryOp(g1, g2, overlayOp(OverlayOp::opDIFFERENCE)));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->difference(g2);
-        //return g3;
+        return g1->difference(g2);
     }
     catch (const std::exception &e)
     {
@@ -1918,10 +1908,7 @@ GEOSSymDifference_r(GEOSContextHandle_t extHandle, const Geometry *g1, const Geo
 
     try
     {
-        GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opSYMDIFFERENCE));
-        return g3.release();
-        //Geometry *g3 = g1->symDifference(g2);
-        //return g3;
+        return g1->symDifference(g2);
     }
     catch (const std::exception &e)
     {
@@ -1953,12 +1940,7 @@ GEOSUnion_r(GEOSContextHandle_t extHandle, const Geometry *g1, const Geometry *g
 
     try
     {
-        GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opUNION));
-        return g3.release();
-
-        // XXX: old version
-        //Geometry *g3 = g1->Union(g2);
-        //return g3;
+        return g1->Union(g2);
     }
     catch (const std::exception &e)
     {
@@ -2078,8 +2060,8 @@ GEOSPointOnSurface_r(GEOSContextHandle_t extHandle, const Geometry *g1)
         if ( ! ret )
         {
             const GeometryFactory* gf = handle->geomFactory;
-            // return an empty collection 
-            return gf->createGeometryCollection();
+            // return an empty point 
+            return gf->createPoint();
         }
         return ret;
     }
@@ -2781,7 +2763,7 @@ GEOSGetCentroid_r(GEOSContextHandle_t extHandle, const Geometry *g)
         if (0 == ret)
         {
             const GeometryFactory *gf = handle->geomFactory;
-            return gf->createGeometryCollection();
+            return gf->createPoint();
         }
         return ret;
     }
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
index 3eda65a..725ab7d 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/cmake_uninstall.cmake.in
@@ -1,5 +1,4 @@
 #################################################################################
-# $Id: CMakeLists.txt 2920 2010-02-21 17:11:38Z mloskot $
 #
 # This file is a part of CMake build configuration of GEOS library
 #
diff --git a/config.guess b/config.guess
index 8152efd..d622a44 100755
--- a/config.guess
+++ b/config.guess
@@ -2,9 +2,9 @@
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-11-11'
+timestamp='2012-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2011-11-11'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -57,8 +55,8 @@ GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -863,6 +861,13 @@ EOF
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -897,16 +902,16 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     hexagon:Linux:*:*)
-	echo hexagon-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	LIBC=gnu
@@ -948,7 +953,7 @@ EOF
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     padre:Linux:*:*)
 	echo sparc-unknown-linux-gnu
@@ -989,7 +994,7 @@ EOF
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -1320,6 +1325,9 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/config.sub b/config.sub
index e76eaf4..c894da4 100755
--- a/config.sub
+++ b/config.sub
@@ -2,9 +2,9 @@
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011 Free Software Foundation, Inc.
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2011-11-11'
+timestamp='2012-02-10'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2011-11-11'
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -76,8 +74,8 @@ version="\
 GNU config.sub ($timestamp)
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,6 +130,10 @@ case $maybe_os in
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -247,6 +249,7 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
@@ -319,8 +322,7 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -333,7 +335,10 @@ case $basic_machine in
 	strongarm | thumb | xscale)
 		basic_machine=arm-unknown
 		;;
-
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
 	xscaleeb)
 		basic_machine=armeb-unknown
 		;;
@@ -356,6 +361,7 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
@@ -719,7 +725,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -1559,9 +1564,6 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
diff --git a/configure b/configure
index 1e92916..57cd8ff 100755
--- a/configure
+++ b/configure
@@ -2583,12 +2583,12 @@ test -n "$target_alias" &&
 JTS_PORT=1.12.0
 
 CAPI_INTERFACE_CURRENT=8
-CAPI_INTERFACE_REVISION=4
+CAPI_INTERFACE_REVISION=8
 CAPI_INTERFACE_AGE=7
 
 VERSION_MAJOR=3
 VERSION_MINOR=3
-VERSION_PATCH=3
+VERSION_PATCH=8
 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
 
 CAPI_VERSION_MAJOR=`expr $CAPI_INTERFACE_CURRENT - $CAPI_INTERFACE_AGE`
@@ -3055,11 +3055,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -5639,7 +5639,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -9033,6 +9033,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -9254,7 +9257,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -9431,6 +9434,7 @@ _LT_EOF
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	link_all_deplibs=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -9884,7 +9888,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -10912,6 +10916,18 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -14165,7 +14181,7 @@ lt_prog_compiler_static_CXX=
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -14536,6 +14552,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs_CXX=no
+    ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -15161,6 +15180,18 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -17044,30 +17075,44 @@ if ${pgac_cv_type_int64_t_64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
+  # If cross-compiling, check the size reported by the compiler and
+# trust that the arithmetic works.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof(int64_t) == 8)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  pgac_cv_type_int64_t_64=yes
+else
   pgac_cv_type_int64_t_64=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64 bit arithmetic disabled when cross-compiling" >&5
-$as_echo "$as_me: WARNING: 64 bit arithmetic disabled when cross-compiling" >&2;}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-
-#include <inttypes.h>
-
-typedef int64_t int64;
+typedef int64_t ac_int64;
 
 /*
  * These are globals to discourage the compiler from folding all the
  * arithmetic tests down to compile-time constants.
  */
-int64 a = 20000001;
-int64 b = 40000005;
+ac_int64 a = 20000001;
+ac_int64 b = 40000005;
 
 int does_int64_work()
 {
-  int64 c,d;
+  ac_int64 c,d;
 
-  if (sizeof(int64) != 8)
+  if (sizeof(ac_int64) != 8)
     return 0;			/* definitely not the right size */
 
   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
@@ -17097,7 +17142,7 @@ $as_echo "$pgac_cv_type_int64_t_64" >&6; }
 HAVE_INT64_T_64=$pgac_cv_type_int64_t_64
 if test x"$pgac_cv_type_int64_t_64" = xyes ; then
 
-$as_echo "#define HAVE_INT64_T_64 /**/" >>confdefs.h
+$as_echo "#define HAVE_INT64_T_64 1" >>confdefs.h
 
 fi
 
@@ -17108,30 +17153,44 @@ if ${pgac_cv_type_long_int_64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
+  # If cross-compiling, check the size reported by the compiler and
+# trust that the arithmetic works.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof(long int) == 8)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  pgac_cv_type_long_int_64=yes
+else
   pgac_cv_type_long_int_64=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64 bit arithmetic disabled when cross-compiling" >&5
-$as_echo "$as_me: WARNING: 64 bit arithmetic disabled when cross-compiling" >&2;}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-
-#include <inttypes.h>
-
-typedef long int int64;
+typedef long int ac_int64;
 
 /*
  * These are globals to discourage the compiler from folding all the
  * arithmetic tests down to compile-time constants.
  */
-int64 a = 20000001;
-int64 b = 40000005;
+ac_int64 a = 20000001;
+ac_int64 b = 40000005;
 
 int does_int64_work()
 {
-  int64 c,d;
+  ac_int64 c,d;
 
-  if (sizeof(int64) != 8)
+  if (sizeof(ac_int64) != 8)
     return 0;			/* definitely not the right size */
 
   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
@@ -17161,7 +17220,7 @@ $as_echo "$pgac_cv_type_long_int_64" >&6; }
 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
 if test x"$pgac_cv_type_long_int_64" = xyes ; then
 
-$as_echo "#define HAVE_LONG_INT_64 /**/" >>confdefs.h
+$as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
 
 fi
 
@@ -17172,30 +17231,44 @@ if ${pgac_cv_type_long_long_int_64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
+  # If cross-compiling, check the size reported by the compiler and
+# trust that the arithmetic works.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  pgac_cv_type_long_long_int_64=yes
+else
   pgac_cv_type_long_long_int_64=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64 bit arithmetic disabled when cross-compiling" >&5
-$as_echo "$as_me: WARNING: 64 bit arithmetic disabled when cross-compiling" >&2;}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-
-#include <inttypes.h>
-
-typedef long long int int64;
+typedef long long int ac_int64;
 
 /*
  * These are globals to discourage the compiler from folding all the
  * arithmetic tests down to compile-time constants.
  */
-int64 a = 20000001;
-int64 b = 40000005;
+ac_int64 a = 20000001;
+ac_int64 b = 40000005;
 
 int does_int64_work()
 {
-  int64 c,d;
+  ac_int64 c,d;
 
-  if (sizeof(int64) != 8)
+  if (sizeof(ac_int64) != 8)
     return 0;			/* definitely not the right size */
 
   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
@@ -17225,7 +17298,7 @@ $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
 
-$as_echo "#define HAVE_LONG_LONG_INT_64 /**/" >>confdefs.h
+$as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
 
 fi
 
diff --git a/configure.in b/configure.in
index 76ca8c7..d8eccff 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl $Id: configure.in 3582 2012-04-01 20:42:27Z pramsey $
+dnl $Id: configure.in 3775 2013-02-28 10:38:25Z strk $
 dnl
 dnl configure.in - autoconf input template to produce ./configure script
 dnl
@@ -16,7 +16,7 @@ JTS_PORT=1.12.0
 
 dnl -- Version info for the CAPI
 CAPI_INTERFACE_CURRENT=8
-CAPI_INTERFACE_REVISION=4
+CAPI_INTERFACE_REVISION=8
 CAPI_INTERFACE_AGE=7
 
 dnl
@@ -25,7 +25,7 @@ dnl -- encoding ABI break at every release
 dnl
 VERSION_MAJOR=3
 VERSION_MINOR=3
-VERSION_PATCH=3
+VERSION_PATCH=8
 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
 
 dnl CAPI_VERSION_MAJOR=$(($CAPI_INTERFACE_CURRENT-$CAPI_INTERFACE_AGE))
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 592bcf3..4fe3519 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -23,7 +23,7 @@ PROJECT_NAME           =  GEOS
 # This could be handy for archiving the generated documentation or 
 # if some version control system is used.
 
-PROJECT_NUMBER         = 3.3.3
+PROJECT_NUMBER         = 3.3.8
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 93607ea..6c41d74 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -303,7 +303,7 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-example$(EXEEXT): $(example_OBJECTS) $(example_DEPENDENCIES) 
+example$(EXEEXT): $(example_OBJECTS) $(example_DEPENDENCIES) $(EXTRA_example_DEPENDENCIES) 
 	@rm -f example$(EXEEXT)
 	$(CXXLINK) $(example_OBJECTS) $(example_LDADD) $(LIBS)
 
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index d611572..8c23e79 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,5 +1,4 @@
 #################################################################################
-# $Id: CMakeLists.txt 3375 2011-05-22 23:34:04Z mloskot $
 #
 # GEOS C++ library build configuration for CMake build system
 #
diff --git a/include/Makefile.in b/include/Makefile.in
index cf6f520..02f9e87 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/config.h.in b/include/config.h.in
index 735e166..1113a1f 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -37,7 +37,7 @@
 /* Define to 1 if you have the <ieeefp.h> header file. */
 #undef HAVE_IEEEFP_H
 
-/* Set to 1 if `int64_t' is 64 bits */
+/* Define to 1 if `int64_t' works and is 64 bits. */
 #undef HAVE_INT64_T_64
 
 /* Define to 1 if you have the <inttypes.h> header file. */
@@ -49,10 +49,10 @@
 /* Has isnan */
 #undef HAVE_ISNAN
 
-/* Set to 1 if `long int' is 64 bits */
+/* Define to 1 if `long int' works and is 64 bits. */
 #undef HAVE_LONG_INT_64
 
-/* Set to 1 if `long long int' is 64 bits */
+/* Define to 1 if `long long int' works and is 64 bits. */
 #undef HAVE_LONG_LONG_INT_64
 
 /* Define to 1 if you have the `memcpy' function. */
diff --git a/include/geos/Makefile.in b/include/geos/Makefile.in
index 75cf9c3..16caac7 100644
--- a/include/geos/Makefile.in
+++ b/include/geos/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/algorithm/CentroidArea.h b/include/geos/algorithm/CentroidArea.h
index cca6aaf..b9eba72 100644
--- a/include/geos/algorithm/CentroidArea.h
+++ b/include/geos/algorithm/CentroidArea.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: CentroidArea.h 2556 2009-06-06 22:22:28Z strk $
+ * $Id: CentroidArea.h 3681 2012-06-22 15:46:04Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -12,6 +12,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ * Last port: algorithm/CentroidArea.java r612
+ *
  **********************************************************************/
 
 #ifndef GEOS_ALGORITHM_CENTROIDAREA_H
@@ -46,6 +50,10 @@ namespace algorithm { // geos::algorithm
  * The algorithm has been extended to handle holes and multi-polygons.
  * See <code>http://www.faqs.org/faqs/graphics/algorithms-faq/</code>
  * for further details of the basic approach.
+ * 
+ * The code has also be extended to handle degenerate (zero-area) polygons.
+ * In this case, the centroid of the line segments in the polygon
+ * will be returned.
  */
 class GEOS_DLL CentroidArea {
 
@@ -54,7 +62,8 @@ public:
 	CentroidArea()
 		:
 		basePt(0.0, 0.0),
-		areasum2(0)
+		areasum2(0.0),
+		totalLength(0.0)
 	{}
 
 	~CentroidArea() {}
@@ -75,9 +84,10 @@ public:
 	 */
 	void add(const geom::CoordinateSequence *ring);
 
+	// TODO: deprecate
 	geom::Coordinate* getCentroid() const;
 
-	/// Return false if a centroid couldn't be computed
+	/// Return false if a centroid couldn't be computed ( empty polygon )
 	bool getCentroid(geom::Coordinate& ret) const;
 
 private:
@@ -94,6 +104,10 @@ private:
 	/// partial centroid sum
 	geom::Coordinate cg3;
 
+	// data for linear centroid computation, if needed
+	geom::Coordinate centSum;
+	double totalLength;
+
 	void setBasePoint(const geom::Coordinate &newbasePt);
 
 	void add(const geom::Polygon *poly);
@@ -111,6 +125,17 @@ private:
 	static double area2(const geom::Coordinate &p1, const geom::Coordinate &p2,
 			const geom::Coordinate &p3);
 
+	/**
+	 * Adds the linear segments defined by an array of coordinates
+	 * to the linear centroid accumulators.
+	 *
+	 * This is done in case the polygon(s) have zero-area,
+	 * in which case the linear centroid is computed instead.
+	 *
+	 * @param pts an array of {@link Coordinate}s
+	 */
+	void addLinearSegments(const geom::CoordinateSequence& pts);
+
 };
 
 } // namespace geos::algorithm
@@ -118,11 +143,3 @@ private:
 
 
 #endif // GEOS_ALGORITHM_CENTROIDAREA_H
-
-/**********************************************************************
- * $Log$
- * Revision 1.1  2006/03/09 16:46:48  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/
-
diff --git a/include/geos/algorithm/InteriorPointArea.h b/include/geos/algorithm/InteriorPointArea.h
index c5e1bd8..51f0b8b 100644
--- a/include/geos/algorithm/InteriorPointArea.h
+++ b/include/geos/algorithm/InteriorPointArea.h
@@ -1,9 +1,10 @@
 /**********************************************************************
- * $Id: InteriorPointArea.h 2556 2009-06-06 22:22:28Z strk $
+ * $Id: InteriorPointArea.h 3746 2013-01-14 11:08:51Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2013 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -12,6 +13,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ * Last port: algorithm/InteriorPointArea.java r728 (JTS-1.13+)
+ *
  **********************************************************************/
 
 #ifndef GEOS_ALGORITHM_INTERIORPOINTAREA_H
diff --git a/include/geos/algorithm/Makefile.in b/include/geos/algorithm/Makefile.in
index 25c87cf..3d63900 100644
--- a/include/geos/algorithm/Makefile.in
+++ b/include/geos/algorithm/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/algorithm/distance/Makefile.in b/include/geos/algorithm/distance/Makefile.in
index 091c9f7..c827abf 100644
--- a/include/geos/algorithm/distance/Makefile.in
+++ b/include/geos/algorithm/distance/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/algorithm/locate/Makefile.in b/include/geos/algorithm/locate/Makefile.in
index 3fb380e..cb24fd6 100644
--- a/include/geos/algorithm/locate/Makefile.in
+++ b/include/geos/algorithm/locate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/geom/BinaryOp.h b/include/geos/geom/BinaryOp.h
index 5afd262..7e8554e 100644
--- a/include/geos/geom/BinaryOp.h
+++ b/include/geos/geom/BinaryOp.h
@@ -1,9 +1,10 @@
 /**********************************************************************
- * $Id: BinaryOp.h 3552 2011-12-15 14:18:38Z strk $
+ * $Id: BinaryOp.h 3750 2013-01-17 12:04:00Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2013 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2006 Refractions Research Inc.
  *
  * This is free software; you can redistribute and/or modify it under
@@ -50,6 +51,8 @@
 #define GEOS_GEOM_BINARYOP_H
 
 #include <geos/geom/Geometry.h>
+#include <geos/geom/GeometryCollection.h>
+#include <geos/geom/Polygon.h>
 #include <geos/geom/PrecisionModel.h>
 #include <geos/precision/CommonBitsRemover.h>
 #include <geos/precision/SimpleGeometryPrecisionReducer.h>
@@ -152,34 +155,52 @@ check_valid(const Geometry& g, const std::string& label)
 	return true;
 }
 
-/* A single component may become a multi component */
+/*
+ * Attempt to fix noding of multilines and
+ * self-intersection of multipolygons 
+ *
+ * May return the input untouched.
+ */
 inline std::auto_ptr<Geometry>
-fix_snap_collapses(std::auto_ptr<Geometry> g, const std::string& label)
+fix_self_intersections(std::auto_ptr<Geometry> g, const std::string& label)
 {
+#ifdef GEOS_DEBUG_BINARYOP
+	std::cerr << label << " fix_self_intersection (UnaryUnion)" << std::endl;
+#endif
 
-  // Areal geometries may become self-intersecting on snapping
-  if ( g->getGeometryTypeId() == GEOS_POLYGON ||
-       g->getGeometryTypeId() == GEOS_MULTIPOLYGON )
-  {
+  // Only multi-components can be fixed by UnaryUnion
+  if ( ! dynamic_cast<const GeometryCollection*>(g.get()) ) return g;
 
-    // TODO: use only ConsistentAreaTester
-    if ( ! check_valid(*g, label) ) {
-#if GEOS_DEBUG_BINARYOP
-      std::cerr << label << ": self-unioning" << std::endl;
+  using operation::valid::IsValidOp;
+
+  IsValidOp ivo(g.get());
+
+  // Polygon is valid, nothing to do
+  if ( ivo.isValid() ) return g;
+
+  // Not all invalidities can be fixed by this code
+
+  using operation::valid::TopologyValidationError;
+  TopologyValidationError* err = ivo.getValidationError();
+  switch ( err->getErrorType() ) {
+    case TopologyValidationError::eRingSelfIntersection:
+    case TopologyValidationError::eTooFewPoints: // collapsed lines
+#ifdef GEOS_DEBUG_BINARYOP
+	    std::cerr << label << " ATTEMPT_TO_FIX: " << err->getErrorType() << ": " << *g << std::endl;
 #endif
       g = g->Union();
-#if GEOS_DEBUG_BINARYOP
-      std::stringstream ss;
-      ss << label << " self-unioned";
-      check_valid(*g, ss.str());
+#ifdef GEOS_DEBUG_BINARYOP
+	    std::cerr << label << " ATTEMPT_TO_FIX succeeded.. " << std::endl;
 #endif
-    }
-
+      return g;
+    case TopologyValidationError::eSelfIntersection:
+      // this one is within a single component, won't be fixed
+    default:
+#ifdef GEOS_DEBUG_BINARYOP
+	    std::cerr << label << " invalidity is: " << err->getErrorType() << std::endl;
+#endif
+      return g;
   }
-
-  // TODO: check linear collapses ? (!isSimple)
-
-  return g;
 }
 
 
@@ -234,13 +255,12 @@ SnapOp(const Geometry* g0, const Geometry *g1, BinOp _Op)
 
 	GeometrySnapper snapper0( operand0 );
 	GeomPtr snapG0( snapper0.snapTo(operand1, snapTolerance) );
-	snapG0 = fix_snap_collapses(snapG0, "SNAP: snapped geom 0");
+	snapG0 = fix_self_intersections(snapG0, "SNAP: snapped geom 0");
 
 	// NOTE: second geom is snapped on the snapped first one
 	GeometrySnapper snapper1( operand1 );
 	GeomPtr snapG1( snapper1.snapTo(*snapG0, snapTolerance) );
-	snapG1 = fix_snap_collapses(snapG1, "SNAP: snapped geom 1");
-
+	snapG1 = fix_self_intersections(snapG1, "SNAP: snapped geom 1");
 
 	// Run the binary op
 	GeomPtr result( _Op(snapG0.get(), snapG1.get()) );
@@ -252,6 +272,7 @@ SnapOp(const Geometry* g0, const Geometry *g1, BinOp _Op)
 #if CBR_BEFORE_SNAPPING
 	// Add common bits back in
 	cbr.addCommonBits( result.get() );
+	result = fix_self_intersections(result, "SNAP: result (after common-bits addition)");
 #endif
 
 #if GEOS_DEBUG_BINARYOP
@@ -287,6 +308,13 @@ BinaryOp(const Geometry* g0, const Geometry *g1, BinOp _Op)
 		std::cerr << "Original exception: " << ex.what() << std::endl;
 #endif
 	}
+
+#if GEOS_DEBUG_BINARYOP
+  // Should we just give up here ?
+  check_valid(*g0, "Input geom 0");
+  check_valid(*g1, "Input geom 1");
+#endif
+
 #endif // USE_ORIGINAL_INPUT
 
 
@@ -328,7 +356,14 @@ BinaryOp(const Geometry* g0, const Geometry *g1, BinOp _Op)
 		cbr.addCommonBits( ret.get() ); 
 
 #if GEOS_DEBUG_BINARYOP
-		check_valid(*ret, "CBR: result (before common-bits addition)");
+		check_valid(*ret, "CBR: result (after common-bits addition)");
+#endif
+
+		// Common-bits removal policy could introduce self-intersections
+		ret = fix_self_intersections(ret, "CBR: result (after common-bits addition)");
+
+#if GEOS_DEBUG_BINARYOP
+		check_valid(*ret, "CBR: result (after common-bits addition and fix_self_intersections)");
 #endif
 
 #if GEOS_CHECK_COMMONBITS_VALIDITY
diff --git a/include/geos/geom/Geometry.h b/include/geos/geom/Geometry.h
index 0a99f42..fe188f1 100644
--- a/include/geos/geom/Geometry.h
+++ b/include/geos/geom/Geometry.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: Geometry.h 3538 2011-12-09 10:44:54Z strk $
+ * $Id: Geometry.h 3634 2012-05-21 14:12:06Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -850,8 +850,6 @@ private:
 	///
 	const GeometryFactory *factory;
 
-	static const GeometryFactory* INTERNAL_GEOMETRY_FACTORY;
-
 	void* userData;
 };
 
diff --git a/include/geos/geom/Makefile.in b/include/geos/geom/Makefile.in
index e586d18..a9b38d9 100644
--- a/include/geos/geom/Makefile.in
+++ b/include/geos/geom/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/geom/prep/Makefile.in b/include/geos/geom/prep/Makefile.in
index c73605d..cd62af3 100644
--- a/include/geos/geom/prep/Makefile.in
+++ b/include/geos/geom/prep/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/geom/util/GeometryExtracter.h b/include/geos/geom/util/GeometryExtracter.h
index 794660a..64f69a3 100644
--- a/include/geos/geom/util/GeometryExtracter.h
+++ b/include/geos/geom/util/GeometryExtracter.h
@@ -19,8 +19,8 @@
  *
  **********************************************************************/
 
-#ifndef GEOS_GEOM_UTIL_POINTEXTRACTER_H
-#define GEOS_GEOM_UTIL_POINTEXTRACTER_H
+#ifndef GEOS_GEOM_UTIL_GEOMETRYEXTRACTER_H
+#define GEOS_GEOM_UTIL_GEOMETRYEXTRACTER_H
 
 #include <geos/export.h>
 #include <geos/geom/GeometryFilter.h>
diff --git a/include/geos/geom/util/Makefile.in b/include/geos/geom/util/Makefile.in
index a396645..20a7db4 100644
--- a/include/geos/geom/util/Makefile.in
+++ b/include/geos/geom/util/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/geomgraph/Makefile.in b/include/geos/geomgraph/Makefile.in
index 5fb2585..d37f915 100644
--- a/include/geos/geomgraph/Makefile.in
+++ b/include/geos/geomgraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/geomgraph/index/Makefile.in b/include/geos/geomgraph/index/Makefile.in
index 04cbfbf..36305aa 100644
--- a/include/geos/geomgraph/index/Makefile.in
+++ b/include/geos/geomgraph/index/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/Makefile.in b/include/geos/index/Makefile.in
index 0bee422..9b27305 100644
--- a/include/geos/index/Makefile.in
+++ b/include/geos/index/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/bintree/Makefile.in b/include/geos/index/bintree/Makefile.in
index 33f7d52..84587c9 100644
--- a/include/geos/index/bintree/Makefile.in
+++ b/include/geos/index/bintree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/chain/Makefile.in b/include/geos/index/chain/Makefile.in
index fd4fd08..43c8950 100644
--- a/include/geos/index/chain/Makefile.in
+++ b/include/geos/index/chain/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/intervalrtree/Makefile.in b/include/geos/index/intervalrtree/Makefile.in
index cd92ade..52614c9 100644
--- a/include/geos/index/intervalrtree/Makefile.in
+++ b/include/geos/index/intervalrtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/quadtree/Makefile.in b/include/geos/index/quadtree/Makefile.in
index 45f4e33..5e5b957 100644
--- a/include/geos/index/quadtree/Makefile.in
+++ b/include/geos/index/quadtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/strtree/Makefile.in b/include/geos/index/strtree/Makefile.in
index f4a155c..ee77d5f 100644
--- a/include/geos/index/strtree/Makefile.in
+++ b/include/geos/index/strtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/index/sweepline/Makefile.in b/include/geos/index/sweepline/Makefile.in
index ef939ae..22f66c1 100644
--- a/include/geos/index/sweepline/Makefile.in
+++ b/include/geos/index/sweepline/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/io/CLocalizer.h b/include/geos/io/CLocalizer.h
index d88e692..295d3d2 100644
--- a/include/geos/io/CLocalizer.h
+++ b/include/geos/io/CLocalizer.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: CLocalizer.h 2958 2010-03-29 11:29:40Z mloskot $
+ * $Id: CLocalizer.h 3763 2013-02-01 06:34:23Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -17,6 +17,9 @@
  *
  **********************************************************************/
 
+#ifndef GEOS_IO_CLOCALIZER_H
+#define GEOS_IO_CLOCALIZER_H
+
 #include <geos/export.h>
 
 #include <string>
@@ -51,3 +54,4 @@ private:
 } // namespace io
 } // namespace geos
 
+#endif // GEOS_IO_CLOCALIZER_H
diff --git a/include/geos/io/Makefile.in b/include/geos/io/Makefile.in
index 7bfdf8a..d046efb 100644
--- a/include/geos/io/Makefile.in
+++ b/include/geos/io/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/linearref/LocationIndexOfLine.h b/include/geos/linearref/LocationIndexOfLine.h
index 5deb726..e2aff89 100644
--- a/include/geos/linearref/LocationIndexOfLine.h
+++ b/include/geos/linearref/LocationIndexOfLine.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: LocationIndexOfLine.h 2809 2009-12-06 01:05:24Z mloskot $
+ * $Id: LocationIndexOfLine.h 3761 2013-02-01 06:31:04Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -14,12 +14,12 @@
  *
  **********************************************************************
  *
- * Last port: linearref/LinearGeometryBuilder.java rev. 1.10
+ * Last port: linearref/LocationIndexOfLine.java r731
  *
  **********************************************************************/
 
-#ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
-#define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
+#ifndef GEOS_LINEARREF_LOCATIONINDEXOFLINE_H
+#define GEOS_LINEARREF_LOCATIONINDEXOFLINE_H
 
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/Geometry.h>
diff --git a/include/geos/linearref/Makefile.in b/include/geos/linearref/Makefile.in
index b2252ef..680378b 100644
--- a/include/geos/linearref/Makefile.in
+++ b/include/geos/linearref/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/noding/Makefile.in b/include/geos/noding/Makefile.in
index a074921..7baca17 100644
--- a/include/geos/noding/Makefile.in
+++ b/include/geos/noding/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/noding/snapround/Makefile.in b/include/geos/noding/snapround/Makefile.in
index a01d58c..89d8b84 100644
--- a/include/geos/noding/snapround/Makefile.in
+++ b/include/geos/noding/snapround/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/Makefile.in b/include/geos/operation/Makefile.in
index dfabd70..1eb5e82 100644
--- a/include/geos/operation/Makefile.in
+++ b/include/geos/operation/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/buffer/Makefile.in b/include/geos/operation/buffer/Makefile.in
index 5dcab1f..97755ce 100644
--- a/include/geos/operation/buffer/Makefile.in
+++ b/include/geos/operation/buffer/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/distance/Makefile.in b/include/geos/operation/distance/Makefile.in
index d6ec018..3e4f928 100644
--- a/include/geos/operation/distance/Makefile.in
+++ b/include/geos/operation/distance/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/linemerge/Makefile.in b/include/geos/operation/linemerge/Makefile.in
index 78a91cd..923182f 100644
--- a/include/geos/operation/linemerge/Makefile.in
+++ b/include/geos/operation/linemerge/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/overlay/Makefile.in b/include/geos/operation/overlay/Makefile.in
index b348f34..380cf12 100644
--- a/include/geos/operation/overlay/Makefile.in
+++ b/include/geos/operation/overlay/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/overlay/snap/Makefile.in b/include/geos/operation/overlay/snap/Makefile.in
index 9b55674..7854690 100644
--- a/include/geos/operation/overlay/snap/Makefile.in
+++ b/include/geos/operation/overlay/snap/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/polygonize/Makefile.in b/include/geos/operation/polygonize/Makefile.in
index b336eb1..9caf554 100644
--- a/include/geos/operation/polygonize/Makefile.in
+++ b/include/geos/operation/polygonize/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/predicate/Makefile.in b/include/geos/operation/predicate/Makefile.in
index 2aa94fb..d749b6e 100644
--- a/include/geos/operation/predicate/Makefile.in
+++ b/include/geos/operation/predicate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/relate/Makefile.in b/include/geos/operation/relate/Makefile.in
index 4aeb6ca..bf1deb5 100644
--- a/include/geos/operation/relate/Makefile.in
+++ b/include/geos/operation/relate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/sharedpaths/Makefile.in b/include/geos/operation/sharedpaths/Makefile.in
index 8d57b58..8b01dc1 100644
--- a/include/geos/operation/sharedpaths/Makefile.in
+++ b/include/geos/operation/sharedpaths/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/union/Makefile.in b/include/geos/operation/union/Makefile.in
index 8200bc8..4d0c502 100644
--- a/include/geos/operation/union/Makefile.in
+++ b/include/geos/operation/union/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/operation/union/UnaryUnionOp.h b/include/geos/operation/union/UnaryUnionOp.h
index 72cbae8..9abbc22 100644
--- a/include/geos/operation/union/UnaryUnionOp.h
+++ b/include/geos/operation/union/UnaryUnionOp.h
@@ -25,11 +25,13 @@
 
 #include <geos/export.h>
 #include <geos/geom/GeometryFactory.h>
+#include <geos/geom/BinaryOp.h>
 #include <geos/geom/Point.h>
 #include <geos/geom/LineString.h>
 #include <geos/geom/Polygon.h>
 #include <geos/geom/util/GeometryExtracter.h>
-#include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
+#include <geos/operation/overlay/OverlayOp.h>
+//#include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
 
 #ifdef _MSC_VER
 #pragma warning(push)
@@ -183,12 +185,13 @@ private:
   std::auto_ptr<geom::Geometry> unionNoOpt(const geom::Geometry& g0)
   {
     using geos::operation::overlay::OverlayOp;
-    using geos::operation::overlay::snap::SnapIfNeededOverlayOp;
+    //using geos::operation::overlay::snap::SnapIfNeededOverlayOp;
 
     if ( ! empty.get() ) {
       empty.reset( geomFact->createEmptyGeometry() );
     }
-    return SnapIfNeededOverlayOp::overlayOp(g0, *empty, OverlayOp::opUNION);
+    //return SnapIfNeededOverlayOp::overlayOp(g0, *empty, OverlayOp::opUNION);
+    return BinaryOp(&g0, empty.get(), overlay::overlayOp(OverlayOp::opUNION));
   }
 
   /**
diff --git a/include/geos/operation/valid/Makefile.in b/include/geos/operation/valid/Makefile.in
index a39cc10..10fba3b 100644
--- a/include/geos/operation/valid/Makefile.in
+++ b/include/geos/operation/valid/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/planargraph/Makefile.in b/include/geos/planargraph/Makefile.in
index c5f15b1..ed1d778 100644
--- a/include/geos/planargraph/Makefile.in
+++ b/include/geos/planargraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/planargraph/algorithm/Makefile.in b/include/geos/planargraph/algorithm/Makefile.in
index f347ccf..695db23 100644
--- a/include/geos/planargraph/algorithm/Makefile.in
+++ b/include/geos/planargraph/algorithm/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/platform.h b/include/geos/platform.h
index ebfd6bf..ed641c0 100644
--- a/include/geos/platform.h
+++ b/include/geos/platform.h
@@ -3,10 +3,10 @@
 #define GEOS_PLATFORM_H
 
 /* Set to 1 if you have `int64_t' type */
-#define HAVE_INT64_T_64 /**/
+/* #undef HAVE_INT64_T_64 */
 
 /* Set to 1 if `long int' is 64 bits */
-/* #undef HAVE_LONG_INT_64 */
+#define HAVE_LONG_INT_64 1
 
 /* Set to 1 if `long long int' is 64 bits */
 /* #undef HAVE_LONG_LONG_INT_64 */
@@ -21,7 +21,7 @@
 #define HAVE_ISFINITE 1
 
 /* Has isnan */
-/* #undef HAVE_ISNAN */
+#define HAVE_ISNAN 1
 
 #ifdef HAVE_IEEEFP_H
 extern "C"
diff --git a/include/geos/precision/Makefile.in b/include/geos/precision/Makefile.in
index c377bcb..46f1f23 100644
--- a/include/geos/precision/Makefile.in
+++ b/include/geos/precision/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/simplify/Makefile.in b/include/geos/simplify/Makefile.in
index 8adbcc4..dd66ef7 100644
--- a/include/geos/simplify/Makefile.in
+++ b/include/geos/simplify/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/simplify/TaggedLineStringSimplifier.h b/include/geos/simplify/TaggedLineStringSimplifier.h
index c2a9c6c..a9fdc5c 100644
--- a/include/geos/simplify/TaggedLineStringSimplifier.h
+++ b/include/geos/simplify/TaggedLineStringSimplifier.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: TaggedLineStringSimplifier.h 2958 2010-03-29 11:29:40Z mloskot $
+ * $Id: TaggedLineStringSimplifier.h 3626 2012-05-09 18:02:09Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: simplify/TaggedLineStringSimplifier.java rev. 1.8 (JTS-1.7.1)
+ * Last port: simplify/TaggedLineStringSimplifier.java r536 (JTS-1.12+)
  *
  **********************************************************************
  *
@@ -78,6 +78,12 @@ public:
 	 */
 	void setDistanceTolerance(double d);
 
+	/**
+	 * Simplifies the given {@link TaggedLineString}
+	 * using the distance tolerance specified.
+	 *
+	 * @param line the linestring to simplify
+	 */
 	void simplify(TaggedLineString* line);
 
 
@@ -164,16 +170,3 @@ TaggedLineStringSimplifier::setDistanceTolerance(double d)
 
 #endif // GEOS_SIMPLIFY_TAGGEDLINESTRINGSIMPLIFIER_H
 
-/**********************************************************************
- * $Log$
- * Revision 1.3  2006/04/13 21:52:34  strk
- * Many debugging lines and assertions added. Fixed bug in TaggedLineString class.
- *
- * Revision 1.2  2006/04/13 10:39:12  strk
- * Initial implementation of TaggedLinesSimplifier class
- *
- * Revision 1.1  2006/04/12 17:19:57  strk
- * Ported TaggedLineStringSimplifier class, made LineSegment class
- * polymorphic to fix derivation of TaggedLineSegment
- *
- **********************************************************************/
diff --git a/include/geos/simplify/TopologyPreservingSimplifier.h b/include/geos/simplify/TopologyPreservingSimplifier.h
index 33220f2..f061208 100644
--- a/include/geos/simplify/TopologyPreservingSimplifier.h
+++ b/include/geos/simplify/TopologyPreservingSimplifier.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: TopologyPreservingSimplifier.h 2958 2010-03-29 11:29:40Z mloskot $
+ * $Id: TopologyPreservingSimplifier.h 3626 2012-05-09 18:02:09Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: simplify/TopologyPreservingSimplifier.java rev. 1.4 (JTS-1.7)
+ * Last port: simplify/TopologyPreservingSimplifier.java r536 (JTS-1.12+)
  *
  **********************************************************************
  *
diff --git a/include/geos/util/Makefile.in b/include/geos/util/Makefile.in
index ed2cb46..351c1a0 100644
--- a/include/geos/util/Makefile.in
+++ b/include/geos/util/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/include/geos/version.h b/include/geos/version.h
index 239224f..63f0085 100644
--- a/include/geos/version.h
+++ b/include/geos/version.h
@@ -24,11 +24,11 @@
 #endif
 
 #ifndef GEOS_VERSION_PATCH
-#define GEOS_VERSION_PATCH 3
+#define GEOS_VERSION_PATCH 8
 #endif
 
 #ifndef GEOS_VERSION
-#define GEOS_VERSION "3.3.3"
+#define GEOS_VERSION "3.3.8"
 #endif
 
 #ifndef GEOS_JTS_PORT
diff --git a/include/geos/version.h.vc b/include/geos/version.h.vc
index 8437943..4a4f78c 100644
--- a/include/geos/version.h.vc
+++ b/include/geos/version.h.vc
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: version.h.vc 2828 2009-12-14 19:18:34Z pramsey $
+ * $Id: version.h.vc 3757 2013-01-25 17:29:36Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -35,15 +35,15 @@
 #endif
 
 #ifndef GEOS_VERSION_PATCH
-#define GEOS_VERSION_PATCH 0
+#define GEOS_VERSION_PATCH 8
 #endif
 
 #ifndef GEOS_VERSION
-#define GEOS_VERSION "3.3.0"
+#define GEOS_VERSION "3.3.8"
 #endif
 
 #ifndef GEOS_JTS_PORT
-#define GEOS_JTS_PORT "1.10.0"
+#define GEOS_JTS_PORT "1.12.0"
 #endif
 
 #endif // GEOS_VERSION_H_INCLUDED
diff --git a/ltmain.sh b/ltmain.sh
index 63ae69d..c2852d8 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
+VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
@@ -6124,7 +6124,10 @@ func_mode_link ()
 	case $pass in
 	dlopen) libs="$dlfiles" ;;
 	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
 	esac
       fi
       if test "$linkmode,$pass" = "lib,dlpreopen"; then
@@ -6444,19 +6447,19 @@ func_mode_link ()
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_preserve_dup_deps ; then
+		case "$tmp_libs " in
+		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+		esac
+	      fi
+	      func_append tmp_libs " $deplib"
+	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
 	  continue
 	fi # $pass = conv
 
@@ -7349,6 +7352,9 @@ func_mode_link ()
 	    revision="$number_minor"
 	    lt_irix_increment=no
 	    ;;
+	  *)
+	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+	    ;;
 	  esac
 	  ;;
 	no)
diff --git a/macros/Makefile.in b/macros/Makefile.in
index ad23912..29d345d 100644
--- a/macros/Makefile.in
+++ b/macros/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/macros/libtool.m4 b/macros/libtool.m4
index 44e0ecf..828104c 100644
--- a/macros/libtool.m4
+++ b/macros/libtool.m4
@@ -2684,6 +2684,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -3289,7 +3301,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -4101,7 +4113,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4578,6 +4590,9 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4640,6 +4655,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4861,7 +4879,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -5038,6 +5056,7 @@ _LT_EOF
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -5342,7 +5361,7 @@ _LT_EOF
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
diff --git a/missing b/missing
index 28055d2..86a8fc3 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@ Supported PROGRAM values:
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@ WARNING: \`$1' $msg.  You should only need it if
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@ WARNING: \`$1' is $msg.  You should only need it if
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
diff --git a/php/Makefile.in b/php/Makefile.in
index ac91fe4..49a5824 100644
--- a/php/Makefile.in
+++ b/php/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -433,7 +433,7 @@ clean-pkglibLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-geos.la: $(geos_la_OBJECTS) $(geos_la_DEPENDENCIES) 
+geos.la: $(geos_la_OBJECTS) $(geos_la_DEPENDENCIES) $(EXTRA_geos_la_DEPENDENCIES) 
 	$(geos_la_LINK) $(am_geos_la_rpath) $(geos_la_OBJECTS) $(geos_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/php/README b/php/README
index 11fdb31..a2e6913 100644
--- a/php/README
+++ b/php/README
@@ -28,6 +28,11 @@ togheter with the rest of the GEOS testsuite.
 You can still run 'make check' from this dir for
 localized (php-only) testing.
 
+Note that you'll need phpunit installed for this to work.
+To install:
+
+  sudo pear install --force --alldeps phpunit/phpunit
+
 INSTALL
 -------
 
diff --git a/php/geos.c b/php/geos.c
index f64fce0..d9c44e7 100644
--- a/php/geos.c
+++ b/php/geos.c
@@ -44,7 +44,11 @@ PHP_FUNCTION(GEOSLineMerge);
 PHP_FUNCTION(GEOSSharedPaths);
 PHP_FUNCTION(GEOSRelateMatch);
 
-static function_entry geos_functions[] = {
+#if PHP_VERSION_ID < 50399 
+#define zend_function_entry function_entry
+#endif
+
+static zend_function_entry geos_functions[] = {
     PHP_FE(GEOSVersion, NULL)
     PHP_FE(GEOSPolygonize, NULL)
     PHP_FE(GEOSLineMerge, NULL)
@@ -161,8 +165,12 @@ Gen_create_obj (zend_class_entry *type TSRMLS_DC,
 
     ALLOC_HASHTABLE(obj->std.properties);
     zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+#if PHP_VERSION_ID < 50399 
     zend_hash_copy(obj->std.properties, &type->default_properties,
         (copy_ctor_func_t)zval_add_ref, (void *)&tmp, sizeof(zval *));
+#else
+    object_properties_init(&(obj->std), type);
+#endif
 
     retval.handle = zend_objects_store_put(obj, NULL, st, NULL TSRMLS_CC);
     retval.handlers = handlers;
@@ -233,7 +241,7 @@ PHP_METHOD(Geometry, distance);
 PHP_METHOD(Geometry, hausdorffDistance);
 PHP_METHOD(Geometry, snapTo);
 
-static function_entry Geometry_methods[] = {
+static zend_function_entry Geometry_methods[] = {
     PHP_ME(Geometry, __construct, NULL, 0)
     PHP_ME(Geometry, __toString, NULL, 0)
     PHP_ME(Geometry, project, NULL, 0)
@@ -1906,7 +1914,7 @@ PHP_METHOD(Geometry, snapTo)
 PHP_METHOD(WKTReader, __construct);
 PHP_METHOD(WKTReader, read);
 
-static function_entry WKTReader_methods[] = {
+static zend_function_entry WKTReader_methods[] = {
     PHP_ME(WKTReader, __construct, NULL, 0)
     PHP_ME(WKTReader, read, NULL, 0)
     {NULL, NULL, NULL}
@@ -1984,7 +1992,7 @@ PHP_METHOD(WKTWriter, setOutputDimension);
 PHP_METHOD(WKTWriter, getOutputDimension);
 PHP_METHOD(WKTWriter, setOld3D);
 
-static function_entry WKTWriter_methods[] = {
+static zend_function_entry WKTWriter_methods[] = {
     PHP_ME(WKTWriter, __construct, NULL, 0)
     PHP_ME(WKTWriter, write, NULL, 0)
     PHP_ME(WKTWriter, setTrim, NULL, 0)
@@ -2156,7 +2164,7 @@ PHP_METHOD(WKBWriter, setIncludeSRID);
 PHP_METHOD(WKBWriter, getIncludeSRID);
 PHP_METHOD(WKBWriter, writeHEX);
 
-static function_entry WKBWriter_methods[] = {
+static zend_function_entry WKBWriter_methods[] = {
     PHP_ME(WKBWriter, __construct, NULL, 0)
     PHP_ME(WKBWriter, getOutputDimension, NULL, 0)
     PHP_ME(WKBWriter, setOutputDimension, NULL, 0)
@@ -2352,7 +2360,7 @@ PHP_METHOD(WKBWriter, setIncludeSRID)
 PHP_METHOD(WKBReader, __construct);
 PHP_METHOD(WKBReader, readHEX);
 
-static function_entry WKBReader_methods[] = {
+static zend_function_entry WKBReader_methods[] = {
     PHP_ME(WKBReader, __construct, NULL, 0)
     PHP_ME(WKBReader, readHEX, NULL, 0)
     {NULL, NULL, NULL}
diff --git a/php/test/Makefile.in b/php/test/Makefile.in
index 532e8ea..8f69436 100644
--- a/php/test/Makefile.in
+++ b/php/test/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/php/test/test.php b/php/test/test.php
index fc3d6ca..50f772d 100644
--- a/php/test/test.php
+++ b/php/test/test.php
@@ -5,11 +5,21 @@
 
 dl("geos.so");
 
-require_once 'PHPUnit/Framework.php';
+if ( version_compare(PHPUnit_Runner_Version::id(), '3.6') < 0 )
+    require_once 'PHPUnit/Framework.php';
 
 
 class test extends PHPUnit_Framework_TestCase
 {
+    # This method override is needed to support phpunit < 3.5 (Ubuntu 10.04 ships 3.4)
+    static public function assertType($x, $y)
+    {
+        #global $phpunit_version;
+        if ( version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0 )
+            return PHPUnit_Framework_TestCase::assertType($x, $y);
+        else return PHPUnit_Framework_TestCase::assertInternalType($x, $y);
+    }
+
     public function testGEOSVersion()
     {
         $this->assertContains('-CAPI-', GEOSVersion());
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bebcc86..f29e52b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,4 @@
 #################################################################################
-# $Id: CMakeLists.txt 3485 2011-09-23 15:59:11Z strk $
 #
 # GEOS C++ library build configuration for CMake build system
 #
@@ -15,7 +14,7 @@
 file(GLOB_RECURSE geos_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
 file(GLOB_RECURSE geos_ALL_HEADERS ${CMAKE_SOURCE_DIR}/include/*.h) # fix source_group issue
 
-if(APPLE AND GEOS_ENABLE_MACOSX_FRAMEWORK)
+if(GEOS_ENABLE_MACOSX_FRAMEWORK)
   # OS X frameworks don't have static libs
   # also 1 binary, so include CAPI here
   # and, make name all caps
@@ -65,7 +64,6 @@ else()
   add_library(geos SHARED ${geos_SOURCES} ${geos_ALL_HEADERS})
   add_library(geos-static STATIC ${geos_SOURCES} ${geos_ALL_HEADERS})
 
-# TODO: Enable SOVERSION property
   set_target_properties(geos
     PROPERTIES
     DEFINE_SYMBOL GEOS_DLL_EXPORT
@@ -78,20 +76,20 @@ else()
     PREFIX "lib"
     CLEAN_DIRECT_OUTPUT 1)
 
-if(APPLE)
-  set_target_properties(geos
-    PROPERTIES
-    BUILD_WITH_INSTALL_RPATH TRUE
-    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}")
-
-endif()
 endif()
 
+# if(APPLE)
+#   set_target_properties(geos
+#     PROPERTIES
+#     BUILD_WITH_INSTALL_RPATH TRUE
+#     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}")
+# endif()
+
 #################################################################################
 # Installation
 #################################################################################
 
-if(NOT APPLE AND NOT GEOS_ENABLE_MACOSX_FRAMEWORK)
+if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK)
   install(TARGETS geos geos-static
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
diff --git a/src/Makefile.am b/src/Makefile.am
index 6762bc0..57baa4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 3381 2011-05-27 14:04:18Z strk $
+# $Id: Makefile.am 3664 2012-06-06 07:04:45Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -22,6 +22,10 @@ INCLUDES = -I$(top_srcdir)/include
 
 lib_LTLIBRARIES = libgeos.la
 
+# libgeos uses -release because it is not feasible to know if the ABI
+# has changed between releases; the project chooses not to expend the
+# effort to determine this because depending programs should not be
+# using the C++ library.
 libgeos_la_LDFLAGS = \
     -release @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@ \
     -no-undefined
diff --git a/src/Makefile.in b/src/Makefile.in
index d64cba2..16c69d2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -321,7 +321,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# $Id: Makefile.am 3381 2011-05-27 14:04:18Z strk $
+# $Id: Makefile.am 3664 2012-06-06 07:04:45Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -342,6 +342,11 @@ SUBDIRS = \
 EXTRA_DIST = Makefile.vc dirlist.mk CMakeLists.txt info.plist.in
 INCLUDES = -I$(top_srcdir)/include
 lib_LTLIBRARIES = libgeos.la
+
+# libgeos uses -release because it is not feasible to know if the ABI
+# has changed between releases; the project chooses not to expend the
+# effort to determine this because depending programs should not be
+# using the C++ library.
 libgeos_la_LDFLAGS = \
     -release @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@ \
     -no-undefined
@@ -428,7 +433,7 @@ clean-libLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeos.la: $(libgeos_la_OBJECTS) $(libgeos_la_DEPENDENCIES) 
+libgeos.la: $(libgeos_la_OBJECTS) $(libgeos_la_DEPENDENCIES) $(EXTRA_libgeos_la_DEPENDENCIES) 
 	$(libgeos_la_LINK) -rpath $(libdir) $(libgeos_la_OBJECTS) $(libgeos_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/algorithm/CentroidArea.cpp b/src/algorithm/CentroidArea.cpp
index c5a4d12..6bac25b 100644
--- a/src/algorithm/CentroidArea.cpp
+++ b/src/algorithm/CentroidArea.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: CentroidArea.cpp 1986 2007-06-08 15:27:42Z mloskot $
+ * $Id: CentroidArea.cpp 3774 2013-02-28 09:45:21Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -14,6 +14,8 @@
  *
  **********************************************************************
  *
+ * Last port: algorithm/CentroidArea.java r612
+ *
  **********************************************************************/
 
 #include <geos/algorithm/CentroidArea.h>
@@ -36,7 +38,8 @@ namespace algorithm { // geos.algorithm
 void
 CentroidArea::add(const Geometry *geom)
 {
-	if(const Polygon *poly=dynamic_cast<const Polygon*>(geom)) {
+  if(geom->isEmpty()) return;
+	else if(const Polygon *poly=dynamic_cast<const Polygon*>(geom)) {
 		setBasePoint(poly->getExteriorRing()->getCoordinateN(0));
 		add(poly);
 	}
@@ -57,20 +60,25 @@ CentroidArea::add(const CoordinateSequence *ring)
 	addShell(ring);
 }
 
+/* TODO: deprecate this */
 Coordinate*
 CentroidArea::getCentroid() const
 {
 	Coordinate *cent = new Coordinate();
-	cent->x = cg3.x/3.0/areasum2;
-	cent->y = cg3.y/3.0/areasum2;
+	getCentroid(*cent); // or return NULL on failure !
 	return cent;
 }
 
 bool
 CentroidArea::getCentroid(Coordinate& ret) const
 {
-	if ( areasum2 == 0.0 ) return false;
-	ret=Coordinate(cg3.x/3.0/areasum2, cg3.y/3.0/areasum2);
+	if ( areasum2 ) {
+		ret = Coordinate(cg3.x/3.0/areasum2, cg3.y/3.0/areasum2);
+	} else if ( totalLength ) {
+		ret = Coordinate(centSum.x/totalLength, centSum.y/totalLength);
+	} else {
+		return false;
+	}
 	return true;
 }
 
@@ -94,11 +102,12 @@ void
 CentroidArea::addShell(const CoordinateSequence *pts)
 {
 	bool isPositiveArea=!CGAlgorithms::isCCW(pts);
-    std::size_t const n=pts->getSize()-1;
+	std::size_t const n=pts->getSize()-1;
 	for(std::size_t i=0; i<n; ++i)
 	{
 		addTriangle(basePt, pts->getAt(i), pts->getAt(i+1), isPositiveArea);
 	}
+	addLinearSegments(*pts);
 }
 
 void
@@ -110,6 +119,7 @@ CentroidArea::addHole(const CoordinateSequence *pts)
 	{
 		addTriangle(basePt, pts->getAt(i), pts->getAt(i+1), isPositiveArea);
 	}
+	addLinearSegments(*pts);
 }
 
 void
@@ -147,24 +157,20 @@ CentroidArea::area2(const Coordinate &p1, const Coordinate &p2, const Coordinate
 	return (p2.x-p1.x)*(p3.y-p1.y)-(p3.x-p1.x)*(p2.y-p1.y);
 }
 
+void
+CentroidArea::addLinearSegments(const geom::CoordinateSequence& pts)
+{
+	std::size_t const n = pts.size()-1;
+	for (std::size_t i = 0; i < n; ++i) {
+		double segmentLen = pts[i].distance(pts[i + 1]);
+		totalLength += segmentLen;
+
+		double midx = (pts[i].x + pts[i + 1].x) / 2;
+		centSum.x += segmentLen * midx;
+		double midy = (pts[i].y + pts[i + 1].y) / 2;
+		centSum.y += segmentLen * midy;
+	}
+}
+
 } // namespace geos.algorithm
 } //namespace geos
-
-/**********************************************************************
- * $Log$
- * Revision 1.24  2006/06/08 17:58:57  strk
- * Polygon::getNumInteriorRing() return size_t, Polygon::interiorRingN() takes size_t.
- *
- * Revision 1.23  2006/04/07 09:54:28  strk
- * Geometry::getNumGeometries() changed to return 'unsigned int'
- * rather then 'int'
- *
- * Revision 1.22  2006/03/21 11:12:23  strk
- * Cleanups: headers inclusion and Log section
- *
- * Revision 1.21  2006/03/09 16:46:45  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/
-
-
diff --git a/src/algorithm/InteriorPointArea.cpp b/src/algorithm/InteriorPointArea.cpp
index 5b223eb..82c1b64 100644
--- a/src/algorithm/InteriorPointArea.cpp
+++ b/src/algorithm/InteriorPointArea.cpp
@@ -3,7 +3,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
- * Copyright (C) 2011      Sandro Santilli <strk at keybit.net>
+ * Copyright (C) 2013 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -12,6 +12,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ * Last port: algorithm/InteriorPointArea.java r728 (JTS-1.13+)
+ *
  **********************************************************************/
 
 #include <geos/algorithm/InteriorPointArea.h>
@@ -89,13 +93,25 @@ InteriorPointArea::add(const Geometry *geom)
 void
 InteriorPointArea::addPolygon(const Geometry *geometry)
 {
+  if (geometry->isEmpty()) return;
+
+  Coordinate intPt;
+  double width;
+
   auto_ptr<LineString> bisector ( horizontalBisector(geometry) );
-  auto_ptr<Geometry> intersections ( bisector->intersection(geometry) );
-  const Geometry *widestIntersection = widestGeometry(intersections.get());
-  const Envelope *env = widestIntersection->getEnvelopeInternal();
-  double width=env->getWidth();
+  if ( bisector->getLength() == 0.0 ) {
+    width = 0;
+    intPt = bisector->getCoordinateN(0);
+  }
+  else {
+    auto_ptr<Geometry> intersections ( bisector->intersection(geometry) );
+    const Geometry *widestIntersection = widestGeometry(intersections.get());
+    const Envelope *env = widestIntersection->getEnvelopeInternal();
+    width=env->getWidth();
+    env->centre(intPt);
+  }
   if (!foundInterior || width>maxWidth) {
-    env->centre(interiorPoint);
+    interiorPoint = intPt;
     maxWidth = width;
     foundInterior=true;
   }
diff --git a/src/algorithm/InteriorPointLine.cpp b/src/algorithm/InteriorPointLine.cpp
index d6b7665..94c1c32 100644
--- a/src/algorithm/InteriorPointLine.cpp
+++ b/src/algorithm/InteriorPointLine.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: InteriorPointLine.cpp 3164 2010-12-24 14:27:46Z strk $
+ * $Id: InteriorPointLine.cpp 3739 2013-01-11 14:25:46Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -48,8 +48,8 @@ InteriorPointLine::InteriorPointLine(const Geometry *g)
 		std::cerr << "Centroid: " << centroid << std::endl;
 #endif
 		addInterior(g);
-		if (!hasInterior) addEndpoints(g);
 	}
+	if (!hasInterior) addEndpoints(g);
 }
 
 InteriorPointLine::~InteriorPointLine()
@@ -119,8 +119,11 @@ InteriorPointLine::addEndpoints(const Geometry *geom)
 void
 InteriorPointLine::addEndpoints(const CoordinateSequence *pts)
 {
-	add(pts->getAt(0));
-	add(pts->getAt(pts->getSize()-1));
+  size_t npts = pts->size();
+  if ( npts ) {
+    add(pts->getAt(0));
+    if ( npts > 1 ) add(pts->getAt(npts-1));
+  }
 }
 
 /*private*/
diff --git a/src/algorithm/Makefile.in b/src/algorithm/Makefile.in
index bd266de..a423f83 100644
--- a/src/algorithm/Makefile.in
+++ b/src/algorithm/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -377,7 +377,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libalgorithm.la: $(libalgorithm_la_OBJECTS) $(libalgorithm_la_DEPENDENCIES) 
+libalgorithm.la: $(libalgorithm_la_OBJECTS) $(libalgorithm_la_DEPENDENCIES) $(EXTRA_libalgorithm_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libalgorithm_la_OBJECTS) $(libalgorithm_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/algorithm/distance/Makefile.in b/src/algorithm/distance/Makefile.in
index 0c938d4..10ff2cf 100644
--- a/src/algorithm/distance/Makefile.in
+++ b/src/algorithm/distance/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -341,7 +341,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libdistance.la: $(libdistance_la_OBJECTS) $(libdistance_la_DEPENDENCIES) 
+libdistance.la: $(libdistance_la_OBJECTS) $(libdistance_la_DEPENDENCIES) $(EXTRA_libdistance_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libdistance_la_OBJECTS) $(libdistance_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/algorithm/locate/Makefile.in b/src/algorithm/locate/Makefile.in
index 63bcc49..0387053 100644
--- a/src/algorithm/locate/Makefile.in
+++ b/src/algorithm/locate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -342,7 +342,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liblocation.la: $(liblocation_la_OBJECTS) $(liblocation_la_DEPENDENCIES) 
+liblocation.la: $(liblocation_la_OBJECTS) $(liblocation_la_DEPENDENCIES) $(EXTRA_liblocation_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liblocation_la_OBJECTS) $(liblocation_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index 67c297b..43e186c 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: Geometry.cpp 3317 2011-04-28 15:08:47Z strk $
+ * $Id: Geometry.cpp 3634 2012-05-21 14:12:06Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -100,9 +100,6 @@ jtsport()
 
 Geometry::GeometryChangedFilter Geometry::geometryChangedFilter;
 
-// REMOVE THIS, use GeometryFactory::getDefaultInstance() directly
-const GeometryFactory* Geometry::INTERNAL_GEOMETRY_FACTORY=GeometryFactory::getDefaultInstance();
-
 Geometry::Geometry(const GeometryFactory *newFactory)
 	:
 	envelope(NULL),
@@ -110,7 +107,7 @@ Geometry::Geometry(const GeometryFactory *newFactory)
 	userData(NULL)
 {
 	if ( factory == NULL ) {
-		factory = INTERNAL_GEOMETRY_FACTORY;
+		factory = GeometryFactory::getDefaultInstance();
 	} 
 	SRID=factory->getSRID();
 }
@@ -607,6 +604,39 @@ Geometry::symDifference(const Geometry *other) const
 	if ( isEmpty() ) return other->clone();
 	if ( other->isEmpty() ) return clone();
 
+	// if envelopes are disjoint return a MULTI geom or
+	// a geometrycollection
+	if ( ! getEnvelopeInternal()->intersects(other->getEnvelopeInternal()) )
+	{
+		const GeometryCollection *coll;
+
+		size_t ngeomsThis = getNumGeometries();
+		size_t ngeomsOther = other->getNumGeometries();
+
+		// Allocated for ownership transfer
+		vector<Geometry *> *v = new vector<Geometry *>();
+		v->reserve(ngeomsThis+ngeomsOther);
+
+
+		if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(this)) )
+		{
+			for (size_t i=0; i<ngeomsThis; ++i)
+				v->push_back(coll->getGeometryN(i)->clone());
+		} else {
+			v->push_back(this->clone());
+		}
+
+		if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(other)) )
+		{
+			for (size_t i=0; i<ngeomsOther; ++i)
+				v->push_back(coll->getGeometryN(i)->clone());
+		} else {
+			v->push_back(other->clone());
+		}
+
+		return factory->buildGeometry(v);
+	}
+
 	return BinaryOp(this, other, overlayOp(OverlayOp::opSYMDIFFERENCE)).release();
 }
 
diff --git a/src/geom/Makefile.in b/src/geom/Makefile.in
index aebe222..601855c 100644
--- a/src/geom/Makefile.in
+++ b/src/geom/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -378,7 +378,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeom.la: $(libgeom_la_OBJECTS) $(libgeom_la_DEPENDENCIES) 
+libgeom.la: $(libgeom_la_OBJECTS) $(libgeom_la_DEPENDENCIES) $(EXTRA_libgeom_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libgeom_la_OBJECTS) $(libgeom_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/geom/prep/Makefile.in b/src/geom/prep/Makefile.in
index 9ca2ff0..d3b910e 100644
--- a/src/geom/prep/Makefile.in
+++ b/src/geom/prep/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -321,7 +321,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeomprep.la: $(libgeomprep_la_OBJECTS) $(libgeomprep_la_DEPENDENCIES) 
+libgeomprep.la: $(libgeomprep_la_OBJECTS) $(libgeomprep_la_DEPENDENCIES) $(EXTRA_libgeomprep_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libgeomprep_la_OBJECTS) $(libgeomprep_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/geom/util/Makefile.in b/src/geom/util/Makefile.in
index 7fdd56d..cb54cc5 100644
--- a/src/geom/util/Makefile.in
+++ b/src/geom/util/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -308,7 +308,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeomutil.la: $(libgeomutil_la_OBJECTS) $(libgeomutil_la_DEPENDENCIES) 
+libgeomutil.la: $(libgeomutil_la_OBJECTS) $(libgeomutil_la_DEPENDENCIES) $(EXTRA_libgeomutil_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libgeomutil_la_OBJECTS) $(libgeomutil_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/geomgraph/Makefile.in b/src/geomgraph/Makefile.in
index 318a70d..e4f2f20 100644
--- a/src/geomgraph/Makefile.in
+++ b/src/geomgraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -363,7 +363,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeomgraph.la: $(libgeomgraph_la_OBJECTS) $(libgeomgraph_la_DEPENDENCIES) 
+libgeomgraph.la: $(libgeomgraph_la_OBJECTS) $(libgeomgraph_la_DEPENDENCIES) $(EXTRA_libgeomgraph_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libgeomgraph_la_OBJECTS) $(libgeomgraph_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/geomgraph/Node.cpp b/src/geomgraph/Node.cpp
index b04cde5..007fe51 100644
--- a/src/geomgraph/Node.cpp
+++ b/src/geomgraph/Node.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: Node.cpp 3402 2011-07-05 09:43:33Z strk $
+ * $Id: Node.cpp 3613 2012-04-12 09:05:59Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -26,6 +26,7 @@
 #include <geos/geomgraph/Label.h>
 #include <geos/geomgraph/DirectedEdge.h>
 #include <geos/geom/Location.h>
+#include <geos/util/IllegalArgumentException.h>
 
 #include <cmath>
 #include <string>
@@ -139,7 +140,12 @@ Node::add(EdgeEnd *e)
 	cerr<<"["<<this<<"] Node::add("<<e->print()<<")"<<endl;
 #endif
 	// Assert: start pt of e is equal to node point
-	assert(e->getCoordinate().equals2D(coord));
+	if ( ! e->getCoordinate().equals2D(coord) ) {
+		std::stringstream ss;
+		ss << "EdgeEnd with coordinate " << e->getCoordinate()
+		   << " invalid for node " << coord;
+		throw util::IllegalArgumentException(ss.str());
+  }
 
 	// It seems it's legal for edges to be NULL
 	// we'd not be honouring the promise of adding
diff --git a/src/geomgraph/index/Makefile.in b/src/geomgraph/index/Makefile.in
index 7773468..8d76e7e 100644
--- a/src/geomgraph/index/Makefile.in
+++ b/src/geomgraph/index/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -310,7 +310,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libgeomgraphindex.la: $(libgeomgraphindex_la_OBJECTS) $(libgeomgraphindex_la_DEPENDENCIES) 
+libgeomgraphindex.la: $(libgeomgraphindex_la_OBJECTS) $(libgeomgraphindex_la_DEPENDENCIES) $(EXTRA_libgeomgraphindex_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libgeomgraphindex_la_OBJECTS) $(libgeomgraphindex_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/Makefile.in b/src/index/Makefile.in
index dfbc355..6993a18 100644
--- a/src/index/Makefile.in
+++ b/src/index/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -349,7 +349,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindex.la: $(libindex_la_OBJECTS) $(libindex_la_DEPENDENCIES) 
+libindex.la: $(libindex_la_OBJECTS) $(libindex_la_DEPENDENCIES) $(EXTRA_libindex_la_DEPENDENCIES) 
 	$(LINK)  $(libindex_la_OBJECTS) $(libindex_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/bintree/Makefile.in b/src/index/bintree/Makefile.in
index 2144293..3d350e4 100644
--- a/src/index/bintree/Makefile.in
+++ b/src/index/bintree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -306,7 +306,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindexbintree.la: $(libindexbintree_la_OBJECTS) $(libindexbintree_la_DEPENDENCIES) 
+libindexbintree.la: $(libindexbintree_la_OBJECTS) $(libindexbintree_la_DEPENDENCIES) $(EXTRA_libindexbintree_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libindexbintree_la_OBJECTS) $(libindexbintree_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/chain/Makefile.in b/src/index/chain/Makefile.in
index 9332c5d..6ba7130 100644
--- a/src/index/chain/Makefile.in
+++ b/src/index/chain/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -303,7 +303,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindexchain.la: $(libindexchain_la_OBJECTS) $(libindexchain_la_DEPENDENCIES) 
+libindexchain.la: $(libindexchain_la_OBJECTS) $(libindexchain_la_DEPENDENCIES) $(EXTRA_libindexchain_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libindexchain_la_OBJECTS) $(libindexchain_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/intervalrtree/Makefile.in b/src/index/intervalrtree/Makefile.in
index 90525c4..8d77a63 100644
--- a/src/index/intervalrtree/Makefile.in
+++ b/src/index/intervalrtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -304,7 +304,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libintervalrtree.la: $(libintervalrtree_la_OBJECTS) $(libintervalrtree_la_DEPENDENCIES) 
+libintervalrtree.la: $(libintervalrtree_la_OBJECTS) $(libintervalrtree_la_DEPENDENCIES) $(EXTRA_libintervalrtree_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libintervalrtree_la_OBJECTS) $(libintervalrtree_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/quadtree/Makefile.in b/src/index/quadtree/Makefile.in
index 5af6944..90eb6b4 100644
--- a/src/index/quadtree/Makefile.in
+++ b/src/index/quadtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -306,7 +306,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindexquadtree.la: $(libindexquadtree_la_OBJECTS) $(libindexquadtree_la_DEPENDENCIES) 
+libindexquadtree.la: $(libindexquadtree_la_OBJECTS) $(libindexquadtree_la_DEPENDENCIES) $(EXTRA_libindexquadtree_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libindexquadtree_la_OBJECTS) $(libindexquadtree_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/strtree/Makefile.in b/src/index/strtree/Makefile.in
index 6f03afd..8ac5f1c 100644
--- a/src/index/strtree/Makefile.in
+++ b/src/index/strtree/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -306,7 +306,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindexstrtree.la: $(libindexstrtree_la_OBJECTS) $(libindexstrtree_la_DEPENDENCIES) 
+libindexstrtree.la: $(libindexstrtree_la_OBJECTS) $(libindexstrtree_la_DEPENDENCIES) $(EXTRA_libindexstrtree_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libindexstrtree_la_OBJECTS) $(libindexstrtree_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/index/sweepline/Makefile.in b/src/index/sweepline/Makefile.in
index 485271c..1a79341 100644
--- a/src/index/sweepline/Makefile.in
+++ b/src/index/sweepline/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -303,7 +303,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libindexsweepline.la: $(libindexsweepline_la_OBJECTS) $(libindexsweepline_la_DEPENDENCIES) 
+libindexsweepline.la: $(libindexsweepline_la_OBJECTS) $(libindexsweepline_la_DEPENDENCIES) $(EXTRA_libindexsweepline_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libindexsweepline_la_OBJECTS) $(libindexsweepline_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/io/Makefile.in b/src/io/Makefile.in
index 185b418..212a31d 100644
--- a/src/io/Makefile.in
+++ b/src/io/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -314,7 +314,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libio.la: $(libio_la_OBJECTS) $(libio_la_DEPENDENCIES) 
+libio.la: $(libio_la_OBJECTS) $(libio_la_DEPENDENCIES) $(EXTRA_libio_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libio_la_OBJECTS) $(libio_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index cb013af..5c3fb6a 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: WKTWriter.cpp 3293 2011-04-22 13:51:38Z strk $
+ * $Id: WKTWriter.cpp 3766 2013-02-21 10:25:43Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -314,24 +314,22 @@ WKTWriter::appendPointText(const Coordinate* coordinate, int /*level*/,
 	}
 }
 
-/* pritected */
+/* protected */
 void
 WKTWriter::appendCoordinate(const Coordinate* coordinate,
 		Writer *writer)
 {
-	string out="";
-	out+=writeNumber(coordinate->x);
-	out+=" ";
-	out+=writeNumber(coordinate->y);
-    if( outputDimension == 3 )
-    {
-        out+=" ";
-        if( ISNAN(coordinate->z) )
-            out+=writeNumber(0.0);
-        else
-            out+=writeNumber(coordinate->z);
-    }
-	writer->write(out);
+	writer->write(writeNumber(coordinate->x));
+	writer->write(" ");
+	writer->write(writeNumber(coordinate->y));
+	if( outputDimension == 3 )
+	{
+		writer->write(" ");
+		if( ISNAN(coordinate->z) )
+			writer->write(writeNumber(0.0));
+		else
+			writer->write(writeNumber(coordinate->z));
+	}
 }
 
 /* protected */
diff --git a/src/linearref/LocationIndexOfLine.cpp b/src/linearref/LocationIndexOfLine.cpp
index 191ca92..b1ee063 100644
--- a/src/linearref/LocationIndexOfLine.cpp
+++ b/src/linearref/LocationIndexOfLine.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: LocationIndexOfLine.cpp 2809 2009-12-06 01:05:24Z mloskot $
+ * $Id: LocationIndexOfLine.cpp 3761 2013-02-01 06:31:04Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -14,7 +14,7 @@
  *
  **********************************************************************
  *
- * Last port: linearref/LengthIndexedLine.java rev. 1.35
+ * Last port: linearref/LengthIndexedLine.java r731
  *
  **********************************************************************/
 
diff --git a/src/linearref/Makefile.in b/src/linearref/Makefile.in
index fda8f9f..0717b08 100644
--- a/src/linearref/Makefile.in
+++ b/src/linearref/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -311,7 +311,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liblinearref.la: $(liblinearref_la_OBJECTS) $(liblinearref_la_DEPENDENCIES) 
+liblinearref.la: $(liblinearref_la_OBJECTS) $(liblinearref_la_DEPENDENCIES) $(EXTRA_liblinearref_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liblinearref_la_OBJECTS) $(liblinearref_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/noding/Makefile.in b/src/noding/Makefile.in
index 53c3fed..6965379 100644
--- a/src/noding/Makefile.in
+++ b/src/noding/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -365,7 +365,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libnoding.la: $(libnoding_la_OBJECTS) $(libnoding_la_DEPENDENCIES) 
+libnoding.la: $(libnoding_la_OBJECTS) $(libnoding_la_DEPENDENCIES) $(EXTRA_libnoding_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libnoding_la_OBJECTS) $(libnoding_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/noding/snapround/Makefile.in b/src/noding/snapround/Makefile.in
index 9b81414..c86c33a 100644
--- a/src/noding/snapround/Makefile.in
+++ b/src/noding/snapround/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -343,7 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libsnapround.la: $(libsnapround_la_OBJECTS) $(libsnapround_la_DEPENDENCIES) 
+libsnapround.la: $(libsnapround_la_OBJECTS) $(libsnapround_la_DEPENDENCIES) $(EXTRA_libsnapround_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libsnapround_la_OBJECTS) $(libsnapround_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/Makefile.in b/src/operation/Makefile.in
index 10fd6c1..1ae1115 100644
--- a/src/operation/Makefile.in
+++ b/src/operation/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -367,7 +367,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liboperation.la: $(liboperation_la_OBJECTS) $(liboperation_la_DEPENDENCIES) 
+liboperation.la: $(liboperation_la_OBJECTS) $(liboperation_la_DEPENDENCIES) $(EXTRA_liboperation_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liboperation_la_OBJECTS) $(liboperation_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/buffer/BufferOp.cpp b/src/operation/buffer/BufferOp.cpp
index e7aab6f..44c3c76 100644
--- a/src/operation/buffer/BufferOp.cpp
+++ b/src/operation/buffer/BufferOp.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: BufferOp.cpp 3559 2012-01-06 21:34:49Z hobu $
+ * $Id: BufferOp.cpp 3732 2012-12-05 07:41:45Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -152,8 +152,11 @@ void
 BufferOp::bufferReducedPrecision()
 {
 
-	// try and compute with decreasing precision
-	for (int precDigits=MAX_PRECISION_DIGITS; precDigits >= 0; precDigits--)
+	// try and compute with decreasing precision,
+	// up to a min, to avoid gross results
+	// (not in JTS, see http://trac.osgeo.org/geos/ticket/605)
+#define MIN_PRECISION_DIGITS 6
+	for (int precDigits=MAX_PRECISION_DIGITS; precDigits >= MIN_PRECISION_DIGITS; precDigits--)
 	{
 #if GEOS_DEBUG
 		std::cerr<<"BufferOp::computeGeometry: trying with precDigits "<<precDigits<<std::endl;
diff --git a/src/operation/buffer/BufferSubgraph.cpp b/src/operation/buffer/BufferSubgraph.cpp
index ae34400..981f89c 100644
--- a/src/operation/buffer/BufferSubgraph.cpp
+++ b/src/operation/buffer/BufferSubgraph.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: BufferSubgraph.cpp 3301 2011-04-27 09:42:31Z strk $
+ * $Id: BufferSubgraph.cpp 3729 2012-12-04 21:39:24Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -71,7 +71,7 @@ BufferSubgraph::create(Node *node)
 	addReachable(node);
 
 	// We are assuming that dirEdgeList 
-	// contains *at leas* ONE forward DirectedEdge
+	// contains *at least* ONE forward DirectedEdge
 	finder.findEdge(&dirEdgeList);
 
 	rightMostCoord=&(finder.getCoordinate());
diff --git a/src/operation/buffer/Makefile.in b/src/operation/buffer/Makefile.in
index 56c521b..698cf1b 100644
--- a/src/operation/buffer/Makefile.in
+++ b/src/operation/buffer/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -363,7 +363,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopbuffer.la: $(libopbuffer_la_OBJECTS) $(libopbuffer_la_DEPENDENCIES) 
+libopbuffer.la: $(libopbuffer_la_OBJECTS) $(libopbuffer_la_DEPENDENCIES) $(EXTRA_libopbuffer_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopbuffer_la_OBJECTS) $(libopbuffer_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/buffer/RightmostEdgeFinder.cpp b/src/operation/buffer/RightmostEdgeFinder.cpp
index 7a6e552..0dc7689 100644
--- a/src/operation/buffer/RightmostEdgeFinder.cpp
+++ b/src/operation/buffer/RightmostEdgeFinder.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: RightmostEdgeFinder.cpp 3245 2011-02-23 16:46:10Z strk $
+ * $Id: RightmostEdgeFinder.cpp 3730 2012-12-04 21:43:28Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -25,6 +25,7 @@
 #include <geos/geomgraph/Position.h>
 #include <geos/geomgraph/Node.h>
 #include <geos/geomgraph/Edge.h>
+#include <geos/util/TopologyException.h>
 
 #include <vector>
 #include <cassert>
@@ -73,6 +74,14 @@ RightmostEdgeFinder::findEdge(std::vector<DirectedEdge*>* dirEdgeList)
 #endif
 	}
 
+  if ( ! minDe ) {
+    // I don't know why, but it looks like this can happen
+    // (invalid PlanarGraph, I think)
+    // See http://trac.osgeo.org/geos/ticket/605#comment:17
+    //
+    throw util::TopologyException("No forward edges found in buffer subgraph");
+  }
+
 #ifndef NDEBUG
 	assert(checked>0);
 	assert(minIndex>=0);
diff --git a/src/operation/distance/Makefile.in b/src/operation/distance/Makefile.in
index 16bce80..6ffcadd 100644
--- a/src/operation/distance/Makefile.in
+++ b/src/operation/distance/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -344,7 +344,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopdistance.la: $(libopdistance_la_OBJECTS) $(libopdistance_la_DEPENDENCIES) 
+libopdistance.la: $(libopdistance_la_OBJECTS) $(libopdistance_la_DEPENDENCIES) $(EXTRA_libopdistance_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopdistance_la_OBJECTS) $(libopdistance_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/linemerge/Makefile.in b/src/operation/linemerge/Makefile.in
index 7a3efc8..ee0f55d 100644
--- a/src/operation/linemerge/Makefile.in
+++ b/src/operation/linemerge/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -346,7 +346,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liboplinemerge.la: $(liboplinemerge_la_OBJECTS) $(liboplinemerge_la_DEPENDENCIES) 
+liboplinemerge.la: $(liboplinemerge_la_OBJECTS) $(liboplinemerge_la_DEPENDENCIES) $(EXTRA_liboplinemerge_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liboplinemerge_la_OBJECTS) $(liboplinemerge_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/overlay/Makefile.in b/src/operation/overlay/Makefile.in
index b40bf6d..fc9b582 100644
--- a/src/operation/overlay/Makefile.in
+++ b/src/operation/overlay/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -361,7 +361,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopoverlay.la: $(libopoverlay_la_OBJECTS) $(libopoverlay_la_DEPENDENCIES) 
+libopoverlay.la: $(libopoverlay_la_OBJECTS) $(libopoverlay_la_DEPENDENCIES) $(EXTRA_libopoverlay_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopoverlay_la_OBJECTS) $(libopoverlay_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp
index ff3f1fe..a9a663f 100644
--- a/src/operation/polygonize/EdgeRing.cpp
+++ b/src/operation/polygonize/EdgeRing.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: EdgeRing.cpp 3078 2010-07-01 21:44:33Z strk $
+ * $Id: EdgeRing.cpp 3628 2012-05-14 19:00:04Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -71,12 +71,17 @@ EdgeRing::findEdgeRingContaining(EdgeRing *testEr,
 		const CoordinateSequence *tryCoords =
 			tryRing->getCoordinatesRO();
 
-		testPt=ptNotInList(testRing->getCoordinatesRO(),
-			tryCoords);
+		if ( tryEnv->contains(testEnv) ) {
 
-		if (tryEnv->contains(testEnv)
-			&& CGAlgorithms::isPointInRing(testPt, tryCoords))
+			// TODO: don't copy testPt !
+			testPt = ptNotInList(testRing->getCoordinatesRO(), tryCoords);
+
+			if ( CGAlgorithms::isPointInRing(testPt, tryCoords) ) {
 				isContained=true;
+			}
+
+    }
+
 		// check if this new containing ring is smaller
 		// than the current minimum ring
 		if (isContained) {
@@ -97,6 +102,7 @@ EdgeRing::ptNotInList(const CoordinateSequence *testPts,
     for (std::size_t i = 0; i < npts; ++i)
     {
         const Coordinate& testPt = testPts->getAt(i);
+        // TODO: shouldn't this be ! isInList ?
         if (isInList(testPt, pts))
             return testPt;
     }
diff --git a/src/operation/polygonize/Makefile.in b/src/operation/polygonize/Makefile.in
index 0d8c780..825efd3 100644
--- a/src/operation/polygonize/Makefile.in
+++ b/src/operation/polygonize/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -345,7 +345,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liboppolygonize.la: $(liboppolygonize_la_OBJECTS) $(liboppolygonize_la_DEPENDENCIES) 
+liboppolygonize.la: $(liboppolygonize_la_OBJECTS) $(liboppolygonize_la_DEPENDENCIES) $(EXTRA_liboppolygonize_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liboppolygonize_la_OBJECTS) $(liboppolygonize_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/predicate/Makefile.in b/src/operation/predicate/Makefile.in
index 648a3e4..bb43fa9 100644
--- a/src/operation/predicate/Makefile.in
+++ b/src/operation/predicate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -305,7 +305,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liboppredicate.la: $(liboppredicate_la_OBJECTS) $(liboppredicate_la_DEPENDENCIES) 
+liboppredicate.la: $(liboppredicate_la_OBJECTS) $(liboppredicate_la_DEPENDENCIES) $(EXTRA_liboppredicate_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liboppredicate_la_OBJECTS) $(liboppredicate_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/relate/Makefile.in b/src/operation/relate/Makefile.in
index b71d1e8..2f9367b 100644
--- a/src/operation/relate/Makefile.in
+++ b/src/operation/relate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -348,7 +348,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-liboprelate.la: $(liboprelate_la_OBJECTS) $(liboprelate_la_DEPENDENCIES) 
+liboprelate.la: $(liboprelate_la_OBJECTS) $(liboprelate_la_DEPENDENCIES) $(EXTRA_liboprelate_la_DEPENDENCIES) 
 	$(CXXLINK)  $(liboprelate_la_OBJECTS) $(liboprelate_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/sharedpaths/Makefile.in b/src/operation/sharedpaths/Makefile.in
index 46661b3..a5b8af7 100644
--- a/src/operation/sharedpaths/Makefile.in
+++ b/src/operation/sharedpaths/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -338,7 +338,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopsharedpaths.la: $(libopsharedpaths_la_OBJECTS) $(libopsharedpaths_la_DEPENDENCIES) 
+libopsharedpaths.la: $(libopsharedpaths_la_OBJECTS) $(libopsharedpaths_la_DEPENDENCIES) $(EXTRA_libopsharedpaths_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopsharedpaths_la_OBJECTS) $(libopsharedpaths_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/union/Makefile.in b/src/operation/union/Makefile.in
index 3b32beb..d13b9d8 100644
--- a/src/operation/union/Makefile.in
+++ b/src/operation/union/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -343,7 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopunion.la: $(libopunion_la_OBJECTS) $(libopunion_la_DEPENDENCIES) 
+libopunion.la: $(libopunion_la_OBJECTS) $(libopunion_la_DEPENDENCIES) $(EXTRA_libopunion_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopunion_la_OBJECTS) $(libopunion_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 289bcb9..41155c6 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: IsValidOp.cpp 3312 2011-04-28 10:04:11Z strk $
+ * $Id: IsValidOp.cpp 3756 2013-01-25 17:26:12Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -528,7 +528,7 @@ IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
 	int nholes = p->getNumInteriorRing();
 	if (nholes<=0) {
 		validErr=new TopologyValidationError(
-			TopologyValidationError::eNestedHoles,
+			TopologyValidationError::eNestedShells,
 			*shellPt);
 		return;
 	}
diff --git a/src/operation/valid/Makefile.in b/src/operation/valid/Makefile.in
index 3d85018..1480df5 100644
--- a/src/operation/valid/Makefile.in
+++ b/src/operation/valid/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -365,7 +365,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libopvalid.la: $(libopvalid_la_OBJECTS) $(libopvalid_la_DEPENDENCIES) 
+libopvalid.la: $(libopvalid_la_OBJECTS) $(libopvalid_la_DEPENDENCIES) $(EXTRA_libopvalid_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libopvalid_la_OBJECTS) $(libopvalid_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/planargraph/Makefile.in b/src/planargraph/Makefile.in
index 7ddf857..aba387a 100644
--- a/src/planargraph/Makefile.in
+++ b/src/planargraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -348,7 +348,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libplanargraph.la: $(libplanargraph_la_OBJECTS) $(libplanargraph_la_DEPENDENCIES) 
+libplanargraph.la: $(libplanargraph_la_OBJECTS) $(libplanargraph_la_DEPENDENCIES) $(EXTRA_libplanargraph_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libplanargraph_la_OBJECTS) $(libplanargraph_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/precision/Makefile.in b/src/precision/Makefile.in
index cc87b70..4fefccd 100644
--- a/src/precision/Makefile.in
+++ b/src/precision/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -345,7 +345,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libprecision.la: $(libprecision_la_OBJECTS) $(libprecision_la_DEPENDENCIES) 
+libprecision.la: $(libprecision_la_OBJECTS) $(libprecision_la_DEPENDENCIES) $(EXTRA_libprecision_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libprecision_la_OBJECTS) $(libprecision_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/simplify/Makefile.in b/src/simplify/Makefile.in
index f154072..f38c012 100644
--- a/src/simplify/Makefile.in
+++ b/src/simplify/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -350,7 +350,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libsimplify.la: $(libsimplify_la_OBJECTS) $(libsimplify_la_DEPENDENCIES) 
+libsimplify.la: $(libsimplify_la_OBJECTS) $(libsimplify_la_DEPENDENCIES) $(EXTRA_libsimplify_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libsimplify_la_OBJECTS) $(libsimplify_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/src/simplify/TaggedLineStringSimplifier.cpp b/src/simplify/TaggedLineStringSimplifier.cpp
index 4f7b0fc..1ed98cd 100644
--- a/src/simplify/TaggedLineStringSimplifier.cpp
+++ b/src/simplify/TaggedLineStringSimplifier.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: TaggedLineStringSimplifier.cpp 3574 2012-03-22 08:34:59Z strk $
+ * $Id: TaggedLineStringSimplifier.cpp 3626 2012-05-09 18:02:09Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: simplify/TaggedLineStringSimplifier.java rev. 1.8 (JTS-1.7.1)
+ * Last port: simplify/TaggedLineStringSimplifier.java r536 (JTS-1.12+)
  *
  **********************************************************************/
 
diff --git a/src/simplify/TopologyPreservingSimplifier.cpp b/src/simplify/TopologyPreservingSimplifier.cpp
index e41eaf4..714da58 100644
--- a/src/simplify/TopologyPreservingSimplifier.cpp
+++ b/src/simplify/TopologyPreservingSimplifier.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: TopologyPreservingSimplifier.cpp 2762 2009-12-03 19:01:10Z mloskot $
+ * $Id: TopologyPreservingSimplifier.cpp 3626 2012-05-09 18:02:09Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: simplify/TopologyPreservingSimplifier.java rev. 1.4 (JTS-1.7)
+ * Last port: simplify/TopologyPreservingSimplifier.java r536 (JTS-1.12+)
  *
  **********************************************************************/
 
@@ -178,6 +178,13 @@ LineStringTransformer::transformCoordinates(
 //----------------------------------------------------------------------
 
 /*
+ * A filter to add linear geometries to the linestring map
+ * with the appropriate minimum size constraint.
+ * Closed {@link LineString}s (including {@link LinearRing}s
+ * have a minimum output size constraint of 4,
+ * to ensure the output is valid.
+ * For all other linestrings, the minimum size is 2 points.
+ *
  * This class populates the given LineString=>TaggedLineString map
  * with newly created TaggedLineString objects.
  * Users must take care of deleting the map's values (elem.second).
@@ -195,6 +202,11 @@ public:
 	// no more needed
 	//friend class TopologyPreservingSimplifier;
 
+	/**
+	 * Filters linear geometries.
+	 *
+	 * geom a geometry of any type
+	 */
 	void filter_ro(const Geometry* geom);
 
 
@@ -226,16 +238,11 @@ LineStringMapBuilderFilter::filter_ro(const Geometry* geom)
 {
 	TaggedLineString* taggedLine;
 
-	if ( const LinearRing* lr =
-			dynamic_cast<const LinearRing*>(geom) )
-	{
-		taggedLine = new TaggedLineString(lr, 4);
-
-	}
-	else if ( const LineString* ls = 
+	if ( const LineString* ls = 
 			dynamic_cast<const LineString*>(geom) )
 	{
-		taggedLine = new TaggedLineString(ls, 2);
+    int minSize = ls->isClosed() ? 4 : 2;
+		taggedLine = new TaggedLineString(ls, minSize);
 	}
 	else
 	{
@@ -292,6 +299,10 @@ TopologyPreservingSimplifier::setDistanceTolerance(double d)
 std::auto_ptr<geom::Geometry> 
 TopologyPreservingSimplifier::getResultGeometry()
 {
+
+	// empty input produces an empty result
+	if (inputGeom->isEmpty()) return std::auto_ptr<Geometry>(inputGeom->clone());
+
 	LinesMap linestringMap;
 
 	std::auto_ptr<geom::Geometry> result;
@@ -354,36 +365,3 @@ TopologyPreservingSimplifier::getResultGeometry()
 } // namespace geos::simplify
 } // namespace geos
 
-/**********************************************************************
- * $Log$
- * Revision 1.8  2006/05/24 11:41:23  strk
- *         * source/headers/geos/simplify/TaggedLinesSimplifier.h,
- *         source/simplify/TaggedLinesSimplifier.cpp,
- *         source/simplify/TopologyPreservingSimplifier.cpp:
- *         fixed bug in TopologyPreservingSimplifier failing to
- *         detect intersections, refactored TaggedLinesSimplifier
- *         class to more closely match JTS and use templated
- *         functions.
- *
- * Revision 1.7  2006/05/19 17:44:29  strk
- *         * source/simplify/TopologyPreservingSimplifier.cpp:
- *         removed friend specification in
- *         TopologyPreservingSimplifier helper class
- *         (no more needed)
- *
- * Revision 1.6  2006/04/24 15:47:35  strk
- * Public constructors change made permanent
- *
- * Revision 1.5  2006/04/22 17:16:31  mloskot
- * Temporar fix of Bug #100. This report requires deeper analysis!.
- *
- * Revision 1.4  2006/04/13 21:52:35  strk
- * Many debugging lines and assertions added. Fixed bug in TaggedLineString class.
- *
- * Revision 1.3  2006/04/13 16:04:10  strk
- * Made TopologyPreservingSimplifier implementation successfully build
- *
- * Revision 1.2  2006/04/13 14:25:17  strk
- * TopologyPreservingSimplifier initial port
- *
- **********************************************************************/
diff --git a/src/util/Makefile.in b/src/util/Makefile.in
index fa01374..647594a 100644
--- a/src/util/Makefile.in
+++ b/src/util/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -343,7 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) 
+libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) $(EXTRA_libutil_la_DEPENDENCIES) 
 	$(CXXLINK)  $(libutil_la_OBJECTS) $(libutil_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/swig/Makefile.in b/swig/Makefile.in
index 44d1dbb..035256a 100644
--- a/swig/Makefile.in
+++ b/swig/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/swig/geos.i b/swig/geos.i
index 469e0a1..d63a0a2 100644
--- a/swig/geos.i
+++ b/swig/geos.i
@@ -29,16 +29,16 @@
    the whole c api. */
 #define GEOS_VERSION_MAJOR 3
 #define GEOS_VERSION_MINOR 3
-#define GEOS_VERSION_PATCH 3
-#define GEOS_VERSION "3.3.3"
+#define GEOS_VERSION_PATCH 8
+#define GEOS_VERSION "3.3.8"
 #define GEOS_JTS_PORT "1.12.0"
 
 #define GEOS_CAPI_VERSION_MAJOR 1
 #define GEOS_CAPI_VERSION_MINOR 7
-#define GEOS_CAPI_VERSION_PATCH 4
+#define GEOS_CAPI_VERSION_PATCH 8
 #define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR 
 #define GEOS_CAPI_LAST_INTERFACE (GEOS_CAPI_VERSION_MAJOR+GEOS_CAPI_VERSION_MINOR)
-#define GEOS_CAPI_VERSION "3.3.3-CAPI-1.7.4"
+#define GEOS_CAPI_VERSION "3.3.8-CAPI-1.7.8"
 
 /* Supported geometry types */
 enum GEOSGeomTypes { 
diff --git a/swig/python/Makefile.in b/swig/python/Makefile.in
index 7387f63..5f2c3b4 100644
--- a/swig/python/Makefile.in
+++ b/swig/python/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -417,7 +417,7 @@ clean-pkgpyexecLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-_geos.la: $(_geos_la_OBJECTS) $(_geos_la_DEPENDENCIES) 
+_geos.la: $(_geos_la_OBJECTS) $(_geos_la_DEPENDENCIES) $(EXTRA__geos_la_DEPENDENCIES) 
 	$(_geos_la_LINK) $(am__geos_la_rpath) $(_geos_la_OBJECTS) $(_geos_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/swig/python/geos.py b/swig/python/geos.py
index 6165813..6a92a7c 100644
--- a/swig/python/geos.py
+++ b/swig/python/geos.py
@@ -1,281 +1,400 @@
-# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.31
-#
-# Don't modify this file, modify the SWIG interface instead.
-
-import _geos
-import new
-new_instancemethod = new.instancemethod
-try:
-    _swig_property = property
-except NameError:
-    pass # Python < 2.2 doesn't have 'property'.
-def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
-    if (name == "thisown"): return self.this.own(value)
-    if (name == "this"):
-        if type(value).__name__ == 'PySwigObject':
-            self.__dict__[name] = value
-            return
-    method = class_type.__swig_setmethods__.get(name,None)
-    if method: return method(self,value)
-    if (not static) or hasattr(self,name):
-        self.__dict__[name] = value
-    else:
-        raise AttributeError("You cannot add attributes to %s" % self)
-
-def _swig_setattr(self,class_type,name,value):
-    return _swig_setattr_nondynamic(self,class_type,name,value,0)
-
-def _swig_getattr(self,class_type,name):
-    if (name == "thisown"): return self.this.own()
-    method = class_type.__swig_getmethods__.get(name,None)
-    if method: return method(self)
-    raise AttributeError,name
-
-def _swig_repr(self):
-    try: strthis = "proxy of " + self.this.__repr__()
-    except: strthis = ""
-    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
-
-import types
-try:
-    _object = types.ObjectType
-    _newclass = 1
-except AttributeError:
-    class _object : pass
-    _newclass = 0
-del types
-
-
-def _swig_setattr_nondynamic_method(set):
-    def set_attr(self,name,value):
-        if (name == "thisown"): return self.this.own(value)
-        if hasattr(self,name) or (name == "this"):
-            set(self,name,value)
-        else:
-            raise AttributeError("You cannot add attributes to %s" % self)
-    return set_attr
-
-
-class PySwigIterator(object):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_PySwigIterator
-    __del__ = lambda self : None;
-    def value(*args): return _geos.PySwigIterator_value(*args)
-    def incr(*args): return _geos.PySwigIterator_incr(*args)
-    def decr(*args): return _geos.PySwigIterator_decr(*args)
-    def distance(*args): return _geos.PySwigIterator_distance(*args)
-    def equal(*args): return _geos.PySwigIterator_equal(*args)
-    def copy(*args): return _geos.PySwigIterator_copy(*args)
-    def next(*args): return _geos.PySwigIterator_next(*args)
-    def previous(*args): return _geos.PySwigIterator_previous(*args)
-    def advance(*args): return _geos.PySwigIterator_advance(*args)
-    def __eq__(*args): return _geos.PySwigIterator___eq__(*args)
-    def __ne__(*args): return _geos.PySwigIterator___ne__(*args)
-    def __iadd__(*args): return _geos.PySwigIterator___iadd__(*args)
-    def __isub__(*args): return _geos.PySwigIterator___isub__(*args)
-    def __add__(*args): return _geos.PySwigIterator___add__(*args)
-    def __sub__(*args): return _geos.PySwigIterator___sub__(*args)
-    def __iter__(self): return self
-PySwigIterator_swigregister = _geos.PySwigIterator_swigregister
-PySwigIterator_swigregister(PySwigIterator)
-
-GEOS_VERSION_MAJOR = _geos.GEOS_VERSION_MAJOR
-GEOS_VERSION_MINOR = _geos.GEOS_VERSION_MINOR
-GEOS_VERSION = _geos.GEOS_VERSION
-GEOS_JTS_PORT = _geos.GEOS_JTS_PORT
-GEOS_CAPI_VERSION_MAJOR = _geos.GEOS_CAPI_VERSION_MAJOR
-GEOS_CAPI_VERSION_MINOR = _geos.GEOS_CAPI_VERSION_MINOR
-GEOS_CAPI_VERSION_PATCH = _geos.GEOS_CAPI_VERSION_PATCH
-GEOS_CAPI_FIRST_INTERFACE = _geos.GEOS_CAPI_FIRST_INTERFACE
-GEOS_CAPI_LAST_INTERFACE = _geos.GEOS_CAPI_LAST_INTERFACE
-GEOS_CAPI_VERSION = _geos.GEOS_CAPI_VERSION
-GEOS_POINT = _geos.GEOS_POINT
-GEOS_LINESTRING = _geos.GEOS_LINESTRING
-GEOS_LINEARRING = _geos.GEOS_LINEARRING
-GEOS_POLYGON = _geos.GEOS_POLYGON
-GEOS_MULTIPOINT = _geos.GEOS_MULTIPOINT
-GEOS_MULTILINESTRING = _geos.GEOS_MULTILINESTRING
-GEOS_MULTIPOLYGON = _geos.GEOS_MULTIPOLYGON
-GEOS_GEOMETRYCOLLECTION = _geos.GEOS_GEOMETRYCOLLECTION
-GEOS_WKB_XDR = _geos.GEOS_WKB_XDR
-GEOS_WKB_NDR = _geos.GEOS_WKB_NDR
-version = _geos.version
-class CoordinateSequence(object):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    __repr__ = _swig_repr
-    def __init__(self, *args): 
-        this = _geos.new_CoordinateSequence(*args)
-        try: self.this.append(this)
-        except: self.this = this
-    __swig_destroy__ = _geos.delete_CoordinateSequence
-    __del__ = lambda self : None;
-    def clone(*args): return _geos.CoordinateSequence_clone(*args)
-    def setX(*args): return _geos.CoordinateSequence_setX(*args)
-    def setY(*args): return _geos.CoordinateSequence_setY(*args)
-    def setZ(*args): return _geos.CoordinateSequence_setZ(*args)
-    def setOrdinate(*args): return _geos.CoordinateSequence_setOrdinate(*args)
-    def getX(*args): return _geos.CoordinateSequence_getX(*args)
-    def getY(*args): return _geos.CoordinateSequence_getY(*args)
-    def getZ(*args): return _geos.CoordinateSequence_getZ(*args)
-    def getOrdinate(*args): return _geos.CoordinateSequence_getOrdinate(*args)
-    def getSize(*args): return _geos.CoordinateSequence_getSize(*args)
-    def getDimensions(*args): return _geos.CoordinateSequence_getDimensions(*args)
-CoordinateSequence_swigregister = _geos.CoordinateSequence_swigregister
-CoordinateSequence_swigregister(CoordinateSequence)
-
-class Geometry(object):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_Geometry
-    __del__ = lambda self : None;
-    def clone(*args): return _geos.Geometry_clone(*args)
-    def geomType(*args): return _geos.Geometry_geomType(*args)
-    def typeId(*args): return _geos.Geometry_typeId(*args)
-    def normalize(*args): return _geos.Geometry_normalize(*args)
-    def getSRID(*args): return _geos.Geometry_getSRID(*args)
-    def setSRID(*args): return _geos.Geometry_setSRID(*args)
-    def getDimensions(*args): return _geos.Geometry_getDimensions(*args)
-    def getNumGeometries(*args): return _geos.Geometry_getNumGeometries(*args)
-    def intersection(*args): return _geos.Geometry_intersection(*args)
-    def buffer(*args): return _geos.Geometry_buffer(*args)
-    def convexHull(*args): return _geos.Geometry_convexHull(*args)
-    def difference(*args): return _geos.Geometry_difference(*args)
-    def symDifference(*args): return _geos.Geometry_symDifference(*args)
-    def boundary(*args): return _geos.Geometry_boundary(*args)
-    def union(*args): return _geos.Geometry_union(*args)
-    def pointOnSurface(*args): return _geos.Geometry_pointOnSurface(*args)
-    def getCentroid(*args): return _geos.Geometry_getCentroid(*args)
-    def getEnvelope(*args): return _geos.Geometry_getEnvelope(*args)
-    def relate(*args): return _geos.Geometry_relate(*args)
-    def lineMerge(*args): return _geos.Geometry_lineMerge(*args)
-    def simplify(*args): return _geos.Geometry_simplify(*args)
-    def topologyPreserveSimplify(*args): return _geos.Geometry_topologyPreserveSimplify(*args)
-    def relatePattern(*args): return _geos.Geometry_relatePattern(*args)
-    def disjoint(*args): return _geos.Geometry_disjoint(*args)
-    def touches(*args): return _geos.Geometry_touches(*args)
-    def intersects(*args): return _geos.Geometry_intersects(*args)
-    def crosses(*args): return _geos.Geometry_crosses(*args)
-    def within(*args): return _geos.Geometry_within(*args)
-    def contains(*args): return _geos.Geometry_contains(*args)
-    def overlaps(*args): return _geos.Geometry_overlaps(*args)
-    def equals(*args): return _geos.Geometry_equals(*args)
-    def equalsExact(*args): return _geos.Geometry_equalsExact(*args)
-    def isEmpty(*args): return _geos.Geometry_isEmpty(*args)
-    def isValid(*args): return _geos.Geometry_isValid(*args)
-    def isSimple(*args): return _geos.Geometry_isSimple(*args)
-    def isRing(*args): return _geos.Geometry_isRing(*args)
-    def hasZ(*args): return _geos.Geometry_hasZ(*args)
-    def area(*args): return _geos.Geometry_area(*args)
-    def length(*args): return _geos.Geometry_length(*args)
-    def distance(*args): return _geos.Geometry_distance(*args)
-Geometry_swigregister = _geos.Geometry_swigregister
-Geometry_swigregister(Geometry)
-
-class Point(Geometry):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_Point
-    __del__ = lambda self : None;
-    def getCoordSeq(*args): return _geos.Point_getCoordSeq(*args)
-Point_swigregister = _geos.Point_swigregister
-Point_swigregister(Point)
-
-class LineString(Geometry):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_LineString
-    __del__ = lambda self : None;
-    def getCoordSeq(*args): return _geos.LineString_getCoordSeq(*args)
-LineString_swigregister = _geos.LineString_swigregister
-LineString_swigregister(LineString)
-
-class LinearRing(Geometry):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_LinearRing
-    __del__ = lambda self : None;
-    def getCoordSeq(*args): return _geos.LinearRing_getCoordSeq(*args)
-LinearRing_swigregister = _geos.LinearRing_swigregister
-LinearRing_swigregister(LinearRing)
-
-class Polygon(Geometry):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_Polygon
-    __del__ = lambda self : None;
-    def getExteriorRing(*args): return _geos.Polygon_getExteriorRing(*args)
-    def getNumInteriorRings(*args): return _geos.Polygon_getNumInteriorRings(*args)
-    def getInteriorRingN(*args): return _geos.Polygon_getInteriorRingN(*args)
-Polygon_swigregister = _geos.Polygon_swigregister
-Polygon_swigregister(Polygon)
-
-class GeometryCollection(Geometry):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_GeometryCollection
-    __del__ = lambda self : None;
-    def getGeometryN(*args): return _geos.GeometryCollection_getGeometryN(*args)
-GeometryCollection_swigregister = _geos.GeometryCollection_swigregister
-GeometryCollection_swigregister(GeometryCollection)
-
-class MultiPoint(GeometryCollection):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_MultiPoint
-    __del__ = lambda self : None;
-MultiPoint_swigregister = _geos.MultiPoint_swigregister
-MultiPoint_swigregister(MultiPoint)
-
-class MultiLineString(GeometryCollection):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_MultiLineString
-    __del__ = lambda self : None;
-MultiLineString_swigregister = _geos.MultiLineString_swigregister
-MultiLineString_swigregister(MultiLineString)
-
-class MultiLinearRing(GeometryCollection):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_MultiLinearRing
-    __del__ = lambda self : None;
-MultiLinearRing_swigregister = _geos.MultiLinearRing_swigregister
-MultiLinearRing_swigregister(MultiLinearRing)
-
-class MultiPolygon(GeometryCollection):
-    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
-    def __init__(self): raise AttributeError, "No constructor defined"
-    __repr__ = _swig_repr
-    __swig_destroy__ = _geos.delete_MultiPolygon
-    __del__ = lambda self : None;
-MultiPolygon_swigregister = _geos.MultiPolygon_swigregister
-MultiPolygon_swigregister(MultiPolygon)
-
-createPoint = _geos.createPoint
-createLineString = _geos.createLineString
-createLinearRing = _geos.createLinearRing
-createPolygon = _geos.createPolygon
-geomFromWKT = _geos.geomFromWKT
-geomToWKT = _geos.geomToWKT
-getWKBOutputDims = _geos.getWKBOutputDims
-setWKBOutputDims = _geos.setWKBOutputDims
-getWKBByteOrder = _geos.getWKBByteOrder
-setWKBByteOrder = _geos.setWKBByteOrder
-geomFromWKB = _geos.geomFromWKB
-geomToWKB = _geos.geomToWKB
-geomFromHEX = _geos.geomFromHEX
-geomToHEX = _geos.geomToHEX
-
-
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 2.0.4
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+
+
+
+from sys import version_info
+if version_info >= (2,6,0):
+    def swig_import_helper():
+        from os.path import dirname
+        import imp
+        fp = None
+        try:
+            fp, pathname, description = imp.find_module('_geos', [dirname(__file__)])
+        except ImportError:
+            import _geos
+            return _geos
+        if fp is not None:
+            try:
+                _mod = imp.load_module('_geos', fp, pathname, description)
+            finally:
+                fp.close()
+            return _mod
+    _geos = swig_import_helper()
+    del swig_import_helper
+else:
+    import _geos
+del version_info
+try:
+    _swig_property = property
+except NameError:
+    pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+    if (name == "thisown"): return self.this.own(value)
+    if (name == "this"):
+        if type(value).__name__ == 'SwigPyObject':
+            self.__dict__[name] = value
+            return
+    method = class_type.__swig_setmethods__.get(name,None)
+    if method: return method(self,value)
+    if (not static):
+        self.__dict__[name] = value
+    else:
+        raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+    if (name == "thisown"): return self.this.own()
+    method = class_type.__swig_getmethods__.get(name,None)
+    if method: return method(self)
+    raise AttributeError(name)
+
+def _swig_repr(self):
+    try: strthis = "proxy of " + self.this.__repr__()
+    except: strthis = ""
+    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+try:
+    _object = object
+    _newclass = 1
+except AttributeError:
+    class _object : pass
+    _newclass = 0
+
+
+def _swig_setattr_nondynamic_method(set):
+    def set_attr(self,name,value):
+        if (name == "thisown"): return self.this.own(value)
+        if hasattr(self,name) or (name == "this"):
+            set(self,name,value)
+        else:
+            raise AttributeError("You cannot add attributes to %s" % self)
+    return set_attr
+
+
+class SwigPyIterator(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_SwigPyIterator
+    __del__ = lambda self : None;
+    def value(self): return _geos.SwigPyIterator_value(self)
+    def incr(self, n = 1): return _geos.SwigPyIterator_incr(self, n)
+    def decr(self, n = 1): return _geos.SwigPyIterator_decr(self, n)
+    def distance(self, *args): return _geos.SwigPyIterator_distance(self, *args)
+    def equal(self, *args): return _geos.SwigPyIterator_equal(self, *args)
+    def copy(self): return _geos.SwigPyIterator_copy(self)
+    def next(self): return _geos.SwigPyIterator_next(self)
+    def __next__(self): return _geos.SwigPyIterator___next__(self)
+    def previous(self): return _geos.SwigPyIterator_previous(self)
+    def advance(self, *args): return _geos.SwigPyIterator_advance(self, *args)
+    def __eq__(self, *args): return _geos.SwigPyIterator___eq__(self, *args)
+    def __ne__(self, *args): return _geos.SwigPyIterator___ne__(self, *args)
+    def __iadd__(self, *args): return _geos.SwigPyIterator___iadd__(self, *args)
+    def __isub__(self, *args): return _geos.SwigPyIterator___isub__(self, *args)
+    def __add__(self, *args): return _geos.SwigPyIterator___add__(self, *args)
+    def __sub__(self, *args): return _geos.SwigPyIterator___sub__(self, *args)
+    def __iter__(self): return self
+SwigPyIterator_swigregister = _geos.SwigPyIterator_swigregister
+SwigPyIterator_swigregister(SwigPyIterator)
+
+GEOS_VERSION_MAJOR = _geos.GEOS_VERSION_MAJOR
+GEOS_VERSION_MINOR = _geos.GEOS_VERSION_MINOR
+GEOS_VERSION_PATCH = _geos.GEOS_VERSION_PATCH
+GEOS_VERSION = _geos.GEOS_VERSION
+GEOS_JTS_PORT = _geos.GEOS_JTS_PORT
+GEOS_CAPI_VERSION_MAJOR = _geos.GEOS_CAPI_VERSION_MAJOR
+GEOS_CAPI_VERSION_MINOR = _geos.GEOS_CAPI_VERSION_MINOR
+GEOS_CAPI_VERSION_PATCH = _geos.GEOS_CAPI_VERSION_PATCH
+GEOS_CAPI_FIRST_INTERFACE = _geos.GEOS_CAPI_FIRST_INTERFACE
+GEOS_CAPI_LAST_INTERFACE = _geos.GEOS_CAPI_LAST_INTERFACE
+GEOS_CAPI_VERSION = _geos.GEOS_CAPI_VERSION
+GEOS_POINT = _geos.GEOS_POINT
+GEOS_LINESTRING = _geos.GEOS_LINESTRING
+GEOS_LINEARRING = _geos.GEOS_LINEARRING
+GEOS_POLYGON = _geos.GEOS_POLYGON
+GEOS_MULTIPOINT = _geos.GEOS_MULTIPOINT
+GEOS_MULTILINESTRING = _geos.GEOS_MULTILINESTRING
+GEOS_MULTIPOLYGON = _geos.GEOS_MULTIPOLYGON
+GEOS_GEOMETRYCOLLECTION = _geos.GEOS_GEOMETRYCOLLECTION
+GEOS_WKB_XDR = _geos.GEOS_WKB_XDR
+GEOS_WKB_NDR = _geos.GEOS_WKB_NDR
+
+def version():
+  return _geos.version()
+version = _geos.version
+class CoordinateSequence(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _geos.new_CoordinateSequence(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_CoordinateSequence
+    __del__ = lambda self : None;
+    def clone(self): return _geos.CoordinateSequence_clone(self)
+    def setX(self, *args): return _geos.CoordinateSequence_setX(self, *args)
+    def setY(self, *args): return _geos.CoordinateSequence_setY(self, *args)
+    def setZ(self, *args): return _geos.CoordinateSequence_setZ(self, *args)
+    def setOrdinate(self, *args): return _geos.CoordinateSequence_setOrdinate(self, *args)
+    def getX(self, *args): return _geos.CoordinateSequence_getX(self, *args)
+    def getY(self, *args): return _geos.CoordinateSequence_getY(self, *args)
+    def getZ(self, *args): return _geos.CoordinateSequence_getZ(self, *args)
+    def getOrdinate(self, *args): return _geos.CoordinateSequence_getOrdinate(self, *args)
+    def getSize(self): return _geos.CoordinateSequence_getSize(self)
+    def getDimensions(self): return _geos.CoordinateSequence_getDimensions(self)
+CoordinateSequence_swigregister = _geos.CoordinateSequence_swigregister
+CoordinateSequence_swigregister(CoordinateSequence)
+
+class Geometry(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_Geometry
+    __del__ = lambda self : None;
+    def clone(self): return _geos.Geometry_clone(self)
+    def geomType(self): return _geos.Geometry_geomType(self)
+    def typeId(self): return _geos.Geometry_typeId(self)
+    def normalize(self): return _geos.Geometry_normalize(self)
+    def getSRID(self): return _geos.Geometry_getSRID(self)
+    def setSRID(self, *args): return _geos.Geometry_setSRID(self, *args)
+    def getDimensions(self): return _geos.Geometry_getDimensions(self)
+    def getNumGeometries(self): return _geos.Geometry_getNumGeometries(self)
+    def intersection(self, *args): return _geos.Geometry_intersection(self, *args)
+    def buffer(self, *args): return _geos.Geometry_buffer(self, *args)
+    def convexHull(self): return _geos.Geometry_convexHull(self)
+    def difference(self, *args): return _geos.Geometry_difference(self, *args)
+    def symDifference(self, *args): return _geos.Geometry_symDifference(self, *args)
+    def boundary(self): return _geos.Geometry_boundary(self)
+    def union(self, *args): return _geos.Geometry_union(self, *args)
+    def pointOnSurface(self): return _geos.Geometry_pointOnSurface(self)
+    def getCentroid(self): return _geos.Geometry_getCentroid(self)
+    def getEnvelope(self): return _geos.Geometry_getEnvelope(self)
+    def relate(self, *args): return _geos.Geometry_relate(self, *args)
+    def lineMerge(self): return _geos.Geometry_lineMerge(self)
+    def simplify(self, *args): return _geos.Geometry_simplify(self, *args)
+    def topologyPreserveSimplify(self, *args): return _geos.Geometry_topologyPreserveSimplify(self, *args)
+    def relatePattern(self, *args): return _geos.Geometry_relatePattern(self, *args)
+    def disjoint(self, *args): return _geos.Geometry_disjoint(self, *args)
+    def touches(self, *args): return _geos.Geometry_touches(self, *args)
+    def intersects(self, *args): return _geos.Geometry_intersects(self, *args)
+    def crosses(self, *args): return _geos.Geometry_crosses(self, *args)
+    def within(self, *args): return _geos.Geometry_within(self, *args)
+    def contains(self, *args): return _geos.Geometry_contains(self, *args)
+    def overlaps(self, *args): return _geos.Geometry_overlaps(self, *args)
+    def equals(self, *args): return _geos.Geometry_equals(self, *args)
+    def equalsExact(self, *args): return _geos.Geometry_equalsExact(self, *args)
+    def isEmpty(self): return _geos.Geometry_isEmpty(self)
+    def isValid(self): return _geos.Geometry_isValid(self)
+    def isSimple(self): return _geos.Geometry_isSimple(self)
+    def isRing(self): return _geos.Geometry_isRing(self)
+    def hasZ(self): return _geos.Geometry_hasZ(self)
+    def area(self): return _geos.Geometry_area(self)
+    def length(self): return _geos.Geometry_length(self)
+    def distance(self, *args): return _geos.Geometry_distance(self, *args)
+Geometry_swigregister = _geos.Geometry_swigregister
+Geometry_swigregister(Geometry)
+
+class Point(Geometry):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_Point
+    __del__ = lambda self : None;
+    def getCoordSeq(self): return _geos.Point_getCoordSeq(self)
+Point_swigregister = _geos.Point_swigregister
+Point_swigregister(Point)
+
+class LineString(Geometry):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_LineString
+    __del__ = lambda self : None;
+    def getCoordSeq(self): return _geos.LineString_getCoordSeq(self)
+LineString_swigregister = _geos.LineString_swigregister
+LineString_swigregister(LineString)
+
+class LinearRing(Geometry):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_LinearRing
+    __del__ = lambda self : None;
+    def getCoordSeq(self): return _geos.LinearRing_getCoordSeq(self)
+LinearRing_swigregister = _geos.LinearRing_swigregister
+LinearRing_swigregister(LinearRing)
+
+class Polygon(Geometry):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_Polygon
+    __del__ = lambda self : None;
+    def getExteriorRing(self): return _geos.Polygon_getExteriorRing(self)
+    def getNumInteriorRings(self): return _geos.Polygon_getNumInteriorRings(self)
+    def getInteriorRingN(self, *args): return _geos.Polygon_getInteriorRingN(self, *args)
+Polygon_swigregister = _geos.Polygon_swigregister
+Polygon_swigregister(Polygon)
+
+class GeometryCollection(Geometry):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_GeometryCollection
+    __del__ = lambda self : None;
+    def getGeometryN(self, *args): return _geos.GeometryCollection_getGeometryN(self, *args)
+GeometryCollection_swigregister = _geos.GeometryCollection_swigregister
+GeometryCollection_swigregister(GeometryCollection)
+
+class MultiPoint(GeometryCollection):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_MultiPoint
+    __del__ = lambda self : None;
+MultiPoint_swigregister = _geos.MultiPoint_swigregister
+MultiPoint_swigregister(MultiPoint)
+
+class MultiLineString(GeometryCollection):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_MultiLineString
+    __del__ = lambda self : None;
+MultiLineString_swigregister = _geos.MultiLineString_swigregister
+MultiLineString_swigregister(MultiLineString)
+
+class MultiLinearRing(GeometryCollection):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_MultiLinearRing
+    __del__ = lambda self : None;
+MultiLinearRing_swigregister = _geos.MultiLinearRing_swigregister
+MultiLinearRing_swigregister(MultiLinearRing)
+
+class MultiPolygon(GeometryCollection):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _geos.delete_MultiPolygon
+    __del__ = lambda self : None;
+MultiPolygon_swigregister = _geos.MultiPolygon_swigregister
+MultiPolygon_swigregister(MultiPolygon)
+
+
+def createPoint(*args):
+  return _geos.createPoint(*args)
+createPoint = _geos.createPoint
+
+def createLineString(*args):
+  return _geos.createLineString(*args)
+createLineString = _geos.createLineString
+
+def createLinearRing(*args):
+  return _geos.createLinearRing(*args)
+createLinearRing = _geos.createLinearRing
+
+def createPolygon(*args):
+  return _geos.createPolygon(*args)
+createPolygon = _geos.createPolygon
+class Prepared(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _geos.new_Prepared(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_Prepared
+    __del__ = lambda self : None;
+    def contains(self, *args): return _geos.Prepared_contains(self, *args)
+    def containsProperly(self, *args): return _geos.Prepared_containsProperly(self, *args)
+    def covers(self, *args): return _geos.Prepared_covers(self, *args)
+    def intersects(self, *args): return _geos.Prepared_intersects(self, *args)
+Prepared_swigregister = _geos.Prepared_swigregister
+Prepared_swigregister(Prepared)
+
+class STRtree(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _geos.new_STRtree(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_STRtree
+    __del__ = lambda self : None;
+    def insert(self, *args): return _geos.STRtree_insert(self, *args)
+    def remove(self, *args): return _geos.STRtree_remove(self, *args)
+    def query(self, *args): return _geos.STRtree_query(self, *args)
+    def iterate(self, *args): return _geos.STRtree_iterate(self, *args)
+STRtree_swigregister = _geos.STRtree_swigregister
+STRtree_swigregister(STRtree)
+
+class WktReader(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self): 
+        this = _geos.new_WktReader()
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_WktReader
+    __del__ = lambda self : None;
+    def read(self, *args): return _geos.WktReader_read(self, *args)
+WktReader_swigregister = _geos.WktReader_swigregister
+WktReader_swigregister(WktReader)
+
+class WktWriter(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self): 
+        this = _geos.new_WktWriter()
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_WktWriter
+    __del__ = lambda self : None;
+    def write(self, *args): return _geos.WktWriter_write(self, *args)
+WktWriter_swigregister = _geos.WktWriter_swigregister
+WktWriter_swigregister(WktWriter)
+
+class WkbReader(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self): 
+        this = _geos.new_WkbReader()
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_WkbReader
+    __del__ = lambda self : None;
+    def read(self, *args): return _geos.WkbReader_read(self, *args)
+    def readHEX(self, *args): return _geos.WkbReader_readHEX(self, *args)
+WkbReader_swigregister = _geos.WkbReader_swigregister
+WkbReader_swigregister(WkbReader)
+
+class WkbWriter(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+    __repr__ = _swig_repr
+    def __init__(self): 
+        this = _geos.new_WkbWriter()
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _geos.delete_WkbWriter
+    __del__ = lambda self : None;
+    def getOutputDimension(self): return _geos.WkbWriter_getOutputDimension(self)
+    def setOutputDimension(self, *args): return _geos.WkbWriter_setOutputDimension(self, *args)
+    def getByteOrder(self): return _geos.WkbWriter_getByteOrder(self)
+    def setByteOrder(self, *args): return _geos.WkbWriter_setByteOrder(self, *args)
+    def getIncludeSRID(self): return _geos.WkbWriter_getIncludeSRID(self)
+    def setIncludeSRID(self, *args): return _geos.WkbWriter_setIncludeSRID(self, *args)
+    def write(self, *args): return _geos.WkbWriter_write(self, *args)
+    def writeHEX(self, *args): return _geos.WkbWriter_writeHEX(self, *args)
+WkbWriter_swigregister = _geos.WkbWriter_swigregister
+WkbWriter_swigregister(WkbWriter)
+
+
+
diff --git a/swig/python/geos_wrap.cxx b/swig/python/geos_wrap.cxx
index 5f57a6d..9cffeb2 100644
--- a/swig/python/geos_wrap.cxx
+++ b/swig/python/geos_wrap.cxx
@@ -1,9253 +1,11086 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.31
- * 
- * This file is not intended to be easily readable and contains a number of 
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
- * ----------------------------------------------------------------------------- */
-
-#define SWIGPYTHON
-#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
-
-#ifdef __cplusplus
-template<class T> class SwigValueWrapper {
-    T *tt;
-public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-#endif
-
-/* -----------------------------------------------------------------------------
- *  This section contains generic SWIG labels for method/variable
- *  declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC)
-#   if (__SUNPRO_CC <= 0x560)
-#     define SWIGTEMPLATEDISAMBIGUATOR template
-#   else
-#     define SWIGTEMPLATEDISAMBIGUATOR 
-#   endif
-# else
-#   define SWIGTEMPLATEDISAMBIGUATOR 
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-#   define SWIGINLINE inline
-# else
-#   define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
-#   else
-#     define SWIGUNUSED
-#   endif
-# elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
-# else
-#   define SWIGUNUSED 
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-#   define SWIGUNUSEDPARM(p)
-# else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
-#  endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   if defined(STATIC_LINKED)
-#     define SWIGEXPORT
-#   else
-#     define SWIGEXPORT __declspec(dllexport)
-#   endif
-# else
-#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-#     define SWIGEXPORT __attribute__ ((visibility("default")))
-#   else
-#     define SWIGEXPORT
-#   endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   define SWIGSTDCALL __stdcall
-# else
-#   define SWIGSTDCALL
-# endif 
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-
-/* Python.h has to appear first */
-#ifdef _DEBUG
-#undef _DEBUG
-#include <Python.h>
-#define _DEBUG
-#undef _CRT_MANIFEST_RETAIL
-#else
-#include <Python.h>
-#endif
-
-/* -----------------------------------------------------------------------------
- * swigrun.swg
- *
- * This file contains generic CAPI SWIG runtime support for pointer
- * type checking.
- * ----------------------------------------------------------------------------- */
-
-/* This should only be incremented when either the layout of swig_type_info changes,
-   or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "3"
-
-/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
-#ifdef SWIG_TYPE_TABLE
-# define SWIG_QUOTE_STRING(x) #x
-# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
-# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
-#else
-# define SWIG_TYPE_TABLE_NAME
-#endif
-
-/*
-  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
-*/
-
-#ifndef SWIGRUNTIME
-# define SWIGRUNTIME SWIGINTERN
-#endif
-
-#ifndef SWIGRUNTIMEINLINE
-# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
-#endif
-
-/*  Generic buffer size */
-#ifndef SWIG_BUFFER_SIZE
-# define SWIG_BUFFER_SIZE 1024
-#endif
-
-/* Flags for pointer conversions */
-#define SWIG_POINTER_DISOWN        0x1
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_OWN           0x1
-
-
-/* 
-   Flags/methods for returning states.
-   
-   The swig conversion methods, as ConvertPtr, return and integer 
-   that tells if the conversion was successful or not. And if not,
-   an error code can be returned (see swigerrors.swg for the codes).
-   
-   Use the following macros/flags to set or process the returning
-   states.
-   
-   In old swig versions, you usually write code as:
-
-     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
-       // success code
-     } else {
-       //fail code
-     }
-
-   Now you can be more explicit as:
-
-    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-    } else {
-      // fail code
-    }
-
-   that seems to be the same, but now you can also do
-
-    Type *ptr;
-    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-      if (SWIG_IsNewObj(res) {
-        ...
-	delete *ptr;
-      } else {
-        ...
-      }
-    } else {
-      // fail code
-    }
-    
-   I.e., now SWIG_ConvertPtr can return new objects and you can
-   identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {         
-        if (<obj is ok>) {			       
-          if (<need new object>) {		       
-            *ptr = <ptr to new allocated object>; 
-            return SWIG_NEWOBJ;		       
-          } else {				       
-            *ptr = <ptr to old object>;	       
-            return SWIG_OLDOBJ;		       
-          } 				       
-        } else {				       
-          return SWIG_BADOBJ;		       
-        }					       
-      }
-
-   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
-   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
-
-   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
-   allows to return the 'cast rank', for example, if you have this
-
-       int food(double)
-       int fooi(int);
-
-   and you call
- 
-      food(1)   // cast rank '1'  (1 -> 1.0)
-      fooi(1)   // cast rank '0'
-
-   just use the SWIG_AddCast()/SWIG_CheckState()
-
-
- */
-#define SWIG_OK                    (0) 
-#define SWIG_ERROR                 (-1)
-#define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
-
-/* The CastRankLimit says how many bits are used for the cast rank */
-#define SWIG_CASTRANKLIMIT         (1 << 8)
-/* The NewMask denotes the object was created (using new/malloc) */
-#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
-/* The TmpMask is for in/out typemaps that use temporal objects */
-#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
-/* Simple returning values */
-#define SWIG_BADOBJ                (SWIG_ERROR)
-#define SWIG_OLDOBJ                (SWIG_OK)
-#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
-#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
-/* Check, add and del mask methods */
-#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
-#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
-#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
-#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
-#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
-#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
-
-
-/* Cast-Rank Mode */
-#if defined(SWIG_CASTRANK_MODE)
-#  ifndef SWIG_TypeRank
-#    define SWIG_TypeRank             unsigned long
-#  endif
-#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
-#    define SWIG_MAXCASTRANK          (2)
-#  endif
-#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
-#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) { 
-  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
-}
-SWIGINTERNINLINE int SWIG_CheckState(int r) { 
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
-}
-#else /* no cast-rank mode */
-#  define SWIG_AddCast
-#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
-#endif
-
-
-
-
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *(*swig_converter_func)(void *);
-typedef struct swig_type_info *(*swig_dycast_func)(void **);
-
-/* Structure to store inforomation on one type */
-typedef struct swig_type_info {
-  const char             *name;			/* mangled name of this type */
-  const char             *str;			/* human readable name of this type */
-  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
-  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
-  void                   *clientdata;		/* language specific type data */
-  int                    owndata;		/* flag if the structure owns the clientdata */
-} swig_type_info;
-
-/* Structure to store a type and conversion function used for casting */
-typedef struct swig_cast_info {
-  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
-  swig_converter_func     converter;		/* function to cast the void pointers */
-  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
-  struct swig_cast_info  *prev;			/* pointer to the previous cast */
-} swig_cast_info;
-
-/* Structure used to store module information
- * Each module generates one structure like this, and the runtime collects
- * all of these structures and stores them in a circularly linked list.*/
-typedef struct swig_module_info {
-  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
-  size_t                 size;		        /* Number of types in this module */
-  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
-  swig_type_info         **type_initial;	/* Array of initially generated type structures */
-  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
-  void                    *clientdata;		/* Language specific module data */
-} swig_module_info;
-
-/* 
-  Compare two type names skipping the space characters, therefore
-  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
-
-  Return 0 when the two name types are equivalent, as in
-  strncmp, but skipping ' '.
-*/
-SWIGRUNTIME int
-SWIG_TypeNameComp(const char *f1, const char *l1,
-		  const char *f2, const char *l2) {
-  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
-    while ((*f1 == ' ') && (f1 != l1)) ++f1;
-    while ((*f2 == ' ') && (f2 != l2)) ++f2;
-    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
-  }
-  return (l1 - f1) - (l2 - f2);
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
-*/
-SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
-*/
-SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
-}
-
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
-/*
-  Check the typename
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
-}
-
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
-}
-
-/*
-  Cast a pointer up an inheritance hierarchy
-*/
-SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
-}
-
-/* 
-   Dynamic pointer casting. Down an inheritance hierarchy
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
-  swig_type_info *lastty = ty;
-  if (!ty || !ty->dcast) return ty;
-  while (ty && (ty->dcast)) {
-    ty = (*ty->dcast)(ptr);
-    if (ty) lastty = ty;
-  }
-  return lastty;
-}
-
-/*
-  Return the name associated with this type
-*/
-SWIGRUNTIMEINLINE const char *
-SWIG_TypeName(const swig_type_info *ty) {
-  return ty->name;
-}
-
-/*
-  Return the pretty name associated with this type,
-  that is an unmangled type name in a form presentable to the user.
-*/
-SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
-  /* The "str" field contains the equivalent pretty names of the
-     type, separated by vertical-bar characters.  We choose
-     to print the last name, as it is often (?) the most
-     specific. */
-  if (!type) return NULL;
-  if (type->str != NULL) {
-    const char *last_name = type->str;
-    const char *s;
-    for (s = type->str; *s; s++)
-      if (*s == '|') last_name = s+1;
-    return last_name;
-  }
-  else
-    return type->name;
-}
-
-/* 
-   Set the clientdata field for a type
-*/
-SWIGRUNTIME void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
-  swig_cast_info *cast = ti->cast;
-  /* if (ti->clientdata == clientdata) return; */
-  ti->clientdata = clientdata;
-  
-  while (cast) {
-    if (!cast->converter) {
-      swig_type_info *tc = cast->type;
-      if (!tc->clientdata) {
-	SWIG_TypeClientData(tc, clientdata);
-      }
-    }    
-    cast = cast->next;
-  }
-}
-SWIGRUNTIME void
-SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
-  SWIG_TypeClientData(ti, clientdata);
-  ti->owndata = 1;
-}
-  
-/*
-  Search for a swig_type_info structure only by mangled name
-  Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
-		            const char *name) {
-  swig_module_info *iter = start;
-  do {
-    if (iter->size) {
-      register size_t l = 0;
-      register size_t r = iter->size - 1;
-      do {
-	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
-	register size_t i = (l + r) >> 1; 
-	const char *iname = iter->types[i]->name;
-	if (iname) {
-	  register int compare = strcmp(name, iname);
-	  if (compare == 0) {	    
-	    return iter->types[i];
-	  } else if (compare < 0) {
-	    if (i) {
-	      r = i - 1;
-	    } else {
-	      break;
-	    }
-	  } else if (compare > 0) {
-	    l = i + 1;
-	  }
-	} else {
-	  break; /* should never happen */
-	}
-      } while (l <= r);
-    }
-    iter = iter->next;
-  } while (iter != end);
-  return 0;
-}
-
-/*
-  Search for a swig_type_info structure for either a mangled name or a human readable name.
-  It first searches the mangled names of the types, which is a O(log #types)
-  If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
-		     const char *name) {
-  /* STEP 1: Search the name field using binary search */
-  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
-  if (ret) {
-    return ret;
-  } else {
-    /* STEP 2: If the type hasn't been found, do a complete search
-       of the str field (the human readable name) */
-    swig_module_info *iter = start;
-    do {
-      register size_t i = 0;
-      for (; i < iter->size; ++i) {
-	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
-	  return iter->types[i];
-      }
-      iter = iter->next;
-    } while (iter != end);
-  }
-  
-  /* neither found a match */
-  return 0;
-}
-
-/* 
-   Pack binary data into a string
-*/
-SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
-  static const char hex[17] = "0123456789abcdef";
-  register const unsigned char *u = (unsigned char *) ptr;
-  register const unsigned char *eu =  u + sz;
-  for (; u != eu; ++u) {
-    register unsigned char uu = *u;
-    *(c++) = hex[(uu & 0xf0) >> 4];
-    *(c++) = hex[uu & 0xf];
-  }
-  return c;
-}
-
-/* 
-   Unpack binary data from a string
-*/
-SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
-  register unsigned char *u = (unsigned char *) ptr;
-  register const unsigned char *eu = u + sz;
-  for (; u != eu; ++u) {
-    register char d = *(c++);
-    register unsigned char uu;
-    if ((d >= '0') && (d <= '9'))
-      uu = ((d - '0') << 4);
-    else if ((d >= 'a') && (d <= 'f'))
-      uu = ((d - ('a'-10)) << 4);
-    else 
-      return (char *) 0;
-    d = *(c++);
-    if ((d >= '0') && (d <= '9'))
-      uu |= (d - '0');
-    else if ((d >= 'a') && (d <= 'f'))
-      uu |= (d - ('a'-10));
-    else 
-      return (char *) 0;
-    *u = uu;
-  }
-  return c;
-}
-
-/* 
-   Pack 'void *' into a string buffer.
-*/
-SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
-  char *r = buff;
-  if ((2*sizeof(void *) + 2) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,&ptr,sizeof(void *));
-  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
-  strcpy(r,name);
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      *ptr = (void *) 0;
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sizeof(void *));
-}
-
-SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
-  char *r = buff;
-  size_t lname = (name ? strlen(name) : 0);
-  if ((2*sz + 2 + lname) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,ptr,sz);
-  if (lname) {
-    strncpy(r,name,lname+1);
-  } else {
-    *r = 0;
-  }
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      memset(ptr,0,sz);
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sz);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-/*  Errors in SWIG */
-#define  SWIG_UnknownError    	   -1 
-#define  SWIG_IOError        	   -2 
-#define  SWIG_RuntimeError   	   -3 
-#define  SWIG_IndexError     	   -4 
-#define  SWIG_TypeError      	   -5 
-#define  SWIG_DivisionByZero 	   -6 
-#define  SWIG_OverflowError  	   -7 
-#define  SWIG_SyntaxError    	   -8 
-#define  SWIG_ValueError     	   -9 
-#define  SWIG_SystemError    	   -10
-#define  SWIG_AttributeError 	   -11
-#define  SWIG_MemoryError    	   -12 
-#define  SWIG_NullReferenceError   -13
-
-
-
-
-/* Add PyOS_snprintf for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
-#  define PyOS_snprintf _snprintf
-# else
-#  define PyOS_snprintf snprintf
-# endif
-#endif
-
-/* A crude PyString_FromFormat implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-
-#ifndef SWIG_PYBUFFER_SIZE
-# define SWIG_PYBUFFER_SIZE 1024
-#endif
-
-static PyObject *
-PyString_FromFormat(const char *fmt, ...) {
-  va_list ap;
-  char buf[SWIG_PYBUFFER_SIZE * 2];
-  int res;
-  va_start(ap, fmt);
-  res = vsnprintf(buf, sizeof(buf), fmt, ap);
-  va_end(ap);
-  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
-}
-#endif
-
-/* Add PyObject_Del for old Pythons */
-#if PY_VERSION_HEX < 0x01060000
-# define PyObject_Del(op) PyMem_DEL((op))
-#endif
-#ifndef PyObject_DEL
-# define PyObject_DEL PyObject_Del
-#endif
-
-/* A crude PyExc_StopIteration exception for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# ifndef PyExc_StopIteration
-#  define PyExc_StopIteration PyExc_RuntimeError
-# endif
-# ifndef PyObject_GenericGetAttr
-#  define PyObject_GenericGetAttr 0
-# endif
-#endif
-/* Py_NotImplemented is defined in 2.1 and up. */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef Py_NotImplemented
-#  define Py_NotImplemented PyExc_RuntimeError
-# endif
-#endif
-
-
-/* A crude PyString_AsStringAndSize implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef PyString_AsStringAndSize
-#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
-# endif
-#endif
-
-/* PySequence_Size for old Pythons */
-#if PY_VERSION_HEX < 0x02000000
-# ifndef PySequence_Size
-#  define PySequence_Size PySequence_Length
-# endif
-#endif
-
-
-/* PyBool_FromLong for old Pythons */
-#if PY_VERSION_HEX < 0x02030000
-static
-PyObject *PyBool_FromLong(long ok)
-{
-  PyObject *result = ok ? Py_True : Py_False;
-  Py_INCREF(result);
-  return result;
-}
-#endif
-
-/* Py_ssize_t for old Pythons */
-/* This code is as recommended by: */
-/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-#endif
-
-/* -----------------------------------------------------------------------------
- * error manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIME PyObject*
-SWIG_Python_ErrorType(int code) {
-  PyObject* type = 0;
-  switch(code) {
-  case SWIG_MemoryError:
-    type = PyExc_MemoryError;
-    break;
-  case SWIG_IOError:
-    type = PyExc_IOError;
-    break;
-  case SWIG_RuntimeError:
-    type = PyExc_RuntimeError;
-    break;
-  case SWIG_IndexError:
-    type = PyExc_IndexError;
-    break;
-  case SWIG_TypeError:
-    type = PyExc_TypeError;
-    break;
-  case SWIG_DivisionByZero:
-    type = PyExc_ZeroDivisionError;
-    break;
-  case SWIG_OverflowError:
-    type = PyExc_OverflowError;
-    break;
-  case SWIG_SyntaxError:
-    type = PyExc_SyntaxError;
-    break;
-  case SWIG_ValueError:
-    type = PyExc_ValueError;
-    break;
-  case SWIG_SystemError:
-    type = PyExc_SystemError;
-    break;
-  case SWIG_AttributeError:
-    type = PyExc_AttributeError;
-    break;
-  default:
-    type = PyExc_RuntimeError;
-  }
-  return type;
-}
-
-
-SWIGRUNTIME void
-SWIG_Python_AddErrorMsg(const char* mesg)
-{
-  PyObject *type = 0;
-  PyObject *value = 0;
-  PyObject *traceback = 0;
-
-  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
-  if (value) {
-    PyObject *old_str = PyObject_Str(value);
-    PyErr_Clear();
-    Py_XINCREF(type);
-    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
-    Py_DECREF(old_str);
-    Py_DECREF(value);
-  } else {
-    PyErr_Format(PyExc_RuntimeError, mesg);
-  }
-}
-
-
-
-#if defined(SWIG_PYTHON_NO_THREADS)
-#  if defined(SWIG_PYTHON_THREADS)
-#    undef SWIG_PYTHON_THREADS
-#  endif
-#endif
-#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
-#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
-#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
-#      define SWIG_PYTHON_USE_GIL
-#    endif
-#  endif
-#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
-#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
-#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
-#    endif
-#    ifdef __cplusplus /* C++ code */
-       class SWIG_Python_Thread_Block {
-         bool status;
-         PyGILState_STATE state;
-       public:
-         void end() { if (status) { PyGILState_Release(state); status = false;} }
-         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
-         ~SWIG_Python_Thread_Block() { end(); }
-       };
-       class SWIG_Python_Thread_Allow {
-         bool status;
-         PyThreadState *save;
-       public:
-         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
-         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
-         ~SWIG_Python_Thread_Allow() { end(); }
-       };
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
-#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
-#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
-#    else /* C code */
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
-#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
-#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
-#    endif
-#  else /* Old thread way, not implemented, user must provide it */
-#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
-#      define SWIG_PYTHON_INITIALIZE_THREADS
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
-#      define SWIG_PYTHON_THREAD_END_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
-#      define SWIG_PYTHON_THREAD_END_ALLOW
-#    endif
-#  endif
-#else /* No thread support */
-#  define SWIG_PYTHON_INITIALIZE_THREADS
-#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#  define SWIG_PYTHON_THREAD_END_BLOCK
-#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#  define SWIG_PYTHON_THREAD_END_ALLOW
-#endif
-
-/* -----------------------------------------------------------------------------
- * Python API portion that goes into the runtime
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* cc-mode */
-#endif
-#endif
-
-/* -----------------------------------------------------------------------------
- * Constant declarations
- * ----------------------------------------------------------------------------- */
-
-/* Constant Types */
-#define SWIG_PY_POINTER 4
-#define SWIG_PY_BINARY  5
-
-/* Constant information structure */
-typedef struct swig_const_info {
-  int type;
-  char *name;
-  long lvalue;
-  double dvalue;
-  void   *pvalue;
-  swig_type_info **ptype;
-} swig_const_info;
-
-#ifdef __cplusplus
-#if 0
-{ /* cc-mode */
-#endif
-}
-#endif
-
-
-/* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
- * pyrun.swg
- *
- * This file contains the runtime support for Python modules
- * and includes code for managing global variables and pointer
- * type checking.
- *
- * ----------------------------------------------------------------------------- */
-
-/* Common SWIG API */
-
-/* for raw pointers */
-#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
-#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
-#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
-#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
-#define swig_owntype                                    int
-
-/* for raw packed data */
-#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-/* for class or struct pointers */
-#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
-
-/* for C or C++ function pointers */
-#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
-#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
-
-/* for C++ member pointers, ie, member methods */
-#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-
-/* Runtime API */
-
-#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
-#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
-
-#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
-#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
-#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
-#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
-#define SWIG_fail                        		goto fail					   
-
-
-/* Runtime API implementation */
-
-/* Error manipulation */
-
-SWIGINTERN void 
-SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
-  PyErr_SetObject(errtype, obj);
-  Py_DECREF(obj);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-SWIGINTERN void 
-SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-  PyErr_SetString(errtype, (char *) msg);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
-
-/* Set a constant value */
-
-SWIGINTERN void
-SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
-  PyDict_SetItemString(d, (char*) name, obj);
-  Py_DECREF(obj);                            
-}
-
-/* Append a value to the result obj */
-
-SWIGINTERN PyObject*
-SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
-#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyList_Check(result)) {
-      PyObject *o2 = result;
-      result = PyList_New(1);
-      PyList_SetItem(result, 0, o2);
-    }
-    PyList_Append(result,obj);
-    Py_DECREF(obj);
-  }
-  return result;
-#else
-  PyObject*   o2;
-  PyObject*   o3;
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyTuple_Check(result)) {
-      o2 = result;
-      result = PyTuple_New(1);
-      PyTuple_SET_ITEM(result, 0, o2);
-    }
-    o3 = PyTuple_New(1);
-    PyTuple_SET_ITEM(o3, 0, obj);
-    o2 = result;
-    result = PySequence_Concat(o2, o3);
-    Py_DECREF(o2);
-    Py_DECREF(o3);
-  }
-  return result;
-#endif
-}
-
-/* Unpack the argument tuple */
-
-SWIGINTERN int
-SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
-{
-  if (!args) {
-    if (!min && !max) {
-      return 1;
-    } else {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
-		   name, (min == max ? "" : "at least "), min);
-      return 0;
-    }
-  }  
-  if (!PyTuple_Check(args)) {
-    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
-    return 0;
-  } else {
-    register int l = PyTuple_GET_SIZE(args);
-    if (l < min) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at least "), min, l);
-      return 0;
-    } else if (l > max) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at most "), max, l);
-      return 0;
-    } else {
-      register int i;
-      for (i = 0; i < l; ++i) {
-	objs[i] = PyTuple_GET_ITEM(args, i);
-      }
-      for (; l < max; ++l) {
-	objs[l] = 0;
-      }
-      return i + 1;
-    }    
-  }
-}
-
-/* A functor is a function object with one single object argument */
-#if PY_VERSION_HEX >= 0x02020000
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
-#else
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
-#endif
-
-/*
-  Helper for static pointer initialization for both C and C++ code, for example
-  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
-*/
-#ifdef __cplusplus
-#define SWIG_STATIC_POINTER(var)  var
-#else
-#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
-#endif
-
-/* -----------------------------------------------------------------------------
- * Pointer declarations
- * ----------------------------------------------------------------------------- */
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
-#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
-
-#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* cc-mode */
-#endif
-#endif
-
-/*  How to access Py_None */
-#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#  ifndef SWIG_PYTHON_NO_BUILD_NONE
-#    ifndef SWIG_PYTHON_BUILD_NONE
-#      define SWIG_PYTHON_BUILD_NONE
-#    endif
-#  endif
-#endif
-
-#ifdef SWIG_PYTHON_BUILD_NONE
-#  ifdef Py_None
-#   undef Py_None
-#   define Py_None SWIG_Py_None()
-#  endif
-SWIGRUNTIMEINLINE PyObject * 
-_SWIG_Py_None(void)
-{
-  PyObject *none = Py_BuildValue((char*)"");
-  Py_DECREF(none);
-  return none;
-}
-SWIGRUNTIME PyObject * 
-SWIG_Py_None(void)
-{
-  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
-  return none;
-}
-#endif
-
-/* The python void return value */
-
-SWIGRUNTIMEINLINE PyObject * 
-SWIG_Py_Void(void)
-{
-  PyObject *none = Py_None;
-  Py_INCREF(none);
-  return none;
-}
-
-/* PySwigClientData */
-
-typedef struct {
-  PyObject *klass;
-  PyObject *newraw;
-  PyObject *newargs;
-  PyObject *destroy;
-  int delargs;
-  int implicitconv;
-} PySwigClientData;
-
-SWIGRUNTIMEINLINE int 
-SWIG_Python_CheckImplicit(swig_type_info *ty)
-{
-  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
-  return data ? data->implicitconv : 0;
-}
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_ExceptionType(swig_type_info *desc) {
-  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
-  PyObject *klass = data ? data->klass : 0;
-  return (klass ? klass : PyExc_RuntimeError);
-}
-
-
-SWIGRUNTIME PySwigClientData * 
-PySwigClientData_New(PyObject* obj)
-{
-  if (!obj) {
-    return 0;
-  } else {
-    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
-    /* the klass element */
-    data->klass = obj;
-    Py_INCREF(data->klass);
-    /* the newraw method and newargs arguments used to create a new raw instance */
-    if (PyClass_Check(obj)) {
-      data->newraw = 0;
-      data->newargs = obj;
-      Py_INCREF(obj);
-    } else {
-#if (PY_VERSION_HEX < 0x02020000)
-      data->newraw = 0;
-#else
-      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
-#endif
-      if (data->newraw) {
-	Py_INCREF(data->newraw);
-	data->newargs = PyTuple_New(1);
-	PyTuple_SetItem(data->newargs, 0, obj);
-      } else {
-	data->newargs = obj;
-      }
-      Py_INCREF(data->newargs);
-    }
-    /* the destroy method, aka as the C++ delete method */
-    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      data->destroy = 0;
-    }
-    if (data->destroy) {
-      int flags;
-      Py_INCREF(data->destroy);
-      flags = PyCFunction_GET_FLAGS(data->destroy);
-#ifdef METH_O
-      data->delargs = !(flags & (METH_O));
-#else
-      data->delargs = 0;
-#endif
-    } else {
-      data->delargs = 0;
-    }
-    data->implicitconv = 0;
-    return data;
-  }
-}
-
-SWIGRUNTIME void 
-PySwigClientData_Del(PySwigClientData* data)
-{
-  Py_XDECREF(data->newraw);
-  Py_XDECREF(data->newargs);
-  Py_XDECREF(data->destroy);
-}
-
-/* =============== PySwigObject =====================*/
-
-typedef struct {
-  PyObject_HEAD
-  void *ptr;
-  swig_type_info *ty;
-  int own;
-  PyObject *next;
-} PySwigObject;
-
-SWIGRUNTIME PyObject *
-PySwigObject_long(PySwigObject *v)
-{
-  return PyLong_FromVoidPtr(v->ptr);
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_format(const char* fmt, PySwigObject *v)
-{
-  PyObject *res = NULL;
-  PyObject *args = PyTuple_New(1);
-  if (args) {
-    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
-      PyObject *ofmt = PyString_FromString(fmt);
-      if (ofmt) {
-	res = PyString_Format(ofmt,args);
-	Py_DECREF(ofmt);
-      }
-      Py_DECREF(args);
-    }
-  }
-  return res;
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_oct(PySwigObject *v)
-{
-  return PySwigObject_format("%o",v);
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_hex(PySwigObject *v)
-{
-  return PySwigObject_format("%x",v);
-}
-
-SWIGRUNTIME PyObject *
-#ifdef METH_NOARGS
-PySwigObject_repr(PySwigObject *v)
-#else
-PySwigObject_repr(PySwigObject *v, PyObject *args)
-#endif
-{
-  const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *hex = PySwigObject_hex(v);    
-  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
-  Py_DECREF(hex);
-  if (v->next) {
-#ifdef METH_NOARGS
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
-#else
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
-#endif
-    PyString_ConcatAndDel(&repr,nrep);
-  }
-  return repr;  
-}
-
-SWIGRUNTIME int
-PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
-{
-#ifdef METH_NOARGS
-  PyObject *repr = PySwigObject_repr(v);
-#else
-  PyObject *repr = PySwigObject_repr(v, NULL);
-#endif
-  if (repr) {
-    fputs(PyString_AsString(repr), fp);
-    Py_DECREF(repr);
-    return 0; 
-  } else {
-    return 1; 
-  }
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_str(PySwigObject *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
-    PyString_FromString(result) : 0;
-}
-
-SWIGRUNTIME int
-PySwigObject_compare(PySwigObject *v, PySwigObject *w)
-{
-  void *i = v->ptr;
-  void *j = w->ptr;
-  return (i < j) ? -1 : ((i > j) ? 1 : 0);
-}
-
-SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
-
-SWIGRUNTIME PyTypeObject*
-PySwigObject_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
-  return type;
-}
-
-SWIGRUNTIMEINLINE int
-PySwigObject_Check(PyObject *op) {
-  return ((op)->ob_type == PySwigObject_type())
-    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own);
-
-SWIGRUNTIME void
-PySwigObject_dealloc(PyObject *v)
-{
-  PySwigObject *sobj = (PySwigObject *) v;
-  PyObject *next = sobj->next;
-  if (sobj->own) {
-    swig_type_info *ty = sobj->ty;
-    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
-    PyObject *destroy = data ? data->destroy : 0;
-    if (destroy) {
-      /* destroy is always a VARARGS method */
-      PyObject *res;
-      if (data->delargs) {
-	/* we need to create a temporal object to carry the destroy operation */
-	PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
-	res = SWIG_Python_CallFunctor(destroy, tmp);
-	Py_DECREF(tmp);
-      } else {
-	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
-	PyObject *mself = PyCFunction_GET_SELF(destroy);
-	res = ((*meth)(mself, v));
-      }
-      Py_XDECREF(res);
-    } else {
-      const char *name = SWIG_TypePrettyName(ty);
-#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
-#endif
-    }
-  } 
-  Py_XDECREF(next);
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyObject* 
-PySwigObject_append(PyObject* v, PyObject* next)
-{
-  PySwigObject *sobj = (PySwigObject *) v;
-#ifndef METH_O
-  PyObject *tmp = 0;
-  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
-  next = tmp;
-#endif
-  if (!PySwigObject_Check(next)) {
-    return NULL;
-  }
-  sobj->next = next;
-  Py_INCREF(next);
-  return SWIG_Py_Void();
-}
-
-SWIGRUNTIME PyObject* 
-#ifdef METH_NOARGS
-PySwigObject_next(PyObject* v)
-#else
-PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  PySwigObject *sobj = (PySwigObject *) v;
-  if (sobj->next) {    
-    Py_INCREF(sobj->next);
-    return sobj->next;
-  } else {
-    return SWIG_Py_Void();
-  }
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-PySwigObject_disown(PyObject *v)
-#else
-PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  PySwigObject *sobj = (PySwigObject *)v;
-  sobj->own = 0;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-PySwigObject_acquire(PyObject *v)
-#else
-PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  PySwigObject *sobj = (PySwigObject *)v;
-  sobj->own = SWIG_POINTER_OWN;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-PySwigObject_own(PyObject *v, PyObject *args)
-{
-  PyObject *val = 0;
-#if (PY_VERSION_HEX < 0x02020000)
-  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
-#else
-  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
-#endif
-    {
-      return NULL;
-    } 
-  else
-    {
-      PySwigObject *sobj = (PySwigObject *)v;
-      PyObject *obj = PyBool_FromLong(sobj->own);
-      if (val) {
-#ifdef METH_NOARGS
-	if (PyObject_IsTrue(val)) {
-	  PySwigObject_acquire(v);
-	} else {
-	  PySwigObject_disown(v);
-	}
-#else
-	if (PyObject_IsTrue(val)) {
-	  PySwigObject_acquire(v,args);
-	} else {
-	  PySwigObject_disown(v,args);
-	}
-#endif
-      } 
-      return obj;
-    }
-}
-
-#ifdef METH_O
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#else
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#endif
-
-#if PY_VERSION_HEX < 0x02020000
-SWIGINTERN PyObject *
-PySwigObject_getattr(PySwigObject *sobj,char *name)
-{
-  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
-}
-#endif
-
-SWIGRUNTIME PyTypeObject*
-_PySwigObject_type(void) {
-  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
-  
-  static PyNumberMethods PySwigObject_as_number = {
-    (binaryfunc)0, /*nb_add*/
-    (binaryfunc)0, /*nb_subtract*/
-    (binaryfunc)0, /*nb_multiply*/
-    (binaryfunc)0, /*nb_divide*/
-    (binaryfunc)0, /*nb_remainder*/
-    (binaryfunc)0, /*nb_divmod*/
-    (ternaryfunc)0,/*nb_power*/
-    (unaryfunc)0,  /*nb_negative*/
-    (unaryfunc)0,  /*nb_positive*/
-    (unaryfunc)0,  /*nb_absolute*/
-    (inquiry)0,    /*nb_nonzero*/
-    0,		   /*nb_invert*/
-    0,		   /*nb_lshift*/
-    0,		   /*nb_rshift*/
-    0,		   /*nb_and*/
-    0,		   /*nb_xor*/
-    0,		   /*nb_or*/
-    (coercion)0,   /*nb_coerce*/
-    (unaryfunc)PySwigObject_long, /*nb_int*/
-    (unaryfunc)PySwigObject_long, /*nb_long*/
-    (unaryfunc)0,                 /*nb_float*/
-    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
-    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02020000
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 
-#elif PY_VERSION_HEX >= 0x02000000
-    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
-#endif
-  };
-
-  static PyTypeObject pyswigobject_type;  
-  static int type_init = 0;
-  if (!type_init) {
-    const PyTypeObject tmp
-      = {
-	PyObject_HEAD_INIT(NULL)
-	0,				    /* ob_size */
-	(char *)"PySwigObject",		    /* tp_name */
-	sizeof(PySwigObject),		    /* tp_basicsize */
-	0,			            /* tp_itemsize */
-	(destructor)PySwigObject_dealloc,   /* tp_dealloc */
-	(printfunc)PySwigObject_print,	    /* tp_print */
-#if PY_VERSION_HEX < 0x02020000
-	(getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
-#else
-	(getattrfunc)0,			    /* tp_getattr */ 
-#endif
-	(setattrfunc)0,			    /* tp_setattr */ 
-	(cmpfunc)PySwigObject_compare,	    /* tp_compare */ 
-	(reprfunc)PySwigObject_repr,	    /* tp_repr */    
-	&PySwigObject_as_number,	    /* tp_as_number */
-	0,				    /* tp_as_sequence */
-	0,				    /* tp_as_mapping */
-	(hashfunc)0,			    /* tp_hash */
-	(ternaryfunc)0,			    /* tp_call */
-	(reprfunc)PySwigObject_str,	    /* tp_str */
-	PyObject_GenericGetAttr,            /* tp_getattro */
-	0,				    /* tp_setattro */
-	0,		                    /* tp_as_buffer */
-	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
-	swigobject_doc, 	            /* tp_doc */        
-	0,                                  /* tp_traverse */
-	0,                                  /* tp_clear */
-	0,                                  /* tp_richcompare */
-	0,                                  /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-	0,                                  /* tp_iter */
-	0,                                  /* tp_iternext */
-	swigobject_methods,		    /* tp_methods */ 
-	0,			            /* tp_members */
-	0,				    /* tp_getset */	    	
-	0,			            /* tp_base */	        
-	0,				    /* tp_dict */	    	
-	0,				    /* tp_descr_get */  	
-	0,				    /* tp_descr_set */  	
-	0,				    /* tp_dictoffset */ 	
-	0,				    /* tp_init */	    	
-	0,				    /* tp_alloc */	    	
-	0,			            /* tp_new */	    	
-	0,	                            /* tp_free */	   
-        0,                                  /* tp_is_gc */  
-	0,				    /* tp_bases */   
-	0,				    /* tp_mro */
-	0,				    /* tp_cache */   
- 	0,				    /* tp_subclasses */
-	0,				    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-	0,                                  /* tp_del */
-#endif
-#ifdef COUNT_ALLOCS
-	0,0,0,0                             /* tp_alloc -> tp_next */
-#endif
-      };
-    pyswigobject_type = tmp;
-    pyswigobject_type.ob_type = &PyType_Type;
-    type_init = 1;
-  }
-  return &pyswigobject_type;
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own)
-{
-  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
-  if (sobj) {
-    sobj->ptr  = ptr;
-    sobj->ty   = ty;
-    sobj->own  = own;
-    sobj->next = 0;
-  }
-  return (PyObject *)sobj;
-}
-
-/* -----------------------------------------------------------------------------
- * Implements a simple Swig Packed type, and use it instead of string
- * ----------------------------------------------------------------------------- */
-
-typedef struct {
-  PyObject_HEAD
-  void *pack;
-  swig_type_info *ty;
-  size_t size;
-} PySwigPacked;
-
-SWIGRUNTIME int
-PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
-{
-  char result[SWIG_BUFFER_SIZE];
-  fputs("<Swig Packed ", fp); 
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    fputs("at ", fp); 
-    fputs(result, fp); 
-  }
-  fputs(v->ty->name,fp); 
-  fputs(">", fp);
-  return 0; 
-}
-  
-SWIGRUNTIME PyObject *
-PySwigPacked_repr(PySwigPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
-  } else {
-    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
-  }  
-}
-
-SWIGRUNTIME PyObject *
-PySwigPacked_str(PySwigPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return PyString_FromFormat("%s%s", result, v->ty->name);
-  } else {
-    return PyString_FromString(v->ty->name);
-  }  
-}
-
-SWIGRUNTIME int
-PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
-{
-  size_t i = v->size;
-  size_t j = w->size;
-  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
-  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
-}
-
-SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
-
-SWIGRUNTIME PyTypeObject*
-PySwigPacked_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
-  return type;
-}
-
-SWIGRUNTIMEINLINE int
-PySwigPacked_Check(PyObject *op) {
-  return ((op)->ob_type == _PySwigPacked_type()) 
-    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
-}
-
-SWIGRUNTIME void
-PySwigPacked_dealloc(PyObject *v)
-{
-  if (PySwigPacked_Check(v)) {
-    PySwigPacked *sobj = (PySwigPacked *) v;
-    free(sobj->pack);
-  }
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyTypeObject*
-_PySwigPacked_type(void) {
-  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject pyswigpacked_type;
-  static int type_init = 0;  
-  if (!type_init) {
-    const PyTypeObject tmp
-      = {
-	PyObject_HEAD_INIT(NULL)
-	0,				    /* ob_size */	
-	(char *)"PySwigPacked",		    /* tp_name */	
-	sizeof(PySwigPacked),		    /* tp_basicsize */	
-	0,				    /* tp_itemsize */	
-	(destructor)PySwigPacked_dealloc,   /* tp_dealloc */	
-	(printfunc)PySwigPacked_print,	    /* tp_print */   	
-	(getattrfunc)0,			    /* tp_getattr */ 	
-	(setattrfunc)0,			    /* tp_setattr */ 	
-	(cmpfunc)PySwigPacked_compare,	    /* tp_compare */ 	
-	(reprfunc)PySwigPacked_repr,	    /* tp_repr */    	
-	0,	                            /* tp_as_number */	
-	0,				    /* tp_as_sequence */
-	0,				    /* tp_as_mapping */	
-	(hashfunc)0,			    /* tp_hash */	
-	(ternaryfunc)0,			    /* tp_call */	
-	(reprfunc)PySwigPacked_str,	    /* tp_str */	
-	PyObject_GenericGetAttr,            /* tp_getattro */
-	0,				    /* tp_setattro */
-	0,		                    /* tp_as_buffer */
-	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
-	swigpacked_doc, 	            /* tp_doc */
-	0,                                  /* tp_traverse */
-	0,                                  /* tp_clear */
-	0,                                  /* tp_richcompare */
-	0,                                  /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-	0,                                  /* tp_iter */
-	0,                                  /* tp_iternext */
-	0,		                    /* tp_methods */ 
-	0,			            /* tp_members */
-	0,				    /* tp_getset */	    	
-	0,			            /* tp_base */	        
-	0,				    /* tp_dict */	    	
-	0,				    /* tp_descr_get */  	
-	0,				    /* tp_descr_set */  	
-	0,				    /* tp_dictoffset */ 	
-	0,				    /* tp_init */	    	
-	0,				    /* tp_alloc */	    	
-	0,			            /* tp_new */	    	
-	0, 	                            /* tp_free */	   
-        0,                                  /* tp_is_gc */  
-	0,				    /* tp_bases */   
-	0,				    /* tp_mro */
-	0,				    /* tp_cache */   
- 	0,				    /* tp_subclasses */
-	0,				    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-	0,                                  /* tp_del */
-#endif
-#ifdef COUNT_ALLOCS
-	0,0,0,0                             /* tp_alloc -> tp_next */
-#endif
-      };
-    pyswigpacked_type = tmp;
-    pyswigpacked_type.ob_type = &PyType_Type;
-    type_init = 1;
-  }
-  return &pyswigpacked_type;
-}
-
-SWIGRUNTIME PyObject *
-PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
-{
-  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
-  if (sobj) {
-    void *pack = malloc(size);
-    if (pack) {
-      memcpy(pack, ptr, size);
-      sobj->pack = pack;
-      sobj->ty   = ty;
-      sobj->size = size;
-    } else {
-      PyObject_DEL((PyObject *) sobj);
-      sobj = 0;
-    }
-  }
-  return (PyObject *) sobj;
-}
-
-SWIGRUNTIME swig_type_info *
-PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
-{
-  if (PySwigPacked_Check(obj)) {
-    PySwigPacked *sobj = (PySwigPacked *)obj;
-    if (sobj->size != size) return 0;
-    memcpy(ptr, sobj->pack, size);
-    return sobj->ty;
-  } else {
-    return 0;
-  }
-}
-
-/* -----------------------------------------------------------------------------
- * pointers/data manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIMEINLINE PyObject *
-_SWIG_This(void)
-{
-  return PyString_FromString("this");
-}
-
-SWIGRUNTIME PyObject *
-SWIG_This(void)
-{
-  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
-  return swig_this;
-}
-
-/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
-
-SWIGRUNTIME PySwigObject *
-SWIG_Python_GetSwigThis(PyObject *pyobj) 
-{
-  if (PySwigObject_Check(pyobj)) {
-    return (PySwigObject *) pyobj;
-  } else {
-    PyObject *obj = 0;
-#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
-    if (PyInstance_Check(pyobj)) {
-      obj = _PyInstance_Lookup(pyobj, SWIG_This());      
-    } else {
-      PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
-      if (dictptr != NULL) {
-	PyObject *dict = *dictptr;
-	obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
-      } else {
-#ifdef PyWeakref_CheckProxy
-	if (PyWeakref_CheckProxy(pyobj)) {
-	  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
-	  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
-	}
-#endif
-	obj = PyObject_GetAttr(pyobj,SWIG_This());
-	if (obj) {
-	  Py_DECREF(obj);
-	} else {
-	  if (PyErr_Occurred()) PyErr_Clear();
-	  return 0;
-	}
-      }
-    }
-#else
-    obj = PyObject_GetAttr(pyobj,SWIG_This());
-    if (obj) {
-      Py_DECREF(obj);
-    } else {
-      if (PyErr_Occurred()) PyErr_Clear();
-      return 0;
-    }
-#endif
-    if (obj && !PySwigObject_Check(obj)) {
-      /* a PyObject is called 'this', try to get the 'real this'
-	 PySwigObject from it */ 
-      return SWIG_Python_GetSwigThis(obj);
-    }
-    return (PySwigObject *)obj;
-  }
-}
-
-/* Acquire a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_AcquirePtr(PyObject *obj, int own) {
-  if (own) {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
-    if (sobj) {
-      int oldown = sobj->own;
-      sobj->own = own;
-      return oldown;
-    }
-  }
-  return 0;
-}
-
-/* Convert a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
-  if (!obj) return SWIG_ERROR;
-  if (obj == Py_None) {
-    if (ptr) *ptr = 0;
-    return SWIG_OK;
-  } else {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
-    while (sobj) {
-      void *vptr = sobj->ptr;
-      if (ty) {
-	swig_type_info *to = sobj->ty;
-	if (to == ty) {
-	  /* no type cast needed */
-	  if (ptr) *ptr = vptr;
-	  break;
-	} else {
-	  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-	  if (!tc) {
-	    sobj = (PySwigObject *)sobj->next;
-	  } else {
-	    if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
-	    break;
-	  }
-	}
-      } else {
-	if (ptr) *ptr = vptr;
-	break;
-      }
-    }
-    if (sobj) {
-      if (own) *own = sobj->own;
-      if (flags & SWIG_POINTER_DISOWN) {
-	sobj->own = 0;
-      }
-      return SWIG_OK;
-    } else {
-      int res = SWIG_ERROR;
-      if (flags & SWIG_POINTER_IMPLICIT_CONV) {
-	PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
-	if (data && !data->implicitconv) {
-	  PyObject *klass = data->klass;
-	  if (klass) {
-	    PyObject *impconv;
-	    data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
-	    impconv = SWIG_Python_CallFunctor(klass, obj);
-	    data->implicitconv = 0;
-	    if (PyErr_Occurred()) {
-	      PyErr_Clear();
-	      impconv = 0;
-	    }
-	    if (impconv) {
-	      PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
-	      if (iobj) {
-		void *vptr;
-		res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
-		if (SWIG_IsOK(res)) {
-		  if (ptr) {
-		    *ptr = vptr;
-		    /* transfer the ownership to 'ptr' */
-		    iobj->own = 0;
-		    res = SWIG_AddCast(res);
-		    res = SWIG_AddNewMask(res);
-		  } else {
-		    res = SWIG_AddCast(res);		    
-		  }
-		}
-	      }
-	      Py_DECREF(impconv);
-	    }
-	  }
-	}
-      }
-      return res;
-    }
-  }
-}
-
-/* Convert a function ptr value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
-  if (!PyCFunction_Check(obj)) {
-    return SWIG_ConvertPtr(obj, ptr, ty, 0);
-  } else {
-    void *vptr = 0;
-    
-    /* here we get the method pointer for callbacks */
-    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
-    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc) {
-      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-      if (!desc) return SWIG_ERROR;
-    }
-    if (ty) {
-      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
-      if (!tc) return SWIG_ERROR;
-      *ptr = SWIG_TypeCast(tc,vptr);
-    } else {
-      *ptr = vptr;
-    }
-    return SWIG_OK;
-  }
-}
-
-/* Convert a packed value value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
-  if (!to) return SWIG_ERROR;
-  if (ty) {
-    if (to != ty) {
-      /* check type cast? */
-      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-      if (!tc) return SWIG_ERROR;
-    }
-  }
-  return SWIG_OK;
-}  
-
-/* -----------------------------------------------------------------------------
- * Create a new pointer object
- * ----------------------------------------------------------------------------- */
-
-/*
-  Create a new instance object, whitout calling __init__, and set the
-  'this' attribute.
-*/
-
-SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
-{
-#if (PY_VERSION_HEX >= 0x02020000)
-  PyObject *inst = 0;
-  PyObject *newraw = data->newraw;
-  if (newraw) {
-    inst = PyObject_Call(newraw, data->newargs, NULL);
-    if (inst) {
-#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
-      PyObject **dictptr = _PyObject_GetDictPtr(inst);
-      if (dictptr != NULL) {
-	PyObject *dict = *dictptr;
-	if (dict == NULL) {
-	  dict = PyDict_New();
-	  *dictptr = dict;
-	  PyDict_SetItem(dict, SWIG_This(), swig_this);
-	}
-      }
-#else
-      PyObject *key = SWIG_This();
-      PyObject_SetAttr(inst, key, swig_this);
-#endif
-    }
-  } else {
-    PyObject *dict = PyDict_New();
-    PyDict_SetItem(dict, SWIG_This(), swig_this);
-    inst = PyInstance_NewRaw(data->newargs, dict);
-    Py_DECREF(dict);
-  }
-  return inst;
-#else
-#if (PY_VERSION_HEX >= 0x02010000)
-  PyObject *inst;
-  PyObject *dict = PyDict_New();
-  PyDict_SetItem(dict, SWIG_This(), swig_this);
-  inst = PyInstance_NewRaw(data->newargs, dict);
-  Py_DECREF(dict);
-  return (PyObject *) inst;
-#else
-  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
-  if (inst == NULL) {
-    return NULL;
-  }
-  inst->in_class = (PyClassObject *)data->newargs;
-  Py_INCREF(inst->in_class);
-  inst->in_dict = PyDict_New();
-  if (inst->in_dict == NULL) {
-    Py_DECREF(inst);
-    return NULL;
-  }
-#ifdef Py_TPFLAGS_HAVE_WEAKREFS
-  inst->in_weakreflist = NULL;
-#endif
-#ifdef Py_TPFLAGS_GC
-  PyObject_GC_Init(inst);
-#endif
-  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
-  return (PyObject *) inst;
-#endif
-#endif
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
-{
- PyObject *dict;
-#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
- PyObject **dictptr = _PyObject_GetDictPtr(inst);
- if (dictptr != NULL) {
-   dict = *dictptr;
-   if (dict == NULL) {
-     dict = PyDict_New();
-     *dictptr = dict;
-   }
-   PyDict_SetItem(dict, SWIG_This(), swig_this);
-   return;
- }
-#endif
- dict = PyObject_GetAttrString(inst, (char*)"__dict__");
- PyDict_SetItem(dict, SWIG_This(), swig_this);
- Py_DECREF(dict);
-} 
-
-
-SWIGINTERN PyObject *
-SWIG_Python_InitShadowInstance(PyObject *args) {
-  PyObject *obj[2];
-  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
-    return NULL;
-  } else {
-    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
-    if (sthis) {
-      PySwigObject_append((PyObject*) sthis, obj[1]);
-    } else {
-      SWIG_Python_SetSwigThis(obj[0], obj[1]);
-    }
-    return SWIG_Py_Void();
-  }
-}
-
-/* Create a new pointer object */
-
-SWIGRUNTIME PyObject *
-SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
-  if (!ptr) {
-    return SWIG_Py_Void();
-  } else {
-    int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-    PyObject *robj = PySwigObject_New(ptr, type, own);
-    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
-    if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
-      PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
-      if (inst) {
-	Py_DECREF(robj);
-	robj = inst;
-      }
-    }
-    return robj;
-  }
-}
-
-/* Create a new packed object */
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
-}
-
-/* -----------------------------------------------------------------------------*
- *  Get type list 
- * -----------------------------------------------------------------------------*/
-
-#ifdef SWIG_LINK_RUNTIME
-void *SWIG_ReturnGlobalTypeList(void *);
-#endif
-
-SWIGRUNTIME swig_module_info *
-SWIG_Python_GetModule(void) {
-  static void *type_pointer = (void *)0;
-  /* first check if module already created */
-  if (!type_pointer) {
-#ifdef SWIG_LINK_RUNTIME
-    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
-#else
-    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
-				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      type_pointer = (void *)0;
-    }
-#endif
-  }
-  return (swig_module_info *) type_pointer;
-}
-
-#if PY_MAJOR_VERSION < 2
-/* PyModule_AddObject function was introduced in Python 2.0.  The following function
-   is copied out of Python/modsupport.c in python version 2.3.4 */
-SWIGINTERN int
-PyModule_AddObject(PyObject *m, char *name, PyObject *o)
-{
-  PyObject *dict;
-  if (!PyModule_Check(m)) {
-    PyErr_SetString(PyExc_TypeError,
-		    "PyModule_AddObject() needs module as first arg");
-    return SWIG_ERROR;
-  }
-  if (!o) {
-    PyErr_SetString(PyExc_TypeError,
-		    "PyModule_AddObject() needs non-NULL value");
-    return SWIG_ERROR;
-  }
-  
-  dict = PyModule_GetDict(m);
-  if (dict == NULL) {
-    /* Internal error -- modules must have a dict! */
-    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
-		 PyModule_GetName(m));
-    return SWIG_ERROR;
-  }
-  if (PyDict_SetItemString(dict, name, o))
-    return SWIG_ERROR;
-  Py_DECREF(o);
-  return SWIG_OK;
-}
-#endif
-
-SWIGRUNTIME void
-SWIG_Python_DestroyModule(void *vptr)
-{
-  swig_module_info *swig_module = (swig_module_info *) vptr;
-  swig_type_info **types = swig_module->types;
-  size_t i;
-  for (i =0; i < swig_module->size; ++i) {
-    swig_type_info *ty = types[i];
-    if (ty->owndata) {
-      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
-      if (data) PySwigClientData_Del(data);
-    }
-  }
-  Py_DECREF(SWIG_This());
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetModule(swig_module_info *swig_module) {
-  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
-
-  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
-				   swig_empty_runtime_method_table);
-  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
-  if (pointer && module) {
-    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
-  } else {
-    Py_XDECREF(pointer);
-  }
-}
-
-/* The python cached type query */
-SWIGRUNTIME PyObject *
-SWIG_Python_TypeCache(void) {
-  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
-  return cache;
-}
-
-SWIGRUNTIME swig_type_info *
-SWIG_Python_TypeQuery(const char *type)
-{
-  PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = PyString_FromString(type); 
-  PyObject *obj = PyDict_GetItem(cache, key);
-  swig_type_info *descriptor;
-  if (obj) {
-    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
-  } else {
-    swig_module_info *swig_module = SWIG_Python_GetModule();
-    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
-    if (descriptor) {
-      obj = PyCObject_FromVoidPtr(descriptor, NULL);
-      PyDict_SetItem(cache, key, obj);
-      Py_DECREF(obj);
-    }
-  }
-  Py_DECREF(key);
-  return descriptor;
-}
-
-/* 
-   For backward compatibility only
-*/
-#define SWIG_POINTER_EXCEPTION  0
-#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
-#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
-
-SWIGRUNTIME int
-SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{
-  if (PyErr_Occurred()) {
-    PyObject *type = 0;
-    PyObject *value = 0;
-    PyObject *traceback = 0;
-    PyErr_Fetch(&type, &value, &traceback);
-    if (value) {
-      PyObject *old_str = PyObject_Str(value);
-      Py_XINCREF(type);
-      PyErr_Clear();
-      if (infront) {
-	PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
-      } else {
-	PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
-      }
-      Py_DECREF(old_str);
-    }
-    return 1;
-  } else {
-    return 0;
-  }
-}
-  
-SWIGRUNTIME int
-SWIG_Python_ArgFail(int argnum)
-{
-  if (PyErr_Occurred()) {
-    /* add information about failing argument */
-    char mesg[256];
-    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
-    return SWIG_Python_AddErrMesg(mesg, 1);
-  } else {
-    return 0;
-  }
-}
-
-SWIGRUNTIMEINLINE const char *
-PySwigObject_GetDesc(PyObject *self)
-{
-  PySwigObject *v = (PySwigObject *)self;
-  swig_type_info *ty = v ? v->ty : 0;
-  return ty ? ty->str : (char*)"";
-}
-
-SWIGRUNTIME void
-SWIG_Python_TypeError(const char *type, PyObject *obj)
-{
-  if (type) {
-#if defined(SWIG_COBJECT_TYPES)
-    if (obj && PySwigObject_Check(obj)) {
-      const char *otype = (const char *) PySwigObject_GetDesc(obj);
-      if (otype) {
-	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
-		     type, otype);
-	return;
-      }
-    } else 
-#endif      
-    {
-      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
-      if (otype) {
-	PyObject *str = PyObject_Str(obj);
-	const char *cstr = str ? PyString_AsString(str) : 0;
-	if (cstr) {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
-		       type, otype, cstr);
-	} else {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
-		       type, otype);
-	}
-	Py_XDECREF(str);
-	return;
-      }
-    }   
-    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
-  } else {
-    PyErr_Format(PyExc_TypeError, "unexpected type is received");
-  }
-}
-
-
-/* Convert a pointer value, signal an exception on a type mismatch */
-SWIGRUNTIME void *
-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
-  void *result;
-  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
-    PyErr_Clear();
-    if (flags & SWIG_POINTER_EXCEPTION) {
-      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
-      SWIG_Python_ArgFail(argnum);
-    }
-  }
-  return result;
-}
-
-
-#ifdef __cplusplus
-#if 0
-{ /* cc-mode */
-#endif
-}
-#endif
-
-
-
-#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
-
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
-
-
-
-  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
-
-
-/* -------- TYPES TABLE (BEGIN) -------- */
-
-#define SWIGTYPE_p_GeosCoordinateSequence swig_types[0]
-#define SWIGTYPE_p_GeosGeometry swig_types[1]
-#define SWIGTYPE_p_GeosGeometryCollection swig_types[2]
-#define SWIGTYPE_p_GeosLineString swig_types[3]
-#define SWIGTYPE_p_GeosLinearRing swig_types[4]
-#define SWIGTYPE_p_GeosMultiLineString swig_types[5]
-#define SWIGTYPE_p_GeosMultiLinearRing swig_types[6]
-#define SWIGTYPE_p_GeosMultiPoint swig_types[7]
-#define SWIGTYPE_p_GeosMultiPolygon swig_types[8]
-#define SWIGTYPE_p_GeosPoint swig_types[9]
-#define SWIGTYPE_p_GeosPolygon swig_types[10]
-#define SWIGTYPE_p_char swig_types[11]
-#define SWIGTYPE_p_p_GeosLinearRing swig_types[12]
-#define SWIGTYPE_p_size_t swig_types[13]
-#define SWIGTYPE_p_std__invalid_argument swig_types[14]
-#define SWIGTYPE_p_swig__PySwigIterator swig_types[15]
-#define SWIGTYPE_p_unsigned_char swig_types[16]
-static swig_type_info *swig_types[18];
-static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
-#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
-#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
-
-/* -------- TYPES TABLE (END) -------- */
-
-#if (PY_VERSION_HEX <= 0x02000000)
-# if !defined(SWIG_PYTHON_CLASSIC)
-#  error "This python version requires swig to be run with the '-classic' option"
-# endif
-#endif
-#if (PY_VERSION_HEX <= 0x02020000)
-# error "This python version requires swig to be run with the '-nomodern' option"
-#endif
-#if (PY_VERSION_HEX <= 0x02020000)
-# error "This python version requires swig to be run with the '-nomodernargs' option"
-#endif
-
-/*-----------------------------------------------
-              @(target):= _geos.so
-  ------------------------------------------------*/
-#define SWIG_init    init_geos
-
-#define SWIG_name    "_geos"
-
-#define SWIGVERSION 0x010331 
-#define SWIG_VERSION SWIGVERSION
-
-
-#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
-#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
-
-
-#include <stdexcept>
-
-
-namespace swig {
-  class PyObject_ptr {
-  protected:
-    PyObject *_obj;
-
-  public:
-    PyObject_ptr() :_obj(0)
-    {
-    }
-
-    PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj)
-    {
-      Py_XINCREF(_obj);      
-    }
-    
-    PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
-    {
-      if (initial_ref) Py_XINCREF(_obj);
-    }
-    
-    PyObject_ptr & operator=(const PyObject_ptr& item) 
-    {
-      Py_XINCREF(item._obj);
-      Py_XDECREF(_obj);
-      _obj = item._obj;
-      return *this;      
-    }
-    
-    ~PyObject_ptr() 
-    {
-      Py_XDECREF(_obj);
-    }
-    
-    operator PyObject *() const
-    {
-      return _obj;
-    }
-
-    PyObject *operator->() const
-    {
-      return _obj;
-    }
-  };
-}
-
-
-namespace swig {
-  struct PyObject_var : PyObject_ptr {
-    PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { }
-    
-    PyObject_var & operator = (PyObject* obj)
-    {
-      Py_XDECREF(_obj);
-      _obj = obj;
-      return *this;      
-    }
-  };
-}
-
-
-#include <string>
-
-
-#include <iostream>
-
-
-#include <stdexcept>
-
-
-  
-#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
-#  define SWIG_STD_NOASSIGN_STL
-#  define SWIG_STD_NOINSERT_TEMPLATE_STL
-#  define SWIG_STD_NOITERATOR_TRAITS_STL
-#endif
-
-#if defined(__GNUC__)
-#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
-#     define SWIG_STD_NOMODERN_STL
-#  endif
-#endif
-
-
-
-
-#include <string>
-#include <stdexcept>
-
-  
-namespace swig {
-  struct stop_iteration {
-  };
-
-  struct PySwigIterator {
-  private:
-    PyObject_ptr _seq;
-
-  protected:
-    PySwigIterator(PyObject *seq) : _seq(seq)
-    {
-    }
-      
-  public:
-    virtual ~PySwigIterator() {}
-
-    // Access iterator method, required by Python
-    virtual PyObject *value() const = 0;
-
-    // Forward iterator method, required by Python
-    virtual PySwigIterator *incr(size_t n = 1) = 0;
-    
-    // Backward iterator method, very common in C++, but not required in Python
-    virtual PySwigIterator *decr(size_t n = 1)
-    {
-      throw stop_iteration();
-    }
-
-    // Random access iterator methods, but not required in Python
-    virtual ptrdiff_t distance(const PySwigIterator &x) const
-    {
-      throw std::invalid_argument("operation not supported");
-    }
-
-    virtual bool equal (const PySwigIterator &x) const
-    {
-      throw std::invalid_argument("operation not supported");
-    }
-    
-    // C++ common/needed methods
-    virtual PySwigIterator *copy() const = 0;
-
-    PyObject *next()
-    {
-      PyObject *obj = value();
-      incr();
-      return obj;
-    }
-
-    PyObject *previous()
-    {
-      decr();
-      return value();
-    }
-
-    PySwigIterator *advance(ptrdiff_t n)
-    {
-      return  (n > 0) ?  incr(n) : decr(-n);
-    }
-      
-    bool operator == (const PySwigIterator& x)  const
-    {
-      return equal(x);
-    }
-      
-    bool operator != (const PySwigIterator& x) const
-    {
-      return ! operator==(x);
-    }
-      
-    PySwigIterator& operator += (ptrdiff_t n)
-    {
-      return *advance(n);
-    }
-
-    PySwigIterator& operator -= (ptrdiff_t n)
-    {
-      return *advance(-n);
-    }
-      
-    PySwigIterator* operator + (ptrdiff_t n) const
-    {
-      return copy()->advance(n);
-    }
-
-    PySwigIterator* operator - (ptrdiff_t n) const
-    {
-      return copy()->advance(-n);
-    }
-      
-    ptrdiff_t operator - (const PySwigIterator& x) const
-    {
-      return x.distance(*this);
-    }
-      
-    static swig_type_info* descriptor() {
-      static int init = 0;
-      static swig_type_info* desc = 0;
-      if (!init) {
-	desc = SWIG_TypeQuery("swig::PySwigIterator *");
-	init = 1;
-      }	
-      return desc;
-    }    
-  };
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_double (PyObject *obj, double *val)
-{
-  int res = SWIG_TypeError;
-  if (PyFloat_Check(obj)) {
-    if (val) *val = PyFloat_AsDouble(obj);
-    return SWIG_OK;
-  } else if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else if (PyLong_Check(obj)) {
-    double v = PyLong_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    double d = PyFloat_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = d;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      long v = PyLong_AsLong(obj);
-      if (!PyErr_Occurred()) {
-	if (val) *val = v;
-	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
-      } else {
-	PyErr_Clear();
-      }
-    }
-  }
-#endif
-  return res;
-}
-
-
-#include <float.h>
-
-
-#include <math.h>
-
-
-SWIGINTERNINLINE int
-SWIG_CanCastAsInteger(double *d, double min, double max) {
-  double x = *d;
-  if ((min <= x && x <= max)) {
-   double fx = floor(x);
-   double cx = ceil(x);
-   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
-   if ((errno == EDOM) || (errno == ERANGE)) {
-     errno = 0;
-   } else {
-     double summ, reps, diff;
-     if (rd < x) {
-       diff = x - rd;
-     } else if (rd > x) {
-       diff = rd - x;
-     } else {
-       return 1;
-     }
-     summ = rd + x;
-     reps = diff/summ;
-     if (reps < 8*DBL_EPSILON) {
-       *d = rd;
-       return 1;
-     }
-   }
-  }
-  return 0;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
-{
-  if (PyInt_Check(obj)) {
-    long v = PyInt_AsLong(obj);
-    if (v >= 0) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      return SWIG_OverflowError;
-    }
-  } else if (PyLong_Check(obj)) {
-    unsigned long v = PyLong_AsUnsignedLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    unsigned long v = PyLong_AsUnsignedLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      double d;
-      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
-	if (val) *val = (unsigned long)(d);
-	return res;
-      }
-    }
-  }
-#endif
-  return SWIG_TypeError;
-}
-
-
-SWIGINTERNINLINE int
-SWIG_AsVal_size_t (PyObject * obj, size_t *val)
-{
-  unsigned long v;
-  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
-  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
-  return res;
-}
-
-
-  #define SWIG_From_long   PyInt_FromLong 
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_ptrdiff_t  (ptrdiff_t value)
-{    
-  return SWIG_From_long  (static_cast< long >(value));
-}
-
-
-SWIGINTERNINLINE PyObject*
-  SWIG_From_bool  (bool value)
-{
-  return PyBool_FromLong(value ? 1 : 0);
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_long (PyObject *obj, long* val)
-{
-  if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else if (PyLong_Check(obj)) {
-    long v = PyLong_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    long v = PyInt_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      double d;
-      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
-	if (val) *val = (long)(d);
-	return res;
-      }
-    }
-  }
-#endif
-  return SWIG_TypeError;
-}
-
-
-SWIGINTERNINLINE int
-SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
-{
-  long v;
-  int res = SWIG_AsVal_long (obj, val ? &v : 0);
-  if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
-  return res;
-}
-
-
-#include <stdexcept>
-
-
-#include <algorithm>
-
-
-#include <vector>
-
- 
-#include "geos_c.h"
-/* Needed for va_start, etc. */
-#include <stdarg.h>
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_int  (int value)
-{    
-  return SWIG_From_long  (value);
-}
-
-
-SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
-{
-  static int init = 0;
-  static swig_type_info* info = 0;
-  if (!init) {
-    info = SWIG_TypeQuery("_p_char");
-    init = 1;
-  }
-  return info;
-}
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_FromCharPtrAndSize(const char* carray, size_t size)
-{
-  if (carray) {
-    if (size > INT_MAX) {
-      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
-      return pchar_descriptor ? 
-	SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
-    } else {
-      return PyString_FromStringAndSize(carray, static_cast< int >(size));
-    }
-  } else {
-    return SWIG_Py_Void();
-  }
-}
-
-
-SWIGINTERNINLINE PyObject * 
-SWIG_FromCharPtr(const char *cptr)
-{ 
-  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
-}
-
-
-    static const int DEFAULT_QUADRANT_SEGMENTS=8;
-
-
-
-/* This is not thread safe ! */
-static const int MESSAGE_SIZE = 1000;
-static char message[MESSAGE_SIZE];
-
-void noticeHandler(const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    vsnprintf(message, sizeof(message) - 1, fmt, args);
-    va_end(args);
-}
-
-void errorHandler(const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    vsnprintf(message, sizeof(message) - 1, fmt, args);
-    va_end(args);
-}
-
-
-typedef void GeosCoordinateSequence;
-
-void checkCoordSeqBounds(const GEOSCoordSeq coordSeq, const size_t index)
-{
-    unsigned int size = 0;
-    GEOSCoordSeq_getSize(coordSeq, &size);
-
-    if (index < 0 || index >= size)
-        throw std::runtime_error("Index out of bounds");
-}
-
-SWIGINTERN GeosCoordinateSequence *new_GeosCoordinateSequence(size_t size,size_t dims){
-        return (GeosCoordinateSequence*) GEOSCoordSeq_create(size, dims);
-    }
-SWIGINTERN void delete_GeosCoordinateSequence(GeosCoordinateSequence *self){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        return GEOSCoordSeq_destroy(coords);
-    }
-SWIGINTERN GeosCoordinateSequence *GeosCoordinateSequence_clone(GeosCoordinateSequence *self){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        return (GeosCoordinateSequence*) GEOSCoordSeq_clone(coords);
-    }
-SWIGINTERN int GeosCoordinateSequence_setX(GeosCoordinateSequence *self,size_t idx,double val){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        return GEOSCoordSeq_setX(coords, idx, val);
-    }
-SWIGINTERN int GeosCoordinateSequence_setY(GeosCoordinateSequence *self,size_t idx,double val){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        return GEOSCoordSeq_setY(coords, idx, val);
-    }
-SWIGINTERN int GeosCoordinateSequence_setZ(GeosCoordinateSequence *self,size_t idx,double val){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        return GEOSCoordSeq_setZ(coords, idx, val);
-    }
-SWIGINTERN int GeosCoordinateSequence_setOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim,double val){
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        return GEOSCoordSeq_setOrdinate(coords, idx, dim, val);
-    }
-SWIGINTERN double GeosCoordinateSequence_getX(GeosCoordinateSequence *self,size_t idx){
-        double result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        GEOSCoordSeq_getX(coords, idx, &result);
-        return result;
-    }
-
-  #define SWIG_From_double   PyFloat_FromDouble 
-
-SWIGINTERN double GeosCoordinateSequence_getY(GeosCoordinateSequence *self,size_t idx){
-        double result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        GEOSCoordSeq_getY(coords, idx, &result);
-        return result;
-    }
-SWIGINTERN double GeosCoordinateSequence_getZ(GeosCoordinateSequence *self,size_t idx){
-        double result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        GEOSCoordSeq_getZ(coords, idx, &result);
-        return result;
-    }
-SWIGINTERN double GeosCoordinateSequence_getOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim){
-        double result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        checkCoordSeqBounds(coords, idx);
-        GEOSCoordSeq_getOrdinate(coords, idx, dim, &result);
-        return result;
-    }
-SWIGINTERN unsigned int GeosCoordinateSequence_getSize(GeosCoordinateSequence *self){
-        unsigned int result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        GEOSCoordSeq_getSize(coords, &result);
-        return result;
-    }
-
-SWIGINTERNINLINE PyObject* 
-SWIG_From_unsigned_SS_long  (unsigned long value)
-{
-  return (value > LONG_MAX) ?
-    PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); 
-}
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_unsigned_SS_int  (unsigned int value)
-{    
-  return SWIG_From_unsigned_SS_long  (value);
-}
-
-SWIGINTERN unsigned int GeosCoordinateSequence_getDimensions(GeosCoordinateSequence *self){
-        unsigned int result;
-        GEOSCoordSeq coords = (GEOSCoordSeq) self;
-        GEOSCoordSeq_getDimensions(coords, &result);
-        return result;
-    }
-
-typedef void GeosGeometry;
-typedef void GeosPoint;
-typedef void GeosLineString;
-typedef void GeosLinearRing;
-typedef void GeosPolygon;
-typedef void GeosGeometryCollection;
-typedef void GeosMultiPoint;
-typedef void GeosMultiLineString;
-typedef void GeosMultiLinearRing;
-typedef void GeosMultiPolygon;
-
-
-bool checkBoolResult(char result)
-{
-    int intResult = (int) result;
-
-    if (intResult == 1)
-        return true;
-    else if (intResult == 0)
-        return false;
-    else
-        throw std::runtime_error(message);
-}
-
-SWIGINTERN void delete_GeosGeometry(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_clone(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSGeom_clone(geom);
-    }
-SWIGINTERN char *GeosGeometry_geomType(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSGeomType(geom);
-    }
-SWIGINTERN int GeosGeometry_typeId(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSGeomTypeId(geom);
-    }
-SWIGINTERN void GeosGeometry_normalize(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        int result = GEOSNormalize(geom);
-
-        if (result == -1)
-            throw std::runtime_error(message);
-    }
-SWIGINTERN int GeosGeometry_getSRID(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSGetSRID(geom);
-    }
-
-#include <limits.h>
-#ifndef LLONG_MIN
-# define LLONG_MIN	LONG_LONG_MIN
-#endif
-#ifndef LLONG_MAX
-# define LLONG_MAX	LONG_LONG_MAX
-#endif
-#ifndef ULLONG_MAX
-# define ULLONG_MAX	ULONG_LONG_MAX
-#endif
-
-
-SWIGINTERN int
-SWIG_AsVal_int (PyObject * obj, int *val)
-{
-  long v;
-  int res = SWIG_AsVal_long (obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v < INT_MIN || v > INT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = static_cast< int >(v);
-    }
-  }  
-  return res;
-}
-
-SWIGINTERN void GeosGeometry_setSRID(GeosGeometry *self,int SRID){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSSetSRID(geom, SRID);
-    }
-SWIGINTERN size_t GeosGeometry_getDimensions(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSGeom_getDimensions(geom);
-    }
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_size_t  (size_t value)
-{    
-  return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
-}
-
-SWIGINTERN size_t GeosGeometry_getNumGeometries(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        size_t result = GEOSGetNumGeometries(geom);
-        
-        if ((int)result == -1)
-            throw std::runtime_error(message);
-
-        return result;
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_intersection(GeosGeometry *self,GeosGeometry *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return (GeosGeometry*) GEOSIntersection(geom, otherGeom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_buffer(GeosGeometry *self,double width,int quadsegs){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSBuffer(geom, width, quadsegs);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_convexHull(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSConvexHull(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_difference(GeosGeometry *self,GeosGeometry *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return (GeosGeometry*) GEOSDifference(geom, otherGeom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_symDifference(GeosGeometry *self,GeosGeometry *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return (GeosGeometry*) GEOSSymDifference(geom, otherGeom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_boundary(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSBoundary(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_geomUnion(GeosGeometry *self,GeosGeometry *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return (GeosGeometry*) GEOSUnion(geom, otherGeom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_pointOnSurface(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSPointOnSurface(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_getCentroid(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSGetCentroid(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_getEnvelope(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSEnvelope(geom);
-    }
-SWIGINTERN char *GeosGeometry_relate(GeosGeometry *self,GeosGeometry *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return GEOSRelate(geom, otherGeom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_lineMerge(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return GEOSLineMerge(geom);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_simplify(GeosGeometry *self,double tolerance){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSSimplify(geom, tolerance);
-    }
-SWIGINTERN GeosGeometry *GeosGeometry_topologyPreserveSimplify(GeosGeometry *self,double tolerance){
-        GEOSGeom geom = (GEOSGeom) self;
-        return (GeosGeometry*) GEOSTopologyPreserveSimplify(geom, tolerance);
-    }
-
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
-{
-  if (PyString_Check(obj)) {
-    char *cstr; Py_ssize_t len;
-    PyString_AsStringAndSize(obj, &cstr, &len);
-    if (cptr)  {
-      if (alloc) {
-	/* 
-	   In python the user should not be able to modify the inner
-	   string representation. To warranty that, if you define
-	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
-	   buffer is always returned.
-
-	   The default behavior is just to return the pointer value,
-	   so, be careful.
-	*/ 
-#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
-	if (*alloc != SWIG_OLDOBJ) 
-#else
-	if (*alloc == SWIG_NEWOBJ) 
-#endif
-	  {
-	    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
-	    *alloc = SWIG_NEWOBJ;
-	  }
-	else {
-	  *cptr = cstr;
-	  *alloc = SWIG_OLDOBJ;
-	}
-      } else {
-	*cptr = PyString_AsString(obj);
-      }
-    }
-    if (psize) *psize = len + 1;
-    return SWIG_OK;
-  } else {
-    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
-    if (pchar_descriptor) {
-      void* vptr = 0;
-      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
-	if (cptr) *cptr = (char *) vptr;
-	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
-	if (alloc) *alloc = SWIG_OLDOBJ;
-	return SWIG_OK;
-      }
-    }
-  }
-  return SWIG_TypeError;
-}
-
-
-
-
-SWIGINTERN bool GeosGeometry_relatePattern(GeosGeometry *self,GeosGeometry const *other,char const *pat){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSRelatePattern(geom, otherGeom, pat));
-    }
-SWIGINTERN bool GeosGeometry_disjoint(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSDisjoint(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_touches(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSTouches(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_intersects(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSIntersects(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_crosses(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSCrosses(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_within(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSWithin(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_contains(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSContains(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_overlaps(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSOverlaps(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_equals(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSEquals(geom, otherGeom));
-    }
-SWIGINTERN bool GeosGeometry_equalsExact(GeosGeometry *self,GeosGeometry const *other,double tolerance){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        return checkBoolResult(GEOSEqualsExact(geom, otherGeom, tolerance));
-    }
-SWIGINTERN bool GeosGeometry_isEmpty(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return checkBoolResult(GEOSisEmpty(geom));
-    }
-SWIGINTERN bool GeosGeometry_isValid(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return checkBoolResult(GEOSisValid(geom));
-    }
-SWIGINTERN bool GeosGeometry_isSimple(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return checkBoolResult(GEOSisSimple(geom));
-    }
-SWIGINTERN bool GeosGeometry_isRing(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return checkBoolResult(GEOSisRing(geom));
-    }
-SWIGINTERN bool GeosGeometry_hasZ(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        return checkBoolResult(GEOSHasZ(geom));
-    }
-SWIGINTERN double GeosGeometry_area(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        double result;
-
-        int code = GEOSArea(geom, &result);
-
-        if (code == 0)
-            throw std::runtime_error(message);
-
-        return result;
-    }
-SWIGINTERN double GeosGeometry_length(GeosGeometry *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        double result;
-
-        int code = GEOSLength(geom, &result);
-
-        if (code == 0)
-            throw std::runtime_error(message);
-
-        return result;
-    }
-SWIGINTERN double GeosGeometry_distance(GeosGeometry *self,GeosGeometry const *other){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom otherGeom = (GEOSGeom) other;
-        double result;
-
-        int code = GEOSDistance(geom, otherGeom, &result);
-
-        if (code == 0)
-            throw std::runtime_error(message);
-
-        return result;
-    }
-SWIGINTERN void delete_GeosPoint(GeosPoint *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosCoordinateSequence const *GeosPoint_getCoordSeq(GeosPoint *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosCoordinateSequence*) result;
-    }
-SWIGINTERN void delete_GeosLineString(GeosLineString *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosCoordinateSequence const *GeosLineString_getCoordSeq(GeosLineString *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosCoordinateSequence*) result;
-    }
-SWIGINTERN void delete_GeosLinearRing(GeosLinearRing *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosCoordinateSequence const *GeosLinearRing_getCoordSeq(GeosLinearRing *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosCoordinateSequence*) result;
-    }
-SWIGINTERN void delete_GeosPolygon(GeosPolygon *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosGeometry const *GeosPolygon_getExteriorRing(GeosPolygon *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        const GEOSGeom result = (const GEOSGeom) GEOSGetExteriorRing(geom);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosGeometry*) result;
-    }
-SWIGINTERN size_t GeosPolygon_getNumInteriorRings(GeosPolygon *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        size_t result = GEOSGetNumInteriorRings(geom);
-
-        if ((int)result == -1)
-            throw std::runtime_error(message);
-
-        return result;
-    }
-SWIGINTERN GeosGeometry const *GeosPolygon_getInteriorRingN(GeosPolygon *self,size_t n){
-        GEOSGeom geom = (GEOSGeom) self;
-
-        size_t size = GEOSGetNumInteriorRings(geom);
-
-        if (n < 0 || n >= size)
-            throw std::runtime_error("Index out of bounds");
-
-        const GEOSGeom result = (const GEOSGeom) GEOSGetInteriorRingN(geom, n);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosGeometry*) result;
-    }
-SWIGINTERN void delete_GeosGeometryCollection(GeosGeometryCollection *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN GeosGeometry const *GeosGeometryCollection_getGeometryN(GeosGeometryCollection *self,size_t n){
-        GEOSGeom geom = (GEOSGeom) self;
-        const GEOSGeom result = (const GEOSGeom) GEOSGetGeometryN(geom, n);
-
-        if (result == NULL)
-            throw std::runtime_error(message);
-
-        return (const GeosGeometry*) result;
-    }
-SWIGINTERN void delete_GeosMultiPoint(GeosMultiPoint *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN void delete_GeosMultiLineString(GeosMultiLineString *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN void delete_GeosMultiLinearRing(GeosMultiLinearRing *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-SWIGINTERN void delete_GeosMultiPolygon(GeosMultiPolygon *self){
-        GEOSGeom geom = (GEOSGeom) self;
-        GEOSGeom_destroy(geom);
-    }
-
-GeosGeometry *createPoint(GeosCoordinateSequence *s)
-{
-    GEOSCoordSeq coords = (GEOSCoordSeq) s;
-    GEOSGeom geom = GEOSGeom_createPoint(coords);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-GeosGeometry *createLineString(GeosCoordinateSequence *s)
-{
-    GEOSCoordSeq coords = (GEOSCoordSeq) s;
-    GEOSGeom geom = GEOSGeom_createLineString(coords);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-GeosGeometry *createLinearRing(GeosCoordinateSequence *s)
-{
-    GEOSCoordSeq coords = (GEOSCoordSeq) s;
-    GEOSGeom geom = GEOSGeom_createLinearRing(coords);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-GeosGeometry *createPolygon(GeosLinearRing *shell, GeosLinearRing **holes, size_t nholes)
-{
-    GEOSGeom shellGeom = (GEOSGeom) shell;
-    GEOSGeom* holeGeoms = (GEOSGeom*) holes;
-    GEOSGeom geom = GEOSGeom_createPolygon(shellGeom, holeGeoms, nholes);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-
-
-GeosGeometry* geomFromWKT(const char *wkt)
-{
-    if(wkt == NULL)
-        throw std::runtime_error("Trying to create geometry from a NULL string");
-        
-    GEOSGeom geom = GEOSGeomFromWKT(wkt);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-char* geomToWKT(const GeosGeometry* g)
-{
-    GEOSGeom geom = (GEOSGeom) g;
-    return GEOSGeomToWKT(geom);
-}
-
-int getWKBOutputDims()
-{
-    return GEOS_getWKBOutputDims();
-}
-
-int setWKBOutputDims(int newDims)
-{
-    return GEOS_setWKBOutputDims(newDims);
-}
-
-int getWKBByteOrder()
-{
-    return GEOS_getWKBByteOrder();
-}
-
-int setWKBByteOrder(int byteOrder)
-{
-    return GEOS_setWKBByteOrder(byteOrder);
-}
-
-GeosGeometry* geomFromWKB(const unsigned char *wkb, size_t size)
-{
-    GEOSGeom geom = GEOSGeomFromWKB_buf(wkb, size);
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-unsigned char *geomToWKB(const GeosGeometry* g, size_t *size)
-{
-    GEOSGeom geom = (GEOSGeom) g;
-    return GEOSGeomToWKB_buf(geom, size);
-}
-
-/* use wkb parameter instead of hex so we can reuse the typemap above. */
-GeosGeometry* geomFromHEX(const unsigned char *wkb, size_t size)
-{
-    GEOSGeom geom = GEOSGeomFromHEX_buf(wkb, size);
-
-    if(geom == NULL)
-        throw std::runtime_error(message);
-
-    return (GeosGeometry*) geom;
-}
-
-unsigned char *geomToHEX(const GeosGeometry* g, size_t *size)
-{
-    GEOSGeom geom = (GEOSGeom) g;
-    return GEOSGeomToHEX_buf(geom, size);
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-SWIGINTERN PyObject *_wrap_delete_PySwigIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_PySwigIterator",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PySwigIterator" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  delete arg1;
-  
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  PyObject *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_value",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_value" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  try {
-    result = (PyObject *)((swig::PySwigIterator const *)arg1)->value();
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  size_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_incr",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_incr" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  try {
-    result = (swig::PySwigIterator *)(arg1)->incr(arg2);
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_incr",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  try {
-    result = (swig::PySwigIterator *)(arg1)->incr();
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_incr(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_PySwigIterator_incr__SWIG_1(self, args);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_size_t(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        return _wrap_PySwigIterator_incr__SWIG_0(self, args);
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_incr'.\n  Possible C/C++ prototypes are:\n    incr(size_t)\n    incr()\n");
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  size_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_decr",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_decr" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  try {
-    result = (swig::PySwigIterator *)(arg1)->decr(arg2);
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_decr",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  try {
-    result = (swig::PySwigIterator *)(arg1)->decr();
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_decr(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_PySwigIterator_decr__SWIG_1(self, args);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_size_t(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        return _wrap_PySwigIterator_decr__SWIG_0(self, args);
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_decr'.\n  Possible C/C++ prototypes are:\n    decr(size_t)\n    decr()\n");
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *arg2 = 0 ;
-  ptrdiff_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_distance",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_distance" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator,  0  | 0);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2);
-  try {
-    result = ((swig::PySwigIterator const *)arg1)->distance((swig::PySwigIterator const &)*arg2);
-  }
-  catch(std::invalid_argument &_e) {
-    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
-  }
-  
-  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *arg2 = 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_equal",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_equal" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator,  0  | 0);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2);
-  try {
-    result = (bool)((swig::PySwigIterator const *)arg1)->equal((swig::PySwigIterator const &)*arg2);
-  }
-  catch(std::invalid_argument &_e) {
-    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
-  }
-  
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_copy",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_copy" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->copy();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  PyObject *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_next",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_next" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  try {
-    result = (PyObject *)(arg1)->next();
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  PyObject *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_previous",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_previous" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  try {
-    result = (PyObject *)(arg1)->previous();
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  ptrdiff_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  ptrdiff_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator_advance",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_advance" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
-  } 
-  arg2 = static_cast< ptrdiff_t >(val2);
-  try {
-    result = (swig::PySwigIterator *)(arg1)->advance(arg2);
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *arg2 = 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___eq__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___eq__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator,  0  | 0);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2);
-  result = (bool)((swig::PySwigIterator const *)arg1)->operator ==((swig::PySwigIterator const &)*arg2);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *arg2 = 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___ne__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___ne__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator,  0  | 0);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2);
-  result = (bool)((swig::PySwigIterator const *)arg1)->operator !=((swig::PySwigIterator const &)*arg2);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  ptrdiff_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  ptrdiff_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___iadd__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___iadd__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
-  } 
-  arg2 = static_cast< ptrdiff_t >(val2);
-  try {
-    {
-      swig::PySwigIterator &_result_ref = (arg1)->operator +=(arg2);
-      result = (swig::PySwigIterator *) &_result_ref;
-    }
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  ptrdiff_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  ptrdiff_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___isub__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___isub__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
-  } 
-  arg2 = static_cast< ptrdiff_t >(val2);
-  try {
-    {
-      swig::PySwigIterator &_result_ref = (arg1)->operator -=(arg2);
-      result = (swig::PySwigIterator *) &_result_ref;
-    }
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  ptrdiff_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  ptrdiff_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___add__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___add__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
-  } 
-  arg2 = static_cast< ptrdiff_t >(val2);
-  try {
-    result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator +(arg2);
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  ptrdiff_t arg2 ;
-  swig::PySwigIterator *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  ptrdiff_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
-  } 
-  arg2 = static_cast< ptrdiff_t >(val2);
-  try {
-    result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator -(arg2);
-  }
-  catch(swig::stop_iteration &_e) {
-    {
-      (void)_e;
-      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
-      SWIG_fail;
-    }
-  }
-  
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ;
-  swig::PySwigIterator *arg2 = 0 ;
-  ptrdiff_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"PySwigIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); 
-  }
-  arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator,  0  | 0);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); 
-  }
-  arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2);
-  result = ((swig::PySwigIterator const *)arg1)->operator -((swig::PySwigIterator const &)*arg2);
-  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_PySwigIterator___sub__(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__PySwigIterator, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_PySwigIterator___sub____SWIG_1(self, args);
-      }
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        return _wrap_PySwigIterator___sub____SWIG_0(self, args);
-      }
-    }
-  }
-  
-fail:
-  Py_INCREF(Py_NotImplemented);
-  return Py_NotImplemented;
-}
-
-
-SWIGINTERN PyObject *PySwigIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_swig__PySwigIterator, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  char *result = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"version",0,0)) SWIG_fail;
-  result = (char *)GEOSversion();
-  resultobj = SWIG_FromCharPtr((const char *)result);
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  size_t arg1 ;
-  size_t arg2 ;
-  GeosCoordinateSequence *result = 0 ;
-  size_t val1 ;
-  int ecode1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"new_CoordinateSequence",2,2,&obj0,&obj1)) SWIG_fail;
-  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CoordinateSequence" "', argument " "1"" of type '" "size_t""'");
-  } 
-  arg1 = static_cast< size_t >(val1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CoordinateSequence" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (GeosCoordinateSequence *)new_GeosCoordinateSequence(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_delete_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_CoordinateSequence",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CoordinateSequence" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  {
-    try
-    {
-      delete_GeosCoordinateSequence(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  GeosCoordinateSequence *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_clone",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_clone" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  {
-    try
-    {
-      result = (GeosCoordinateSequence *)GeosCoordinateSequence_clone(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_OWN |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_setX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double arg3 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setX",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setX" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setX" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try
-    {
-      result = (int)GeosCoordinateSequence_setX(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_setY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double arg3 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setY",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setY" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setY" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try
-    {
-      result = (int)GeosCoordinateSequence_setY(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_setZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double arg3 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setZ",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setZ" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setZ" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try
-    {
-      result = (int)GeosCoordinateSequence_setZ(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_setOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  size_t arg3 ;
-  double arg4 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  size_t val3 ;
-  int ecode3 = 0 ;
-  double val4 ;
-  int ecode4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setOrdinate",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setOrdinate" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setOrdinate" "', argument " "3"" of type '" "size_t""'");
-  } 
-  arg3 = static_cast< size_t >(val3);
-  ecode4 = SWIG_AsVal_double(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoordinateSequence_setOrdinate" "', argument " "4"" of type '" "double""'");
-  } 
-  arg4 = static_cast< double >(val4);
-  {
-    try
-    {
-      result = (int)GeosCoordinateSequence_setOrdinate(arg1,arg2,arg3,arg4);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getX",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getX" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (double)GeosCoordinateSequence_getX(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getY",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getY" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (double)GeosCoordinateSequence_getY(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getZ",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getZ" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (double)GeosCoordinateSequence_getZ(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  size_t arg2 ;
-  size_t arg3 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  size_t val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getOrdinate",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getOrdinate" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_getOrdinate" "', argument " "3"" of type '" "size_t""'");
-  } 
-  arg3 = static_cast< size_t >(val3);
-  {
-    try
-    {
-      result = (double)GeosCoordinateSequence_getOrdinate(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  unsigned int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getSize",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getSize" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  {
-    try
-    {
-      result = (unsigned int)GeosCoordinateSequence_getSize(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CoordinateSequence_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  unsigned int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getDimensions",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getDimensions" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
-  {
-    try
-    {
-      result = (unsigned int)GeosCoordinateSequence_getDimensions(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *CoordinateSequence_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosCoordinateSequence, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_Geometry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_Geometry",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Geometry" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      delete_GeosGeometry(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_clone",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_clone" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_clone(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_geomType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_geomType",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_geomType" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (char *)GeosGeometry_geomType(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_FromCharPtr((const char *)result);
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_typeId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_typeId",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_typeId" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (int)GeosGeometry_typeId(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_normalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_normalize",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_normalize" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      GeosGeometry_normalize(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_getSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getSRID",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getSRID" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (int)GeosGeometry_getSRID(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_setSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  int arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_setSRID",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_setSRID" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_setSRID" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  {
-    try
-    {
-      GeosGeometry_setSRID(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  size_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getDimensions",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getDimensions" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = GeosGeometry_getDimensions(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_getNumGeometries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  size_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getNumGeometries",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getNumGeometries" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = GeosGeometry_getNumGeometries(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_intersection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersection",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersection" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersection" "', argument " "2"" of type '" "GeosGeometry *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_intersection(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  double arg2 ;
-  int arg3 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  {
-    arg3 = DEFAULT_QUADRANT_SEGMENTS;
-  }
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_buffer",2,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_buffer" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_buffer" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
-  if (obj2) {
-    ecode3 = SWIG_AsVal_int(obj2, &val3);
-    if (!SWIG_IsOK(ecode3)) {
-      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_buffer" "', argument " "3"" of type '" "int""'");
-    } 
-    arg3 = static_cast< int >(val3);
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_buffer(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_convexHull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_convexHull",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_convexHull" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_convexHull(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_difference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_difference",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_difference" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_difference" "', argument " "2"" of type '" "GeosGeometry *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_difference(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_symDifference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_symDifference",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_symDifference" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_symDifference" "', argument " "2"" of type '" "GeosGeometry *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_symDifference(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_boundary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_boundary",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_boundary" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_boundary(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_union(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_union",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_union" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_union" "', argument " "2"" of type '" "GeosGeometry *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_geomUnion(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_pointOnSurface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_pointOnSurface",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_pointOnSurface" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_pointOnSurface(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_getCentroid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getCentroid",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getCentroid" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_getCentroid(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_getEnvelope(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getEnvelope",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getEnvelope" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_getEnvelope(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_relate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_relate",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relate" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relate" "', argument " "2"" of type '" "GeosGeometry *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (char *)GeosGeometry_relate(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_FromCharPtr((const char *)result);
-  delete[] result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_lineMerge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_lineMerge",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_lineMerge" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_lineMerge(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_simplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  double arg2 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_simplify",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_simplify" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_simplify" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_simplify(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_topologyPreserveSimplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  double arg2 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_topologyPreserveSimplify",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometry_topologyPreserveSimplify(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_relatePattern(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  char *arg3 = (char *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_relatePattern",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relatePattern" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relatePattern" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Geometry_relatePattern" "', argument " "3"" of type '" "char const *""'");
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_relatePattern(arg1,(GeosGeometry const *)arg2,(char const *)arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return resultobj;
-fail:
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_disjoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_disjoint",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_disjoint" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_disjoint" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_disjoint(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_touches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_touches",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_touches" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_touches" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_touches(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_intersects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersects",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersects" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersects" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_intersects(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_crosses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_crosses",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_crosses" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_crosses" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_crosses(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_within(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_within",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_within" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_within" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_within(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_contains",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_contains" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_contains" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_contains(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_overlaps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_overlaps",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_overlaps" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_overlaps" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_overlaps(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_equals",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equals" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equals" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_equals(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_equalsExact(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  double arg3 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_equalsExact",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equalsExact" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equalsExact" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_equalsExact" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_equalsExact(arg1,(GeosGeometry const *)arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_isEmpty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isEmpty",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isEmpty" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_isEmpty(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_isValid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isValid",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isValid" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_isValid(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_isSimple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isSimple",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isSimple" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_isSimple(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_isRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isRing",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isRing" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_isRing(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_hasZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_hasZ",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_hasZ" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (bool)GeosGeometry_hasZ(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_area(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_area",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_area" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (double)GeosGeometry_area(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_length",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_length" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (double)GeosGeometry_length(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Geometry_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Geometry_distance",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_distance" "', argument " "1"" of type '" "GeosGeometry *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_distance" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
-  {
-    try
-    {
-      result = (double)GeosGeometry_distance(arg1,(GeosGeometry const *)arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *Geometry_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometry, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_Point(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPoint *arg1 = (GeosPoint *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_Point",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Point" "', argument " "1"" of type '" "GeosPoint *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPoint * >(argp1);
-  {
-    try
-    {
-      delete_GeosPoint(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Point_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPoint *arg1 = (GeosPoint *) 0 ;
-  GeosCoordinateSequence *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Point_getCoordSeq",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Point_getCoordSeq" "', argument " "1"" of type '" "GeosPoint *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPoint * >(argp1);
-  {
-    try
-    {
-      result = (GeosCoordinateSequence *)GeosPoint_getCoordSeq(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *Point_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosPoint, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_LineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosLineString *arg1 = (GeosLineString *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_LineString",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LineString" "', argument " "1"" of type '" "GeosLineString *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosLineString * >(argp1);
-  {
-    try
-    {
-      delete_GeosLineString(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_LineString_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosLineString *arg1 = (GeosLineString *) 0 ;
-  GeosCoordinateSequence *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"LineString_getCoordSeq",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LineString_getCoordSeq" "', argument " "1"" of type '" "GeosLineString *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosLineString * >(argp1);
-  {
-    try
-    {
-      result = (GeosCoordinateSequence *)GeosLineString_getCoordSeq(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *LineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosLineString, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_LinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_LinearRing",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearRing" "', argument " "1"" of type '" "GeosLinearRing *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
-  {
-    try
-    {
-      delete_GeosLinearRing(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_LinearRing_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
-  GeosCoordinateSequence *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"LinearRing_getCoordSeq",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearRing_getCoordSeq" "', argument " "1"" of type '" "GeosLinearRing *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
-  {
-    try
-    {
-      result = (GeosCoordinateSequence *)GeosLinearRing_getCoordSeq(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *LinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosLinearRing, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_Polygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_Polygon",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Polygon" "', argument " "1"" of type '" "GeosPolygon *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
-  {
-    try
-    {
-      delete_GeosPolygon(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Polygon_getExteriorRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getExteriorRing",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getExteriorRing" "', argument " "1"" of type '" "GeosPolygon *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosPolygon_getExteriorRing(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Polygon_getNumInteriorRings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
-  size_t result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getNumInteriorRings",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getNumInteriorRings" "', argument " "1"" of type '" "GeosPolygon *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
-  {
-    try
-    {
-      result = GeosPolygon_getNumInteriorRings(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_Polygon_getInteriorRingN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
-  size_t arg2 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getInteriorRingN",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getInteriorRingN" "', argument " "1"" of type '" "GeosPolygon *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Polygon_getInteriorRingN" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosPolygon_getInteriorRingN(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *Polygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosPolygon, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_GeometryCollection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_GeometryCollection",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GeometryCollection" "', argument " "1"" of type '" "GeosGeometryCollection *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
-  {
-    try
-    {
-      delete_GeosGeometryCollection(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_GeometryCollection_getGeometryN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
-  size_t arg2 ;
-  GeosGeometry *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"GeometryCollection_getGeometryN",2,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeometryCollection_getGeometryN" "', argument " "1"" of type '" "GeosGeometryCollection *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
-  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeometryCollection_getGeometryN" "', argument " "2"" of type '" "size_t""'");
-  } 
-  arg2 = static_cast< size_t >(val2);
-  {
-    try
-    {
-      result = (GeosGeometry *)GeosGeometryCollection_getGeometryN(arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *GeometryCollection_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometryCollection, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_MultiPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosMultiPoint *arg1 = (GeosMultiPoint *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPoint",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPoint, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPoint" "', argument " "1"" of type '" "GeosMultiPoint *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosMultiPoint * >(argp1);
-  {
-    try
-    {
-      delete_GeosMultiPoint(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *MultiPoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPoint, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_MultiLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosMultiLineString *arg1 = (GeosMultiLineString *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLineString",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLineString, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLineString" "', argument " "1"" of type '" "GeosMultiLineString *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosMultiLineString * >(argp1);
-  {
-    try
-    {
-      delete_GeosMultiLineString(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *MultiLineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLineString, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_MultiLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosMultiLinearRing *arg1 = (GeosMultiLinearRing *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLinearRing",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLinearRing, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLinearRing" "', argument " "1"" of type '" "GeosMultiLinearRing *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosMultiLinearRing * >(argp1);
-  {
-    try
-    {
-      delete_GeosMultiLinearRing(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *MultiLinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLinearRing, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_delete_MultiPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosMultiPolygon *arg1 = (GeosMultiPolygon *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPolygon",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPolygon, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPolygon" "', argument " "1"" of type '" "GeosMultiPolygon *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosMultiPolygon * >(argp1);
-  {
-    try
-    {
-      delete_GeosMultiPolygon(arg1);
-      
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *MultiPolygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPolygon, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_createPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  GeosGeometry *result = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"createPoint",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPoint" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)createPoint(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_createLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  GeosGeometry *result = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"createLineString",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLineString" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)createLineString(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_createLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
-  GeosGeometry *result = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"createLinearRing",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLinearRing" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)createLinearRing(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_createPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
-  GeosLinearRing **arg2 = (GeosLinearRing **) 0 ;
-  size_t arg3 ;
-  GeosGeometry *result = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  {
-    arg2 = NULL;
-    arg3 = 0;
-  }
-  if(!PyArg_UnpackTuple(args,(char *)"createPolygon",1,2,&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
-  }
-  if (obj1) {
-    {
-      if (obj1 == Py_None)
-      {
-        arg2 = NULL;
-        arg3 = 0;
-      }
-      else
-      {
-        /* Make sure the input can be treated as an array. */
-        if (!PySequence_Check(obj1))
-        SWIG_exception_fail(SWIG_RuntimeError, "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
-        
-        /* Get the length */
-        arg3 = PySequence_Size(obj1);
-        
-        /* Allocate space for the C array. */
-        arg2 = (GeosLinearRing**) malloc(arg3*sizeof(GeosLinearRing*));
-        
-        for(size_t i = 0; i<arg3; i++)
-        {
-          /* Get the Python Object */
-          PyObject *item = PySequence_GetItem(obj1,i);
-          
-          /* Get the underlying pointer and give up ownership of it. */
-          GeosLinearRing *ring = NULL;
-          int convertResult = SWIG_ConvertPtr(item, (void**)&ring, SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN);
-          if (!SWIG_IsOK(convertResult)) {
-            SWIG_exception_fail(SWIG_ArgError(convertResult), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
-          }
-          
-          /* Put the pointer in the array */
-          arg2[i] = ring;
-        }    
-      }
-    }
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)createPolygon(arg1,arg2,arg3);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  {
-    if (arg2) {
-      free((void*) arg2);
-    }
-  }
-  return resultobj;
-fail:
-  {
-    if (arg2) {
-      free((void*) arg2);
-    }
-  }
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomFromWKT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  char *arg1 = (char *) 0 ;
-  GeosGeometry *result = 0 ;
-  int res1 ;
-  char *buf1 = 0 ;
-  int alloc1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"geomFromWKT",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "geomFromWKT" "', argument " "1"" of type '" "char const *""'");
-  }
-  arg1 = reinterpret_cast< char * >(buf1);
-  {
-    try
-    {
-      result = (GeosGeometry *)geomFromWKT((char const *)arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
-  return resultobj;
-fail:
-  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomToWKT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"geomToWKT",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "geomToWKT" "', argument " "1"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (char *)geomToWKT((GeosGeometry const *)arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_FromCharPtr((const char *)result);
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_getWKBOutputDims(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"getWKBOutputDims",0,0)) SWIG_fail;
-  {
-    try
-    {
-      result = (int)getWKBOutputDims();
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_setWKBOutputDims(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int arg1 ;
-  int result;
-  int val1 ;
-  int ecode1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"setWKBOutputDims",1,1,&obj0)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setWKBOutputDims" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  {
-    try
-    {
-      result = (int)setWKBOutputDims(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_getWKBByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"getWKBByteOrder",0,0)) SWIG_fail;
-  {
-    try
-    {
-      result = (int)getWKBByteOrder();
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_setWKBByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int arg1 ;
-  int result;
-  int val1 ;
-  int ecode1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"setWKBByteOrder",1,1,&obj0)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setWKBByteOrder" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  {
-    try
-    {
-      result = (int)setWKBByteOrder(arg1);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomFromWKB(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  unsigned char *arg1 = (unsigned char *) 0 ;
-  size_t arg2 ;
-  GeosGeometry *result = 0 ;
-  int alloc1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"geomFromWKB",1,1,&obj0)) SWIG_fail;
-  {
-    /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc1 = 0) */
-    if (SWIG_AsCharPtrAndSize(obj0, (char**)&arg1, &arg2, &alloc1) != SWIG_OK)
-    SWIG_exception(SWIG_RuntimeError, "Expecting a string");
-    /* Don't want to include last null character! */
-    arg2--;
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)geomFromWKB((unsigned char const *)arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomToWKB(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  size_t *arg2 = (size_t *) 0 ;
-  unsigned char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t temp2 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  {
-    /* %typemap(in, numinputs=0) size_t *size (size_t temp2 = 0) */
-    arg2 = &temp2;
-  }
-  if(!PyArg_UnpackTuple(args,(char *)"geomToWKB",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "geomToWKB" "', argument " "1"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (unsigned char *)geomToWKB((GeosGeometry const *)arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) unsigned char* */
-  }
-  {
-    /* %typemap(argout) size_t *size */
-    resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg2);
-  }
-  {
-    /* %typemap(freearg) size_t *size */
-    std::free(result);
-  }
-  return resultobj;
-fail:
-  {
-    /* %typemap(freearg) size_t *size */
-    std::free(result);
-  }
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomFromHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  unsigned char *arg1 = (unsigned char *) 0 ;
-  size_t arg2 ;
-  GeosGeometry *result = 0 ;
-  int alloc1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if(!PyArg_UnpackTuple(args,(char *)"geomFromHEX",1,1,&obj0)) SWIG_fail;
-  {
-    /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc1 = 0) */
-    if (SWIG_AsCharPtrAndSize(obj0, (char**)&arg1, &arg2, &alloc1) != SWIG_OK)
-    SWIG_exception(SWIG_RuntimeError, "Expecting a string");
-    /* Don't want to include last null character! */
-    arg2--;
-  }
-  {
-    try
-    {
-      result = (GeosGeometry *)geomFromHEX((unsigned char const *)arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) GeosGeometry */
-    
-    if (result == NULL)
-    SWIG_exception(SWIG_RuntimeError, message);
-    
-    GeosGeometry *geom = result;
-    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
-    
-    switch (geomId)
-    {
-    case GEOS_POINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_LINEARRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_POLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOINT:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTILINESTRING:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_MULTIPOLYGON:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
-      break;
-    case GEOS_GEOMETRYCOLLECTION:
-      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
-      break;
-    }
-  }
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_geomToHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
-  size_t *arg2 = (size_t *) 0 ;
-  unsigned char *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  size_t temp2 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  {
-    /* %typemap(in, numinputs=0) size_t *size (size_t temp2 = 0) */
-    arg2 = &temp2;
-  }
-  if(!PyArg_UnpackTuple(args,(char *)"geomToHEX",1,1,&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "geomToHEX" "', argument " "1"" of type '" "GeosGeometry const *""'"); 
-  }
-  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
-  {
-    try
-    {
-      result = (unsigned char *)geomToHEX((GeosGeometry const *)arg1,arg2);
-    }
-    catch (const std::exception& e)
-    {
-      SWIG_exception(SWIG_RuntimeError, e.what());
-    }
-  }
-  {
-    /* %typemap(out) unsigned char* */
-  }
-  {
-    /* %typemap(argout) size_t *size */
-    resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg2);
-  }
-  {
-    /* %typemap(freearg) size_t *size */
-    std::free(result);
-  }
-  return resultobj;
-fail:
-  {
-    /* %typemap(freearg) size_t *size */
-    std::free(result);
-  }
-  return NULL;
-}
-
-
-static PyMethodDef SwigMethods[] = {
-	 { (char *)"delete_PySwigIterator", _wrap_delete_PySwigIterator, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_value", _wrap_PySwigIterator_value, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_incr", _wrap_PySwigIterator_incr, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_decr", _wrap_PySwigIterator_decr, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_distance", _wrap_PySwigIterator_distance, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_equal", _wrap_PySwigIterator_equal, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_copy", _wrap_PySwigIterator_copy, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_next", _wrap_PySwigIterator_next, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_previous", _wrap_PySwigIterator_previous, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_advance", _wrap_PySwigIterator_advance, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___eq__", _wrap_PySwigIterator___eq__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___ne__", _wrap_PySwigIterator___ne__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___iadd__", _wrap_PySwigIterator___iadd__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___isub__", _wrap_PySwigIterator___isub__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___add__", _wrap_PySwigIterator___add__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator___sub__", _wrap_PySwigIterator___sub__, METH_VARARGS, NULL},
-	 { (char *)"PySwigIterator_swigregister", PySwigIterator_swigregister, METH_VARARGS, NULL},
-	 { (char *)"version", _wrap_version, METH_VARARGS, NULL},
-	 { (char *)"new_CoordinateSequence", _wrap_new_CoordinateSequence, METH_VARARGS, NULL},
-	 { (char *)"delete_CoordinateSequence", _wrap_delete_CoordinateSequence, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_clone", _wrap_CoordinateSequence_clone, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_setX", _wrap_CoordinateSequence_setX, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_setY", _wrap_CoordinateSequence_setY, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_setZ", _wrap_CoordinateSequence_setZ, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_setOrdinate", _wrap_CoordinateSequence_setOrdinate, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getX", _wrap_CoordinateSequence_getX, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getY", _wrap_CoordinateSequence_getY, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getZ", _wrap_CoordinateSequence_getZ, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getOrdinate", _wrap_CoordinateSequence_getOrdinate, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getSize", _wrap_CoordinateSequence_getSize, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_getDimensions", _wrap_CoordinateSequence_getDimensions, METH_VARARGS, NULL},
-	 { (char *)"CoordinateSequence_swigregister", CoordinateSequence_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_Geometry", _wrap_delete_Geometry, METH_VARARGS, NULL},
-	 { (char *)"Geometry_clone", _wrap_Geometry_clone, METH_VARARGS, NULL},
-	 { (char *)"Geometry_geomType", _wrap_Geometry_geomType, METH_VARARGS, NULL},
-	 { (char *)"Geometry_typeId", _wrap_Geometry_typeId, METH_VARARGS, NULL},
-	 { (char *)"Geometry_normalize", _wrap_Geometry_normalize, METH_VARARGS, NULL},
-	 { (char *)"Geometry_getSRID", _wrap_Geometry_getSRID, METH_VARARGS, NULL},
-	 { (char *)"Geometry_setSRID", _wrap_Geometry_setSRID, METH_VARARGS, NULL},
-	 { (char *)"Geometry_getDimensions", _wrap_Geometry_getDimensions, METH_VARARGS, NULL},
-	 { (char *)"Geometry_getNumGeometries", _wrap_Geometry_getNumGeometries, METH_VARARGS, NULL},
-	 { (char *)"Geometry_intersection", _wrap_Geometry_intersection, METH_VARARGS, NULL},
-	 { (char *)"Geometry_buffer", _wrap_Geometry_buffer, METH_VARARGS, NULL},
-	 { (char *)"Geometry_convexHull", _wrap_Geometry_convexHull, METH_VARARGS, NULL},
-	 { (char *)"Geometry_difference", _wrap_Geometry_difference, METH_VARARGS, NULL},
-	 { (char *)"Geometry_symDifference", _wrap_Geometry_symDifference, METH_VARARGS, NULL},
-	 { (char *)"Geometry_boundary", _wrap_Geometry_boundary, METH_VARARGS, NULL},
-	 { (char *)"Geometry_union", _wrap_Geometry_union, METH_VARARGS, NULL},
-	 { (char *)"Geometry_pointOnSurface", _wrap_Geometry_pointOnSurface, METH_VARARGS, NULL},
-	 { (char *)"Geometry_getCentroid", _wrap_Geometry_getCentroid, METH_VARARGS, NULL},
-	 { (char *)"Geometry_getEnvelope", _wrap_Geometry_getEnvelope, METH_VARARGS, NULL},
-	 { (char *)"Geometry_relate", _wrap_Geometry_relate, METH_VARARGS, NULL},
-	 { (char *)"Geometry_lineMerge", _wrap_Geometry_lineMerge, METH_VARARGS, NULL},
-	 { (char *)"Geometry_simplify", _wrap_Geometry_simplify, METH_VARARGS, NULL},
-	 { (char *)"Geometry_topologyPreserveSimplify", _wrap_Geometry_topologyPreserveSimplify, METH_VARARGS, NULL},
-	 { (char *)"Geometry_relatePattern", _wrap_Geometry_relatePattern, METH_VARARGS, NULL},
-	 { (char *)"Geometry_disjoint", _wrap_Geometry_disjoint, METH_VARARGS, NULL},
-	 { (char *)"Geometry_touches", _wrap_Geometry_touches, METH_VARARGS, NULL},
-	 { (char *)"Geometry_intersects", _wrap_Geometry_intersects, METH_VARARGS, NULL},
-	 { (char *)"Geometry_crosses", _wrap_Geometry_crosses, METH_VARARGS, NULL},
-	 { (char *)"Geometry_within", _wrap_Geometry_within, METH_VARARGS, NULL},
-	 { (char *)"Geometry_contains", _wrap_Geometry_contains, METH_VARARGS, NULL},
-	 { (char *)"Geometry_overlaps", _wrap_Geometry_overlaps, METH_VARARGS, NULL},
-	 { (char *)"Geometry_equals", _wrap_Geometry_equals, METH_VARARGS, NULL},
-	 { (char *)"Geometry_equalsExact", _wrap_Geometry_equalsExact, METH_VARARGS, NULL},
-	 { (char *)"Geometry_isEmpty", _wrap_Geometry_isEmpty, METH_VARARGS, NULL},
-	 { (char *)"Geometry_isValid", _wrap_Geometry_isValid, METH_VARARGS, NULL},
-	 { (char *)"Geometry_isSimple", _wrap_Geometry_isSimple, METH_VARARGS, NULL},
-	 { (char *)"Geometry_isRing", _wrap_Geometry_isRing, METH_VARARGS, NULL},
-	 { (char *)"Geometry_hasZ", _wrap_Geometry_hasZ, METH_VARARGS, NULL},
-	 { (char *)"Geometry_area", _wrap_Geometry_area, METH_VARARGS, NULL},
-	 { (char *)"Geometry_length", _wrap_Geometry_length, METH_VARARGS, NULL},
-	 { (char *)"Geometry_distance", _wrap_Geometry_distance, METH_VARARGS, NULL},
-	 { (char *)"Geometry_swigregister", Geometry_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_Point", _wrap_delete_Point, METH_VARARGS, NULL},
-	 { (char *)"Point_getCoordSeq", _wrap_Point_getCoordSeq, METH_VARARGS, NULL},
-	 { (char *)"Point_swigregister", Point_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_LineString", _wrap_delete_LineString, METH_VARARGS, NULL},
-	 { (char *)"LineString_getCoordSeq", _wrap_LineString_getCoordSeq, METH_VARARGS, NULL},
-	 { (char *)"LineString_swigregister", LineString_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_LinearRing", _wrap_delete_LinearRing, METH_VARARGS, NULL},
-	 { (char *)"LinearRing_getCoordSeq", _wrap_LinearRing_getCoordSeq, METH_VARARGS, NULL},
-	 { (char *)"LinearRing_swigregister", LinearRing_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_Polygon", _wrap_delete_Polygon, METH_VARARGS, NULL},
-	 { (char *)"Polygon_getExteriorRing", _wrap_Polygon_getExteriorRing, METH_VARARGS, NULL},
-	 { (char *)"Polygon_getNumInteriorRings", _wrap_Polygon_getNumInteriorRings, METH_VARARGS, NULL},
-	 { (char *)"Polygon_getInteriorRingN", _wrap_Polygon_getInteriorRingN, METH_VARARGS, NULL},
-	 { (char *)"Polygon_swigregister", Polygon_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_GeometryCollection", _wrap_delete_GeometryCollection, METH_VARARGS, NULL},
-	 { (char *)"GeometryCollection_getGeometryN", _wrap_GeometryCollection_getGeometryN, METH_VARARGS, NULL},
-	 { (char *)"GeometryCollection_swigregister", GeometryCollection_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_MultiPoint", _wrap_delete_MultiPoint, METH_VARARGS, NULL},
-	 { (char *)"MultiPoint_swigregister", MultiPoint_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_MultiLineString", _wrap_delete_MultiLineString, METH_VARARGS, NULL},
-	 { (char *)"MultiLineString_swigregister", MultiLineString_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_MultiLinearRing", _wrap_delete_MultiLinearRing, METH_VARARGS, NULL},
-	 { (char *)"MultiLinearRing_swigregister", MultiLinearRing_swigregister, METH_VARARGS, NULL},
-	 { (char *)"delete_MultiPolygon", _wrap_delete_MultiPolygon, METH_VARARGS, NULL},
-	 { (char *)"MultiPolygon_swigregister", MultiPolygon_swigregister, METH_VARARGS, NULL},
-	 { (char *)"createPoint", _wrap_createPoint, METH_VARARGS, NULL},
-	 { (char *)"createLineString", _wrap_createLineString, METH_VARARGS, NULL},
-	 { (char *)"createLinearRing", _wrap_createLinearRing, METH_VARARGS, NULL},
-	 { (char *)"createPolygon", _wrap_createPolygon, METH_VARARGS, NULL},
-	 { (char *)"geomFromWKT", _wrap_geomFromWKT, METH_VARARGS, NULL},
-	 { (char *)"geomToWKT", _wrap_geomToWKT, METH_VARARGS, NULL},
-	 { (char *)"getWKBOutputDims", _wrap_getWKBOutputDims, METH_VARARGS, NULL},
-	 { (char *)"setWKBOutputDims", _wrap_setWKBOutputDims, METH_VARARGS, NULL},
-	 { (char *)"getWKBByteOrder", _wrap_getWKBByteOrder, METH_VARARGS, NULL},
-	 { (char *)"setWKBByteOrder", _wrap_setWKBByteOrder, METH_VARARGS, NULL},
-	 { (char *)"geomFromWKB", _wrap_geomFromWKB, METH_VARARGS, NULL},
-	 { (char *)"geomToWKB", _wrap_geomToWKB, METH_VARARGS, NULL},
-	 { (char *)"geomFromHEX", _wrap_geomFromHEX, METH_VARARGS, NULL},
-	 { (char *)"geomToHEX", _wrap_geomToHEX, METH_VARARGS, NULL},
-	 { NULL, NULL, 0, NULL }
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-
-static void *_p_GeosMultiPolygonTo_p_GeosGeometryCollection(void *x) {
-    return (void *)((GeosGeometryCollection *)  ((GeosMultiPolygon *) x));
-}
-static void *_p_GeosMultiPointTo_p_GeosGeometryCollection(void *x) {
-    return (void *)((GeosGeometryCollection *)  ((GeosMultiPoint *) x));
-}
-static void *_p_GeosMultiLineStringTo_p_GeosGeometryCollection(void *x) {
-    return (void *)((GeosGeometryCollection *)  ((GeosMultiLineString *) x));
-}
-static void *_p_GeosMultiLinearRingTo_p_GeosGeometryCollection(void *x) {
-    return (void *)((GeosGeometryCollection *)  ((GeosMultiLinearRing *) x));
-}
-static void *_p_GeosPolygonTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *)  ((GeosPolygon *) x));
-}
-static void *_p_GeosMultiPolygonTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPolygon *) x));
-}
-static void *_p_GeosPointTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *)  ((GeosPoint *) x));
-}
-static void *_p_GeosLineStringTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *)  ((GeosLineString *) x));
-}
-static void *_p_GeosLinearRingTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *)  ((GeosLinearRing *) x));
-}
-static void *_p_GeosMultiPointTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPoint *) x));
-}
-static void *_p_GeosMultiLineStringTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLineString *) x));
-}
-static void *_p_GeosMultiLinearRingTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLinearRing *) x));
-}
-static void *_p_GeosGeometryCollectionTo_p_GeosGeometry(void *x) {
-    return (void *)((GeosGeometry *)  ((GeosGeometryCollection *) x));
-}
-static swig_type_info _swigt__p_GeosCoordinateSequence = {"_p_GeosCoordinateSequence", "GeosCoordinateSequence *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosGeometry = {"_p_GeosGeometry", "GeosGeometry *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosGeometryCollection = {"_p_GeosGeometryCollection", "GeosGeometryCollection *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosLineString = {"_p_GeosLineString", "GeosLineString *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosLinearRing = {"_p_GeosLinearRing", "GeosLinearRing *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosMultiLineString = {"_p_GeosMultiLineString", "GeosMultiLineString *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosMultiLinearRing = {"_p_GeosMultiLinearRing", "GeosMultiLinearRing *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosMultiPoint = {"_p_GeosMultiPoint", "GeosMultiPoint *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosMultiPolygon = {"_p_GeosMultiPolygon", "GeosMultiPolygon *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosPoint = {"_p_GeosPoint", "GeosPoint *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_GeosPolygon = {"_p_GeosPolygon", "GeosPolygon *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_p_GeosLinearRing = {"_p_p_GeosLinearRing", "GeosLinearRing **", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_swig__PySwigIterator = {"_p_swig__PySwigIterator", "swig::PySwigIterator *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
-
-static swig_type_info *swig_type_initial[] = {
-  &_swigt__p_GeosCoordinateSequence,
-  &_swigt__p_GeosGeometry,
-  &_swigt__p_GeosGeometryCollection,
-  &_swigt__p_GeosLineString,
-  &_swigt__p_GeosLinearRing,
-  &_swigt__p_GeosMultiLineString,
-  &_swigt__p_GeosMultiLinearRing,
-  &_swigt__p_GeosMultiPoint,
-  &_swigt__p_GeosMultiPolygon,
-  &_swigt__p_GeosPoint,
-  &_swigt__p_GeosPolygon,
-  &_swigt__p_char,
-  &_swigt__p_p_GeosLinearRing,
-  &_swigt__p_size_t,
-  &_swigt__p_std__invalid_argument,
-  &_swigt__p_swig__PySwigIterator,
-  &_swigt__p_unsigned_char,
-};
-
-static swig_cast_info _swigc__p_GeosCoordinateSequence[] = {  {&_swigt__p_GeosCoordinateSequence, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosGeometry[] = {  {&_swigt__p_GeosPolygon, _p_GeosPolygonTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosPoint, _p_GeosPointTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosGeometry, 0, 0, 0},  {&_swigt__p_GeosLineString, _p_GeosLineStringTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosLinearRing, _p_GeosLinearRingTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosGeometryCollection, _p_GeosGeometryCollectionTo_p_GeosGeometry, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosGeometryCollection[] = {  {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosGeometryCollection, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosLineString[] = {  {&_swigt__p_GeosLineString, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosLinearRing[] = {  {&_swigt__p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosMultiLineString[] = {  {&_swigt__p_GeosMultiLineString, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosMultiLinearRing[] = {  {&_swigt__p_GeosMultiLinearRing, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosMultiPoint[] = {  {&_swigt__p_GeosMultiPoint, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosMultiPolygon[] = {  {&_swigt__p_GeosMultiPolygon, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosPoint[] = {  {&_swigt__p_GeosPoint, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_GeosPolygon[] = {  {&_swigt__p_GeosPolygon, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_p_GeosLinearRing[] = {  {&_swigt__p_p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_std__invalid_argument[] = {  {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_swig__PySwigIterator[] = {  {&_swigt__p_swig__PySwigIterator, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
-
-static swig_cast_info *swig_cast_initial[] = {
-  _swigc__p_GeosCoordinateSequence,
-  _swigc__p_GeosGeometry,
-  _swigc__p_GeosGeometryCollection,
-  _swigc__p_GeosLineString,
-  _swigc__p_GeosLinearRing,
-  _swigc__p_GeosMultiLineString,
-  _swigc__p_GeosMultiLinearRing,
-  _swigc__p_GeosMultiPoint,
-  _swigc__p_GeosMultiPolygon,
-  _swigc__p_GeosPoint,
-  _swigc__p_GeosPolygon,
-  _swigc__p_char,
-  _swigc__p_p_GeosLinearRing,
-  _swigc__p_size_t,
-  _swigc__p_std__invalid_argument,
-  _swigc__p_swig__PySwigIterator,
-  _swigc__p_unsigned_char,
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
-
-static swig_const_info swig_const_table[] = {
-{0, 0, 0, 0.0, 0, 0}};
-
-#ifdef __cplusplus
-}
-#endif
-/* -----------------------------------------------------------------------------
- * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
- * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
- * swig_module, and does all the lookup, filling in the swig_module.types
- * array with the correct data and linking the correct swig_cast_info
- * structures together.
- *
- * The generated swig_type_info structures are assigned staticly to an initial 
- * array. We just loop through that array, and handle each type individually.
- * First we lookup if this type has been already loaded, and if so, use the
- * loaded structure instead of the generated one. Then we have to fill in the
- * cast linked list. The cast data is initially stored in something like a
- * two-dimensional array. Each row corresponds to a type (there are the same
- * number of rows as there are in the swig_type_initial array). Each entry in
- * a column is one of the swig_cast_info structures for that type.
- * The cast_initial array is actually an array of arrays, because each row has
- * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
- * adding the casts to the list. The one last trick we need to do is making
- * sure the type pointer in the swig_cast_info struct is correct.
- *
- * First off, we lookup the cast->type name to see if it is already loaded. 
- * There are three cases to handle:
- *  1) If the cast->type has already been loaded AND the type we are adding
- *     casting info to has not been loaded (it is in this module), THEN we
- *     replace the cast->type pointer with the type pointer that has already
- *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
- *     cast->type) are loaded, THEN the cast info has already been loaded by
- *     the previous module so we just ignore it.
- *  3) Finally, if cast->type has not already been loaded, then we add that
- *     swig_cast_info to the linked list (because the cast->type) pointer will
- *     be correct.
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* c-mode */
-#endif
-#endif
-
-#if 0
-#define SWIGRUNTIME_DEBUG
-#endif
-
-
-SWIGRUNTIME void
-SWIG_InitializeModule(void *clientdata) {
-  size_t i;
-  swig_module_info *module_head, *iter;
-  int found;
-  
-  clientdata = clientdata;
-  
-  /* check to see if the circular list has been setup, if not, set it up */
-  if (swig_module.next==0) {
-    /* Initialize the swig_module */
-    swig_module.type_initial = swig_type_initial;
-    swig_module.cast_initial = swig_cast_initial;
-    swig_module.next = &swig_module;
-  }
-  
-  /* Try and load any already created modules */
-  module_head = SWIG_GetModule(clientdata);
-  if (!module_head) {
-    /* This is the first module loaded for this interpreter */
-    /* so set the swig module into the interpreter */
-    SWIG_SetModule(clientdata, &swig_module);
-    module_head = &swig_module;
-  } else {
-    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    found=0;
-    iter=module_head;
-    do {
-      if (iter==&swig_module) {
-        found=1;
-        break;
-      }
-      iter=iter->next;
-    } while (iter!= module_head);
-    
-    /* if the is found in the list, then all is done and we may leave */
-    if (found) return;
-    /* otherwise we must add out module into the list */
-    swig_module.next = module_head->next;
-    module_head->next = &swig_module;
-  }
-  
-  /* Now work on filling in swig_module.types */
-#ifdef SWIGRUNTIME_DEBUG
-  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
-#endif
-  for (i = 0; i < swig_module.size; ++i) {
-    swig_type_info *type = 0;
-    swig_type_info *ret;
-    swig_cast_info *cast;
-    
-#ifdef SWIGRUNTIME_DEBUG
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-#endif
-    
-    /* if there is another module already loaded */
-    if (swig_module.next != &swig_module) {
-      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
-    }
-    if (type) {
-      /* Overwrite clientdata field */
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: found type %s\n", type->name);
-#endif
-      if (swig_module.type_initial[i]->clientdata) {
-        type->clientdata = swig_module.type_initial[i]->clientdata;
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
-#endif
-      }
-    } else {
-      type = swig_module.type_initial[i];
-    }
-    
-    /* Insert casting types */
-    cast = swig_module.cast_initial[i];
-    while (cast->type) {
-      /* Don't need to add information already in the list */
-      ret = 0;
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
-#endif
-      if (swig_module.next != &swig_module) {
-        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
-#ifdef SWIGRUNTIME_DEBUG
-        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
-#endif
-      }
-      if (ret) {
-        if (type == swig_module.type_initial[i]) {
-#ifdef SWIGRUNTIME_DEBUG
-          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
-#endif
-          cast->type = ret;
-          ret = 0;
-        } else {
-          /* Check for casting already in the list */
-          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
-#ifdef SWIGRUNTIME_DEBUG
-          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
-#endif
-          if (!ocast) ret = 0;
-        }
-      }
-      
-      if (!ret) {
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
-#endif
-        if (type->cast) {
-          type->cast->prev = cast;
-          cast->next = type->cast;
-        }
-        type->cast = cast;
-      }
-      cast++;
-    }
-    /* Set entry in modules->types array equal to the type */
-    swig_module.types[i] = type;
-  }
-  swig_module.types[i] = 0;
-  
-#ifdef SWIGRUNTIME_DEBUG
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-  for (i = 0; i < swig_module.size; ++i) {
-    int j = 0;
-    swig_cast_info *cast = swig_module.cast_initial[i];
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-    while (cast->type) {
-      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
-      cast++;
-      ++j;
-    }
-    printf("---- Total casts: %d\n",j);
-  }
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-#endif
-}
-
-/* This function will propagate the clientdata field of type to
-* any new swig_type_info structures that have been added into the list
-* of equivalent types.  It is like calling
-* SWIG_TypeClientData(type, clientdata) a second time.
-*/
-SWIGRUNTIME void
-SWIG_PropagateClientData(void) {
-  size_t i;
-  swig_cast_info *equiv;
-  static int init_run = 0;
-  
-  if (init_run) return;
-  init_run = 1;
-  
-  for (i = 0; i < swig_module.size; i++) {
-    if (swig_module.types[i]->clientdata) {
-      equiv = swig_module.types[i]->cast;
-      while (equiv) {
-        if (!equiv->converter) {
-          if (equiv->type && !equiv->type->clientdata)
-          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
-        }
-        equiv = equiv->next;
-      }
-    }
-  }
-}
-
-#ifdef __cplusplus
-#if 0
-{
-  /* c-mode */
-#endif
-}
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-  
-  /* Python-specific SWIG API */
-#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
-#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
-#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
-  
-  /* -----------------------------------------------------------------------------
-   * global variable support code.
-   * ----------------------------------------------------------------------------- */
-  
-  typedef struct swig_globalvar {
-    char       *name;                  /* Name of global variable */
-    PyObject *(*get_attr)(void);       /* Return the current value */
-    int       (*set_attr)(PyObject *); /* Set the value */
-    struct swig_globalvar *next;
-  } swig_globalvar;
-  
-  typedef struct swig_varlinkobject {
-    PyObject_HEAD
-    swig_globalvar *vars;
-  } swig_varlinkobject;
-  
-  SWIGINTERN PyObject *
-  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
-    return PyString_FromString("<Swig global variables>");
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_str(swig_varlinkobject *v) {
-    PyObject *str = PyString_FromString("(");
-    swig_globalvar  *var;
-    for (var = v->vars; var; var=var->next) {
-      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
-      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
-    }
-    PyString_ConcatAndDel(&str,PyString_FromString(")"));
-    return str;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
-    PyObject *str = swig_varlink_str(v);
-    fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", PyString_AsString(str));
-    Py_DECREF(str);
-    return 0;
-  }
-  
-  SWIGINTERN void
-  swig_varlink_dealloc(swig_varlinkobject *v) {
-    swig_globalvar *var = v->vars;
-    while (var) {
-      swig_globalvar *n = var->next;
-      free(var->name);
-      free(var);
-      var = n;
-    }
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
-    PyObject *res = NULL;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->get_attr)();
-        break;
-      }
-      var = var->next;
-    }
-    if (res == NULL && !PyErr_Occurred()) {
-      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
-    }
-    return res;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
-    int res = 1;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->set_attr)(p);
-        break;
-      }
-      var = var->next;
-    }
-    if (res == 1 && !PyErr_Occurred()) {
-      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
-    }
-    return res;
-  }
-  
-  SWIGINTERN PyTypeObject*
-  swig_varlink_type(void) {
-    static char varlink__doc__[] = "Swig var link object";
-    static PyTypeObject varlink_type;
-    static int type_init = 0;  
-    if (!type_init) {
-      const PyTypeObject tmp
-      = {
-        PyObject_HEAD_INIT(NULL)
-        0,                                  /* Number of items in variable part (ob_size) */
-        (char *)"swigvarlink",              /* Type name (tp_name) */
-        sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
-        0,                                  /* Itemsize (tp_itemsize) */
-        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
-        (printfunc) swig_varlink_print,     /* Print (tp_print) */
-        (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
-        (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
-        0,                                  /* tp_compare */
-        (reprfunc) swig_varlink_repr,       /* tp_repr */
-        0,                                  /* tp_as_number */
-        0,                                  /* tp_as_sequence */
-        0,                                  /* tp_as_mapping */
-        0,                                  /* tp_hash */
-        0,                                  /* tp_call */
-        (reprfunc)swig_varlink_str,        /* tp_str */
-        0,                                  /* tp_getattro */
-        0,                                  /* tp_setattro */
-        0,                                  /* tp_as_buffer */
-        0,                                  /* tp_flags */
-        varlink__doc__,                     /* tp_doc */
-        0,                                  /* tp_traverse */
-        0,                                  /* tp_clear */
-        0,                                  /* tp_richcompare */
-        0,                                  /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-        0,                                  /* tp_del */
-#endif
-#ifdef COUNT_ALLOCS
-        0,0,0,0                             /* tp_alloc -> tp_next */
-#endif
-      };
-      varlink_type = tmp;
-      varlink_type.ob_type = &PyType_Type;
-      type_init = 1;
-    }
-    return &varlink_type;
-  }
-  
-  /* Create a variable linking object for use later */
-  SWIGINTERN PyObject *
-  SWIG_Python_newvarlink(void) {
-    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
-    if (result) {
-      result->vars = 0;
-    }
-    return ((PyObject*) result);
-  }
-  
-  SWIGINTERN void 
-  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
-    swig_varlinkobject *v = (swig_varlinkobject *) p;
-    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
-    if (gv) {
-      size_t size = strlen(name)+1;
-      gv->name = (char *)malloc(size);
-      if (gv->name) {
-        strncpy(gv->name,name,size);
-        gv->get_attr = get_attr;
-        gv->set_attr = set_attr;
-        gv->next = v->vars;
-      }
-    }
-    v->vars = gv;
-  }
-  
-  SWIGINTERN PyObject *
-  SWIG_globals(void) {
-    static PyObject *_SWIG_globals = 0; 
-    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
-    return _SWIG_globals;
-  }
-  
-  /* -----------------------------------------------------------------------------
-   * constants/methods manipulation
-   * ----------------------------------------------------------------------------- */
-  
-  /* Install Constants */
-  SWIGINTERN void
-  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
-    PyObject *obj = 0;
-    size_t i;
-    for (i = 0; constants[i].type; ++i) {
-      switch(constants[i].type) {
-      case SWIG_PY_POINTER:
-        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
-        break;
-      case SWIG_PY_BINARY:
-        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
-        break;
-      default:
-        obj = 0;
-        break;
-      }
-      if (obj) {
-        PyDict_SetItemString(d, constants[i].name, obj);
-        Py_DECREF(obj);
-      }
-    }
-  }
-  
-  /* -----------------------------------------------------------------------------*/
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  /* -----------------------------------------------------------------------------*/
-  
-  SWIGINTERN void
-  SWIG_Python_FixMethods(PyMethodDef *methods,
-    swig_const_info *const_table,
-    swig_type_info **types,
-    swig_type_info **types_initial) {
-    size_t i;
-    for (i = 0; methods[i].ml_name; ++i) {
-      const char *c = methods[i].ml_doc;
-      if (c && (c = strstr(c, "swig_ptr: "))) {
-        int j;
-        swig_const_info *ci = 0;
-        const char *name = c + 10;
-        for (j = 0; const_table[j].type; ++j) {
-          if (strncmp(const_table[j].name, name, 
-              strlen(const_table[j].name)) == 0) {
-            ci = &(const_table[j]);
-            break;
-          }
-        }
-        if (ci) {
-          size_t shift = (ci->ptype) - types;
-          swig_type_info *ty = types_initial[shift];
-          size_t ldoc = (c - methods[i].ml_doc);
-          size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
-          char *ndoc = (char*)malloc(ldoc + lptr + 10);
-          if (ndoc) {
-            char *buff = ndoc;
-            void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
-            if (ptr) {
-              strncpy(buff, methods[i].ml_doc, ldoc);
-              buff += ldoc;
-              strncpy(buff, "swig_ptr: ", 10);
-              buff += 10;
-              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
-              methods[i].ml_doc = ndoc;
-            }
-          }
-        }
-      }
-    }
-  } 
-  
-#ifdef __cplusplus
-}
-#endif
-
-/* -----------------------------------------------------------------------------*
- *  Partial Init method
- * -----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT void SWIG_init(void) {
-  PyObject *m, *d;
-  
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
-  
-  m = Py_InitModule((char *) SWIG_name, SwigMethods);
-  d = PyModule_GetDict(m);
-  
-  SWIG_InitializeModule(0);
-  SWIG_InstallConstants(d,swig_const_table);
-  
-  
-  SWIG_Python_SetConstant(d, "GEOS_VERSION_MAJOR",SWIG_From_int(static_cast< int >(3)));
-  SWIG_Python_SetConstant(d, "GEOS_VERSION_MINOR",SWIG_From_int(static_cast< int >(0)));
-  SWIG_Python_SetConstant(d, "GEOS_VERSION",SWIG_FromCharPtr("3.0.0rc4"));
-  SWIG_Python_SetConstant(d, "GEOS_JTS_PORT",SWIG_FromCharPtr("1.7.1"));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MAJOR",SWIG_From_int(static_cast< int >(1)));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MINOR",SWIG_From_int(static_cast< int >(3)));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_PATCH",SWIG_From_int(static_cast< int >(3)));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_FIRST_INTERFACE",SWIG_From_int(static_cast< int >(1)));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_LAST_INTERFACE",SWIG_From_int(static_cast< int >((1+3))));
-  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION",SWIG_FromCharPtr("3.0.0rc4-CAPI-1.3.3"));
-  SWIG_Python_SetConstant(d, "GEOS_POINT",SWIG_From_int(static_cast< int >(GEOS_POINT)));
-  SWIG_Python_SetConstant(d, "GEOS_LINESTRING",SWIG_From_int(static_cast< int >(GEOS_LINESTRING)));
-  SWIG_Python_SetConstant(d, "GEOS_LINEARRING",SWIG_From_int(static_cast< int >(GEOS_LINEARRING)));
-  SWIG_Python_SetConstant(d, "GEOS_POLYGON",SWIG_From_int(static_cast< int >(GEOS_POLYGON)));
-  SWIG_Python_SetConstant(d, "GEOS_MULTIPOINT",SWIG_From_int(static_cast< int >(GEOS_MULTIPOINT)));
-  SWIG_Python_SetConstant(d, "GEOS_MULTILINESTRING",SWIG_From_int(static_cast< int >(GEOS_MULTILINESTRING)));
-  SWIG_Python_SetConstant(d, "GEOS_MULTIPOLYGON",SWIG_From_int(static_cast< int >(GEOS_MULTIPOLYGON)));
-  SWIG_Python_SetConstant(d, "GEOS_GEOMETRYCOLLECTION",SWIG_From_int(static_cast< int >(GEOS_GEOMETRYCOLLECTION)));
-  SWIG_Python_SetConstant(d, "GEOS_WKB_XDR",SWIG_From_int(static_cast< int >(GEOS_WKB_XDR)));
-  SWIG_Python_SetConstant(d, "GEOS_WKB_NDR",SWIG_From_int(static_cast< int >(GEOS_WKB_NDR)));
-  
-  initGEOS(noticeHandler, errorHandler);
-  
-}
-
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.4
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template<typename T> class SwigValueWrapper {
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+public:
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
+};
+
+template <typename T> T SwigValueInit() {
+  return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic C API SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+  
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The SWIG conversion methods, as ConvertPtr, return an integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old versions of SWIG, code such as the following was usually written:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   which is the same really, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   SWIG errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+*/
+
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyString_Check(name) PyBytes_Check(name)
+#define PyString_FromString(x) PyUnicode_FromString(x)
+#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
+#define PyString_AsString(str) PyBytes_AsString(str)
+#define PyString_Size(str) PyBytes_Size(str)	
+#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
+#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
+#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
+#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
+
+#endif
+
+#ifndef Py_TYPE
+#  define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+#  define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  char *cstr;
+  char *newstr;
+  Py_ssize_t len;
+  str = PyUnicode_AsUTF8String(str);
+  PyBytes_AsStringAndSize(str, &cstr, &len);
+  newstr = (char *) malloc(len+1);
+  memcpy(newstr, cstr, len+1);
+  Py_XDECREF(str);
+  return newstr;
+#else
+  return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+#  define SWIG_Python_str_DelForPy3(x) 
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyUnicode_FromString(c); 
+#else
+  return PyString_FromString(c);
+#endif
+}
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#  define PyOS_snprintf _snprintf
+# else
+#  define PyOS_snprintf snprintf
+# endif
+#endif
+
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+
+#ifndef SWIG_PYBUFFER_SIZE
+# define SWIG_PYBUFFER_SIZE 1024
+#endif
+
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+  va_list ap;
+  char buf[SWIG_PYBUFFER_SIZE * 2];
+  int res;
+  va_start(ap, fmt);
+  res = vsnprintf(buf, sizeof(buf), fmt, ap);
+  va_end(ap);
+  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
+
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+# define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+# define PyObject_DEL PyObject_Del
+#endif
+
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# ifndef PyExc_StopIteration
+#  define PyExc_StopIteration PyExc_RuntimeError
+# endif
+# ifndef PyObject_GenericGetAttr
+#  define PyObject_GenericGetAttr 0
+# endif
+#endif
+
+/* Py_NotImplemented is defined in 2.1 and up. */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef Py_NotImplemented
+#  define Py_NotImplemented PyExc_RuntimeError
+# endif
+#endif
+
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef PyString_AsStringAndSize
+#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+# endif
+#endif
+
+/* PySequence_Size for old Pythons */
+#if PY_VERSION_HEX < 0x02000000
+# ifndef PySequence_Size
+#  define PySequence_Size PySequence_Length
+# endif
+#endif
+
+/* PyBool_FromLong for old Pythons */
+#if PY_VERSION_HEX < 0x02030000
+static
+PyObject *PyBool_FromLong(long ok)
+{
+  PyObject *result = ok ? Py_True : Py_False;
+  Py_INCREF(result);
+  return result;
+}
+#endif
+
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+typedef inquiry lenfunc;
+typedef intargfunc ssizeargfunc;
+typedef intintargfunc ssizessizeargfunc;
+typedef intobjargproc ssizeobjargproc;
+typedef intintobjargproc ssizessizeobjargproc;
+typedef getreadbufferproc readbufferproc;
+typedef getwritebufferproc writebufferproc;
+typedef getsegcountproc segcountproc;
+typedef getcharbufferproc charbufferproc;
+static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
+{
+  long result = 0;
+  PyObject *i = PyNumber_Int(x);
+  if (i) {
+    result = PyInt_AsLong(i);
+    Py_DECREF(i);
+  }
+  return result;
+}
+#endif
+
+#if PY_VERSION_HEX < 0x02040000
+#define Py_VISIT(op)				\
+  do { 						\
+    if (op) {					\
+      int vret = visit((op), arg);		\
+      if (vret)					\
+        return vret;				\
+    }						\
+  } while (0)
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef struct {
+  PyTypeObject type;
+  PyNumberMethods as_number;
+  PyMappingMethods as_mapping;
+  PySequenceMethods as_sequence;
+  PyBufferProcs as_buffer;
+  PyObject *name, *slots;
+} PyHeapTypeObject;
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef destructor freefunc;
+#endif
+
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
+     (PY_MAJOR_VERSION > 3))
+# define SWIGPY_USE_CAPSULE
+# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
+
+#if PY_VERSION_HEX < 0x03020000
+#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
+#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+  PyObject* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = PyExc_MemoryError;
+    break;
+  case SWIG_IOError:
+    type = PyExc_IOError;
+    break;
+  case SWIG_RuntimeError:
+    type = PyExc_RuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = PyExc_IndexError;
+    break;
+  case SWIG_TypeError:
+    type = PyExc_TypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = PyExc_ZeroDivisionError;
+    break;
+  case SWIG_OverflowError:
+    type = PyExc_OverflowError;
+    break;
+  case SWIG_SyntaxError:
+    type = PyExc_SyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = PyExc_ValueError;
+    break;
+  case SWIG_SystemError:
+    type = PyExc_SystemError;
+    break;
+  case SWIG_AttributeError:
+    type = PyExc_AttributeError;
+    break;
+  default:
+    type = PyExc_RuntimeError;
+  }
+  return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+  PyObject *type = 0;
+  PyObject *value = 0;
+  PyObject *traceback = 0;
+
+  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+  if (value) {
+    char *tmp;
+    PyObject *old_str = PyObject_Str(value);
+    PyErr_Clear();
+    Py_XINCREF(type);
+
+    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+    SWIG_Python_str_DelForPy3(tmp);
+    Py_DECREF(old_str);
+    Py_DECREF(value);
+  } else {
+    PyErr_SetString(PyExc_RuntimeError, mesg);
+  }
+}
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+#  if defined(SWIG_PYTHON_THREADS)
+#    undef SWIG_PYTHON_THREADS
+#  endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+#      define SWIG_PYTHON_USE_GIL
+#    endif
+#  endif
+#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
+#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
+#    endif
+#    ifdef __cplusplus /* C++ code */
+       class SWIG_Python_Thread_Block {
+         bool status;
+         PyGILState_STATE state;
+       public:
+         void end() { if (status) { PyGILState_Release(state); status = false;} }
+         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+         ~SWIG_Python_Thread_Block() { end(); }
+       };
+       class SWIG_Python_Thread_Allow {
+         bool status;
+         PyThreadState *save;
+       public:
+         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+         ~SWIG_Python_Thread_Allow() { end(); }
+       };
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
+#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
+#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
+#    else /* C code */
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
+#    endif
+#  else /* Old thread way, not implemented, user must provide it */
+#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+#      define SWIG_PYTHON_INITIALIZE_THREADS
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+#      define SWIG_PYTHON_THREAD_END_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+#      define SWIG_PYTHON_THREAD_END_ALLOW
+#    endif
+#  endif
+#else /* No thread support */
+#  define SWIG_PYTHON_INITIALIZE_THREADS
+#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#  define SWIG_PYTHON_THREAD_END_BLOCK
+#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#  define SWIG_PYTHON_THREAD_END_ALLOW
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Python API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Constant declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Constant Types */
+#define SWIG_PY_POINTER 4
+#define SWIG_PY_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_const_info {
+  int type;
+  char *name;
+  long lvalue;
+  double dvalue;
+  void   *pvalue;
+  swig_type_info **ptype;
+} swig_const_info;
+
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+#if PY_VERSION_HEX >= 0x03000000
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
+{
+  return PyInstanceMethod_New(func);
+}
+#else
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
+{
+  return NULL;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * pyrun.swg
+ *
+ * This file contains the runtime support for Python modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ *
+ * ----------------------------------------------------------------------------- */
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+
+#ifdef SWIGPYTHON_BUILTIN
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
+#else
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+#endif
+
+#define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+
+#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
+#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype                                    int
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
+
+#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
+#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
+#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
+#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
+#define SWIG_fail                        		goto fail					   
+
+
+/* Runtime API implementation */
+
+/* Error manipulation */
+
+SWIGINTERN void 
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
+  PyErr_SetObject(errtype, obj);
+  Py_DECREF(obj);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+SWIGINTERN void 
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+  PyErr_SetString(errtype, (char *) msg);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+#if defined(SWIGPYTHON_BUILTIN)
+
+SWIGINTERN void
+SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
+  PyObject *s = PyString_InternFromString(key);
+  PyList_Append(seq, s);
+  Py_DECREF(s);
+}
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char *)name, obj);
+  Py_DECREF(obj);
+  if (public_interface)
+    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
+}
+
+#else
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char *)name, obj);
+  Py_DECREF(obj);                            
+}
+
+#endif
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyList_Check(result)) {
+      PyObject *o2 = result;
+      result = PyList_New(1);
+      PyList_SetItem(result, 0, o2);
+    }
+    PyList_Append(result,obj);
+    Py_DECREF(obj);
+  }
+  return result;
+#else
+  PyObject*   o2;
+  PyObject*   o3;
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyTuple_Check(result)) {
+      o2 = result;
+      result = PyTuple_New(1);
+      PyTuple_SET_ITEM(result, 0, o2);
+    }
+    o3 = PyTuple_New(1);
+    PyTuple_SET_ITEM(o3, 0, obj);
+    o2 = result;
+    result = PySequence_Concat(o2, o3);
+    Py_DECREF(o2);
+    Py_DECREF(o3);
+  }
+  return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
+{
+  if (!args) {
+    if (!min && !max) {
+      return 1;
+    } else {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
+		   name, (min == max ? "" : "at least "), (int)min);
+      return 0;
+    }
+  }  
+  if (!PyTuple_Check(args)) {
+    if (min <= 1 && max >= 1) {
+      register int i;
+      objs[0] = args;
+      for (i = 1; i < max; ++i) {
+	objs[i] = 0;
+      }
+      return 2;
+    }
+    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+    return 0;
+  } else {
+    register Py_ssize_t l = PyTuple_GET_SIZE(args);
+    if (l < min) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at least "), (int)min, (int)l);
+      return 0;
+    } else if (l > max) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at most "), (int)max, (int)l);
+      return 0;
+    } else {
+      register int i;
+      for (i = 0; i < l; ++i) {
+	objs[i] = PyTuple_GET_ITEM(args, i);
+      }
+      for (; l < max; ++l) {
+	objs[l] = 0;
+      }
+      return i + 1;
+    }    
+  }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+  Helper for static pointer initialization for both C and C++ code, for example
+  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var)  var
+#else
+#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
+#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
+
+#define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
+#define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*  How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#  ifndef SWIG_PYTHON_NO_BUILD_NONE
+#    ifndef SWIG_PYTHON_BUILD_NONE
+#      define SWIG_PYTHON_BUILD_NONE
+#    endif
+#  endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+#  ifdef Py_None
+#   undef Py_None
+#   define Py_None SWIG_Py_None()
+#  endif
+SWIGRUNTIMEINLINE PyObject * 
+_SWIG_Py_None(void)
+{
+  PyObject *none = Py_BuildValue((char*)"");
+  Py_DECREF(none);
+  return none;
+}
+SWIGRUNTIME PyObject * 
+SWIG_Py_None(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+  return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject * 
+SWIG_Py_Void(void)
+{
+  PyObject *none = Py_None;
+  Py_INCREF(none);
+  return none;
+}
+
+/* SwigPyClientData */
+
+typedef struct {
+  PyObject *klass;
+  PyObject *newraw;
+  PyObject *newargs;
+  PyObject *destroy;
+  int delargs;
+  int implicitconv;
+  PyTypeObject *pytype;
+} SwigPyClientData;
+
+SWIGRUNTIMEINLINE int 
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
+  return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
+  PyObject *klass = data ? data->klass : 0;
+  return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME SwigPyClientData * 
+SwigPyClientData_New(PyObject* obj)
+{
+  if (!obj) {
+    return 0;
+  } else {
+    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
+    /* the klass element */
+    data->klass = obj;
+    Py_INCREF(data->klass);
+    /* the newraw method and newargs arguments used to create a new raw instance */
+    if (PyClass_Check(obj)) {
+      data->newraw = 0;
+      data->newargs = obj;
+      Py_INCREF(obj);
+    } else {
+#if (PY_VERSION_HEX < 0x02020000)
+      data->newraw = 0;
+#else
+      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
+#endif
+      if (data->newraw) {
+	Py_INCREF(data->newraw);
+	data->newargs = PyTuple_New(1);
+	PyTuple_SetItem(data->newargs, 0, obj);
+      } else {
+	data->newargs = obj;
+      }
+      Py_INCREF(data->newargs);
+    }
+    /* the destroy method, aka as the C++ delete method */
+    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      data->destroy = 0;
+    }
+    if (data->destroy) {
+      int flags;
+      Py_INCREF(data->destroy);
+      flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+      data->delargs = !(flags & (METH_O));
+#else
+      data->delargs = 0;
+#endif
+    } else {
+      data->delargs = 0;
+    }
+    data->implicitconv = 0;
+    data->pytype = 0;
+    return data;
+  }
+}
+
+SWIGRUNTIME void 
+SwigPyClientData_Del(SwigPyClientData *data) {
+  Py_XDECREF(data->newraw);
+  Py_XDECREF(data->newargs);
+  Py_XDECREF(data->destroy);
+}
+
+/* =============== SwigPyObject =====================*/
+
+typedef struct {
+  PyObject_HEAD
+  void *ptr;
+  swig_type_info *ty;
+  int own;
+  PyObject *next;
+#ifdef SWIGPYTHON_BUILTIN
+  PyObject *dict;
+#endif
+} SwigPyObject;
+
+SWIGRUNTIME PyObject *
+SwigPyObject_long(SwigPyObject *v)
+{
+  return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
+{
+  PyObject *res = NULL;
+  PyObject *args = PyTuple_New(1);
+  if (args) {
+    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
+      if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+	res = PyUnicode_Format(ofmt,args);
+#else
+	res = PyString_Format(ofmt,args);
+#endif
+	Py_DECREF(ofmt);
+      }
+      Py_DECREF(args);
+    }
+  }
+  return res;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_oct(SwigPyObject *v)
+{
+  return SwigPyObject_format("%o",v);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_hex(SwigPyObject *v)
+{
+  return SwigPyObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+#ifdef METH_NOARGS
+SwigPyObject_repr(SwigPyObject *v)
+#else
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
+#endif
+{
+  const char *name = SWIG_TypePrettyName(v->ty);
+  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, (void *)v);
+  if (v->next) {
+# ifdef METH_NOARGS
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
+# else
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
+# endif
+# if PY_VERSION_HEX >= 0x03000000
+    PyObject *joined = PyUnicode_Concat(repr, nrep);
+    Py_DecRef(repr);
+    Py_DecRef(nrep);
+    repr = joined;
+# else
+    PyString_ConcatAndDel(&repr,nrep);
+# endif
+  }
+  return repr;  
+}
+
+SWIGRUNTIME int
+SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char *str;
+#ifdef METH_NOARGS
+  PyObject *repr = SwigPyObject_repr(v);
+#else
+  PyObject *repr = SwigPyObject_repr(v, NULL);
+#endif
+  if (repr) {
+    str = SWIG_Python_str_AsChar(repr); 
+    fputs(str, fp);
+    SWIG_Python_str_DelForPy3(str);
+    Py_DECREF(repr);
+    return 0; 
+  } else {
+    return 1; 
+  }
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_str(SwigPyObject *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+    SWIG_Python_str_FromChar(result) : 0;
+}
+
+SWIGRUNTIME int
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
+{
+  void *i = v->ptr;
+  void *j = w->ptr;
+  return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
+{
+  PyObject* res;
+  if( op != Py_EQ && op != Py_NE ) {
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+  }
+  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
+  return res;  
+}
+
+
+SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
+
+#ifdef SWIGPYTHON_BUILTIN
+static swig_type_info *SwigPyObject_stype = 0;
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+    SwigPyClientData *cd;
+    assert(SwigPyObject_stype);
+    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+    assert(cd);
+    assert(cd->pytype);
+    return cd->pytype;
+}
+#else
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
+  return type;
+}
+#endif
+
+SWIGRUNTIMEINLINE int
+SwigPyObject_Check(PyObject *op) {
+#ifdef SWIGPYTHON_BUILTIN
+  PyTypeObject *target_tp = SwigPyObject_type();
+  if (PyType_IsSubtype(op->ob_type, target_tp))
+    return 1;
+  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
+#else
+  return (Py_TYPE(op) == SwigPyObject_type())
+    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
+#endif
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
+
+SWIGRUNTIME void
+SwigPyObject_dealloc(PyObject *v)
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+  PyObject *next = sobj->next;
+  if (sobj->own == SWIG_POINTER_OWN) {
+    swig_type_info *ty = sobj->ty;
+    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+    PyObject *destroy = data ? data->destroy : 0;
+    if (destroy) {
+      /* destroy is always a VARARGS method */
+      PyObject *res;
+      if (data->delargs) {
+	/* we need to create a temporary object to carry the destroy operation */
+	PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
+	res = SWIG_Python_CallFunctor(destroy, tmp);
+	Py_DECREF(tmp);
+      } else {
+	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+	PyObject *mself = PyCFunction_GET_SELF(destroy);
+	res = ((*meth)(mself, v));
+      }
+      Py_XDECREF(res);
+    } 
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+    else {
+      const char *name = SWIG_TypePrettyName(ty);
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
+    }
+#endif
+  } 
+  Py_XDECREF(next);
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject* 
+SwigPyObject_append(PyObject* v, PyObject* next)
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+#ifndef METH_O
+  PyObject *tmp = 0;
+  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+  next = tmp;
+#endif
+  if (!SwigPyObject_Check(next)) {
+    return NULL;
+  }
+  sobj->next = next;
+  Py_INCREF(next);
+  return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject* 
+#ifdef METH_NOARGS
+SwigPyObject_next(PyObject* v)
+#else
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+  if (sobj->next) {    
+    Py_INCREF(sobj->next);
+    return sobj->next;
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_disown(PyObject *v)
+#else
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *)v;
+  sobj->own = 0;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_acquire(PyObject *v)
+#else
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *)v;
+  sobj->own = SWIG_POINTER_OWN;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+SwigPyObject_own(PyObject *v, PyObject *args)
+{
+  PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
+#endif
+    {
+      return NULL;
+    } 
+  else
+    {
+      SwigPyObject *sobj = (SwigPyObject *)v;
+      PyObject *obj = PyBool_FromLong(sobj->own);
+      if (val) {
+#ifdef METH_NOARGS
+	if (PyObject_IsTrue(val)) {
+	  SwigPyObject_acquire(v);
+	} else {
+	  SwigPyObject_disown(v);
+	}
+#else
+	if (PyObject_IsTrue(val)) {
+	  SwigPyObject_acquire(v,args);
+	} else {
+	  SwigPyObject_disown(v,args);
+	}
+#endif
+      } 
+      return obj;
+    }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
+{
+  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
+}
+#endif
+
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_TypeOnce(void) {
+  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+
+  static PyNumberMethods SwigPyObject_as_number = {
+    (binaryfunc)0, /*nb_add*/
+    (binaryfunc)0, /*nb_subtract*/
+    (binaryfunc)0, /*nb_multiply*/
+    /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
+    (binaryfunc)0, /*nb_divide*/
+#endif
+    (binaryfunc)0, /*nb_remainder*/
+    (binaryfunc)0, /*nb_divmod*/
+    (ternaryfunc)0,/*nb_power*/
+    (unaryfunc)0,  /*nb_negative*/
+    (unaryfunc)0,  /*nb_positive*/
+    (unaryfunc)0,  /*nb_absolute*/
+    (inquiry)0,    /*nb_nonzero*/
+    0,		   /*nb_invert*/
+    0,		   /*nb_lshift*/
+    0,		   /*nb_rshift*/
+    0,		   /*nb_and*/
+    0,		   /*nb_xor*/
+    0,		   /*nb_or*/
+#if PY_VERSION_HEX < 0x03000000
+    0,   /*nb_coerce*/
+#endif
+    (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+    0, /*nb_reserved*/
+#endif
+    (unaryfunc)0,                 /*nb_float*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
+    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
+#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
+#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
+    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
+#endif
+  };
+
+  static PyTypeObject swigpyobject_type;
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyObject",               /* tp_name */
+      sizeof(SwigPyObject),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
+      (printfunc)SwigPyObject_print,        /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
+#else
+      (getattrfunc)0,                       /* tp_getattr */
+#endif
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX >= 0x03000000
+    0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
+#else
+      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyObject_repr,          /* tp_repr */
+      &SwigPyObject_as_number,              /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      (reprfunc)SwigPyObject_str,           /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigobject_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      swigobject_methods,                   /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+      0,0,0,0                               /* tp_alloc -> tp_next */
+#endif
+    };
+    swigpyobject_type = tmp;
+    type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpyobject_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpyobject_type) < 0)
+      return NULL;
+#endif
+  }
+  return &swigpyobject_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
+{
+  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
+  if (sobj) {
+    sobj->ptr  = ptr;
+    sobj->ty   = ty;
+    sobj->own  = own;
+    sobj->next = 0;
+  }
+  return (PyObject *)sobj;
+}
+
+/* -----------------------------------------------------------------------------
+ * Implements a simple Swig Packed type, and use it instead of string
+ * ----------------------------------------------------------------------------- */
+
+typedef struct {
+  PyObject_HEAD
+  void *pack;
+  swig_type_info *ty;
+  size_t size;
+} SwigPyPacked;
+
+SWIGRUNTIME int
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char result[SWIG_BUFFER_SIZE];
+  fputs("<Swig Packed ", fp); 
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    fputs("at ", fp); 
+    fputs(result, fp); 
+  }
+  fputs(v->ty->name,fp); 
+  fputs(">", fp);
+  return 0; 
+}
+  
+SWIGRUNTIME PyObject *
+SwigPyPacked_repr(SwigPyPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+  } else {
+    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
+  }  
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_str(SwigPyPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
+    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
+  } else {
+    return SWIG_Python_str_FromChar(v->ty->name);
+  }  
+}
+
+SWIGRUNTIME int
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
+{
+  size_t i = v->size;
+  size_t j = w->size;
+  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
+
+SWIGRUNTIME PyTypeObject*
+SwigPyPacked_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+SwigPyPacked_Check(PyObject *op) {
+  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
+    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
+}
+
+SWIGRUNTIME void
+SwigPyPacked_dealloc(PyObject *v)
+{
+  if (SwigPyPacked_Check(v)) {
+    SwigPyPacked *sobj = (SwigPyPacked *) v;
+    free(sobj->pack);
+  }
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyTypeObject*
+SwigPyPacked_TypeOnce(void) {
+  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+  static PyTypeObject swigpypacked_type;
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyPacked",               /* tp_name */
+      sizeof(SwigPyPacked),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
+      (printfunc)SwigPyPacked_print,        /* tp_print */
+      (getattrfunc)0,                       /* tp_getattr */
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX>=0x03000000
+      0, /* tp_reserved in 3.0.1 */
+#else
+      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
+      0,                                    /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      (reprfunc)SwigPyPacked_str,           /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigpacked_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      0,                                    /* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      0,                                    /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+      0,0,0,0                               /* tp_alloc -> tp_next */
+#endif
+    };
+    swigpypacked_type = tmp;
+    type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpypacked_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpypacked_type) < 0)
+      return NULL;
+#endif
+  }
+  return &swigpypacked_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
+{
+  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
+  if (sobj) {
+    void *pack = malloc(size);
+    if (pack) {
+      memcpy(pack, ptr, size);
+      sobj->pack = pack;
+      sobj->ty   = ty;
+      sobj->size = size;
+    } else {
+      PyObject_DEL((PyObject *) sobj);
+      sobj = 0;
+    }
+  }
+  return (PyObject *) sobj;
+}
+
+SWIGRUNTIME swig_type_info *
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+{
+  if (SwigPyPacked_Check(obj)) {
+    SwigPyPacked *sobj = (SwigPyPacked *)obj;
+    if (sobj->size != size) return 0;
+    memcpy(ptr, sobj->pack, size);
+    return sobj->ty;
+  } else {
+    return 0;
+  }
+}
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+    return SWIG_Python_str_FromChar("this");
+}
+
+static PyObject *swig_this = NULL;
+
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+  if (swig_this == NULL)
+    swig_this = _SWIG_This();
+  return swig_this;
+}
+
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
+
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS 
+#endif
+
+SWIGRUNTIME SwigPyObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj) 
+{
+  PyObject *obj;
+
+  if (SwigPyObject_Check(pyobj))
+    return (SwigPyObject *) pyobj;
+
+#ifdef SWIGPYTHON_BUILTIN
+  (void)obj;
+# ifdef PyWeakref_CheckProxy
+  if (PyWeakref_CheckProxy(pyobj)) {
+    pyobj = PyWeakref_GET_OBJECT(pyobj);
+    if (pyobj && SwigPyObject_Check(pyobj))
+      return (SwigPyObject*) pyobj;
+  }
+# endif
+  return NULL;
+#else
+
+  obj = 0;
+
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+  if (PyInstance_Check(pyobj)) {
+    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+  } else {
+    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+    if (dictptr != NULL) {
+      PyObject *dict = *dictptr;
+      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+    } else {
+#ifdef PyWeakref_CheckProxy
+      if (PyWeakref_CheckProxy(pyobj)) {
+	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+      }
+#endif
+      obj = PyObject_GetAttr(pyobj,SWIG_This());
+      if (obj) {
+	Py_DECREF(obj);
+      } else {
+	if (PyErr_Occurred()) PyErr_Clear();
+	return 0;
+      }
+    }
+  }
+#else
+  obj = PyObject_GetAttr(pyobj,SWIG_This());
+  if (obj) {
+    Py_DECREF(obj);
+  } else {
+    if (PyErr_Occurred()) PyErr_Clear();
+    return 0;
+  }
+#endif
+  if (obj && !SwigPyObject_Check(obj)) {
+    /* a PyObject is called 'this', try to get the 'real this'
+       SwigPyObject from it */ 
+    return SWIG_Python_GetSwigThis(obj);
+  }
+  return (SwigPyObject *)obj;
+#endif
+}
+
+/* Acquire a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+  if (own == SWIG_POINTER_OWN) {
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (sobj) {
+      int oldown = sobj->own;
+      sobj->own = own;
+      return oldown;
+    }
+  }
+  return 0;
+}
+
+/* Convert a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+  int res;
+  SwigPyObject *sobj;
+
+  if (!obj)
+    return SWIG_ERROR;
+  if (obj == Py_None) {
+    if (ptr)
+      *ptr = 0;
+    return SWIG_OK;
+  }
+
+  res = SWIG_ERROR;
+
+  sobj = SWIG_Python_GetSwigThis(obj);
+  if (own)
+    *own = 0;
+  while (sobj) {
+    void *vptr = sobj->ptr;
+    if (ty) {
+      swig_type_info *to = sobj->ty;
+      if (to == ty) {
+        /* no type cast needed */
+        if (ptr) *ptr = vptr;
+        break;
+      } else {
+        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+        if (!tc) {
+          sobj = (SwigPyObject *)sobj->next;
+        } else {
+          if (ptr) {
+            int newmemory = 0;
+            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+            if (newmemory == SWIG_CAST_NEW_MEMORY) {
+              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
+              if (own)
+                *own = *own | SWIG_CAST_NEW_MEMORY;
+            }
+          }
+          break;
+        }
+      }
+    } else {
+      if (ptr) *ptr = vptr;
+      break;
+    }
+  }
+  if (sobj) {
+    if (own)
+      *own = *own | sobj->own;
+    if (flags & SWIG_POINTER_DISOWN) {
+      sobj->own = 0;
+    }
+    res = SWIG_OK;
+  } else {
+    if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+      if (data && !data->implicitconv) {
+        PyObject *klass = data->klass;
+        if (klass) {
+          PyObject *impconv;
+          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+          impconv = SWIG_Python_CallFunctor(klass, obj);
+          data->implicitconv = 0;
+          if (PyErr_Occurred()) {
+            PyErr_Clear();
+            impconv = 0;
+          }
+          if (impconv) {
+            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
+            if (iobj) {
+              void *vptr;
+              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+              if (SWIG_IsOK(res)) {
+                if (ptr) {
+                  *ptr = vptr;
+                  /* transfer the ownership to 'ptr' */
+                  iobj->own = 0;
+                  res = SWIG_AddCast(res);
+                  res = SWIG_AddNewMask(res);
+                } else {
+                  res = SWIG_AddCast(res);		    
+                }
+              }
+            }
+            Py_DECREF(impconv);
+          }
+        }
+      }
+    }
+  }
+  return res;
+}
+
+/* Convert a function ptr value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+  if (!PyCFunction_Check(obj)) {
+    return SWIG_ConvertPtr(obj, ptr, ty, 0);
+  } else {
+    void *vptr = 0;
+    
+    /* here we get the method pointer for callbacks */
+    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+    if (desc)
+      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+    if (!desc) 
+      return SWIG_ERROR;
+    if (ty) {
+      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+      if (tc) {
+        int newmemory = 0;
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+        assert(!newmemory); /* newmemory handling not yet implemented */
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      *ptr = vptr;
+    }
+    return SWIG_OK;
+  }
+}
+
+/* Convert a packed value value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
+  if (!to) return SWIG_ERROR;
+  if (ty) {
+    if (to != ty) {
+      /* check type cast? */
+      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+      if (!tc) return SWIG_ERROR;
+    }
+  }
+  return SWIG_OK;
+}  
+
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+  Create a new instance object, without calling __init__, and set the
+  'this' attribute.
+*/
+
+SWIGRUNTIME PyObject* 
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+  PyObject *inst = 0;
+  PyObject *newraw = data->newraw;
+  if (newraw) {
+    inst = PyObject_Call(newraw, data->newargs, NULL);
+    if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+      PyObject **dictptr = _PyObject_GetDictPtr(inst);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	if (dict == NULL) {
+	  dict = PyDict_New();
+	  *dictptr = dict;
+	  PyDict_SetItem(dict, SWIG_This(), swig_this);
+	}
+      }
+#else
+      PyObject *key = SWIG_This();
+      PyObject_SetAttr(inst, key, swig_this);
+#endif
+    }
+  } else {
+#if PY_VERSION_HEX >= 0x03000000
+    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+    PyObject_SetAttr(inst, SWIG_This(), swig_this);
+    Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+#else
+    PyObject *dict = PyDict_New();
+    PyDict_SetItem(dict, SWIG_This(), swig_this);
+    inst = PyInstance_NewRaw(data->newargs, dict);
+    Py_DECREF(dict);
+#endif
+  }
+  return inst;
+#else
+#if (PY_VERSION_HEX >= 0x02010000)
+  PyObject *inst;
+  PyObject *dict = PyDict_New();
+  PyDict_SetItem(dict, SWIG_This(), swig_this);
+  inst = PyInstance_NewRaw(data->newargs, dict);
+  Py_DECREF(dict);
+  return (PyObject *) inst;
+#else
+  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+  if (inst == NULL) {
+    return NULL;
+  }
+  inst->in_class = (PyClassObject *)data->newargs;
+  Py_INCREF(inst->in_class);
+  inst->in_dict = PyDict_New();
+  if (inst->in_dict == NULL) {
+    Py_DECREF(inst);
+    return NULL;
+  }
+#ifdef Py_TPFLAGS_HAVE_WEAKREFS
+  inst->in_weakreflist = NULL;
+#endif
+#ifdef Py_TPFLAGS_GC
+  PyObject_GC_Init(inst);
+#endif
+  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+  return (PyObject *) inst;
+#endif
+#endif
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
+{
+ PyObject *dict;
+#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+   dict = *dictptr;
+   if (dict == NULL) {
+     dict = PyDict_New();
+     *dictptr = dict;
+   }
+   PyDict_SetItem(dict, SWIG_This(), swig_this);
+   return;
+ }
+#endif
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ Py_DECREF(dict);
+} 
+
+
+SWIGINTERN PyObject *
+SWIG_Python_InitShadowInstance(PyObject *args) {
+  PyObject *obj[2];
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+    return NULL;
+  } else {
+    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    if (sthis) {
+      SwigPyObject_append((PyObject*) sthis, obj[1]);
+    } else {
+      SWIG_Python_SetSwigThis(obj[0], obj[1]);
+    }
+    return SWIG_Py_Void();
+  }
+}
+
+/* Create a new pointer object */
+
+SWIGRUNTIME PyObject *
+SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
+  SwigPyClientData *clientdata;
+  PyObject * robj;
+  int own;
+
+  if (!ptr)
+    return SWIG_Py_Void();
+
+  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
+  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+  if (clientdata && clientdata->pytype) {
+    SwigPyObject *newobj;
+    if (flags & SWIG_BUILTIN_TP_INIT) {
+      newobj = (SwigPyObject*) self;
+      if (newobj->ptr) {
+        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
+        while (newobj->next)
+	  newobj = (SwigPyObject *) newobj->next;
+        newobj->next = next_self;
+        newobj = (SwigPyObject *)next_self;
+      }
+    } else {
+      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+    }
+    if (newobj) {
+      newobj->ptr = ptr;
+      newobj->ty = type;
+      newobj->own = own;
+      newobj->next = 0;
+#ifdef SWIGPYTHON_BUILTIN
+      newobj->dict = 0;
+#endif
+      return (PyObject*) newobj;
+    }
+    return SWIG_Py_Void();
+  }
+
+  assert(!(flags & SWIG_BUILTIN_TP_INIT));
+
+  robj = SwigPyObject_New(ptr, type, own);
+  if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+    if (inst) {
+      Py_DECREF(robj);
+      robj = inst;
+    }
+  }
+  return robj;
+}
+
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
+  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+}
+
+/* -----------------------------------------------------------------------------*
+ *  Get type list 
+ * -----------------------------------------------------------------------------*/
+
+#ifdef SWIG_LINK_RUNTIME
+void *SWIG_ReturnGlobalTypeList(void *);
+#endif
+
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  /* first check if module already created */
+  if (!type_pointer) {
+#ifdef SWIG_LINK_RUNTIME
+    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+#else
+# ifdef SWIGPY_USE_CAPSULE
+    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
+# else
+    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+# endif
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      type_pointer = (void *)0;
+    }
+#endif
+  }
+  return (swig_module_info *) type_pointer;
+}
+
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0.  The following function
+   is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+  PyObject *dict;
+  if (!PyModule_Check(m)) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs module as first arg");
+    return SWIG_ERROR;
+  }
+  if (!o) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs non-NULL value");
+    return SWIG_ERROR;
+  }
+  
+  dict = PyModule_GetDict(m);
+  if (dict == NULL) {
+    /* Internal error -- modules must have a dict! */
+    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+		 PyModule_GetName(m));
+    return SWIG_ERROR;
+  }
+  if (PyDict_SetItemString(dict, name, o))
+    return SWIG_ERROR;
+  Py_DECREF(o);
+  return SWIG_OK;
+}
+#endif
+
+SWIGRUNTIME void
+#ifdef SWIGPY_USE_CAPSULE
+SWIG_Python_DestroyModule(PyObject *obj)
+#else
+SWIG_Python_DestroyModule(void *vptr)
+#endif
+{
+#ifdef SWIGPY_USE_CAPSULE
+  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
+#else
+  swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
+  swig_type_info **types = swig_module->types;
+  size_t i;
+  for (i =0; i < swig_module->size; ++i) {
+    swig_type_info *ty = types[i];
+    if (ty->owndata) {
+      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+      if (data) SwigPyClientData_Del(data);
+    }
+  }
+  Py_DECREF(SWIG_This());
+  swig_this = NULL;
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
+  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
+  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
+#endif
+#ifdef SWIGPY_USE_CAPSULE
+  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+#else
+  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+#endif
+}
+
+/* The python cached type query */
+SWIGRUNTIME PyObject *
+SWIG_Python_TypeCache(void) {
+  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+  return cache;
+}
+
+SWIGRUNTIME swig_type_info *
+SWIG_Python_TypeQuery(const char *type)
+{
+  PyObject *cache = SWIG_Python_TypeCache();
+  PyObject *key = SWIG_Python_str_FromChar(type); 
+  PyObject *obj = PyDict_GetItem(cache, key);
+  swig_type_info *descriptor;
+  if (obj) {
+#ifdef SWIGPY_USE_CAPSULE
+    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
+#else
+    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
+  } else {
+    swig_module_info *swig_module = SWIG_Python_GetModule();
+    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
+    if (descriptor) {
+#ifdef SWIGPY_USE_CAPSULE
+      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
+#else
+      obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
+      PyDict_SetItem(cache, key, obj);
+      Py_DECREF(obj);
+    }
+  }
+  Py_DECREF(key);
+  return descriptor;
+}
+
+/* 
+   For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION  0
+#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
+
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{  
+  if (PyErr_Occurred()) {
+    PyObject *type = 0;
+    PyObject *value = 0;
+    PyObject *traceback = 0;
+    PyErr_Fetch(&type, &value, &traceback);
+    if (value) {
+      char *tmp;
+      PyObject *old_str = PyObject_Str(value);
+      Py_XINCREF(type);
+      PyErr_Clear();
+      if (infront) {
+	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
+      } else {
+	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+      }
+      SWIG_Python_str_DelForPy3(tmp);
+      Py_DECREF(old_str);
+    }
+    return 1;
+  } else {
+    return 0;
+  }
+}
+  
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+  if (PyErr_Occurred()) {
+    /* add information about failing argument */
+    char mesg[256];
+    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+    return SWIG_Python_AddErrMesg(mesg, 1);
+  } else {
+    return 0;
+  }
+}
+
+SWIGRUNTIMEINLINE const char *
+SwigPyObject_GetDesc(PyObject *self)
+{
+  SwigPyObject *v = (SwigPyObject *)self;
+  swig_type_info *ty = v ? v->ty : 0;
+  return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+  if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+    if (obj && SwigPyObject_Check(obj)) {
+      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
+      if (otype) {
+	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
+		     type, otype);
+	return;
+      }
+    } else 
+#endif      
+    {
+      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
+      if (otype) {
+	PyObject *str = PyObject_Str(obj);
+	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
+	if (cstr) {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+		       type, otype, cstr);
+          SWIG_Python_str_DelForPy3(cstr);
+	} else {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+		       type, otype);
+	}
+	Py_XDECREF(str);
+	return;
+      }
+    }   
+    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+  } else {
+    PyErr_Format(PyExc_TypeError, "unexpected type is received");
+  }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
+  void *result;
+  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+    PyErr_Clear();
+#if SWIG_POINTER_EXCEPTION
+    if (flags) {
+      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+      SWIG_Python_ArgFail(argnum);
+    }
+#endif
+  }
+  return result;
+}
+
+SWIGRUNTIME int
+SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
+  PyTypeObject *tp = obj->ob_type;
+  PyObject *descr;
+  PyObject *encoded_name;
+  descrsetfunc f;
+  int res;
+
+#ifdef Py_USING_UNICODE
+  if (PyString_Check(name)) {
+    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
+    if (!name)
+      return -1;
+  } else if (!PyUnicode_Check(name))
+#else
+  if (!PyString_Check(name))
+#endif
+  {
+    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
+    return -1;
+  } else {
+    Py_INCREF(name);
+  }
+
+  if (!tp->tp_dict) {
+    if (PyType_Ready(tp) < 0)
+      goto done;
+  }
+
+  res = -1;
+  descr = _PyType_Lookup(tp, name);
+  f = NULL;
+  if (descr != NULL)
+    f = descr->ob_type->tp_descr_set;
+  if (!f) {
+    if (PyString_Check(name)) {
+      encoded_name = name;
+      Py_INCREF(name);
+    } else {
+      encoded_name = PyUnicode_AsUTF8String(name);
+    }
+    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
+    Py_DECREF(encoded_name);
+  } else {
+    res = f(descr, obj, value);
+  }
+  
+  done:
+  Py_DECREF(name);
+  return res;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_GeosCoordinateSequence swig_types[0]
+#define SWIGTYPE_p_GeosGeometry swig_types[1]
+#define SWIGTYPE_p_GeosGeometryCollection swig_types[2]
+#define SWIGTYPE_p_GeosIndexItem swig_types[3]
+#define SWIGTYPE_p_GeosLineString swig_types[4]
+#define SWIGTYPE_p_GeosLinearRing swig_types[5]
+#define SWIGTYPE_p_GeosMultiLineString swig_types[6]
+#define SWIGTYPE_p_GeosMultiLinearRing swig_types[7]
+#define SWIGTYPE_p_GeosMultiPoint swig_types[8]
+#define SWIGTYPE_p_GeosMultiPolygon swig_types[9]
+#define SWIGTYPE_p_GeosPoint swig_types[10]
+#define SWIGTYPE_p_GeosPolygon swig_types[11]
+#define SWIGTYPE_p_GeosPreparedGeometry swig_types[12]
+#define SWIGTYPE_p_GeosQueryCallback swig_types[13]
+#define SWIGTYPE_p_GeosSTRtree swig_types[14]
+#define SWIGTYPE_p_GeosWkbReader swig_types[15]
+#define SWIGTYPE_p_GeosWkbWriter swig_types[16]
+#define SWIGTYPE_p_GeosWktReader swig_types[17]
+#define SWIGTYPE_p_GeosWktWriter swig_types[18]
+#define SWIGTYPE_p_char swig_types[19]
+#define SWIGTYPE_p_p_GeosLinearRing swig_types[20]
+#define SWIGTYPE_p_size_t swig_types[21]
+#define SWIGTYPE_p_std__invalid_argument swig_types[22]
+#define SWIGTYPE_p_swig__SwigPyIterator swig_types[23]
+#define SWIGTYPE_p_unsigned_char swig_types[24]
+static swig_type_info *swig_types[26];
+static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+#  error "This python version requires swig to be run with the '-classic' option"
+# endif
+#endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodern' option"
+#endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodernargs' option"
+#endif
+
+/*-----------------------------------------------
+              @(target):= _geos.so
+  ------------------------------------------------*/
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_init    PyInit__geos
+
+#else
+#  define SWIG_init    init_geos
+
+#endif
+#define SWIG_name    "_geos"
+
+#define SWIGVERSION 0x020004 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
+
+
+#include <stdexcept>
+
+
+namespace swig {
+  class SwigPtr_PyObject {
+  protected:
+    PyObject *_obj;
+
+  public:
+    SwigPtr_PyObject() :_obj(0)
+    {
+    }
+
+    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
+    {
+      Py_XINCREF(_obj);      
+    }
+    
+    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
+    {
+      if (initial_ref) {
+        Py_XINCREF(_obj);
+      }
+    }
+    
+    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
+    {
+      Py_XINCREF(item._obj);
+      Py_XDECREF(_obj);
+      _obj = item._obj;
+      return *this;      
+    }
+    
+    ~SwigPtr_PyObject() 
+    {
+      Py_XDECREF(_obj);
+    }
+    
+    operator PyObject *() const
+    {
+      return _obj;
+    }
+
+    PyObject *operator->() const
+    {
+      return _obj;
+    }
+  };
+}
+
+
+namespace swig {
+  struct SwigVar_PyObject : SwigPtr_PyObject {
+    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
+    
+    SwigVar_PyObject & operator = (PyObject* obj)
+    {
+      Py_XDECREF(_obj);
+      _obj = obj;
+      return *this;      
+    }
+  };
+}
+
+
+#include <string>
+
+
+#include <iostream>
+
+#if PY_VERSION_HEX >= 0x03020000
+# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
+#else
+# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
+#endif
+
+
+#include <stdexcept>
+
+
+#if defined(__GNUC__)
+#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
+#     define SWIG_STD_NOMODERN_STL
+#  endif
+#endif
+
+
+#include <string>
+#include <stdexcept>
+#include <stddef.h>
+
+  
+namespace swig {
+  struct stop_iteration {
+  };
+
+  struct SwigPyIterator {
+  private:
+    SwigPtr_PyObject _seq;
+
+  protected:
+    SwigPyIterator(PyObject *seq) : _seq(seq)
+    {
+    }
+      
+  public:
+    virtual ~SwigPyIterator() {}
+
+    // Access iterator method, required by Python
+    virtual PyObject *value() const = 0;
+
+    // Forward iterator method, required by Python
+    virtual SwigPyIterator *incr(size_t n = 1) = 0;
+    
+    // Backward iterator method, very common in C++, but not required in Python
+    virtual SwigPyIterator *decr(size_t /*n*/ = 1)
+    {
+      throw stop_iteration();
+    }
+
+    // Random access iterator methods, but not required in Python
+    virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
+    {
+      throw std::invalid_argument("operation not supported");
+    }
+
+    virtual bool equal (const SwigPyIterator &/*x*/) const
+    {
+      throw std::invalid_argument("operation not supported");
+    }
+    
+    // C++ common/needed methods
+    virtual SwigPyIterator *copy() const = 0;
+
+    PyObject *next()     
+    {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
+      PyObject *obj = value();
+      incr();       
+      SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
+      return obj;     
+    }
+
+    /* Make an alias for Python 3.x */
+    PyObject *__next__()
+    {
+      return next();
+    }
+
+    PyObject *previous()
+    {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
+      decr();
+      PyObject *obj = value();
+      SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads       
+      return obj;
+    }
+
+    SwigPyIterator *advance(ptrdiff_t n)
+    {
+      return  (n > 0) ?  incr(n) : decr(-n);
+    }
+      
+    bool operator == (const SwigPyIterator& x)  const
+    {
+      return equal(x);
+    }
+      
+    bool operator != (const SwigPyIterator& x) const
+    {
+      return ! operator==(x);
+    }
+      
+    SwigPyIterator& operator += (ptrdiff_t n)
+    {
+      return *advance(n);
+    }
+
+    SwigPyIterator& operator -= (ptrdiff_t n)
+    {
+      return *advance(-n);
+    }
+      
+    SwigPyIterator* operator + (ptrdiff_t n) const
+    {
+      return copy()->advance(n);
+    }
+
+    SwigPyIterator* operator - (ptrdiff_t n) const
+    {
+      return copy()->advance(-n);
+    }
+      
+    ptrdiff_t operator - (const SwigPyIterator& x) const
+    {
+      return x.distance(*this);
+    }
+      
+    static swig_type_info* descriptor() {
+      static int init = 0;
+      static swig_type_info* desc = 0;
+      if (!init) {
+	desc = SWIG_TypeQuery("swig::SwigPyIterator *");
+	init = 1;
+      }	
+      return desc;
+    }    
+  };
+
+#if defined(SWIGPYTHON_BUILTIN)
+  inline PyObject* make_output_iterator_builtin (PyObject *pyself)
+  {
+    Py_INCREF(pyself);
+    return pyself;
+  }
+#endif
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+  int res = SWIG_TypeError;
+  if (PyFloat_Check(obj)) {
+    if (val) *val = PyFloat_AsDouble(obj);
+    return SWIG_OK;
+  } else if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    double v = PyLong_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    double d = PyFloat_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = d;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      long v = PyLong_AsLong(obj);
+      if (!PyErr_Occurred()) {
+	if (val) *val = v;
+	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
+      } else {
+	PyErr_Clear();
+      }
+    }
+  }
+#endif
+  return res;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
+{
+  if (PyInt_Check(obj)) {
+    long v = PyInt_AsLong(obj);
+    if (v >= 0) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      return SWIG_OverflowError;
+    }
+  } else if (PyLong_Check(obj)) {
+    unsigned long v = PyLong_AsUnsignedLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    unsigned long v = PyLong_AsUnsignedLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+	if (val) *val = (unsigned long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t (PyObject * obj, size_t *val)
+{
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
+  return res;
+}
+
+
+  #define SWIG_From_long   PyInt_FromLong 
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_ptrdiff_t  (ptrdiff_t value)
+{    
+  return SWIG_From_long  (static_cast< long >(value));
+}
+
+
+SWIGINTERNINLINE PyObject*
+  SWIG_From_bool  (bool value)
+{
+  return PyBool_FromLong(value ? 1 : 0);
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long (PyObject *obj, long* val)
+{
+  if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    long v = PyLong_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    long v = PyInt_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+	if (val) *val = (long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
+  return res;
+}
+
+
+#include <stdexcept>
+
+
+#include <algorithm>
+
+
+#include <vector>
+
+ 
+#include "geos_c.h"
+/* Needed for va_start, etc. */
+#include <stdarg.h>
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_int  (int value)
+{    
+  return SWIG_From_long  (value);
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  if (carray) {
+    if (size > INT_MAX) {
+      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+      return pchar_descriptor ? 
+	SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+    } else {
+#if PY_VERSION_HEX >= 0x03000000
+      return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#else
+      return PyString_FromStringAndSize(carray, static_cast< int >(size));
+#endif
+    }
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+
+SWIGINTERNINLINE PyObject * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+    static const int DEFAULT_QUADRANT_SEGMENTS=8;
+
+
+
+/* This is not thread safe ! */
+static const int MESSAGE_SIZE = 1000;
+static char message[MESSAGE_SIZE];
+
+void noticeHandler(const char *fmt, ...)
+{
+    va_list args;
+    va_start(args, fmt);
+    vsnprintf(message, sizeof(message) - 1, fmt, args);
+    va_end(args);
+}
+
+void errorHandler(const char *fmt, ...)
+{
+    va_list args;
+    va_start(args, fmt);
+    vsnprintf(message, sizeof(message) - 1, fmt, args);
+    va_end(args);
+}
+
+
+typedef void GeosCoordinateSequence;
+
+void checkCoordSeqBounds(const GEOSCoordSeq coordSeq, const size_t index)
+{
+    unsigned int size = 0;
+    GEOSCoordSeq_getSize(coordSeq, &size);
+
+    if (index < 0 || index >= size)
+        throw std::runtime_error("Index out of bounds");
+}
+
+SWIGINTERN GeosCoordinateSequence *new_GeosCoordinateSequence(size_t size,size_t dims){
+        return (GeosCoordinateSequence*) GEOSCoordSeq_create(size, dims);
+    }
+SWIGINTERN void delete_GeosCoordinateSequence(GeosCoordinateSequence *self){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        return GEOSCoordSeq_destroy(coords);
+    }
+SWIGINTERN GeosCoordinateSequence *GeosCoordinateSequence_clone(GeosCoordinateSequence *self){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        return (GeosCoordinateSequence*) GEOSCoordSeq_clone(coords);
+    }
+SWIGINTERN int GeosCoordinateSequence_setX(GeosCoordinateSequence *self,size_t idx,double val){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        return GEOSCoordSeq_setX(coords, idx, val);
+    }
+SWIGINTERN int GeosCoordinateSequence_setY(GeosCoordinateSequence *self,size_t idx,double val){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        return GEOSCoordSeq_setY(coords, idx, val);
+    }
+SWIGINTERN int GeosCoordinateSequence_setZ(GeosCoordinateSequence *self,size_t idx,double val){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        return GEOSCoordSeq_setZ(coords, idx, val);
+    }
+SWIGINTERN int GeosCoordinateSequence_setOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim,double val){
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        return GEOSCoordSeq_setOrdinate(coords, idx, dim, val);
+    }
+SWIGINTERN double GeosCoordinateSequence_getX(GeosCoordinateSequence *self,size_t idx){
+        double result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        GEOSCoordSeq_getX(coords, idx, &result);
+        return result;
+    }
+
+  #define SWIG_From_double   PyFloat_FromDouble 
+
+SWIGINTERN double GeosCoordinateSequence_getY(GeosCoordinateSequence *self,size_t idx){
+        double result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        GEOSCoordSeq_getY(coords, idx, &result);
+        return result;
+    }
+SWIGINTERN double GeosCoordinateSequence_getZ(GeosCoordinateSequence *self,size_t idx){
+        double result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        GEOSCoordSeq_getZ(coords, idx, &result);
+        return result;
+    }
+SWIGINTERN double GeosCoordinateSequence_getOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim){
+        double result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        checkCoordSeqBounds(coords, idx);
+        GEOSCoordSeq_getOrdinate(coords, idx, dim, &result);
+        return result;
+    }
+SWIGINTERN unsigned int GeosCoordinateSequence_getSize(GeosCoordinateSequence *self){
+        unsigned int result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        GEOSCoordSeq_getSize(coords, &result);
+        return result;
+    }
+
+SWIGINTERNINLINE PyObject* 
+SWIG_From_unsigned_SS_long  (unsigned long value)
+{
+  return (value > LONG_MAX) ?
+    PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); 
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_unsigned_SS_int  (unsigned int value)
+{    
+  return SWIG_From_unsigned_SS_long  (value);
+}
+
+SWIGINTERN unsigned int GeosCoordinateSequence_getDimensions(GeosCoordinateSequence *self){
+        unsigned int result;
+        GEOSCoordSeq coords = (GEOSCoordSeq) self;
+        GEOSCoordSeq_getDimensions(coords, &result);
+        return result;
+    }
+
+typedef void GeosGeometry;
+typedef void GeosPoint;
+typedef void GeosLineString;
+typedef void GeosLinearRing;
+typedef void GeosPolygon;
+typedef void GeosGeometryCollection;
+typedef void GeosMultiPoint;
+typedef void GeosMultiLineString;
+typedef void GeosMultiLinearRing;
+typedef void GeosMultiPolygon;
+
+typedef void GeosWktReader;
+typedef void GeosWktWriter;
+typedef void GeosWkbReader;
+typedef void GeosWkbWriter;
+
+
+bool checkBoolResult(char result)
+{
+    int intResult = (int) result;
+
+    if (intResult == 1)
+        return true;
+    else if (intResult == 0)
+        return false;
+    else
+        throw std::runtime_error(message);
+}
+
+SWIGINTERN void delete_GeosGeometry(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_clone(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSGeom_clone(geom);
+    }
+SWIGINTERN char *GeosGeometry_geomType(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSGeomType(geom);
+    }
+SWIGINTERN int GeosGeometry_typeId(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSGeomTypeId(geom);
+    }
+SWIGINTERN void GeosGeometry_normalize(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        int result = GEOSNormalize(geom);
+
+        if (result == -1)
+            throw std::runtime_error(message);
+    }
+SWIGINTERN int GeosGeometry_getSRID(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSGetSRID(geom);
+    }
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = static_cast< int >(v);
+    }
+  }  
+  return res;
+}
+
+SWIGINTERN void GeosGeometry_setSRID(GeosGeometry *self,int SRID){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSSetSRID(geom, SRID);
+    }
+SWIGINTERN size_t GeosGeometry_getDimensions(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSGeom_getDimensions(geom);
+    }
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_size_t  (size_t value)
+{    
+  return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
+}
+
+SWIGINTERN size_t GeosGeometry_getNumGeometries(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        size_t result = GEOSGetNumGeometries(geom);
+        
+        if ((int)result == -1)
+            throw std::runtime_error(message);
+
+        return result;
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_intersection(GeosGeometry *self,GeosGeometry *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return (GeosGeometry*) GEOSIntersection(geom, otherGeom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_buffer(GeosGeometry *self,double width,int quadsegs){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSBuffer(geom, width, quadsegs);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_convexHull(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSConvexHull(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_difference(GeosGeometry *self,GeosGeometry *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return (GeosGeometry*) GEOSDifference(geom, otherGeom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_symDifference(GeosGeometry *self,GeosGeometry *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return (GeosGeometry*) GEOSSymDifference(geom, otherGeom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_boundary(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSBoundary(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_geomUnion(GeosGeometry *self,GeosGeometry *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return (GeosGeometry*) GEOSUnion(geom, otherGeom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_pointOnSurface(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSPointOnSurface(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_getCentroid(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSGetCentroid(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_getEnvelope(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSEnvelope(geom);
+    }
+SWIGINTERN char *GeosGeometry_relate(GeosGeometry *self,GeosGeometry *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return GEOSRelate(geom, otherGeom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_lineMerge(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return GEOSLineMerge(geom);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_simplify(GeosGeometry *self,double tolerance){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSSimplify(geom, tolerance);
+    }
+SWIGINTERN GeosGeometry *GeosGeometry_topologyPreserveSimplify(GeosGeometry *self,double tolerance){
+        GEOSGeom geom = (GEOSGeom) self;
+        return (GeosGeometry*) GEOSTopologyPreserveSimplify(geom, tolerance);
+    }
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
+{
+#if PY_VERSION_HEX>=0x03000000
+  if (PyUnicode_Check(obj))
+#else  
+  if (PyString_Check(obj))
+#endif
+  {
+    char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+    if (!alloc && cptr) {
+        /* We can't allow converting without allocation, since the internal
+           representation of string in Python 3 is UCS-2/UCS-4 but we require
+           a UTF-8 representation.
+           TODO(bhy) More detailed explanation */
+        return SWIG_RuntimeError;
+    }
+    obj = PyUnicode_AsUTF8String(obj);
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
+    if(alloc) *alloc = SWIG_NEWOBJ;
+#else
+    PyString_AsStringAndSize(obj, &cstr, &len);
+#endif
+    if (cptr) {
+      if (alloc) {
+	/* 
+	   In python the user should not be able to modify the inner
+	   string representation. To warranty that, if you define
+	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
+	   buffer is always returned.
+
+	   The default behavior is just to return the pointer value,
+	   so, be careful.
+	*/ 
+#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
+	if (*alloc != SWIG_OLDOBJ) 
+#else
+	if (*alloc == SWIG_NEWOBJ) 
+#endif
+	  {
+	    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+	    *alloc = SWIG_NEWOBJ;
+	  }
+	else {
+	  *cptr = cstr;
+	  *alloc = SWIG_OLDOBJ;
+	}
+      } else {
+        #if PY_VERSION_HEX>=0x03000000
+        assert(0); /* Should never reach here in Python 3 */
+        #endif
+	*cptr = SWIG_Python_str_AsChar(obj);
+      }
+    }
+    if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+    Py_XDECREF(obj);
+#endif
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      void* vptr = 0;
+      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+	if (cptr) *cptr = (char *) vptr;
+	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
+	if (alloc) *alloc = SWIG_OLDOBJ;
+	return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN bool GeosGeometry_relatePattern(GeosGeometry *self,GeosGeometry const *other,char const *pat){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSRelatePattern(geom, otherGeom, pat));
+    }
+SWIGINTERN bool GeosGeometry_disjoint(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSDisjoint(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_touches(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSTouches(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_intersects(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSIntersects(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_crosses(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSCrosses(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_within(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSWithin(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_contains(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSContains(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_overlaps(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSOverlaps(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_equals(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSEquals(geom, otherGeom));
+    }
+SWIGINTERN bool GeosGeometry_equalsExact(GeosGeometry *self,GeosGeometry const *other,double tolerance){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSEqualsExact(geom, otherGeom, tolerance));
+    }
+SWIGINTERN bool GeosGeometry_isEmpty(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return checkBoolResult(GEOSisEmpty(geom));
+    }
+SWIGINTERN bool GeosGeometry_isValid(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return checkBoolResult(GEOSisValid(geom));
+    }
+SWIGINTERN bool GeosGeometry_isSimple(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return checkBoolResult(GEOSisSimple(geom));
+    }
+SWIGINTERN bool GeosGeometry_isRing(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return checkBoolResult(GEOSisRing(geom));
+    }
+SWIGINTERN bool GeosGeometry_hasZ(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        return checkBoolResult(GEOSHasZ(geom));
+    }
+SWIGINTERN double GeosGeometry_area(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        double result;
+
+        int code = GEOSArea(geom, &result);
+
+        if (code == 0)
+            throw std::runtime_error(message);
+
+        return result;
+    }
+SWIGINTERN double GeosGeometry_length(GeosGeometry *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        double result;
+
+        int code = GEOSLength(geom, &result);
+
+        if (code == 0)
+            throw std::runtime_error(message);
+
+        return result;
+    }
+SWIGINTERN double GeosGeometry_distance(GeosGeometry *self,GeosGeometry const *other){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        double result;
+
+        int code = GEOSDistance(geom, otherGeom, &result);
+
+        if (code == 0)
+            throw std::runtime_error(message);
+
+        return result;
+    }
+SWIGINTERN void delete_GeosPoint(GeosPoint *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosCoordinateSequence const *GeosPoint_getCoordSeq(GeosPoint *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosCoordinateSequence*) result;
+    }
+SWIGINTERN void delete_GeosLineString(GeosLineString *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosCoordinateSequence const *GeosLineString_getCoordSeq(GeosLineString *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosCoordinateSequence*) result;
+    }
+SWIGINTERN void delete_GeosLinearRing(GeosLinearRing *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosCoordinateSequence const *GeosLinearRing_getCoordSeq(GeosLinearRing *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosCoordinateSequence*) result;
+    }
+SWIGINTERN void delete_GeosPolygon(GeosPolygon *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosGeometry const *GeosPolygon_getExteriorRing(GeosPolygon *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        const GEOSGeom result = (const GEOSGeom) GEOSGetExteriorRing(geom);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosGeometry*) result;
+    }
+SWIGINTERN size_t GeosPolygon_getNumInteriorRings(GeosPolygon *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        size_t result = GEOSGetNumInteriorRings(geom);
+
+        if ((int)result == -1)
+            throw std::runtime_error(message);
+
+        return result;
+    }
+SWIGINTERN GeosGeometry const *GeosPolygon_getInteriorRingN(GeosPolygon *self,size_t n){
+        GEOSGeom geom = (GEOSGeom) self;
+
+        size_t size = GEOSGetNumInteriorRings(geom);
+
+        if (n < 0 || n >= size)
+            throw std::runtime_error("Index out of bounds");
+
+        const GEOSGeom result = (const GEOSGeom) GEOSGetInteriorRingN(geom, n);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosGeometry*) result;
+    }
+SWIGINTERN void delete_GeosGeometryCollection(GeosGeometryCollection *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN GeosGeometry const *GeosGeometryCollection_getGeometryN(GeosGeometryCollection *self,size_t n){
+        GEOSGeom geom = (GEOSGeom) self;
+        const GEOSGeom result = (const GEOSGeom) GEOSGetGeometryN(geom, n);
+
+        if (result == NULL)
+            throw std::runtime_error(message);
+
+        return (const GeosGeometry*) result;
+    }
+SWIGINTERN void delete_GeosMultiPoint(GeosMultiPoint *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN void delete_GeosMultiLineString(GeosMultiLineString *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN void delete_GeosMultiLinearRing(GeosMultiLinearRing *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+SWIGINTERN void delete_GeosMultiPolygon(GeosMultiPolygon *self){
+        GEOSGeom geom = (GEOSGeom) self;
+        GEOSGeom_destroy(geom);
+    }
+
+GeosGeometry *createPoint(GeosCoordinateSequence *s)
+{
+    GEOSCoordSeq coords = (GEOSCoordSeq) s;
+    GEOSGeom geom = GEOSGeom_createPoint(coords);
+
+    if(geom == NULL)
+        throw std::runtime_error(message);
+
+    return (GeosGeometry*) geom;
+}
+
+GeosGeometry *createLineString(GeosCoordinateSequence *s)
+{
+    GEOSCoordSeq coords = (GEOSCoordSeq) s;
+    GEOSGeom geom = GEOSGeom_createLineString(coords);
+
+    if(geom == NULL)
+        throw std::runtime_error(message);
+
+    return (GeosGeometry*) geom;
+}
+
+GeosGeometry *createLinearRing(GeosCoordinateSequence *s)
+{
+    GEOSCoordSeq coords = (GEOSCoordSeq) s;
+    GEOSGeom geom = GEOSGeom_createLinearRing(coords);
+
+    if(geom == NULL)
+        throw std::runtime_error(message);
+
+    return (GeosGeometry*) geom;
+}
+
+GeosGeometry *createPolygon(GeosLinearRing *shell, GeosLinearRing **holes, size_t nholes)
+{
+    GEOSGeom shellGeom = (GEOSGeom) shell;
+    GEOSGeom* holeGeoms = (GEOSGeom*) holes;
+    GEOSGeom geom = GEOSGeom_createPolygon(shellGeom, holeGeoms, nholes);
+
+    if(geom == NULL)
+        throw std::runtime_error(message);
+
+    return (GeosGeometry*) geom;
+}
+
+
+
+typedef void GeosPreparedGeometry;
+
+SWIGINTERN GeosPreparedGeometry *new_GeosPreparedGeometry(GeosGeometry const *source){
+        const GEOSPreparedGeometry *prep = GEOSPrepare((const GEOSGeometry *)source);
+        if(prep == NULL)
+            throw std::runtime_error(message);
+        return (GeosPreparedGeometry *) prep;
+    }
+SWIGINTERN void delete_GeosPreparedGeometry(GeosPreparedGeometry *self){
+        GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
+        return GEOSPreparedGeom_destroy(prep);
+    }
+SWIGINTERN bool GeosPreparedGeometry_contains(GeosPreparedGeometry *self,GeosGeometry const *other){
+        GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSPreparedContains(prep, otherGeom));
+    }
+SWIGINTERN bool GeosPreparedGeometry_containsProperly(GeosPreparedGeometry *self,GeosGeometry const *other){
+        GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSPreparedContainsProperly(prep, otherGeom));
+    }
+SWIGINTERN bool GeosPreparedGeometry_covers(GeosPreparedGeometry *self,GeosGeometry const *other){
+        GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSPreparedCovers(prep, otherGeom));
+    }
+SWIGINTERN bool GeosPreparedGeometry_intersects(GeosPreparedGeometry *self,GeosGeometry const *other){
+        GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
+        GEOSGeom otherGeom = (GEOSGeom) other;
+        return checkBoolResult(GEOSPreparedIntersects(prep, otherGeom));
+    }
+
+typedef void GeosSTRtree;
+/* GeosIndexItem typedef'd here so it can be %typemap(typecheck)'d
+   as a native object by each language specially */
+typedef void *GeosIndexItem;
+typedef GEOSQueryCallback GeosQueryCallback;
+
+SWIGINTERN GeosSTRtree *new_GeosSTRtree(int nodeCapacity){
+        GEOSSTRtree *tree = GEOSSTRtree_create(nodeCapacity);
+        if(tree == NULL)
+            throw std::runtime_error(message);
+        return (GeosSTRtree *) tree;
+    }
+SWIGINTERN void delete_GeosSTRtree(GeosSTRtree *self){
+        GEOSSTRtree *tree = (GEOSSTRtree *) self;
+        return GEOSSTRtree_destroy(tree);
+    }
+SWIGINTERN void GeosSTRtree_insert(GeosSTRtree *self,GeosGeometry const *g,GeosIndexItem item){
+        GEOSSTRtree *tree = (GEOSSTRtree *) self;
+        const GEOSGeometry *geom = (const GEOSGeometry *) g;
+        GEOSSTRtree_insert(tree, geom, item);
+    }
+SWIGINTERN void GeosSTRtree_remove(GeosSTRtree *self,GeosGeometry const *g,GeosIndexItem item){
+        GEOSSTRtree *tree = (GEOSSTRtree *) self;
+        const GEOSGeometry *geom = (const GEOSGeometry *) g;
+        GEOSSTRtree_remove(tree, geom, item);
+    }
+SWIGINTERN void GeosSTRtree_query(GeosSTRtree *self,GeosGeometry const *g,GeosQueryCallback callback,GeosIndexItem accumulator){
+        GEOSSTRtree *tree = (GEOSSTRtree *) self;
+        const GEOSGeometry *geom = (const GEOSGeometry *) g;
+        GEOSSTRtree_query(tree, geom, callback, accumulator);
+    }
+SWIGINTERN void GeosSTRtree_iterate(GeosSTRtree *self,GeosQueryCallback callback,GeosIndexItem accumulator){
+        GEOSSTRtree *tree = (GEOSSTRtree *) self;
+        GEOSSTRtree_iterate(tree, callback, accumulator);
+    }
+SWIGINTERN GeosWktReader *new_GeosWktReader(){
+        return GEOSWKTReader_create();
+    }
+SWIGINTERN void delete_GeosWktReader(GeosWktReader *self){
+        GEOSWKTReader *reader = (GEOSWKTReader*) self;
+        GEOSWKTReader_destroy(reader);
+    }
+SWIGINTERN GeosGeometry *GeosWktReader_read(GeosWktReader *self,char const *wkt){
+        if(wkt == NULL)
+            throw std::runtime_error("Trying to create geometry from a NULL string");
+            
+        GEOSWKTReader *reader = (GEOSWKTReader*) self;
+        GEOSGeometry *geom = GEOSWKTReader_read(reader, wkt);
+
+        if(geom == NULL)
+            throw std::runtime_error(message);
+
+        return (GeosGeometry*) geom;
+    }
+SWIGINTERN GeosWktWriter *new_GeosWktWriter(){
+        return GEOSWKTWriter_create();
+    }
+SWIGINTERN void delete_GeosWktWriter(GeosWktWriter *self){
+        GEOSWKTWriter *writer = (GEOSWKTWriter*) self;
+        GEOSWKTWriter_destroy(writer);
+    }
+SWIGINTERN char *GeosWktWriter_write(GeosWktWriter *self,GeosGeometry const *g){
+        GEOSWKTWriter *writer = (GEOSWKTWriter*) self;
+        GEOSGeom geom = (GEOSGeom) g;
+        return GEOSWKTWriter_write(writer, geom);
+    }
+SWIGINTERN GeosWkbReader *new_GeosWkbReader(){
+        return GEOSWKBReader_create();
+    }
+SWIGINTERN void delete_GeosWkbReader(GeosWkbReader *self){
+        GEOSWKBReader *reader = (GEOSWKBReader*) self;
+        GEOSWKBReader_destroy(reader);
+    }
+SWIGINTERN GeosGeometry *GeosWkbReader_read(GeosWkbReader *self,unsigned char const *wkb,size_t size){
+        if(wkb == NULL)
+          throw std::runtime_error("Trying to create geometry from a NULL string");
+         
+        GEOSWKBReader *reader = (GEOSWKBReader*) self;
+        GEOSGeometry *geom = GEOSWKBReader_read(reader, wkb, size);
+       
+        if(geom == NULL)
+          throw std::runtime_error(message);
+
+        return (GeosGeometry*) geom;
+    }
+SWIGINTERN GeosGeometry *GeosWkbReader_readHEX(GeosWkbReader *self,unsigned char const *wkb,size_t size){
+        if(wkb == NULL)
+          throw std::runtime_error("Trying to create geometry from a NULL string");
+         
+        GEOSWKBReader *reader = (GEOSWKBReader*) self;
+        GEOSGeometry *geom = GEOSWKBReader_readHEX(reader, wkb, size);
+       
+        if(geom == NULL)
+          throw std::runtime_error(message);
+
+        return (GeosGeometry*) geom;
+    }
+SWIGINTERN GeosWkbWriter *new_GeosWkbWriter(){
+        return GEOSWKBWriter_create();
+    }
+SWIGINTERN void delete_GeosWkbWriter(GeosWkbWriter *self){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        GEOSWKBWriter_destroy(writer);
+    }
+SWIGINTERN int GeosWkbWriter_getOutputDimension(GeosWkbWriter *self){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        return GEOSWKBWriter_getOutputDimension(writer);
+    }
+SWIGINTERN void GeosWkbWriter_setOutputDimension(GeosWkbWriter *self,int newDimension){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        GEOSWKBWriter_setOutputDimension(writer, newDimension);
+    }
+SWIGINTERN int GeosWkbWriter_getByteOrder(GeosWkbWriter *self){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        return GEOSWKBWriter_getByteOrder(writer);
+    }
+SWIGINTERN void GeosWkbWriter_setByteOrder(GeosWkbWriter *self,int newByteOrder){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        return GEOSWKBWriter_setByteOrder(writer, newByteOrder);
+    }
+SWIGINTERN bool GeosWkbWriter_getIncludeSRID(GeosWkbWriter *self){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        return GEOSWKBWriter_getIncludeSRID(writer);
+    }
+
+SWIGINTERN int
+SWIG_AsVal_bool (PyObject *obj, bool *val)
+{
+  int r = PyObject_IsTrue(obj);
+  if (r == -1)
+    return SWIG_ERROR;
+  if (val) *val = r ? true : false;
+  return SWIG_OK;
+}
+
+SWIGINTERN void GeosWkbWriter_setIncludeSRID(GeosWkbWriter *self,bool newIncludeSRID){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        return GEOSWKBWriter_setIncludeSRID(writer, newIncludeSRID);
+    }
+SWIGINTERN unsigned char *GeosWkbWriter_write(GeosWkbWriter *self,GeosGeometry const *g,size_t *size){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        GEOSGeom geom = (GEOSGeom) g;
+        return GEOSWKBWriter_write(writer, geom, size);
+    }
+SWIGINTERN unsigned char *GeosWkbWriter_writeHEX(GeosWkbWriter *self,GeosGeometry const *g,size_t *size){
+        GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
+        GEOSGeom geom = (GEOSGeom) g;
+        return GEOSWKBWriter_writeHEX(writer, geom, size);
+    }
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_SwigPyIterator",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_value",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_incr",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_incr",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->incr();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_incr'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    swig::SwigPyIterator::incr(size_t)\n"
+    "    swig::SwigPyIterator::incr()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_decr",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_decr",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->decr();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_decr'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    swig::SwigPyIterator::decr(size_t)\n"
+    "    swig::SwigPyIterator::decr()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  ptrdiff_t result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_distance",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  try {
+    result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+  }
+  
+  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_equal",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  try {
+    result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+  }
+  
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_copy",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_next",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->next();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___next__",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->__next__();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_previous",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->previous();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_advance",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___eq__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___ne__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___iadd__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___isub__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___add__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  ptrdiff_t result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  Py_INCREF(Py_NotImplemented);
+  return Py_NotImplemented;
+}
+
+
+SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *result = 0 ;
+  
+  result = (char *)GEOSversion();
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  size_t arg1 ;
+  size_t arg2 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosCoordinateSequence *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"new_CoordinateSequence",2,2,&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CoordinateSequence" "', argument " "1"" of type '" "size_t""'");
+  } 
+  arg1 = static_cast< size_t >(val1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CoordinateSequence" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (GeosCoordinateSequence *)new_GeosCoordinateSequence(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_CoordinateSequence",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CoordinateSequence" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  {
+    try
+    {
+      delete_GeosCoordinateSequence(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosCoordinateSequence *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_clone",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_clone" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  {
+    try
+    {
+      result = (GeosCoordinateSequence *)GeosCoordinateSequence_clone(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_setX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  double arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setX",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setX" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setX" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  {
+    try
+    {
+      result = (int)GeosCoordinateSequence_setX(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_setY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  double arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setY",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setY" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setY" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  {
+    try
+    {
+      result = (int)GeosCoordinateSequence_setY(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_setZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  double arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setZ",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setZ" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setZ" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  {
+    try
+    {
+      result = (int)GeosCoordinateSequence_setZ(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_setOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  size_t arg3 ;
+  double arg4 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setOrdinate",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setOrdinate" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setOrdinate" "', argument " "3"" of type '" "size_t""'");
+  } 
+  arg3 = static_cast< size_t >(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoordinateSequence_setOrdinate" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = static_cast< double >(val4);
+  {
+    try
+    {
+      result = (int)GeosCoordinateSequence_setOrdinate(arg1,arg2,arg3,arg4);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getX",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getX" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (double)GeosCoordinateSequence_getX(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getY",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getY" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (double)GeosCoordinateSequence_getY(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getZ",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getZ" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (double)GeosCoordinateSequence_getZ(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  size_t arg2 ;
+  size_t arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getOrdinate",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getOrdinate" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_getOrdinate" "', argument " "3"" of type '" "size_t""'");
+  } 
+  arg3 = static_cast< size_t >(val3);
+  {
+    try
+    {
+      result = (double)GeosCoordinateSequence_getOrdinate(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  unsigned int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getSize",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getSize" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  {
+    try
+    {
+      result = (unsigned int)GeosCoordinateSequence_getSize(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoordinateSequence_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  unsigned int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getDimensions",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getDimensions" "', argument " "1"" of type '" "GeosCoordinateSequence *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
+  {
+    try
+    {
+      result = (unsigned int)GeosCoordinateSequence_getDimensions(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CoordinateSequence_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosCoordinateSequence, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_Geometry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_Geometry",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Geometry" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      delete_GeosGeometry(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_clone",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_clone" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_clone(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_geomType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_geomType",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_geomType" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (char *)GeosGeometry_geomType(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_typeId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_typeId",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_typeId" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (int)GeosGeometry_typeId(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_normalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_normalize",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_normalize" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      GeosGeometry_normalize(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_getSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getSRID",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getSRID" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (int)GeosGeometry_getSRID(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_setSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_setSRID",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_setSRID" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_setSRID" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    try
+    {
+      GeosGeometry_setSRID(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  size_t result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getDimensions",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getDimensions" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = GeosGeometry_getDimensions(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_getNumGeometries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  size_t result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getNumGeometries",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getNumGeometries" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = GeosGeometry_getNumGeometries(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_intersection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersection",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersection" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersection" "', argument " "2"" of type '" "GeosGeometry *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_intersection(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  double arg2 ;
+  int arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  {
+    arg3 = DEFAULT_QUADRANT_SEGMENTS;
+  }
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_buffer",2,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_buffer" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_buffer" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (obj2) {
+    ecode3 = SWIG_AsVal_int(obj2, &val3);
+    if (!SWIG_IsOK(ecode3)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_buffer" "', argument " "3"" of type '" "int""'");
+    } 
+    arg3 = static_cast< int >(val3);
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_buffer(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_convexHull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_convexHull",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_convexHull" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_convexHull(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_difference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_difference",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_difference" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_difference" "', argument " "2"" of type '" "GeosGeometry *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_difference(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_symDifference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_symDifference",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_symDifference" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_symDifference" "', argument " "2"" of type '" "GeosGeometry *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_symDifference(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_boundary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_boundary",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_boundary" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_boundary(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_union(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_union",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_union" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_union" "', argument " "2"" of type '" "GeosGeometry *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_geomUnion(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_pointOnSurface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_pointOnSurface",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_pointOnSurface" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_pointOnSurface(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_getCentroid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getCentroid",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getCentroid" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_getCentroid(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_getEnvelope(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_getEnvelope",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getEnvelope" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_getEnvelope(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_relate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_relate",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relate" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relate" "', argument " "2"" of type '" "GeosGeometry *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (char *)GeosGeometry_relate(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  delete[] result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_lineMerge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_lineMerge",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_lineMerge" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_lineMerge(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_simplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_simplify",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_simplify" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_simplify" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_simplify(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_topologyPreserveSimplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_topologyPreserveSimplify",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometry_topologyPreserveSimplify(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_relatePattern(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  char *arg3 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_relatePattern",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relatePattern" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relatePattern" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Geometry_relatePattern" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = reinterpret_cast< char * >(buf3);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_relatePattern(arg1,(GeosGeometry const *)arg2,(char const *)arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_disjoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_disjoint",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_disjoint" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_disjoint" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_disjoint(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_touches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_touches",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_touches" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_touches" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_touches(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_intersects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersects",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersects" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersects" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_intersects(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_crosses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_crosses",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_crosses" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_crosses" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_crosses(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_within(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_within",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_within" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_within" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_within(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_contains",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_contains" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_contains" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_contains(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_overlaps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_overlaps",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_overlaps" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_overlaps" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_overlaps(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_equals",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equals" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equals" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_equals(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_equalsExact(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  double arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_equalsExact",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equalsExact" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equalsExact" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_equalsExact" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_equalsExact(arg1,(GeosGeometry const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_isEmpty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isEmpty",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isEmpty" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_isEmpty(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_isValid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isValid",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isValid" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_isValid(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_isSimple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isSimple",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isSimple" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_isSimple(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_isRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_isRing",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isRing" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_isRing(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_hasZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_hasZ",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_hasZ" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosGeometry_hasZ(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_area(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_area",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_area" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (double)GeosGeometry_area(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_length",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_length" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (double)GeosGeometry_length(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Geometry_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Geometry_distance",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_distance" "', argument " "1"" of type '" "GeosGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_distance" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (double)GeosGeometry_distance(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *Geometry_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometry, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_Point(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPoint *arg1 = (GeosPoint *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_Point",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Point" "', argument " "1"" of type '" "GeosPoint *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPoint * >(argp1);
+  {
+    try
+    {
+      delete_GeosPoint(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Point_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPoint *arg1 = (GeosPoint *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosCoordinateSequence *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Point_getCoordSeq",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Point_getCoordSeq" "', argument " "1"" of type '" "GeosPoint *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPoint * >(argp1);
+  {
+    try
+    {
+      result = (GeosCoordinateSequence *)GeosPoint_getCoordSeq(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *Point_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosPoint, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_LineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosLineString *arg1 = (GeosLineString *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_LineString",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LineString" "', argument " "1"" of type '" "GeosLineString *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosLineString * >(argp1);
+  {
+    try
+    {
+      delete_GeosLineString(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LineString_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosLineString *arg1 = (GeosLineString *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosCoordinateSequence *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"LineString_getCoordSeq",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LineString_getCoordSeq" "', argument " "1"" of type '" "GeosLineString *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosLineString * >(argp1);
+  {
+    try
+    {
+      result = (GeosCoordinateSequence *)GeosLineString_getCoordSeq(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *LineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosLineString, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_LinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_LinearRing",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearRing" "', argument " "1"" of type '" "GeosLinearRing *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
+  {
+    try
+    {
+      delete_GeosLinearRing(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LinearRing_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosCoordinateSequence *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"LinearRing_getCoordSeq",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearRing_getCoordSeq" "', argument " "1"" of type '" "GeosLinearRing *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
+  {
+    try
+    {
+      result = (GeosCoordinateSequence *)GeosLinearRing_getCoordSeq(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *LinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosLinearRing, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_Polygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_Polygon",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Polygon" "', argument " "1"" of type '" "GeosPolygon *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
+  {
+    try
+    {
+      delete_GeosPolygon(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Polygon_getExteriorRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getExteriorRing",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getExteriorRing" "', argument " "1"" of type '" "GeosPolygon *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosPolygon_getExteriorRing(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Polygon_getNumInteriorRings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  size_t result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getNumInteriorRings",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getNumInteriorRings" "', argument " "1"" of type '" "GeosPolygon *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
+  {
+    try
+    {
+      result = GeosPolygon_getNumInteriorRings(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Polygon_getInteriorRingN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPolygon *arg1 = (GeosPolygon *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Polygon_getInteriorRingN",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getInteriorRingN" "', argument " "1"" of type '" "GeosPolygon *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPolygon * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Polygon_getInteriorRingN" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosPolygon_getInteriorRingN(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *Polygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosPolygon, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_GeometryCollection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_GeometryCollection",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GeometryCollection" "', argument " "1"" of type '" "GeosGeometryCollection *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
+  {
+    try
+    {
+      delete_GeosGeometryCollection(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GeometryCollection_getGeometryN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"GeometryCollection_getGeometryN",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeometryCollection_getGeometryN" "', argument " "1"" of type '" "GeosGeometryCollection *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeometryCollection_getGeometryN" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosGeometryCollection_getGeometryN(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *GeometryCollection_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometryCollection, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_MultiPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosMultiPoint *arg1 = (GeosMultiPoint *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPoint",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPoint, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPoint" "', argument " "1"" of type '" "GeosMultiPoint *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosMultiPoint * >(argp1);
+  {
+    try
+    {
+      delete_GeosMultiPoint(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *MultiPoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPoint, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_MultiLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosMultiLineString *arg1 = (GeosMultiLineString *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLineString",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLineString, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLineString" "', argument " "1"" of type '" "GeosMultiLineString *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosMultiLineString * >(argp1);
+  {
+    try
+    {
+      delete_GeosMultiLineString(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *MultiLineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLineString, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_MultiLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosMultiLinearRing *arg1 = (GeosMultiLinearRing *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLinearRing",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLinearRing, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLinearRing" "', argument " "1"" of type '" "GeosMultiLinearRing *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosMultiLinearRing * >(argp1);
+  {
+    try
+    {
+      delete_GeosMultiLinearRing(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *MultiLinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLinearRing, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_delete_MultiPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosMultiPolygon *arg1 = (GeosMultiPolygon *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPolygon",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPolygon, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPolygon" "', argument " "1"" of type '" "GeosMultiPolygon *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosMultiPolygon * >(argp1);
+  {
+    try
+    {
+      delete_GeosMultiPolygon(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *MultiPolygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPolygon, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_createPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"createPoint",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPoint" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)createPoint(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_createLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"createLineString",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLineString" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)createLineString(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_createLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"createLinearRing",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLinearRing" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)createLinearRing(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_createPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
+  GeosLinearRing **arg2 = (GeosLinearRing **) 0 ;
+  size_t arg3 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  {
+    arg2 = NULL;
+    arg3 = 0;
+  }
+  if(!PyArg_UnpackTuple(args,(char *)"createPolygon",1,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
+  }
+  if (obj1) {
+    {
+      if (obj1 == Py_None)
+      {
+        arg2 = NULL;
+        arg3 = 0;
+      }
+      else
+      {
+        /* Make sure the input can be treated as an array. */
+        if (!PySequence_Check(obj1))
+        SWIG_exception_fail(SWIG_RuntimeError, "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
+        
+        /* Get the length */
+        arg3 = PySequence_Size(obj1);
+        
+        /* Allocate space for the C array. */
+        arg2 = (GeosLinearRing**) malloc(arg3*sizeof(GeosLinearRing*));
+        
+        for(size_t i = 0; i<arg3; i++)
+        {
+          /* Get the Python Object */
+          PyObject *item = PySequence_GetItem(obj1,i);
+          
+          /* Get the underlying pointer and give up ownership of it. */
+          GeosLinearRing *ring = NULL;
+          int convertResult = SWIG_ConvertPtr(item, (void**)&ring, SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN);
+          if (!SWIG_IsOK(convertResult)) {
+            SWIG_exception_fail(SWIG_ArgError(convertResult), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
+          }
+          
+          /* Put the pointer in the array */
+          arg2[i] = ring;
+        }    
+      }
+    }
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)createPolygon(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  {
+    if (arg2) {
+      free((void*) arg2);
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if (arg2) {
+      free((void*) arg2);
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_Prepared(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosGeometry *arg1 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosPreparedGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"new_Prepared",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Prepared" "', argument " "1"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosGeometry * >(argp1);
+  {
+    try
+    {
+      result = (GeosPreparedGeometry *)new_GeosPreparedGeometry((GeosGeometry const *)arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPreparedGeometry, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_Prepared(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_Prepared",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Prepared" "', argument " "1"" of type '" "GeosPreparedGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
+  {
+    try
+    {
+      delete_GeosPreparedGeometry(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Prepared_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Prepared_contains",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_contains" "', argument " "1"" of type '" "GeosPreparedGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_contains" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosPreparedGeometry_contains(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Prepared_containsProperly(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Prepared_containsProperly",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_containsProperly" "', argument " "1"" of type '" "GeosPreparedGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_containsProperly" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosPreparedGeometry_containsProperly(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Prepared_covers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Prepared_covers",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_covers" "', argument " "1"" of type '" "GeosPreparedGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_covers" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosPreparedGeometry_covers(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Prepared_intersects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"Prepared_intersects",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_intersects" "', argument " "1"" of type '" "GeosPreparedGeometry *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_intersects" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (bool)GeosPreparedGeometry_intersects(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *Prepared_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosPreparedGeometry, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_STRtree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  GeosSTRtree *result = 0 ;
+  
+  {
+    arg1 = 10;
+  }
+  if(!PyArg_UnpackTuple(args,(char *)"new_STRtree",0,1,&obj0)) SWIG_fail;
+  if (obj0) {
+    ecode1 = SWIG_AsVal_int(obj0, &val1);
+    if (!SWIG_IsOK(ecode1)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_STRtree" "', argument " "1"" of type '" "int""'");
+    } 
+    arg1 = static_cast< int >(val1);
+  }
+  {
+    try
+    {
+      result = (GeosSTRtree *)new_GeosSTRtree(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosSTRtree, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_STRtree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_STRtree",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_STRtree" "', argument " "1"" of type '" "GeosSTRtree *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
+  {
+    try
+    {
+      delete_GeosSTRtree(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_STRtree_insert(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  GeosIndexItem arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"STRtree_insert",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_insert" "', argument " "1"" of type '" "GeosSTRtree *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_insert" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_insert" "', argument " "3"" of type '" "GeosIndexItem""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_insert" "', argument " "3"" of type '" "GeosIndexItem""'");
+    } else {
+      GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try
+    {
+      GeosSTRtree_insert(arg1,(GeosGeometry const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_STRtree_remove(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  GeosIndexItem arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"STRtree_remove",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_remove" "', argument " "1"" of type '" "GeosSTRtree *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_remove" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_remove" "', argument " "3"" of type '" "GeosIndexItem""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_remove" "', argument " "3"" of type '" "GeosIndexItem""'");
+    } else {
+      GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try
+    {
+      GeosSTRtree_remove(arg1,(GeosGeometry const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_STRtree_query(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  GeosQueryCallback arg3 ;
+  GeosIndexItem arg4 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  void *argp4 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"STRtree_query",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_query" "', argument " "1"" of type '" "GeosSTRtree *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_query" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosQueryCallback,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_query" "', argument " "3"" of type '" "GeosQueryCallback""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_query" "', argument " "3"" of type '" "GeosQueryCallback""'");
+    } else {
+      GeosQueryCallback * temp = reinterpret_cast< GeosQueryCallback * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_GeosIndexItem,  0  | 0);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "STRtree_query" "', argument " "4"" of type '" "GeosIndexItem""'"); 
+    }  
+    if (!argp4) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_query" "', argument " "4"" of type '" "GeosIndexItem""'");
+    } else {
+      GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp4);
+      arg4 = *temp;
+      if (SWIG_IsNewObj(res4)) delete temp;
+    }
+  }
+  {
+    try
+    {
+      GeosSTRtree_query(arg1,(GeosGeometry const *)arg2,arg3,arg4);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_STRtree_iterate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
+  GeosQueryCallback arg2 ;
+  GeosIndexItem arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"STRtree_iterate",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_iterate" "', argument " "1"" of type '" "GeosSTRtree *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_GeosQueryCallback,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_iterate" "', argument " "2"" of type '" "GeosQueryCallback""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_iterate" "', argument " "2"" of type '" "GeosQueryCallback""'");
+    } else {
+      GeosQueryCallback * temp = reinterpret_cast< GeosQueryCallback * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_iterate" "', argument " "3"" of type '" "GeosIndexItem""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_iterate" "', argument " "3"" of type '" "GeosIndexItem""'");
+    } else {
+      GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try
+    {
+      GeosSTRtree_iterate(arg1,arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *STRtree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosSTRtree, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_WktReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktReader *result = 0 ;
+  
+  {
+    try
+    {
+      result = (GeosWktReader *)new_GeosWktReader();
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWktReader, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_WktReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktReader *arg1 = (GeosWktReader *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_WktReader",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktReader, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WktReader" "', argument " "1"" of type '" "GeosWktReader *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWktReader * >(argp1);
+  {
+    try
+    {
+      delete_GeosWktReader(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WktReader_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktReader *arg1 = (GeosWktReader *) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WktReader_read",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktReader, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WktReader_read" "', argument " "1"" of type '" "GeosWktReader *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWktReader * >(argp1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WktReader_read" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = reinterpret_cast< char * >(buf2);
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosWktReader_read(arg1,(char const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *WktReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosWktReader, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_WktWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktWriter *result = 0 ;
+  
+  {
+    try
+    {
+      result = (GeosWktWriter *)new_GeosWktWriter();
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWktWriter, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_WktWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktWriter *arg1 = (GeosWktWriter *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_WktWriter",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktWriter, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WktWriter" "', argument " "1"" of type '" "GeosWktWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWktWriter * >(argp1);
+  {
+    try
+    {
+      delete_GeosWktWriter(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WktWriter_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWktWriter *arg1 = (GeosWktWriter *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WktWriter_write",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WktWriter_write" "', argument " "1"" of type '" "GeosWktWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWktWriter * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WktWriter_write" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (char *)GeosWktWriter_write(arg1,(GeosGeometry const *)arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *WktWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosWktWriter, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_WkbReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbReader *result = 0 ;
+  
+  {
+    try
+    {
+      result = (GeosWkbReader *)new_GeosWkbReader();
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWkbReader, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_WkbReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_WkbReader",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WkbReader" "', argument " "1"" of type '" "GeosWkbReader *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
+  {
+    try
+    {
+      delete_GeosWkbReader(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbReader_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
+  unsigned char *arg2 = (unsigned char *) 0 ;
+  size_t arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbReader_read",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbReader_read" "', argument " "1"" of type '" "GeosWkbReader *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
+  {
+    /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc2 = 0) */
+    if (SWIG_AsCharPtrAndSize(obj1, (char**)&arg2, &arg3, &alloc2) != SWIG_OK)
+    SWIG_exception(SWIG_RuntimeError, "Expecting a string");
+    /* Don't want to include last null character! */
+    arg3--;
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosWkbReader_read(arg1,(unsigned char const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbReader_readHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
+  unsigned char *arg2 = (unsigned char *) 0 ;
+  size_t arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  GeosGeometry *result = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbReader_readHEX",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbReader_readHEX" "', argument " "1"" of type '" "GeosWkbReader *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
+  {
+    /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc2 = 0) */
+    if (SWIG_AsCharPtrAndSize(obj1, (char**)&arg2, &arg3, &alloc2) != SWIG_OK)
+    SWIG_exception(SWIG_RuntimeError, "Expecting a string");
+    /* Don't want to include last null character! */
+    arg3--;
+  }
+  {
+    try
+    {
+      result = (GeosGeometry *)GeosWkbReader_readHEX(arg1,(unsigned char const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) GeosGeometry */
+    
+    if (result == NULL)
+    SWIG_exception(SWIG_RuntimeError, message);
+    
+    GeosGeometry *geom = result;
+    GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
+    
+    switch (geomId)
+    {
+    case GEOS_POINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_LINEARRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_POLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOINT:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTILINESTRING:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_MULTIPOLYGON:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
+      break;
+    case GEOS_GEOMETRYCOLLECTION:
+      resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
+      break;
+    }
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *WkbReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosWkbReader, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_WkbWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *result = 0 ;
+  
+  {
+    try
+    {
+      result = (GeosWkbWriter *)new_GeosWkbWriter();
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWkbWriter, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_WkbWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"delete_WkbWriter",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WkbWriter" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  {
+    try
+    {
+      delete_GeosWkbWriter(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_getOutputDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getOutputDimension",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getOutputDimension" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  {
+    try
+    {
+      result = (int)GeosWkbWriter_getOutputDimension(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_setOutputDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setOutputDimension",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setOutputDimension" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setOutputDimension" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    try
+    {
+      GeosWkbWriter_setOutputDimension(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_getByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getByteOrder",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getByteOrder" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  {
+    try
+    {
+      result = (int)GeosWkbWriter_getByteOrder(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_setByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setByteOrder",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setByteOrder" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setByteOrder" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    try
+    {
+      GeosWkbWriter_setByteOrder(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_getIncludeSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getIncludeSRID",1,1,&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getIncludeSRID" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  {
+    try
+    {
+      result = (bool)GeosWkbWriter_getIncludeSRID(arg1);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_setIncludeSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setIncludeSRID",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setIncludeSRID" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setIncludeSRID" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  {
+    try
+    {
+      GeosWkbWriter_setIncludeSRID(arg1,arg2);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  size_t *arg3 = (size_t *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  size_t temp3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  unsigned char *result = 0 ;
+  
+  {
+    /* %typemap(in, numinputs=0) size_t *size (size_t temp3 = 0) */
+    arg3 = &temp3;
+  }
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_write",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_write" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WkbWriter_write" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (unsigned char *)GeosWkbWriter_write(arg1,(GeosGeometry const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) unsigned char* */
+  }
+  {
+    /* %typemap(argout) size_t *size */
+    resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg3);
+  }
+  {
+    /* %typemap(freearg) size_t *size */
+    std::free(result);
+  }
+  return resultobj;
+fail:
+  {
+    /* %typemap(freearg) size_t *size */
+    std::free(result);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_WkbWriter_writeHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
+  GeosGeometry *arg2 = (GeosGeometry *) 0 ;
+  size_t *arg3 = (size_t *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  size_t temp3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  unsigned char *result = 0 ;
+  
+  {
+    /* %typemap(in, numinputs=0) size_t *size (size_t temp3 = 0) */
+    arg3 = &temp3;
+  }
+  if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_writeHEX",2,2,&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_writeHEX" "', argument " "1"" of type '" "GeosWkbWriter *""'"); 
+  }
+  arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WkbWriter_writeHEX" "', argument " "2"" of type '" "GeosGeometry const *""'"); 
+  }
+  arg2 = reinterpret_cast< GeosGeometry * >(argp2);
+  {
+    try
+    {
+      result = (unsigned char *)GeosWkbWriter_writeHEX(arg1,(GeosGeometry const *)arg2,arg3);
+    }
+    catch (const std::exception& e)
+    {
+      SWIG_exception(SWIG_RuntimeError, e.what());
+    }
+  }
+  {
+    /* %typemap(out) unsigned char* */
+  }
+  {
+    /* %typemap(argout) size_t *size */
+    resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg3);
+  }
+  {
+    /* %typemap(freearg) size_t *size */
+    std::free(result);
+  }
+  return resultobj;
+fail:
+  {
+    /* %typemap(freearg) size_t *size */
+    std::free(result);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *WkbWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_GeosWkbWriter, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+static PyMethodDef SwigMethods[] = {
+	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
+	 { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL},
+	 { (char *)"version", _wrap_version, METH_VARARGS, NULL},
+	 { (char *)"new_CoordinateSequence", _wrap_new_CoordinateSequence, METH_VARARGS, NULL},
+	 { (char *)"delete_CoordinateSequence", _wrap_delete_CoordinateSequence, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_clone", _wrap_CoordinateSequence_clone, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_setX", _wrap_CoordinateSequence_setX, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_setY", _wrap_CoordinateSequence_setY, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_setZ", _wrap_CoordinateSequence_setZ, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_setOrdinate", _wrap_CoordinateSequence_setOrdinate, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getX", _wrap_CoordinateSequence_getX, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getY", _wrap_CoordinateSequence_getY, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getZ", _wrap_CoordinateSequence_getZ, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getOrdinate", _wrap_CoordinateSequence_getOrdinate, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getSize", _wrap_CoordinateSequence_getSize, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_getDimensions", _wrap_CoordinateSequence_getDimensions, METH_VARARGS, NULL},
+	 { (char *)"CoordinateSequence_swigregister", CoordinateSequence_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_Geometry", _wrap_delete_Geometry, METH_VARARGS, NULL},
+	 { (char *)"Geometry_clone", _wrap_Geometry_clone, METH_VARARGS, NULL},
+	 { (char *)"Geometry_geomType", _wrap_Geometry_geomType, METH_VARARGS, NULL},
+	 { (char *)"Geometry_typeId", _wrap_Geometry_typeId, METH_VARARGS, NULL},
+	 { (char *)"Geometry_normalize", _wrap_Geometry_normalize, METH_VARARGS, NULL},
+	 { (char *)"Geometry_getSRID", _wrap_Geometry_getSRID, METH_VARARGS, NULL},
+	 { (char *)"Geometry_setSRID", _wrap_Geometry_setSRID, METH_VARARGS, NULL},
+	 { (char *)"Geometry_getDimensions", _wrap_Geometry_getDimensions, METH_VARARGS, NULL},
+	 { (char *)"Geometry_getNumGeometries", _wrap_Geometry_getNumGeometries, METH_VARARGS, NULL},
+	 { (char *)"Geometry_intersection", _wrap_Geometry_intersection, METH_VARARGS, NULL},
+	 { (char *)"Geometry_buffer", _wrap_Geometry_buffer, METH_VARARGS, NULL},
+	 { (char *)"Geometry_convexHull", _wrap_Geometry_convexHull, METH_VARARGS, NULL},
+	 { (char *)"Geometry_difference", _wrap_Geometry_difference, METH_VARARGS, NULL},
+	 { (char *)"Geometry_symDifference", _wrap_Geometry_symDifference, METH_VARARGS, NULL},
+	 { (char *)"Geometry_boundary", _wrap_Geometry_boundary, METH_VARARGS, NULL},
+	 { (char *)"Geometry_union", _wrap_Geometry_union, METH_VARARGS, NULL},
+	 { (char *)"Geometry_pointOnSurface", _wrap_Geometry_pointOnSurface, METH_VARARGS, NULL},
+	 { (char *)"Geometry_getCentroid", _wrap_Geometry_getCentroid, METH_VARARGS, NULL},
+	 { (char *)"Geometry_getEnvelope", _wrap_Geometry_getEnvelope, METH_VARARGS, NULL},
+	 { (char *)"Geometry_relate", _wrap_Geometry_relate, METH_VARARGS, NULL},
+	 { (char *)"Geometry_lineMerge", _wrap_Geometry_lineMerge, METH_VARARGS, NULL},
+	 { (char *)"Geometry_simplify", _wrap_Geometry_simplify, METH_VARARGS, NULL},
+	 { (char *)"Geometry_topologyPreserveSimplify", _wrap_Geometry_topologyPreserveSimplify, METH_VARARGS, NULL},
+	 { (char *)"Geometry_relatePattern", _wrap_Geometry_relatePattern, METH_VARARGS, NULL},
+	 { (char *)"Geometry_disjoint", _wrap_Geometry_disjoint, METH_VARARGS, NULL},
+	 { (char *)"Geometry_touches", _wrap_Geometry_touches, METH_VARARGS, NULL},
+	 { (char *)"Geometry_intersects", _wrap_Geometry_intersects, METH_VARARGS, NULL},
+	 { (char *)"Geometry_crosses", _wrap_Geometry_crosses, METH_VARARGS, NULL},
+	 { (char *)"Geometry_within", _wrap_Geometry_within, METH_VARARGS, NULL},
+	 { (char *)"Geometry_contains", _wrap_Geometry_contains, METH_VARARGS, NULL},
+	 { (char *)"Geometry_overlaps", _wrap_Geometry_overlaps, METH_VARARGS, NULL},
+	 { (char *)"Geometry_equals", _wrap_Geometry_equals, METH_VARARGS, NULL},
+	 { (char *)"Geometry_equalsExact", _wrap_Geometry_equalsExact, METH_VARARGS, NULL},
+	 { (char *)"Geometry_isEmpty", _wrap_Geometry_isEmpty, METH_VARARGS, NULL},
+	 { (char *)"Geometry_isValid", _wrap_Geometry_isValid, METH_VARARGS, NULL},
+	 { (char *)"Geometry_isSimple", _wrap_Geometry_isSimple, METH_VARARGS, NULL},
+	 { (char *)"Geometry_isRing", _wrap_Geometry_isRing, METH_VARARGS, NULL},
+	 { (char *)"Geometry_hasZ", _wrap_Geometry_hasZ, METH_VARARGS, NULL},
+	 { (char *)"Geometry_area", _wrap_Geometry_area, METH_VARARGS, NULL},
+	 { (char *)"Geometry_length", _wrap_Geometry_length, METH_VARARGS, NULL},
+	 { (char *)"Geometry_distance", _wrap_Geometry_distance, METH_VARARGS, NULL},
+	 { (char *)"Geometry_swigregister", Geometry_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_Point", _wrap_delete_Point, METH_VARARGS, NULL},
+	 { (char *)"Point_getCoordSeq", _wrap_Point_getCoordSeq, METH_VARARGS, NULL},
+	 { (char *)"Point_swigregister", Point_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_LineString", _wrap_delete_LineString, METH_VARARGS, NULL},
+	 { (char *)"LineString_getCoordSeq", _wrap_LineString_getCoordSeq, METH_VARARGS, NULL},
+	 { (char *)"LineString_swigregister", LineString_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_LinearRing", _wrap_delete_LinearRing, METH_VARARGS, NULL},
+	 { (char *)"LinearRing_getCoordSeq", _wrap_LinearRing_getCoordSeq, METH_VARARGS, NULL},
+	 { (char *)"LinearRing_swigregister", LinearRing_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_Polygon", _wrap_delete_Polygon, METH_VARARGS, NULL},
+	 { (char *)"Polygon_getExteriorRing", _wrap_Polygon_getExteriorRing, METH_VARARGS, NULL},
+	 { (char *)"Polygon_getNumInteriorRings", _wrap_Polygon_getNumInteriorRings, METH_VARARGS, NULL},
+	 { (char *)"Polygon_getInteriorRingN", _wrap_Polygon_getInteriorRingN, METH_VARARGS, NULL},
+	 { (char *)"Polygon_swigregister", Polygon_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_GeometryCollection", _wrap_delete_GeometryCollection, METH_VARARGS, NULL},
+	 { (char *)"GeometryCollection_getGeometryN", _wrap_GeometryCollection_getGeometryN, METH_VARARGS, NULL},
+	 { (char *)"GeometryCollection_swigregister", GeometryCollection_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_MultiPoint", _wrap_delete_MultiPoint, METH_VARARGS, NULL},
+	 { (char *)"MultiPoint_swigregister", MultiPoint_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_MultiLineString", _wrap_delete_MultiLineString, METH_VARARGS, NULL},
+	 { (char *)"MultiLineString_swigregister", MultiLineString_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_MultiLinearRing", _wrap_delete_MultiLinearRing, METH_VARARGS, NULL},
+	 { (char *)"MultiLinearRing_swigregister", MultiLinearRing_swigregister, METH_VARARGS, NULL},
+	 { (char *)"delete_MultiPolygon", _wrap_delete_MultiPolygon, METH_VARARGS, NULL},
+	 { (char *)"MultiPolygon_swigregister", MultiPolygon_swigregister, METH_VARARGS, NULL},
+	 { (char *)"createPoint", _wrap_createPoint, METH_VARARGS, NULL},
+	 { (char *)"createLineString", _wrap_createLineString, METH_VARARGS, NULL},
+	 { (char *)"createLinearRing", _wrap_createLinearRing, METH_VARARGS, NULL},
+	 { (char *)"createPolygon", _wrap_createPolygon, METH_VARARGS, NULL},
+	 { (char *)"new_Prepared", _wrap_new_Prepared, METH_VARARGS, NULL},
+	 { (char *)"delete_Prepared", _wrap_delete_Prepared, METH_VARARGS, NULL},
+	 { (char *)"Prepared_contains", _wrap_Prepared_contains, METH_VARARGS, NULL},
+	 { (char *)"Prepared_containsProperly", _wrap_Prepared_containsProperly, METH_VARARGS, NULL},
+	 { (char *)"Prepared_covers", _wrap_Prepared_covers, METH_VARARGS, NULL},
+	 { (char *)"Prepared_intersects", _wrap_Prepared_intersects, METH_VARARGS, NULL},
+	 { (char *)"Prepared_swigregister", Prepared_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_STRtree", _wrap_new_STRtree, METH_VARARGS, NULL},
+	 { (char *)"delete_STRtree", _wrap_delete_STRtree, METH_VARARGS, NULL},
+	 { (char *)"STRtree_insert", _wrap_STRtree_insert, METH_VARARGS, NULL},
+	 { (char *)"STRtree_remove", _wrap_STRtree_remove, METH_VARARGS, NULL},
+	 { (char *)"STRtree_query", _wrap_STRtree_query, METH_VARARGS, NULL},
+	 { (char *)"STRtree_iterate", _wrap_STRtree_iterate, METH_VARARGS, NULL},
+	 { (char *)"STRtree_swigregister", STRtree_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_WktReader", _wrap_new_WktReader, METH_VARARGS, NULL},
+	 { (char *)"delete_WktReader", _wrap_delete_WktReader, METH_VARARGS, NULL},
+	 { (char *)"WktReader_read", _wrap_WktReader_read, METH_VARARGS, NULL},
+	 { (char *)"WktReader_swigregister", WktReader_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_WktWriter", _wrap_new_WktWriter, METH_VARARGS, NULL},
+	 { (char *)"delete_WktWriter", _wrap_delete_WktWriter, METH_VARARGS, NULL},
+	 { (char *)"WktWriter_write", _wrap_WktWriter_write, METH_VARARGS, NULL},
+	 { (char *)"WktWriter_swigregister", WktWriter_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_WkbReader", _wrap_new_WkbReader, METH_VARARGS, NULL},
+	 { (char *)"delete_WkbReader", _wrap_delete_WkbReader, METH_VARARGS, NULL},
+	 { (char *)"WkbReader_read", _wrap_WkbReader_read, METH_VARARGS, NULL},
+	 { (char *)"WkbReader_readHEX", _wrap_WkbReader_readHEX, METH_VARARGS, NULL},
+	 { (char *)"WkbReader_swigregister", WkbReader_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_WkbWriter", _wrap_new_WkbWriter, METH_VARARGS, NULL},
+	 { (char *)"delete_WkbWriter", _wrap_delete_WkbWriter, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_getOutputDimension", _wrap_WkbWriter_getOutputDimension, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_setOutputDimension", _wrap_WkbWriter_setOutputDimension, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_getByteOrder", _wrap_WkbWriter_getByteOrder, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_setByteOrder", _wrap_WkbWriter_setByteOrder, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_getIncludeSRID", _wrap_WkbWriter_getIncludeSRID, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_setIncludeSRID", _wrap_WkbWriter_setIncludeSRID, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_write", _wrap_WkbWriter_write, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_writeHEX", _wrap_WkbWriter_writeHEX, METH_VARARGS, NULL},
+	 { (char *)"WkbWriter_swigregister", WkbWriter_swigregister, METH_VARARGS, NULL},
+	 { NULL, NULL, 0, NULL }
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static void *_p_GeosMultiPolygonTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometryCollection *)  ((GeosMultiPolygon *) x));
+}
+static void *_p_GeosMultiPointTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometryCollection *)  ((GeosMultiPoint *) x));
+}
+static void *_p_GeosMultiLineStringTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometryCollection *)  ((GeosMultiLineString *) x));
+}
+static void *_p_GeosMultiLinearRingTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometryCollection *)  ((GeosMultiLinearRing *) x));
+}
+static void *_p_GeosPolygonTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *)  ((GeosPolygon *) x));
+}
+static void *_p_GeosMultiPolygonTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPolygon *) x));
+}
+static void *_p_GeosPointTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *)  ((GeosPoint *) x));
+}
+static void *_p_GeosLineStringTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *)  ((GeosLineString *) x));
+}
+static void *_p_GeosLinearRingTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *)  ((GeosLinearRing *) x));
+}
+static void *_p_GeosMultiPointTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPoint *) x));
+}
+static void *_p_GeosMultiLineStringTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLineString *) x));
+}
+static void *_p_GeosMultiLinearRingTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLinearRing *) x));
+}
+static void *_p_GeosGeometryCollectionTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((GeosGeometry *)  ((GeosGeometryCollection *) x));
+}
+static swig_type_info _swigt__p_GeosCoordinateSequence = {"_p_GeosCoordinateSequence", "GeosCoordinateSequence *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosGeometry = {"_p_GeosGeometry", "GeosGeometry *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosGeometryCollection = {"_p_GeosGeometryCollection", "GeosGeometryCollection *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosIndexItem = {"_p_GeosIndexItem", "GeosIndexItem *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosLineString = {"_p_GeosLineString", "GeosLineString *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosLinearRing = {"_p_GeosLinearRing", "GeosLinearRing *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosMultiLineString = {"_p_GeosMultiLineString", "GeosMultiLineString *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosMultiLinearRing = {"_p_GeosMultiLinearRing", "GeosMultiLinearRing *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosMultiPoint = {"_p_GeosMultiPoint", "GeosMultiPoint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosMultiPolygon = {"_p_GeosMultiPolygon", "GeosMultiPolygon *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosPoint = {"_p_GeosPoint", "GeosPoint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosPolygon = {"_p_GeosPolygon", "GeosPolygon *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosPreparedGeometry = {"_p_GeosPreparedGeometry", "GeosPreparedGeometry *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosQueryCallback = {"_p_GeosQueryCallback", "GeosQueryCallback *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosSTRtree = {"_p_GeosSTRtree", "GeosSTRtree *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosWkbReader = {"_p_GeosWkbReader", "GeosWkbReader *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosWkbWriter = {"_p_GeosWkbWriter", "GeosWkbWriter *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosWktReader = {"_p_GeosWktReader", "GeosWktReader *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GeosWktWriter = {"_p_GeosWktWriter", "GeosWktWriter *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_GeosLinearRing = {"_p_p_GeosLinearRing", "GeosLinearRing **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_GeosCoordinateSequence,
+  &_swigt__p_GeosGeometry,
+  &_swigt__p_GeosGeometryCollection,
+  &_swigt__p_GeosIndexItem,
+  &_swigt__p_GeosLineString,
+  &_swigt__p_GeosLinearRing,
+  &_swigt__p_GeosMultiLineString,
+  &_swigt__p_GeosMultiLinearRing,
+  &_swigt__p_GeosMultiPoint,
+  &_swigt__p_GeosMultiPolygon,
+  &_swigt__p_GeosPoint,
+  &_swigt__p_GeosPolygon,
+  &_swigt__p_GeosPreparedGeometry,
+  &_swigt__p_GeosQueryCallback,
+  &_swigt__p_GeosSTRtree,
+  &_swigt__p_GeosWkbReader,
+  &_swigt__p_GeosWkbWriter,
+  &_swigt__p_GeosWktReader,
+  &_swigt__p_GeosWktWriter,
+  &_swigt__p_char,
+  &_swigt__p_p_GeosLinearRing,
+  &_swigt__p_size_t,
+  &_swigt__p_std__invalid_argument,
+  &_swigt__p_swig__SwigPyIterator,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_GeosCoordinateSequence[] = {  {&_swigt__p_GeosCoordinateSequence, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosGeometry[] = {  {&_swigt__p_GeosPolygon, _p_GeosPolygonTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosPoint, _p_GeosPointTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosGeometry, 0, 0, 0},  {&_swigt__p_GeosLineString, _p_GeosLineStringTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosLinearRing, _p_GeosLinearRingTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometry, 0, 0},  {&_swigt__p_GeosGeometryCollection, _p_GeosGeometryCollectionTo_p_GeosGeometry, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosGeometryCollection[] = {  {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometryCollection, 0, 0},  {&_swigt__p_GeosGeometryCollection, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosIndexItem[] = {  {&_swigt__p_GeosIndexItem, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosLineString[] = {  {&_swigt__p_GeosLineString, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosLinearRing[] = {  {&_swigt__p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosMultiLineString[] = {  {&_swigt__p_GeosMultiLineString, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosMultiLinearRing[] = {  {&_swigt__p_GeosMultiLinearRing, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosMultiPoint[] = {  {&_swigt__p_GeosMultiPoint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosMultiPolygon[] = {  {&_swigt__p_GeosMultiPolygon, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosPoint[] = {  {&_swigt__p_GeosPoint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosPolygon[] = {  {&_swigt__p_GeosPolygon, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosPreparedGeometry[] = {  {&_swigt__p_GeosPreparedGeometry, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosQueryCallback[] = {  {&_swigt__p_GeosQueryCallback, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosSTRtree[] = {  {&_swigt__p_GeosSTRtree, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosWkbReader[] = {  {&_swigt__p_GeosWkbReader, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosWkbWriter[] = {  {&_swigt__p_GeosWkbWriter, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosWktReader[] = {  {&_swigt__p_GeosWktReader, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GeosWktWriter[] = {  {&_swigt__p_GeosWktWriter, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_GeosLinearRing[] = {  {&_swigt__p_p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__invalid_argument[] = {  {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__SwigPyIterator[] = {  {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_GeosCoordinateSequence,
+  _swigc__p_GeosGeometry,
+  _swigc__p_GeosGeometryCollection,
+  _swigc__p_GeosIndexItem,
+  _swigc__p_GeosLineString,
+  _swigc__p_GeosLinearRing,
+  _swigc__p_GeosMultiLineString,
+  _swigc__p_GeosMultiLinearRing,
+  _swigc__p_GeosMultiPoint,
+  _swigc__p_GeosMultiPolygon,
+  _swigc__p_GeosPoint,
+  _swigc__p_GeosPolygon,
+  _swigc__p_GeosPreparedGeometry,
+  _swigc__p_GeosQueryCallback,
+  _swigc__p_GeosSTRtree,
+  _swigc__p_GeosWkbReader,
+  _swigc__p_GeosWkbWriter,
+  _swigc__p_GeosWktReader,
+  _swigc__p_GeosWktWriter,
+  _swigc__p_char,
+  _swigc__p_p_GeosLinearRing,
+  _swigc__p_size_t,
+  _swigc__p_std__invalid_argument,
+  _swigc__p_swig__SwigPyIterator,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_const_info swig_const_table[] = {
+{0, 0, 0, 0.0, 0, 0}};
+
+#ifdef __cplusplus
+}
+#endif
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found, init;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  
+  /* Python-specific SWIG API */
+#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
+#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
+#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
+  
+  /* -----------------------------------------------------------------------------
+   * global variable support code.
+   * ----------------------------------------------------------------------------- */
+  
+  typedef struct swig_globalvar {
+    char       *name;                  /* Name of global variable */
+    PyObject *(*get_attr)(void);       /* Return the current value */
+    int       (*set_attr)(PyObject *); /* Set the value */
+    struct swig_globalvar *next;
+  } swig_globalvar;
+  
+  typedef struct swig_varlinkobject {
+    PyObject_HEAD
+    swig_globalvar *vars;
+  } swig_varlinkobject;
+  
+  SWIGINTERN PyObject *
+  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+    return PyUnicode_InternFromString("<Swig global variables>");
+#else
+    return PyString_FromString("<Swig global variables>");
+#endif
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *str = PyUnicode_InternFromString("(");
+    PyObject *tail;
+    PyObject *joined;
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      tail = PyUnicode_FromString(var->name);
+      joined = PyUnicode_Concat(str, tail);
+      Py_DecRef(str);
+      Py_DecRef(tail);
+      str = joined;
+      if (var->next) {
+        tail = PyUnicode_InternFromString(", ");
+        joined = PyUnicode_Concat(str, tail);
+        Py_DecRef(str);
+        Py_DecRef(tail);
+        str = joined;
+      }
+    }
+    tail = PyUnicode_InternFromString(")");
+    joined = PyUnicode_Concat(str, tail);
+    Py_DecRef(str);
+    Py_DecRef(tail);
+    str = joined;
+#else
+    PyObject *str = PyString_FromString("(");
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
+    }
+    PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
+    return str;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    char *tmp;
+    PyObject *str = swig_varlink_str(v);
+    fprintf(fp,"Swig global variables ");
+    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+    SWIG_Python_str_DelForPy3(tmp);
+    Py_DECREF(str);
+    return 0;
+  }
+  
+  SWIGINTERN void
+  swig_varlink_dealloc(swig_varlinkobject *v) {
+    swig_globalvar *var = v->vars;
+    while (var) {
+      swig_globalvar *n = var->next;
+      free(var->name);
+      free(var);
+      var = n;
+    }
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+    PyObject *res = NULL;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->get_attr)();
+        break;
+      }
+      var = var->next;
+    }
+    if (res == NULL && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+    int res = 1;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->set_attr)(p);
+        break;
+      }
+      var = var->next;
+    }
+    if (res == 1 && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN PyTypeObject*
+  swig_varlink_type(void) {
+    static char varlink__doc__[] = "Swig var link object";
+    static PyTypeObject varlink_type;
+    static int type_init = 0;
+    if (!type_init) {
+      const PyTypeObject tmp = {
+        /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+        PyVarObject_HEAD_INIT(NULL, 0)
+#else
+        PyObject_HEAD_INIT(NULL)
+        0,                                  /* ob_size */
+#endif
+        (char *)"swigvarlink",              /* tp_name */
+        sizeof(swig_varlinkobject),         /* tp_basicsize */
+        0,                                  /* tp_itemsize */
+        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
+        (printfunc) swig_varlink_print,     /* tp_print */
+        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
+        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
+        0,                                  /* tp_compare */
+        (reprfunc) swig_varlink_repr,       /* tp_repr */
+        0,                                  /* tp_as_number */
+        0,                                  /* tp_as_sequence */
+        0,                                  /* tp_as_mapping */
+        0,                                  /* tp_hash */
+        0,                                  /* tp_call */
+        (reprfunc) swig_varlink_str,        /* tp_str */
+        0,                                  /* tp_getattro */
+        0,                                  /* tp_setattro */
+        0,                                  /* tp_as_buffer */
+        0,                                  /* tp_flags */
+        varlink__doc__,                     /* tp_doc */
+        0,                                  /* tp_traverse */
+        0,                                  /* tp_clear */
+        0,                                  /* tp_richcompare */
+        0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+        0,                                  /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+        0,                                  /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+        0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+      varlink_type = tmp;
+      type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+      varlink_type.ob_type = &PyType_Type;
+#else
+      if (PyType_Ready(&varlink_type) < 0)
+      return NULL;
+#endif
+    }
+    return &varlink_type;
+  }
+  
+  /* Create a variable linking object for use later */
+  SWIGINTERN PyObject *
+  SWIG_Python_newvarlink(void) {
+    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+    if (result) {
+      result->vars = 0;
+    }
+    return ((PyObject*) result);
+  }
+  
+  SWIGINTERN void 
+  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+    swig_varlinkobject *v = (swig_varlinkobject *) p;
+    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+    if (gv) {
+      size_t size = strlen(name)+1;
+      gv->name = (char *)malloc(size);
+      if (gv->name) {
+        strncpy(gv->name,name,size);
+        gv->get_attr = get_attr;
+        gv->set_attr = set_attr;
+        gv->next = v->vars;
+      }
+    }
+    v->vars = gv;
+  }
+  
+  SWIGINTERN PyObject *
+  SWIG_globals(void) {
+    static PyObject *_SWIG_globals = 0; 
+    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
+    return _SWIG_globals;
+  }
+  
+  /* -----------------------------------------------------------------------------
+   * constants/methods manipulation
+   * ----------------------------------------------------------------------------- */
+  
+  /* Install Constants */
+  SWIGINTERN void
+  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+    PyObject *obj = 0;
+    size_t i;
+    for (i = 0; constants[i].type; ++i) {
+      switch(constants[i].type) {
+      case SWIG_PY_POINTER:
+        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+        break;
+      case SWIG_PY_BINARY:
+        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+        break;
+      default:
+        obj = 0;
+        break;
+      }
+      if (obj) {
+        PyDict_SetItemString(d, constants[i].name, obj);
+        Py_DECREF(obj);
+      }
+    }
+  }
+  
+  /* -----------------------------------------------------------------------------*/
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  /* -----------------------------------------------------------------------------*/
+  
+  SWIGINTERN void
+  SWIG_Python_FixMethods(PyMethodDef *methods,
+    swig_const_info *const_table,
+    swig_type_info **types,
+    swig_type_info **types_initial) {
+    size_t i;
+    for (i = 0; methods[i].ml_name; ++i) {
+      const char *c = methods[i].ml_doc;
+      if (c && (c = strstr(c, "swig_ptr: "))) {
+        int j;
+        swig_const_info *ci = 0;
+        const char *name = c + 10;
+        for (j = 0; const_table[j].type; ++j) {
+          if (strncmp(const_table[j].name, name, 
+              strlen(const_table[j].name)) == 0) {
+            ci = &(const_table[j]);
+            break;
+          }
+        }
+        if (ci) {
+          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+          if (ptr) {
+            size_t shift = (ci->ptype) - types;
+            swig_type_info *ty = types_initial[shift];
+            size_t ldoc = (c - methods[i].ml_doc);
+            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+            char *ndoc = (char*)malloc(ldoc + lptr + 10);
+            if (ndoc) {
+              char *buff = ndoc;
+              strncpy(buff, methods[i].ml_doc, ldoc);
+              buff += ldoc;
+              strncpy(buff, "swig_ptr: ", 10);
+              buff += 10;
+              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+              methods[i].ml_doc = ndoc;
+            }
+          }
+        }
+      }
+    }
+  } 
+  
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------*
+ *  Partial Init method
+ * -----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+SWIGEXPORT 
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+  PyObject *m, *d, *md;
+#if PY_VERSION_HEX >= 0x03000000
+  static struct PyModuleDef SWIG_module = {
+# if PY_VERSION_HEX >= 0x03020000
+    PyModuleDef_HEAD_INIT,
+# else
+    {
+      PyObject_HEAD_INIT(NULL)
+      NULL, /* m_init */
+      0,    /* m_index */
+      NULL, /* m_copy */
+    },
+# endif
+    (char *) SWIG_name,
+    NULL,
+    -1,
+    SwigMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  };
+#endif
+  
+#if defined(SWIGPYTHON_BUILTIN)
+  static SwigPyClientData SwigPyObject_clientdata = {
+    0, 0, 0, 0, 0, 0, 0
+  };
+  static PyGetSetDef this_getset_def = {
+    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
+  };
+  static SwigPyGetSet thisown_getset_closure = {
+    (PyCFunction) SwigPyObject_own,
+    (PyCFunction) SwigPyObject_own
+  };
+  static PyGetSetDef thisown_getset_def = {
+    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
+  };
+  PyObject *metatype_args;
+  PyTypeObject *builtin_pytype;
+  int builtin_base_count;
+  swig_type_info *builtin_basetype;
+  PyObject *tuple;
+  PyGetSetDescrObject *static_getset;
+  PyTypeObject *metatype;
+  SwigPyClientData *cd;
+  PyObject *public_interface, *public_symbol;
+  PyObject *this_descr;
+  PyObject *thisown_descr;
+  int i;
+  
+  (void)builtin_pytype;
+  (void)builtin_base_count;
+  (void)builtin_basetype;
+  (void)tuple;
+  (void)static_getset;
+  
+  /* metatype is used to implement static member variables. */
+  metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
+  assert(metatype_args);
+  metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
+  assert(metatype);
+  Py_DECREF(metatype_args);
+  metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
+  assert(PyType_Ready(metatype) >= 0);
+#endif
+  
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+  
+#if PY_VERSION_HEX >= 0x03000000
+  m = PyModule_Create(&SWIG_module);
+#else
+  m = Py_InitModule((char *) SWIG_name, SwigMethods);
+#endif
+  md = d = PyModule_GetDict(m);
+  
+  SWIG_InitializeModule(0);
+  
+#ifdef SWIGPYTHON_BUILTIN
+  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
+  assert(SwigPyObject_stype);
+  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+  if (!cd) {
+    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
+    SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
+  } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
+    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
+# if PY_VERSION_HEX >= 0x03000000
+    return NULL;
+# else
+    return;
+# endif
+  }
+  
+  /* All objects have a 'this' attribute */
+  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
+  (void)this_descr;
+  
+  /* All objects have a 'thisown' attribute */
+  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
+  (void)thisown_descr;
+  
+  public_interface = PyList_New(0);
+  public_symbol = 0;
+  (void)public_symbol;
+  
+  PyDict_SetItemString(md, "__all__", public_interface);
+  Py_DECREF(public_interface);
+  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
+  for (i = 0; swig_const_table[i].name != 0; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
+#endif
+  
+  SWIG_InstallConstants(d,swig_const_table);
+  
+  SWIG_Python_SetConstant(d, "GEOS_VERSION_MAJOR",SWIG_From_int(static_cast< int >(3)));
+  SWIG_Python_SetConstant(d, "GEOS_VERSION_MINOR",SWIG_From_int(static_cast< int >(3)));
+  SWIG_Python_SetConstant(d, "GEOS_VERSION_PATCH",SWIG_From_int(static_cast< int >(7)));
+  SWIG_Python_SetConstant(d, "GEOS_VERSION",SWIG_FromCharPtr("3.3.7"));
+  SWIG_Python_SetConstant(d, "GEOS_JTS_PORT",SWIG_FromCharPtr("1.12.0"));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MAJOR",SWIG_From_int(static_cast< int >(1)));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MINOR",SWIG_From_int(static_cast< int >(7)));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_PATCH",SWIG_From_int(static_cast< int >(7)));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_FIRST_INTERFACE",SWIG_From_int(static_cast< int >(1)));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_LAST_INTERFACE",SWIG_From_int(static_cast< int >((1+7))));
+  SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION",SWIG_FromCharPtr("3.3.7-CAPI-1.7.7"));
+  SWIG_Python_SetConstant(d, "GEOS_POINT",SWIG_From_int(static_cast< int >(GEOS_POINT)));
+  SWIG_Python_SetConstant(d, "GEOS_LINESTRING",SWIG_From_int(static_cast< int >(GEOS_LINESTRING)));
+  SWIG_Python_SetConstant(d, "GEOS_LINEARRING",SWIG_From_int(static_cast< int >(GEOS_LINEARRING)));
+  SWIG_Python_SetConstant(d, "GEOS_POLYGON",SWIG_From_int(static_cast< int >(GEOS_POLYGON)));
+  SWIG_Python_SetConstant(d, "GEOS_MULTIPOINT",SWIG_From_int(static_cast< int >(GEOS_MULTIPOINT)));
+  SWIG_Python_SetConstant(d, "GEOS_MULTILINESTRING",SWIG_From_int(static_cast< int >(GEOS_MULTILINESTRING)));
+  SWIG_Python_SetConstant(d, "GEOS_MULTIPOLYGON",SWIG_From_int(static_cast< int >(GEOS_MULTIPOLYGON)));
+  SWIG_Python_SetConstant(d, "GEOS_GEOMETRYCOLLECTION",SWIG_From_int(static_cast< int >(GEOS_GEOMETRYCOLLECTION)));
+  SWIG_Python_SetConstant(d, "GEOS_WKB_XDR",SWIG_From_int(static_cast< int >(GEOS_WKB_XDR)));
+  SWIG_Python_SetConstant(d, "GEOS_WKB_NDR",SWIG_From_int(static_cast< int >(GEOS_WKB_NDR)));
+  
+  initGEOS(noticeHandler, errorHandler);
+  
+#if PY_VERSION_HEX >= 0x03000000
+  return m;
+#else
+  return;
+#endif
+}
+
diff --git a/swig/python/tests/Makefile.in b/swig/python/tests/Makefile.in
index 6f25234..1a7ab9b 100644
--- a/swig/python/tests/Makefile.in
+++ b/swig/python/tests/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/swig/ruby/Makefile.in b/swig/ruby/Makefile.in
index f58064f..2f729ff 100644
--- a/swig/ruby/Makefile.in
+++ b/swig/ruby/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -414,7 +414,7 @@ clean-rubyextensiondirLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-geos.la: $(geos_la_OBJECTS) $(geos_la_DEPENDENCIES) 
+geos.la: $(geos_la_OBJECTS) $(geos_la_DEPENDENCIES) $(EXTRA_geos_la_DEPENDENCIES) 
 	$(geos_la_LINK) $(am_geos_la_rpath) $(geos_la_OBJECTS) $(geos_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
diff --git a/swig/ruby/test/Makefile.in b/swig/ruby/test/Makefile.in
index 7acb090..c61c8a2 100644
--- a/swig/ruby/test/Makefile.in
+++ b/swig/ruby/test/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b086c33..64dcff8 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/bigtest/Makefile.in b/tests/bigtest/Makefile.in
index 1180cd9..b3efe57 100644
--- a/tests/bigtest/Makefile.in
+++ b/tests/bigtest/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -313,10 +313,10 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-TestSweepLineSpeed$(EXEEXT): $(TestSweepLineSpeed_OBJECTS) $(TestSweepLineSpeed_DEPENDENCIES) 
+TestSweepLineSpeed$(EXEEXT): $(TestSweepLineSpeed_OBJECTS) $(TestSweepLineSpeed_DEPENDENCIES) $(EXTRA_TestSweepLineSpeed_DEPENDENCIES) 
 	@rm -f TestSweepLineSpeed$(EXEEXT)
 	$(CXXLINK) $(TestSweepLineSpeed_OBJECTS) $(TestSweepLineSpeed_LDADD) $(LIBS)
-bug234$(EXEEXT): $(bug234_OBJECTS) $(bug234_DEPENDENCIES) 
+bug234$(EXEEXT): $(bug234_OBJECTS) $(bug234_DEPENDENCIES) $(EXTRA_bug234_DEPENDENCIES) 
 	@rm -f bug234$(EXEEXT)
 	$(CXXLINK) $(bug234_OBJECTS) $(bug234_LDADD) $(LIBS)
 
diff --git a/tests/geostest/Makefile.in b/tests/geostest/Makefile.in
index b20c37c..451ff35 100644
--- a/tests/geostest/Makefile.in
+++ b/tests/geostest/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -304,7 +304,7 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-geostest$(EXEEXT): $(geostest_OBJECTS) $(geostest_DEPENDENCIES) 
+geostest$(EXEEXT): $(geostest_OBJECTS) $(geostest_DEPENDENCIES) $(EXTRA_geostest_DEPENDENCIES) 
 	@rm -f geostest$(EXEEXT)
 	$(LINK) $(geostest_OBJECTS) $(geostest_LDADD) $(LIBS)
 
diff --git a/tests/perf/Makefile.in b/tests/perf/Makefile.in
index 217136f..e300d06 100644
--- a/tests/perf/Makefile.in
+++ b/tests/perf/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/perf/capi/Makefile.in b/tests/perf/capi/Makefile.in
index b3de4e8..34c6fb9 100644
--- a/tests/perf/capi/Makefile.in
+++ b/tests/perf/capi/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -297,7 +297,7 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-memleak_mp_prep$(EXEEXT): $(memleak_mp_prep_OBJECTS) $(memleak_mp_prep_DEPENDENCIES) 
+memleak_mp_prep$(EXEEXT): $(memleak_mp_prep_OBJECTS) $(memleak_mp_prep_DEPENDENCIES) $(EXTRA_memleak_mp_prep_DEPENDENCIES) 
 	@rm -f memleak_mp_prep$(EXEEXT)
 	$(LINK) $(memleak_mp_prep_OBJECTS) $(memleak_mp_prep_LDADD) $(LIBS)
 
diff --git a/tests/perf/operation/Makefile.in b/tests/perf/operation/Makefile.in
index 1838c5d..82c78db 100644
--- a/tests/perf/operation/Makefile.in
+++ b/tests/perf/operation/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/perf/operation/buffer/Makefile.in b/tests/perf/operation/buffer/Makefile.in
index e5a5b81..cd07cbc 100644
--- a/tests/perf/operation/buffer/Makefile.in
+++ b/tests/perf/operation/buffer/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -300,7 +300,7 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-IteratedBufferStressTest$(EXEEXT): $(IteratedBufferStressTest_OBJECTS) $(IteratedBufferStressTest_DEPENDENCIES) 
+IteratedBufferStressTest$(EXEEXT): $(IteratedBufferStressTest_OBJECTS) $(IteratedBufferStressTest_DEPENDENCIES) $(EXTRA_IteratedBufferStressTest_DEPENDENCIES) 
 	@rm -f IteratedBufferStressTest$(EXEEXT)
 	$(CXXLINK) $(IteratedBufferStressTest_OBJECTS) $(IteratedBufferStressTest_LDADD) $(LIBS)
 
diff --git a/tests/perf/operation/predicate/Makefile.in b/tests/perf/operation/predicate/Makefile.in
index d8b819f..83e6ee8 100644
--- a/tests/perf/operation/predicate/Makefile.in
+++ b/tests/perf/operation/predicate/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -299,7 +299,7 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-RectangleIntersectsPerfTest$(EXEEXT): $(RectangleIntersectsPerfTest_OBJECTS) $(RectangleIntersectsPerfTest_DEPENDENCIES) 
+RectangleIntersectsPerfTest$(EXEEXT): $(RectangleIntersectsPerfTest_OBJECTS) $(RectangleIntersectsPerfTest_DEPENDENCIES) $(EXTRA_RectangleIntersectsPerfTest_DEPENDENCIES) 
 	@rm -f RectangleIntersectsPerfTest$(EXEEXT)
 	$(CXXLINK) $(RectangleIntersectsPerfTest_OBJECTS) $(RectangleIntersectsPerfTest_LDADD) $(LIBS)
 
diff --git a/tests/thread/Makefile.in b/tests/thread/Makefile.in
index 61422e7..f795997 100644
--- a/tests/thread/Makefile.in
+++ b/tests/thread/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -305,10 +305,10 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-badthreadtest$(EXEEXT): $(badthreadtest_OBJECTS) $(badthreadtest_DEPENDENCIES) 
+badthreadtest$(EXEEXT): $(badthreadtest_OBJECTS) $(badthreadtest_DEPENDENCIES) $(EXTRA_badthreadtest_DEPENDENCIES) 
 	@rm -f badthreadtest$(EXEEXT)
 	$(LINK) $(badthreadtest_OBJECTS) $(badthreadtest_LDADD) $(LIBS)
-threadtest$(EXEEXT): $(threadtest_OBJECTS) $(threadtest_DEPENDENCIES) 
+threadtest$(EXEEXT): $(threadtest_OBJECTS) $(threadtest_DEPENDENCIES) $(EXTRA_threadtest_DEPENDENCIES) 
 	@rm -f threadtest$(EXEEXT)
 	$(LINK) $(threadtest_OBJECTS) $(threadtest_LDADD) $(LIBS)
 
diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am
index 30d9c7a..23f5491 100644
--- a/tests/unit/Makefile.am
+++ b/tests/unit/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 3527 2011-12-06 17:26:09Z strk $
+# $Id: Makefile.am 3685 2012-06-25 10:20:08Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -102,11 +102,13 @@ geos_unit_SOURCES = \
 	capi/GEOSCoordSeqTest.cpp \
 	capi/GEOSGeomFromWKBTest.cpp \
 	capi/GEOSGeomToWKTTest.cpp \
+	capi/GEOSGetCentroidTest.cpp \
 	capi/GEOSContainsTest.cpp \
 	capi/GEOSIntersectsTest.cpp \
 	capi/GEOSWithinTest.cpp \
 	capi/GEOSSimplifyTest.cpp \
 	capi/GEOSPreparedGeometryTest.cpp \
+  capi/GEOSPointOnSurfaceTest.cpp \
 	capi/GEOSPolygonizer_getCutEdgesTest.cpp \
 	capi/GEOSBufferTest.cpp \
 	capi/GEOSOffsetCurveTest.cpp \
diff --git a/tests/unit/Makefile.in b/tests/unit/Makefile.in
index d25abe9..3627fbb 100644
--- a/tests/unit/Makefile.in
+++ b/tests/unit/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -100,9 +100,11 @@ am_geos_unit_OBJECTS = geos_unit.$(OBJEXT) AngleTest.$(OBJEXT) \
 	TopologyPreservingSimplifierTest.$(OBJEXT) \
 	UniqueCoordinateArrayFilterTest.$(OBJEXT) \
 	GEOSCoordSeqTest.$(OBJEXT) GEOSGeomFromWKBTest.$(OBJEXT) \
-	GEOSGeomToWKTTest.$(OBJEXT) GEOSContainsTest.$(OBJEXT) \
-	GEOSIntersectsTest.$(OBJEXT) GEOSWithinTest.$(OBJEXT) \
-	GEOSSimplifyTest.$(OBJEXT) GEOSPreparedGeometryTest.$(OBJEXT) \
+	GEOSGeomToWKTTest.$(OBJEXT) GEOSGetCentroidTest.$(OBJEXT) \
+	GEOSContainsTest.$(OBJEXT) GEOSIntersectsTest.$(OBJEXT) \
+	GEOSWithinTest.$(OBJEXT) GEOSSimplifyTest.$(OBJEXT) \
+	GEOSPreparedGeometryTest.$(OBJEXT) \
+	GEOSPointOnSurfaceTest.$(OBJEXT) \
 	GEOSPolygonizer_getCutEdgesTest.$(OBJEXT) \
 	GEOSBufferTest.$(OBJEXT) GEOSOffsetCurveTest.$(OBJEXT) \
 	GEOSGeom_create.$(OBJEXT) \
@@ -308,7 +310,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# $Id: Makefile.am 3527 2011-12-06 17:26:09Z strk $
+# $Id: Makefile.am 3685 2012-06-25 10:20:08Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -404,11 +406,13 @@ geos_unit_SOURCES = \
 	capi/GEOSCoordSeqTest.cpp \
 	capi/GEOSGeomFromWKBTest.cpp \
 	capi/GEOSGeomToWKTTest.cpp \
+	capi/GEOSGetCentroidTest.cpp \
 	capi/GEOSContainsTest.cpp \
 	capi/GEOSIntersectsTest.cpp \
 	capi/GEOSWithinTest.cpp \
 	capi/GEOSSimplifyTest.cpp \
 	capi/GEOSPreparedGeometryTest.cpp \
+  capi/GEOSPointOnSurfaceTest.cpp \
 	capi/GEOSPolygonizer_getCutEdgesTest.cpp \
 	capi/GEOSBufferTest.cpp \
 	capi/GEOSOffsetCurveTest.cpp \
@@ -469,7 +473,7 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-geos_unit$(EXEEXT): $(geos_unit_OBJECTS) $(geos_unit_DEPENDENCIES) 
+geos_unit$(EXEEXT): $(geos_unit_OBJECTS) $(geos_unit_DEPENDENCIES) $(EXTRA_geos_unit_DEPENDENCIES) 
 	@rm -f geos_unit$(EXEEXT)
 	$(CXXLINK) $(geos_unit_OBJECTS) $(geos_unit_LDADD) $(LIBS)
 
@@ -504,10 +508,12 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSGeomToWKTTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSGeom_create.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSGeom_extractUniquePointsTest.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSGetCentroidTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSIntersectsTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSLineString_PointTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSOffsetCurveTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSOrientationIndex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSPointOnSurfaceTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSPolygonizer_getCutEdgesTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSPreparedGeometryTest.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GEOSRelateBoundaryNodeRuleTest.Po at am__quote@
@@ -1585,6 +1591,20 @@ GEOSGeomToWKTTest.obj: capi/GEOSGeomToWKTTest.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSGeomToWKTTest.obj `if test -f 'capi/GEOSGeomToWKTTest.cpp'; then $(CYGPATH_W) 'capi/GEOSGeomToWKTTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSGeomToWKTTest.cpp'; fi`
 
+GEOSGetCentroidTest.o: capi/GEOSGetCentroidTest.cpp
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSGetCentroidTest.o -MD -MP -MF $(DEPDIR)/GEOSGetCentroidTest.Tpo -c -o GEOSGetCentroidTest.o `test -f 'capi/GEOSGetCentroidTest.cpp' || echo '$(srcdir)/'`capi/GEOSGetCentroidTest.cpp
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSGetCentroidTest.Tpo $(DEPDIR)/GEOSGetCentroidTest.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='capi/GEOSGetCentroidTest.cpp' object='GEOSGetCentroidTest.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSGetCentroidTest.o `test -f 'capi/GEOSGetCentroidTest.cpp' || echo '$(srcdir)/'`capi/GEOSGetCentroidTest.cpp
+
+GEOSGetCentroidTest.obj: capi/GEOSGetCentroidTest.cpp
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSGetCentroidTest.obj -MD -MP -MF $(DEPDIR)/GEOSGetCentroidTest.Tpo -c -o GEOSGetCentroidTest.obj `if test -f 'capi/GEOSGetCentroidTest.cpp'; then $(CYGPATH_W) 'capi/GEOSGetCentroidTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSGetCentroidTest.cpp'; fi`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSGetCentroidTest.Tpo $(DEPDIR)/GEOSGetCentroidTest.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='capi/GEOSGetCentroidTest.cpp' object='GEOSGetCentroidTest.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSGetCentroidTest.obj `if test -f 'capi/GEOSGetCentroidTest.cpp'; then $(CYGPATH_W) 'capi/GEOSGetCentroidTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSGetCentroidTest.cpp'; fi`
+
 GEOSContainsTest.o: capi/GEOSContainsTest.cpp
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSContainsTest.o -MD -MP -MF $(DEPDIR)/GEOSContainsTest.Tpo -c -o GEOSContainsTest.o `test -f 'capi/GEOSContainsTest.cpp' || echo '$(srcdir)/'`capi/GEOSContainsTest.cpp
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSContainsTest.Tpo $(DEPDIR)/GEOSContainsTest.Po
@@ -1655,6 +1675,20 @@ GEOSPreparedGeometryTest.obj: capi/GEOSPreparedGeometryTest.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSPreparedGeometryTest.obj `if test -f 'capi/GEOSPreparedGeometryTest.cpp'; then $(CYGPATH_W) 'capi/GEOSPreparedGeometryTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSPreparedGeometryTest.cpp'; fi`
 
+GEOSPointOnSurfaceTest.o: capi/GEOSPointOnSurfaceTest.cpp
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSPointOnSurfaceTest.o -MD -MP -MF $(DEPDIR)/GEOSPointOnSurfaceTest.Tpo -c -o GEOSPointOnSurfaceTest.o `test -f 'capi/GEOSPointOnSurfaceTest.cpp' || echo '$(srcdir)/'`capi/GEOSPointOnSurfaceTest.cpp
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSPointOnSurfaceTest.Tpo $(DEPDIR)/GEOSPointOnSurfaceTest.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='capi/GEOSPointOnSurfaceTest.cpp' object='GEOSPointOnSurfaceTest.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSPointOnSurfaceTest.o `test -f 'capi/GEOSPointOnSurfaceTest.cpp' || echo '$(srcdir)/'`capi/GEOSPointOnSurfaceTest.cpp
+
+GEOSPointOnSurfaceTest.obj: capi/GEOSPointOnSurfaceTest.cpp
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSPointOnSurfaceTest.obj -MD -MP -MF $(DEPDIR)/GEOSPointOnSurfaceTest.Tpo -c -o GEOSPointOnSurfaceTest.obj `if test -f 'capi/GEOSPointOnSurfaceTest.cpp'; then $(CYGPATH_W) 'capi/GEOSPointOnSurfaceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSPointOnSurfaceTest.cpp'; fi`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSPointOnSurfaceTest.Tpo $(DEPDIR)/GEOSPointOnSurfaceTest.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='capi/GEOSPointOnSurfaceTest.cpp' object='GEOSPointOnSurfaceTest.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GEOSPointOnSurfaceTest.obj `if test -f 'capi/GEOSPointOnSurfaceTest.cpp'; then $(CYGPATH_W) 'capi/GEOSPointOnSurfaceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/capi/GEOSPointOnSurfaceTest.cpp'; fi`
+
 GEOSPolygonizer_getCutEdgesTest.o: capi/GEOSPolygonizer_getCutEdgesTest.cpp
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GEOSPolygonizer_getCutEdgesTest.o -MD -MP -MF $(DEPDIR)/GEOSPolygonizer_getCutEdgesTest.Tpo -c -o GEOSPolygonizer_getCutEdgesTest.o `test -f 'capi/GEOSPolygonizer_getCutEdgesTest.cpp' || echo '$(srcdir)/'`capi/GEOSPolygonizer_getCutEdgesTest.cpp
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/GEOSPolygonizer_getCutEdgesTest.Tpo $(DEPDIR)/GEOSPolygonizer_getCutEdgesTest.Po
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSGetCentroidTest.cpp
similarity index 52%
copy from tests/unit/capi/GEOSOffsetCurveTest.cpp
copy to tests/unit/capi/GEOSGetCentroidTest.cpp
index e2b84a8..e4f0ddc 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSGetCentroidTest.cpp
@@ -1,6 +1,6 @@
 // $Id$
 // 
-// Test Suite for C-API GEOSOffsetCurve
+// Test Suite for C-API GEOSGetCentroid
 
 #include <tut.hpp>
 // geos
@@ -18,7 +18,7 @@ namespace tut
     //
 
     // Common data used in test cases.
-    struct test_capioffsetcurve_data
+    struct test_capicentroid_data
     {
         GEOSGeometry* geom1_;
         GEOSGeometry* geom2_;
@@ -38,15 +38,16 @@ namespace tut
             std::fprintf(stdout, "\n");
         }
 
-        test_capioffsetcurve_data()
+        test_capicentroid_data()
             : geom1_(0), geom2_(0), wkt_(0)
         {
             initGEOS(notice, notice);
             wktw_ = GEOSWKTWriter_create();
             GEOSWKTWriter_setTrim(wktw_, 1);
+            GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
         }       
 
-        ~test_capioffsetcurve_data()
+        ~test_capicentroid_data()
         {
             GEOSGeom_destroy(geom1_);
             GEOSGeom_destroy(geom2_);
@@ -60,35 +61,35 @@ namespace tut
 
     };
 
-    typedef test_group<test_capioffsetcurve_data> group;
+    typedef test_group<test_capicentroid_data> group;
     typedef group::object object;
 
-    group test_capioffsetcurve_group("capi::GEOSOffsetCurve");
+    group test_capicentroid_group("capi::GEOSGetCentroid");
 
     //
     // Test Cases
     //
 
-    // Straight, left
+    // Single point
     template<>
     template<>
     void object::test<1>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
+        geom1_ = GEOSGeomFromWKT("POINT(10 0)");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 2, 0, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSGetCentroid(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string( "LINESTRING (0 2, 10 2)"));
+        ensure_equals(std::string(wkt_), std::string( "POINT (10 0)"));
 
     }
 
-    // Straight, right
+    // line
     template<>
     template<>
     void object::test<2>()
@@ -97,96 +98,76 @@ namespace tut
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, -2, 0, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSGetCentroid(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (10 -2, 0 -2)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (5 0)"));
+
     }
 
-    // Outside curve
+    // polygon
     template<>
     template<>
     void object::test<3>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
+        geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, -2, 1, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSGetCentroid(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (12 10, 12 0, 10 -2, 0 -2)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (5 5)"));
+
     }
 
-    // Inside curve
+    // Tiny triangle, see http://trac.osgeo.org/geos/ticket/559
     template<>
     template<>
     void object::test<4>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
+        geom1_ = GEOSGeomFromWKT(
+"POLYGON(( \
+56.528666666700 25.2101666667, \
+56.529000000000 25.2105000000, \
+56.528833333300 25.2103333333, \
+56.528666666700 25.2101666667))");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 2, 1, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSGetCentroid(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (0 2, 8 2, 8 10)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (56.528833 25.210333)" ) );
+
     }
 
-    // See http://trac.osgeo.org/postgis/ticket/413
+    // Empty geometry -- see http://trac.osgeo.org/geos/ticket/560
     template<>
     template<>
     void object::test<5>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(33282908 6005055,33282900 6005050,33282892 6005042,33282876 6005007,33282863 6004982,33282866 6004971,33282876 6004975,33282967 6005018,33282999 6005031)");
+        geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 44, 1, GEOSBUF_JOIN_MITRE, 1);
+        geom2_ = GEOSGetCentroid(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING EMPTY"
-        ));
-    }
-
-    // 0 distance
-    // See http://trac.osgeo.org/postgis/ticket/454
-    template<>
-    template<>
-    void object::test<6>()
-    {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
-
-        ensure( 0 != geom1_ );
-
-        geom2_ = GEOSOffsetCurve(geom1_, 0, 0, GEOSBUF_JOIN_ROUND, 2);
-
-        ensure( 0 != geom2_ );
-
-        wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
+        ensure_equals(std::string(wkt_), std::string( "POINT EMPTY"));
 
-        ensure_equals(std::string(wkt_), std::string(
-          "LINESTRING (0 0, 10 0)"
-        ));
     }
 
 } // namespace tut
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
similarity index 55%
copy from tests/unit/capi/GEOSOffsetCurveTest.cpp
copy to tests/unit/capi/GEOSPointOnSurfaceTest.cpp
index e2b84a8..0849ff4 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
@@ -1,6 +1,6 @@
 // $Id$
 // 
-// Test Suite for C-API GEOSOffsetCurve
+// Test Suite for C-API GEOSPointOnSurface
 
 #include <tut.hpp>
 // geos
@@ -18,7 +18,7 @@ namespace tut
     //
 
     // Common data used in test cases.
-    struct test_capioffsetcurve_data
+    struct test_capipointonsurface_data
     {
         GEOSGeometry* geom1_;
         GEOSGeometry* geom2_;
@@ -38,15 +38,16 @@ namespace tut
             std::fprintf(stdout, "\n");
         }
 
-        test_capioffsetcurve_data()
+        test_capipointonsurface_data()
             : geom1_(0), geom2_(0), wkt_(0)
         {
             initGEOS(notice, notice);
             wktw_ = GEOSWKTWriter_create();
             GEOSWKTWriter_setTrim(wktw_, 1);
+            GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
         }       
 
-        ~test_capioffsetcurve_data()
+        ~test_capipointonsurface_data()
         {
             GEOSGeom_destroy(geom1_);
             GEOSGeom_destroy(geom2_);
@@ -60,133 +61,131 @@ namespace tut
 
     };
 
-    typedef test_group<test_capioffsetcurve_data> group;
+    typedef test_group<test_capipointonsurface_data> group;
     typedef group::object object;
 
-    group test_capioffsetcurve_group("capi::GEOSOffsetCurve");
+    group test_capipointonsurface_group("capi::GEOSPointOnSurface");
 
     //
     // Test Cases
     //
 
-    // Straight, left
+    // Single point
     template<>
     template<>
     void object::test<1>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
+        geom1_ = GEOSGeomFromWKT("POINT(10 0)");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 2, 0, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string( "LINESTRING (0 2, 10 2)"));
+        ensure_equals(std::string(wkt_), std::string( "POINT (10 0)"));
 
     }
 
-    // Straight, right
+    // line
     template<>
     template<>
     void object::test<2>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
+        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 5 0, 10 0)");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, -2, 0, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (10 -2, 0 -2)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (5 0)"));
+
     }
 
-    // Outside curve
+    // polygon
     template<>
     template<>
     void object::test<3>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
+        geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, -2, 1, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (12 10, 12 0, 10 -2, 0 -2)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (5 5)"));
+
     }
 
-    // Inside curve
+    // Tiny triangle, see http://trac.osgeo.org/geos/ticket/559
     template<>
     template<>
     void object::test<4>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 10 10)");
+        geom1_ = GEOSGeomFromWKT(
+"POLYGON(( \
+56.528666666700 25.2101666667, \
+56.529000000000 25.2105000000, \
+56.528833333300 25.2103333333, \
+56.528666666700 25.2101666667))");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 2, 1, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING (0 2, 8 2, 8 10)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (56.528833 25.210333)" ) );
+
     }
 
-    // See http://trac.osgeo.org/postgis/ticket/413
+    // Empty geometry -- see http://trac.osgeo.org/geos/ticket/560
     template<>
     template<>
     void object::test<5>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(33282908 6005055,33282900 6005050,33282892 6005042,33282876 6005007,33282863 6004982,33282866 6004971,33282876 6004975,33282967 6005018,33282999 6005031)");
+        geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 44, 1, GEOSBUF_JOIN_MITRE, 1);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-"LINESTRING EMPTY"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT EMPTY"));
     }
 
-    // 0 distance
-    // See http://trac.osgeo.org/postgis/ticket/454
+    // Single point linestring -- see http://trac.osgeo.org/geos/ticket/609
     template<>
     template<>
     void object::test<6>()
     {
-        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
+        geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 0)");
 
         ensure( 0 != geom1_ );
 
-        geom2_ = GEOSOffsetCurve(geom1_, 0, 0, GEOSBUF_JOIN_ROUND, 2);
+        geom2_ = GEOSPointOnSurface(geom1_);
 
         ensure( 0 != geom2_ );
 
         wkt_ = GEOSWKTWriter_write(wktw_, geom2_);
 
-        ensure_equals(std::string(wkt_), std::string(
-          "LINESTRING (0 0, 10 0)"
-        ));
+        ensure_equals(std::string(wkt_), std::string( "POINT (0 0)"));
+
     }
 
 } // namespace tut
diff --git a/tests/unit/capi/GEOSUnaryUnionTest.cpp b/tests/unit/capi/GEOSUnaryUnionTest.cpp
index 5161338..531d23b 100644
--- a/tests/unit/capi/GEOSUnaryUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionTest.cpp
@@ -193,5 +193,20 @@ namespace tut
 ));
     }
 
+    // Self-union a geometry with NaN coordinates
+    // See http://trac.osgeo.org/geos/ticket/530
+    template<>
+    template<>
+    void object::test<9>()
+    {
+	const char* hexwkb = "010200000002000000000000000000F8FF000000000000F8FF0000000000000000000000000000F03F";
+        geom1_ = GEOSGeomFromHEX_buf((const unsigned char*)hexwkb, std::strlen(hexwkb));
+        ensure( 0 != geom1_ );
+
+        geom2_ = GEOSUnaryUnion(geom1_);
+	ensure( 0 == geom2_ );
+
+    }
+
 } // namespace tut
 
diff --git a/tests/unit/capi/GEOSisValidDetailTest.cpp b/tests/unit/capi/GEOSisValidDetailTest.cpp
index bbd2921..bd3deec 100644
--- a/tests/unit/capi/GEOSisValidDetailTest.cpp
+++ b/tests/unit/capi/GEOSisValidDetailTest.cpp
@@ -119,7 +119,13 @@ namespace tut
       strToUpper(wkt);
       ensure_equals(r, 0); // invalid
       ensure_equals(std::string(reason_), std::string("Invalid Coordinate"));
-      ensure_equals(wkt, "POINT (NAN -5)");
+      std::string exp1 = "POINT (NAN -5)";
+      std::string exp2 = "POINT (-1#IND -5)";
+      std::stringstream ss;
+      ss << "Expected '" << exp1 << "' or '" << exp2 << "', Obtained '" << wkt;
+      ensure(ss.str(),
+        wkt == "POINT (NAN -5)" ||
+        wkt == "POINT (-1#IND -5)");
     }
 
     // Self intersecting ring forming hole
diff --git a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
index 0a6d14d..121c04b 100644
--- a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
+++ b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp
@@ -1,6 +1,6 @@
-// $Id: TopologyPreservingSimplifierTest.cpp 3574 2012-03-22 08:34:59Z strk $
-// 
 // Test Suite for geos::simplify::TopologyPreservingSimplifier
+//
+// Last port: junit/simplify/TopologyPreservingSimplifierTest.java r536
 
 #include <tut.hpp>
 #include <utility.h>
@@ -50,10 +50,91 @@ namespace tut
 	// Test Cases
 	//
 
+  // EmptyPolygon
+  template<>
+  template<>
+  void object::test<1>()
+  {
+    std::string wkt("POLYGON EMPTY");
+
+    GeomPtr g(wktreader.read(wkt));
+    GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
+
+    ensure( "Simplified geometry is invalid!", simplified->isValid() );
+    ensure_equals_geometry(g.get(), simplified.get() );
+  }
+
+  // Point
+  template<>
+  template<>
+  void object::test<2>()
+  {
+    std::string wkt("POINT (10 10)");
+
+    GeomPtr g(wktreader.read(wkt));
+    GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
+
+    ensure( "Simplified geometry is invalid!", simplified->isValid() );
+    ensure_equals_geometry(g.get(), simplified.get() );
+  }
+
+#if 0 // Fails with JTS too !
+	// MultiPolygonWithSmallComponents
+  // Test is from http://postgis.refractions.net/pipermail/postgis-users/2008-April/019327.html
+	template<>
+	template<>
+	void object::test<3>()
+	{
+		std::string wkt(
+    "MULTIPOLYGON(((13.73095 51.024734,13.7309323 51.0247668,13.7306959 51.0247959,13.7292724 51.0249742,13.7280216 51.0251252,13.7266598 51.0252998,13.7259617 51.0254072,13.7258854 51.0254201,13.7253253 51.0255144,13.725276 51.025492,13.724538 51.025631,13.7230288 51.0259021,13.7223529 51.0260273,13.7223299 51.0260863,13.7222292 51.026391,13.7220002 51.0273366,13.7217875 51.0282094,13.721746 51.028243,13.7217693 51.0282803,13.7215512 51.0291967,13.721513 51.029222,13.7215203 51.0292567,13.7212713 51.0295967,13.7222258 51.0299532,13.722234 51.03,13.7222931 51.0299823,13.7232514 51.0303187,13.7242514 51.0306715,13.724263 51.030714,13.7243024 51.0306951,13.7249934 51.0309315,13.7265097 51.0314552,13.7266116 51.0313952,13.7267988 51.0313334,13.7269952 51.0313243,13.72703 51.0314107,13.7271637 51.0313254,13.7272524 51.0313839,13.72739 51.031449,13.7276768 51.0313074,13.7283793 51.0309944,13.7296654 51.0304157,13.7297572 51.0303637,13.729845 51.0303139,13.7299557 51.0301763,13.7300964 51.0300176,13.730252 51.0298919,13.7304615 51.0297932,13.730668 51.0297363,13.730743 51.029783,13.7307859 51.0298398,13.7307094 51.0301388,13.730624 51.030263,13.7306955 51.0303267,13.7301182 51.0325594,13.7300528 51.0325663,13.7301114 51.0327342,13.7301645 51.0329094,13.7300035 51.0327693,13.7299669 51.0327351,13.7299445 51.0327211,13.7298934 51.032814,13.7298539 51.0328585,13.7297737 51.0328321,13.7288526 51.0325639,13.7288201 51.0324367,13.7284426 51.0324383,13.7276461 51.032179,13.7274569 51.0321976,13.7272787 51.0322421,13.7271265 51.0322903,13.7267034 51.0322495,13.7265364 51.0322161,13.7259018 51.0324269,13.7258649 51.03242,13.725733 51.0326646,13.7251933 51.0328876,13.7247918 51.0331374,13.7244439 51.0331106,13.7242967 51.0334273,13.7239131 51.0337529,13.7237035 51.0338511,13.7235429 51.033967,13.7233375 51.0339148,13.7232064 51.0339347,13.7231786 51.0339863,13.7228848 51.0340776,13.7224481 51.0341888,13.7220471 51.0342483,13.7217493 51.0343198,13.721552 51.0343861,13.7214718 51.0344095,13.7215108 51.034534,13.7205032 51.0349932,13.7197657 51.0352983,13.7195764 51.0352291,13.7195934 51.0352797,13.7182451 51.0359157,13.7181108 51.0359003,13.7181657 51.0359571,13.717622 51.0361956,13.7159749 51.0369683,13.7159057 51.0369284,13.7158604 51.0370288,13.7157161 51.0370124,13.7157523 51.0370733,13.7153708 51.0372801,13.7150274 51.0374899,13.7144074 51.0379192,13.7138287 51.0383899,13.7137514 51.0383857,13.7137492 51.0384566,13.7134249 51.0387269,13.7130179 51.0390385,13.7125791 51.0393343,13.7120736 51.039611,13.7115839 51.0398558,13.7112945 51.0399894,13.7114637 51.0402313,13.7123153 51.041449,13.7126333 51.0417033,13.713371 51.0421453,13.7138861 51.0424061,13.7142518 51.0425683,13.7164587 51.0435668,13.7167995 51.0437957,13.7170883 51.0439897,13.7190694 51.0451663,13.7196131 51.0458277,13.7197562 51.0461521,13.7198262 51.0464192,13.7198377 51.0467389,13.7205681 51.0455573,13.7210009 51.0450379,13.7214987 51.0445401,13.7220306 51.0442859,13.7227215 51.0439558,13.7237962 51.0434514,13.723979 51.0435278,13.7241448 51.0435041,13.7241052 51.0436042,13.7247987 51.0438896,13.7250186 51.0439093,13.7250579 51.0440386,13.7257225 51.0443545,13.7259312 51.0443456,13.725955 51.0443813,13.7260235 51.0443873,13.7260682 51.0445303,13.7282191 51.0455848,13.7290532 51.045927,13.7292643 51.0458591,13.7292228 51.0459969,13.729706 51.0461854,13.7303185 51.046393,13.7309107 51.0465601,13.731546 51.0466841,13.7321939 51.0467752,13.7332896 51.0468999,13.7333733 51.0469094,13.7334778 51.0468127,13.7335706 51.0469078,13.733651 51.0470684,13.7338458 51.0471508,13.7346109 51.0472333,13.7346367 51.0471474,13.7346922 51.0470697,13.7346666 51.0470056,13.7346564 51.0468714,13.7345552 51.0467095,13.7336001 51.0465496,13.733427 51.046454,13.7335317 51.0464255,13.7347225 51.0465948,13.7348421 51.0466562,13.7349123 51.0466203,13.736811 51.0468537,13.7382043 51.0469796,13.7383487 51.0469803,13.7394909 51.0469005,13.7400899 51.0467949,13.7405051 51.0464739,13.7408331 51.0462204,13.7412027 51.0463256,13.741053 51.0466451,13.7407291 51.0469007,13.7405095 51.0469726,13.7400888 51.0470337,13.7393051 51.0471049,13.7393014 51.0472015,13.7393088 51.0473019,13.7395556 51.0473056,13.7404944 51.0472245,13.740932 51.0470192,13.7414421 51.0465652,13.7414893 51.0465576,13.7416494 51.0464916,13.7416003 51.0466074,13.7416246 51.04663,13.741668 51.0466443,13.7417272 51.0467159,13.7417503 51.0466716,13.7423587 51.0468732,13.7426958 51.0470246,13.7429143 51.0471813,13.74318 51.04726,13.7430363 51.0472995,13.7433021 51.047588,13.7434678 51.0475916,13.7433805 51.0477019,13.7436362 51.0479981,13.7446308 51.0491622,13.7447961 51.0491827,13.744722 51.0492509,13.7448536 51.0494078,13.745056 51.0494766,13.7450313 51.0496901,13.7453573 51.0500052,13.7465317 51.0512807,13.7466999 51.0513722,13.746638 51.0514149,13.7468683 51.0516781,13.7470071 51.051777,13.7469985 51.0518746,13.7470732 51.0519866,13.7471316 51.0520528,13.7472989 51.0523089,13.7472368 51.0523858,13.7473063 51.0524932,13.7473468 51.0527412,13.7473392 51.0531614,13.7472987 51.0533157,13.7473919 51.0534224,13.7472684 51.0534549,13.7472134 51.0536926,13.7472913 51.0537784,13.7473216 51.053725,13.7474649 51.0537575,13.7474492 51.053833,13.7475625 51.0537839,13.7497379 51.0544435,13.7515333 51.0551019,13.7527693 51.0555438,13.7549766 51.0564993,13.7550622 51.0565364,13.755105 51.0566612,13.7552745 51.0566237,13.7558661 51.0560648,13.7559318 51.0560101,13.755908 51.055897,13.7559252 51.0558292,13.7559566 51.0557055,13.7564494 51.0551377,13.7564124 51.0550457,13.7573213 51.0539813,13.7575007 51.0539933,13.757856 51.0540047,13.7580394 51.054028,13.7580896 51.053984,13.7580949 51.0539463,13.7579963 51.0538534,13.7581294 51.0537147,13.7582346 51.0535957,13.758354 51.053433,13.758363 51.053392,13.7583656 51.0533457,13.758359 51.0532095,13.7583338 51.0530937,13.7582902 51.0529647,13.7580365 51.0522637,13.7577683 51.051463,13.7573182 51.0501993,13.7571595 51.0497164,13.7567579 51.0490095,13.7563383 51.0482979,13.7557757 51.0473383,13.7557095 51.0472522,13.7555771 51.0471199,13.7554448 51.0470471,13.7548596 51.0462612,13.7547097 51.046054,13.7549127 51.0460086,13.7548633 51.0459174,13.7548127 51.0458413,13.7547176 51.0457237,13.7538293 51.0449222,13.7530218 51.0441346,13.7526711 51.0437838,13.752446 51.0435522,13.7522297 51.0433547,13.751704 51.042833,13.7513058 51.0424448,13.7505766 51.0417281,13.7499967 51.0411283,13.7497695 51.0408943,13.7493849 51.0405205,13.7486222 51.0397896,13.7478209 51.0390261,13.7477474 51.0389532,13.7477041 51.0389189,13.7476277 51.0388729,13.7475781 51.0388513,13.7472699 51.038726,13.747131 51.0386506,13.7469329 51.0385052,13.7468562 51.0384284,13.7466683 51.0383483,13.7467998 51.038236,13.7473841 51.0380129,13.747838 51.0378277,13.7481801 51.0376558,13.7489728 51.0370285,13.7491313 51.0368016,13.7492665 51.0363477,13.7493166 51.0359389,13.7492966 51.0358087,13.7493888 51.0356942,13.7492867 51.0357016,13.7492855 51.0354359,13.7492829 51.034867,13.7492723 51.0348311,13.7492455 51.0347398,13.7493034 51.0346612,13.7491987 51.0346142,13.748866 51.034723,13.748791 51.034201,13.748335 51.034159,13.748294 51.034034,13.748205 51.033764,13.7488691 51.0333037,13.748962 51.033245,13.7486777 51.0332252,13.7483008 51.032683,13.7484397 51.0324582,13.7469913 51.0327817,13.7466998 51.0326205,13.7459997 51.0314852,13.7460996 51.0313569,13.745967 51.0314864,13.7449355 51.0317377,13.7447301 51.0316513,13.7446705 51.0318463,13.7420262 51.0323659,13.7419131 51.0322884,13.7418636 51.0322552,13.7416501 51.0321425,13.7415567 51.0317708,13.7414972 51.0314666,13.741484 51.0311492,13.741923 51.031003,13.7418649 51.030884,13.74209 51.0304134,13.7422077 51.0300143,13.7421975 51.0299222,13.742286 51.029835,13.7421463 51.0297533,13.7420951 51.0296254,13.7415933 51.0288452,13.7414906 51.0286855,13.7414437 51.0286127,13.7413482 51.0284642,13.7410545 51.0280777,13.7407158 51.0277229,13.7401513 51.0273842,13.7392803 51.0270293,13.7382744 51.0267844,13.737321 51.0267454,13.7365929 51.0267541,13.736556 51.026812,13.7364715 51.026754,13.7357088 51.0268017,13.7353967 51.02678,13.73534 51.02685,13.7352667 51.0267757,13.734907 51.0267324,13.734824 51.02679,13.7347684 51.0267064,13.7342093 51.0266674,13.73409 51.026725,13.7340359 51.0266283,13.7335072 51.0265633,13.733407 51.02663,13.7333208 51.0265373,13.7317087 51.0263813,13.7317173 51.0263119,13.73167 51.026241,13.7317563 51.0261602,13.7318473 51.0258395,13.7318647 51.0254971,13.73183 51.0253281,13.7317736 51.0252414,13.731663 51.025181,13.7316826 51.0251114,13.7310803 51.0247604,13.73095 51.024734)),((13.7368533 51.0470386,13.7368426 51.0471226,13.7368067 51.0472669,13.7368255 51.0473828,13.7369099 51.0474154,13.7376695 51.0474677,13.7382756 51.0474245,13.738513 51.0474297,13.7386105 51.0474065,13.738705 51.0473737,13.7385856 51.0473757,13.7385618 51.0473751,13.7385263 51.0473743,13.7384706 51.0473744,13.7383071 51.0473734,13.7383822 51.0473564,13.7390821 51.047287,13.7390933 51.047209,13.7390933 51.0471421,13.7368533 51.0470386)),((13.7367293 51.0470057,13.7346615 51.0466892,13.7347551 51.0468411,13.7347754 51.0470359,13.7347106 51.0471899,13.7356421 51.0472919,13.7366963 51.0474074,13.736705 51.047249,13.7367293 51.0470057)))"
+      );
+
+    GeomPtr g(wktreader.read(wkt));
+		GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 0.0057);
+
+		ensure( "Simplified geometry is invalid!", simplified->isValid() );
+
+	}
+#endif // fails with JTS too
+
+	// PolygonWithSpike
+	template<>
+	template<>
+	void object::test<4>()
+	{         
+		std::string wkt("POLYGON ((3312459.605 6646878.353, \
+      3312460.524 6646875.969, 3312459.427 6646878.421, \
+      3312460.014 6646886.391, 3312465.889 6646887.398, \
+      3312470.827 6646884.839, 3312475.4 6646878.027, \
+      3312477.289 6646871.694, 3312472.748 6646869.547, \
+      3312468.253 6646874.01, 3312463.52 6646875.779, \
+      3312459.605 6646878.353))");
+
+		std::string wkt_expected("POLYGON (( \
+      3312459.605 6646878.353, \
+      3312460.524 6646875.969, \
+      3312459.427 6646878.421, \
+      3312460.014 6646886.391, \
+      3312465.889 6646887.398, \
+      3312470.827 6646884.839, \
+      3312477.289 6646871.694, \
+      3312472.748 6646869.547, \
+      3312459.605 6646878.353))");
+
+    GeomPtr g(wktreader.read(wkt));
+		GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 2.0);
+
+		ensure( "Simplified geometry is invalid!", simplified->isValid() );
+
+    GeomPtr g_expected(wktreader.read(wkt_expected));
+    ensure( g_expected->equalsExact(simplified.get()) );
+
+	}
+
 	// PolygonNoReduction
 	template<>
 	template<>
-	void object::test<1>()
+	void object::test<5>()
 	{         
 		std::string wkt("POLYGON((20 220, 40 220, 60 220, 80 220, \
                     100 220, 120 220, 140 220, 140 180, 100 180, \
@@ -67,15 +148,15 @@ namespace tut
         ensure_equals_geometry( g.get(), simplified.get() );
 	}
 
-    // PolygonNoReductionWithConflicts
+  // PolygonNoReductionWithConflicts
 	template<>
 	template<>
-	void object::test<2>()
+	void object::test<6>()
 	{
-        std::string wkt("POLYGON ((40 240, 160 241, 280 240, 280 160, \
+    std::string wkt("POLYGON ((40 240, 160 241, 280 240, 280 160, \
                         160 240, 40 140, 40 240))");
     
-        GeomPtr g(wktreader.read(wkt));
+    GeomPtr g(wktreader.read(wkt));
 		GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
 
 		ensure( "Simplified geometry is invalid!", simplified->isValid() );
@@ -86,7 +167,7 @@ namespace tut
     // PolygonWithTouchingHole
 	template<>
 	template<>
-	void object::test<3>()
+	void object::test<7>()
 	{
         std::string wkt("POLYGON ((80 200, 240 200, 240 60, 80 60, 80 200), \
                     (120 120, 220 120, 180 199, 160 200, 140 199, 120 120))");
@@ -108,7 +189,7 @@ namespace tut
     // FlattishPolygon
 	template<>
 	template<>
-	void object::test<4>()
+	void object::test<8>()
 	{
         std::string wkt("POLYGON ((0 0, 50 0, 53 0, 55 0, 100 0, \
                     70 1, 60 1, 50 1, 40 1, 0 0))");
@@ -123,7 +204,7 @@ namespace tut
     // PolygonWithFlattishHole
     template<>
 	template<>
-	void object::test<5>()
+	void object::test<9>()
 	{
         std::string wkt("POLYGON ((0 0, 0 200, 200 200, 200 0, 0 0), \
                     (140 40, 90 95, 40 160, 95 100, 140 40))");
@@ -141,7 +222,7 @@ namespace tut
     // TinySquare
     template<>
 	template<>
-	void object::test<6>()
+	void object::test<10>()
 	{
         std::string wkt("POLYGON ((0 5, 5 5, 5 0, 0 0, 0 1, 0 5))");
 
@@ -152,24 +233,38 @@ namespace tut
         ensure_equals_geometry( g.get(), simplified.get() );
     }
 
-    // TinyLineString
-    template<>
+  // TinyLineString
+  template<>
 	template<>
-	void object::test<7>()
+	void object::test<11>()
 	{
-        std::string wkt("LINESTRING (0 5, 1 5, 2 5, 5 5)");
+    std::string wkt("LINESTRING (0 5, 1 5, 2 5, 5 5)");
 
-        GeomPtr g(wktreader.read(wkt));
+    GeomPtr g(wktreader.read(wkt));
 		GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
 
 		ensure( "Simplified geometry is invalid!", simplified->isValid() );
-        ensure_equals_geometry(g.get(), simplified.get() );
-    }
+    ensure_equals_geometry(g.get(), simplified.get() );
+  }
 
-    // MultiPoint
-    template<>
+  // TinyClosedLineString
+  template<>
+  template<>
+  void object::test<12>()
+  {
+    std::string wkt("LINESTRING (0 0, 5 0, 5 5, 0 0)");
+
+    GeomPtr g(wktreader.read(wkt));
+    GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
+
+    ensure( "Simplified geometry is invalid!", simplified->isValid() );
+    ensure_equals_geometry(g.get(), simplified.get() );
+  }
+
+  // MultiPoint
+  template<>
 	template<>
-	void object::test<8>()
+	void object::test<13>()
 	{
         std::string wkt("MULTIPOINT(80 200, 240 200, 240 60, \
                     80 60, 80 200, 140 199, 120 120)");
@@ -184,7 +279,7 @@ namespace tut
     // MultiLineString
     template<>
 	template<>
-	void object::test<9>()
+	void object::test<14>()
 	{
         std::string wkt("MULTILINESTRING((0 0, 50 0, 70 0, 80 0, 100 0), \
                     (0 0, 50 1, 60 1, 100 0))");
@@ -199,7 +294,7 @@ namespace tut
     // GeometryCollection
     template<>
 	template<>
-	void object::test<10>()
+	void object::test<15>()
 	{
         std::string wkt("GEOMETRYCOLLECTION ( \
                     MULTIPOINT (80 200, 240 200, 240 60, 80 60, 80 200, 140 199, 120 120), \
@@ -217,7 +312,7 @@ namespace tut
     // See http://trac.osgeo.org/geos/ticket/519
     template<>
     template<>
-    void object::test<11>()
+    void object::test<16>()
     {
         std::string wkt("GEOMETRYCOLLECTION ( \
                     LINESTRING (0 0, 10 0), POLYGON EMPTY)");
@@ -226,8 +321,8 @@ namespace tut
         GeomPtr simp= TopologyPreservingSimplifier::simplify(g.get(), 1);
 
         ensure( "Simplified geometry is invalid!", simp->isValid() );
-	ensure_equals(wktwriter.write(simp.get()),
-		"GEOMETRYCOLLECTION (LINESTRING (0 0, 10 0))");
+        ensure_equals(wktwriter.write(simp.get()),
+          "GEOMETRYCOLLECTION (LINESTRING (0 0, 10 0))");
     }
 } // namespace tut
 
diff --git a/tests/xmltester/Makefile.am b/tests/xmltester/Makefile.am
index 1f8d544..103b3a4 100644
--- a/tests/xmltester/Makefile.am
+++ b/tests/xmltester/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 3552 2011-12-15 14:18:38Z strk $
+# $Id: Makefile.am 3774 2013-02-28 09:45:21Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -33,7 +33,11 @@ SAFE_XMLTESTS=$(srcdir)/tests/testLeaksBig.xml \
 	$(srcdir)/tests/ticket/bug392.xml \
 	$(srcdir)/tests/ticket/bug398.xml \
 	$(srcdir)/tests/ticket/bug434.xml \
-	$(srcdir)/tests/ticket/bug488.xml \
+	$(srcdir)/tests/ticket/bug527.xml \
+	$(srcdir)/tests/ticket/bug582.xml \
+	$(srcdir)/tests/ticket/bug586.xml \
+	$(srcdir)/tests/ticket/bug599.xml \
+	$(srcdir)/tests/ticket/bug615.xml \
 	$(srcdir)/tests/general/TestBoundary.xml \
 	$(srcdir)/tests/general/TestBuffer.xml \
 	$(srcdir)/tests/general/TestBufferMitredJoin.xml \
@@ -87,7 +91,8 @@ SAFE_XMLTESTS=$(srcdir)/tests/testLeaksBig.xml \
 INVALID_OUTPUT_XMLTESTS = 
 
 FAILING_XMLTESTS = \
-	$(srcdir)/tests/failure/TestOverlay.xml
+	$(srcdir)/tests/failure/TestOverlay.xml \
+	$(srcdir)/tests/ticket/bug488.xml 
 
 XMLTESTS=$(SAFE_XMLTESTS) $(INVALID_OUTPUT_XMLTESTS) $(FAILING_XMLTESTS)
 
diff --git a/tests/xmltester/Makefile.in b/tests/xmltester/Makefile.in
index 1d268ab..0516667 100644
--- a/tests/xmltester/Makefile.in
+++ b/tests/xmltester/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,7 +15,7 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 3552 2011-12-15 14:18:38Z strk $
+# $Id: Makefile.am 3774 2013-02-28 09:45:21Z strk $
 #
 # This file is part of project GEOS (http://trac.osgeo.org/geos/) 
 #
@@ -298,7 +298,11 @@ SAFE_XMLTESTS = $(srcdir)/tests/testLeaksBig.xml \
 	$(srcdir)/tests/ticket/bug392.xml \
 	$(srcdir)/tests/ticket/bug398.xml \
 	$(srcdir)/tests/ticket/bug434.xml \
-	$(srcdir)/tests/ticket/bug488.xml \
+	$(srcdir)/tests/ticket/bug527.xml \
+	$(srcdir)/tests/ticket/bug582.xml \
+	$(srcdir)/tests/ticket/bug586.xml \
+	$(srcdir)/tests/ticket/bug599.xml \
+	$(srcdir)/tests/ticket/bug615.xml \
 	$(srcdir)/tests/general/TestBoundary.xml \
 	$(srcdir)/tests/general/TestBuffer.xml \
 	$(srcdir)/tests/general/TestBufferMitredJoin.xml \
@@ -351,7 +355,8 @@ SAFE_XMLTESTS = $(srcdir)/tests/testLeaksBig.xml \
 
 INVALID_OUTPUT_XMLTESTS = 
 FAILING_XMLTESTS = \
-	$(srcdir)/tests/failure/TestOverlay.xml
+	$(srcdir)/tests/failure/TestOverlay.xml \
+	$(srcdir)/tests/ticket/bug488.xml 
 
 XMLTESTS = $(SAFE_XMLTESTS) $(INVALID_OUTPUT_XMLTESTS) $(FAILING_XMLTESTS)
 # -lmpatrol -lbfd -lintl -liberty -limagehlp
@@ -420,10 +425,10 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-SimpleWKTTester$(EXEEXT): $(SimpleWKTTester_OBJECTS) $(SimpleWKTTester_DEPENDENCIES) 
+SimpleWKTTester$(EXEEXT): $(SimpleWKTTester_OBJECTS) $(SimpleWKTTester_DEPENDENCIES) $(EXTRA_SimpleWKTTester_DEPENDENCIES) 
 	@rm -f SimpleWKTTester$(EXEEXT)
 	$(CXXLINK) $(SimpleWKTTester_OBJECTS) $(SimpleWKTTester_LDADD) $(LIBS)
-XMLTester$(EXEEXT): $(XMLTester_OBJECTS) $(XMLTester_DEPENDENCIES) 
+XMLTester$(EXEEXT): $(XMLTester_OBJECTS) $(XMLTester_DEPENDENCIES) $(EXTRA_XMLTester_DEPENDENCIES) 
 	@rm -f XMLTester$(EXEEXT)
 	$(CXXLINK) $(XMLTester_OBJECTS) $(XMLTester_LDADD) $(LIBS)
 
diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index c2fa50d..0063b26 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: XMLTester.cpp 3531 2011-12-09 08:46:06Z strk $
+ * $Id: XMLTester.cpp 3745 2013-01-14 11:05:23Z strk $
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
@@ -74,11 +74,8 @@
 #include "Stackwalker.h"
 #endif
 
-// Undefine this to use Geometry methods for overlay operations
-//
-// Using BinaryOp gives more successes though...
-//
-#define USE_BINARYOP 1
+// Geometry methods do use BinaryOp internally
+#undef USE_BINARYOP
 
 using namespace geos;
 using namespace geos::operation::polygonize;
@@ -1136,7 +1133,7 @@ XMLTester::parseTest(const TiXmlNode* node)
 
 			GeomAutoPtr gRealRes(gT->getInteriorPoint());
 			if ( gRealRes.get() ) gRealRes->normalize();
-			else gRealRes.reset(factory->createGeometryCollection());
+			else gRealRes.reset(factory->createPoint());
 
 			if (gRes->compareTo(gRealRes.get())==0) success=1;
 
diff --git a/tests/xmltester/tests/general/TestInteriorPoint.xml b/tests/xmltester/tests/general/TestInteriorPoint.xml
index bb98367..fc5944b 100644
--- a/tests/xmltester/tests/general/TestInteriorPoint.xml
+++ b/tests/xmltester/tests/general/TestInteriorPoint.xml
@@ -2,6 +2,12 @@
   <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
 
 <case>
+  <desc>P - empty</desc>
+  <a>    POINT EMPTY  </a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT EMPTY   </op></test>
+</case>
+
+<case>
   <desc>P - single point</desc>
   <a>    POINT(10 10)  </a>
 <test><op name="getInteriorPoint" arg1="A" >    POINT(10 10)   </op></test>
@@ -9,7 +15,7 @@
 
 <case>
   <desc>P - single point</desc>
-  <a>    MULTIPOINT (60 300, 200 200, 240 240, 200 300, 40 140, 80 240, 140 240, 100 160, 140 200, 60 200)
+  <a>    MULTIPOINT ((60 300), (200 200), (240 240), (200 300), (40 140), (80 240), (140 240), (100 160), (140 200), (60 200))
 	</a>
 <test><op name="getInteriorPoint" arg1="A" >    POINT (140 240)   </op></test>
 </case>
@@ -29,6 +35,18 @@
 </case>
 
 <case>
+  <desc>L - zero length line</desc>
+  <a>    LINESTRING (10 10, 10 10)  </a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (10 10)   </op></test>
+</case>
+
+<case>
+  <desc>mL - zero length lines</desc>
+  <a>    MULTILINESTRING ((10 10, 10 10), (20 20, 20 20))  </a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (10 10)   </op></test>
+</case>
+
+<case>
   <desc>mL - complex linestrings</desc>
   <a>    MULTILINESTRING ((60 240, 140 300, 180 200, 40 140, 100 100, 120 220), 
   (240 80, 260 160, 200 240, 180 340, 280 340, 240 180, 180 140, 40 200, 140 260))
@@ -44,14 +62,60 @@
 </case>
 
 <case>
+  <desc>A - empty</desc>
+  <a>    POLYGON EMPTY
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT EMPTY   </op></test>
+</case>
+
+<case>
+  <desc>A - polygon with horizontal segment at centre (L shape)</desc>
+  <a>    POLYGON ((0 2, 0 4, 6 4, 6 0, 2 0, 2 2, 0 2))
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (4 2)   </op></test>
+</case>
+
+<case>
   <desc>mA - polygons with holes</desc>
-  <a>    MULTIPOLYGON (((60 320, 240 340, 260 100, 20 60, 120 180, 60 320), 
-  (200 280, 140 260, 180 160, 240 140, 200 280)), 
-  ((380 280, 300 260, 340 100, 440 80, 380 280), 
-    (380 220, 340 200, 400 100, 380 220)))
+  <a>    MULTIPOLYGON (((50 260, 240 340, 260 100, 20 60, 90 140, 50 260), (200 280, 140 240, 180 160, 240 140, 200 280)), ((380 280, 300 260, 340 100, 440 80, 380 280), (380 220, 340 200, 400 100, 380 220)))
 	</a>
-<test><op name="getInteriorPoint" arg1="A" >    POINT (138 200)  </op></test>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (115 200)  </op></test>
 </case>
 
+<case>
+  <desc>GC - collection of polygons, lines, points</desc>
+  <a>    GEOMETRYCOLLECTION (POLYGON ((0 40, 40 40, 40 0, 0 0, 0 40)), 
+  LINESTRING (80 0, 80 80, 120 40), 
+  MULTIPOINT ((20 60), (40 80), (60 60)))
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (20 20)   </op></test>
+</case>
+
+<case>
+  <desc>GC - collection of zero-area polygons and lines</desc>
+  <a>    GEOMETRYCOLLECTION (POLYGON ((10 10, 10 10, 10 10, 10 10)), 
+  LINESTRING (20 20, 30 30))
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (10 10)   </op></test>
+</case>
+
+<case>
+  <desc>GC - collection of zero-area polygons and zero-length lines</desc>
+  <a>    GEOMETRYCOLLECTION (POLYGON ((10 10, 10 10, 10 10, 10 10)), 
+  LINESTRING (20 20, 20 20))
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (10 10)   </op></test>
+</case>
+
+<case>
+  <desc>GC - collection of zero-area polygons, zero-length lines, and points</desc>
+  <a>    GEOMETRYCOLLECTION (POLYGON ((10 10, 10 10, 10 10, 10 10)), 
+  LINESTRING (20 20, 20 20),
+  MULTIPOINT ((20 10), (10 20)) )
+	</a>
+<test><op name="getInteriorPoint" arg1="A" >    POINT (10 10)   </op></test>
+</case>
+
+
 
 </run>
diff --git a/tests/xmltester/tests/ticket/bug527.xml b/tests/xmltester/tests/ticket/bug527.xml
new file mode 100644
index 0000000..6d7b544
--- /dev/null
+++ b/tests/xmltester/tests/ticket/bug527.xml
@@ -0,0 +1,27 @@
+
+<run>
+  <precisionModel type="FLOATING" />
+
+  <case>
+    <desc>
+Bogus noding
+http://trac.osgeo.org/geos/ticket/527
+    </desc>
+    <a>
+LINESTRING(
+ 1725063 4819121,
+ 1725064.14183882 4819094.70208557,
+ 1725064.13656044 4819094.70235069,
+ 1725064.14210362 4819094.70227252,
+ 1725064.13656043 4819094.70235069,
+ 1725063 4819121
+)
+    </a>
+    <test>
+      <op name='union' arg1='A' >
+MULTILINESTRING ((1725064.1365604456514120 4819094.7023506900295615, 1725064.1365604463499039 4819094.7023506900295615), (1725064.1418305356055498 4819094.7022763714194298, 1725064.1418388199526817 4819094.7020855704322457, 1725064.1365604465827346 4819094.7023506900295615), (1725064.1418305356055498 4819094.7022763714194298, 1725064.1421036201063544 4819094.7022725204005837), (1725064.1365604465827346 4819094.7023506900295615, 1725064.1418305356055498 4819094.7022763714194298), (1725064.1365604465827346 4819094.7023506900295615, 1725064.1365604463499039 4819094.7023506900295615), (1725064.1365604440215975 4819094.7023506900295615, 1725064.1365604400634766 4819094.7023506900295615), (1725064.1365604456514120 4819094.7023506900295615, 1725064.1365604440215975 4819094.7023506900295615), (1725063.0000000000000000 4819121.0000000000000000, 1725064.1418305356055498 4819094.7022763714194298), (1725064.1365604400634766 4819094.7023506900295615, 1725064.1365604300517589 4819094.7023506900295615, 1725063.0000000000000000 4819121.0000000000000000))
+      </op>
+    </test>
+  </case>
+
+</run>
diff --git a/tests/xmltester/tests/ticket/bug582.xml b/tests/xmltester/tests/ticket/bug582.xml
new file mode 100644
index 0000000..781c606
--- /dev/null
+++ b/tests/xmltester/tests/ticket/bug582.xml
@@ -0,0 +1,13 @@
+<run>
+  <precisionModel scale="1.0" offsetx="0.0" offsety="0.0"/>
+
+<case>
+  <desc>GC - overlapping polygons </desc>
+  <a>
+  MULTIPOLYGON(EMPTY,((0 0,1 0,1 1,0 1, 0 0)))
+	</a>
+<test><op name="getCentroid" arg1="A" >    POINT (0.5 0.5)   </op></test>
+</case>
+
+
+</run>
diff --git a/tests/xmltester/tests/ticket/bug586.xml b/tests/xmltester/tests/ticket/bug586.xml
new file mode 100644
index 0000000..10a2929
--- /dev/null
+++ b/tests/xmltester/tests/ticket/bug586.xml
@@ -0,0 +1,21 @@
+<run>
+<precisionModel type="FLOATING" />
+
+<case>
+<desc>
+http://trac.osgeo.org/geos/ticket/586
+</desc>
+  <a>
+ 01060000000100000001030000000100000007000000FC9C4034A1C957C029FEFB19D9684A40F1502ADE523F56C061588FDD786C4C40417FBC44E19552C0D08D9DDB067C464089A1316892B753C02DCD95C08B6E4540BB379A190BBD54C058F25D2DADFE4440314E4AB97BC857C0C042B6CF69B74840FC9C4034A1C957C029FEFB19D9684A40
+  </a>
+  <b>
+0102000020E61000001A0000009D11A5BDC19754C005172B6A305D454008944DB9C29754C0A1B94E232D5D454044FAEDEBC09754C07099D365315D45409D11A5BDC19754C05A0D897B2C5D454012DA722EC59754C07099D365315D4540793BC269C19754C07EE36BCF2C5D454008944DB9C29754C0936FB6B9315D4540C0E78711C29754C03012DA722E5D454020240B98C09754C0459E245D335D4540E4BD6A65C29754C0697407B1335D45409D11A5BDC19754C03012DA722E5D45408481E7DEC39754C0B745990D325D4540793BC269C19754C03012DA722E5D45402B6A300DC39754C04CC3F011315D454020240B98C09754C0697407B1335D454008944DB9C29754C0DA1B7C61325D454020240B98C09754C0A1B94E232D5D45402B6A300DC39754C0B745990D325D45409D11A5BDC19754C0C58F31772D5D4540D97745F0BF9754C0B745990D325D4540C0E78711C29754C04CC3F011315D4540793BC269C19754C01361C3D32B5D4540FD4D2844C09754C0BE6A65C22F5D454008944DB9C29754C0B745990D325D454020240B98C09754C03737A6272C5D4540C0E78711C29754C077BE9F1A2F5D4540
+  </b>
+<test>
+  <op name="intersection" arg1="A" arg2="B">
+ 0105000000EC000000010200000003000000AB2D26D9C09754C0454791C32D5D4540FD4D2844C09754C0BE6A65C22F5D4540249292AFC09754C02777A626305D4540010200000003000000C536AFDEC09754C0EBDE96B02D5D454020240B98C09754C0A1B94E232D5D4540AB2D26D9C09754C0454791C32D5D4540010200000003000000E6DF4401C19754C052634670335D454020240B98C09754C0697407B1335D454012DC3BDBC09754C088055C69335D454001020000000300000001E30A0DC19754C0F9B4A5112D5D454020240B98C09754C03737A6272C5D4540B47885FEC09754C06E216F432D5D45400102000000030000008225D927C19754C05544CB7D315D4540D97745F0BF9754C0B745990D325D4540249292AFC09754C02777A626305D45400102000000030000008225D927C19754C05544CB7D315D454020240B98C09754C0459E245D335D454012DC3BDBC09754C088055C69335D4540010200000003000000A9F7A63BC19754C03C2B64A9305D454044FAEDEBC09754C07099D365315D4540A8F3D611C19754C019C15D82305D4540010200000003000000BAB7DC8EC19754C01B4397FC2C5D4540793BC269C19754C01361C3D32B5D454001E30A0DC19754C0F9B4A5112D5D45400102000000030000000FF8C694C19754C0AFA6BD702D5D4540793BC269C19754C07EE36BCF2C5D4540BAB7DC8EC19754C01B4397FC2C5D45400102000000030000000FC48C03C29754C0C5A517A2305D4540C0E78711C29754C04CC3F011315D4540C4995FCDC19754C099D36531315D45400102000000030000006693640BC29754C006D64F872E5D45409D11A5BDC19754C0C58F31772D5D4540888753A6C19754C0B5C08CB22D5D454001020000000300000075E0D019C29754C0B7ED469C2E5D4540C0E78711C29754C03012DA722E5D45406693640BC29754C006D64F872E5D4540010200000003000000E8327644C29754C08B1C63A9325D4540E4BD6A65C29754C0697407B1335D4540E6DF4401C19754C052634670335D4540010200000003000000BD4CEB75C29754C0B65E27FC2F5D45408481E7DEC39754C0B745990D325D4540BD28DC48C29754C0B460725E2F5D45400102000000030000009B406982C29754C0A7C45DDA315D454008944DB9C29754C0DA1B7C61325D4540E8327644C29754C08B1C63A9325D454001020000000300000058D7BD86C29754C04103D19A2D5D45409D11A5BDC19754C05A0D897B2C5D4540CA60DFA3C19754C04F322B162D5D4540010200000003000000EE07068FC29754C0485F8498315D454008944DB9C29754C0B745990D325D45409B406982C29754C0A7C45DDA315D454001020000000300000020A80991C29754C0A77686A92D5D454008944DB9C29754C0A1B94E232D5D454058D7BD86C29754C04103D19A2D5D454001020000000300000020A80991C29754C0A77686A92D5D454012DA722EC59754C07099D365315D4540CC20F971C29754C069E412112E5D4540010200000003000000DBC165ACC29754C0B2542F79315D454008944DB9C29754C0936FB6B9315D4540405D0CA9C29754C025E2C17C315D4540010200000003000000A0DB14D6C29754C0D0D2B84C315D45402B6A300DC39754C0B745990D325D45402A6C20BBC29754C0B4497969315D4540010200000003000000A0DB14D6C29754C0D0D2B84C315D45402B6A300DC39754C04CC3F011315D454036C7BC88C29754C05E8B043E305D4540010200000002000000C536AFDEC09754C0EBDE96B02D5D4540AB2D26D9C09754C0454791C32D5D4540010200000002000000B47885FEC09754C06E216F432D5D4540C536AFDEC09754C0EBDE96B02D5D4540010200000002000000E6DF4401C19754C052634670335D454012DC3BDBC09754C088055C69335D454001020000000200000001E30A0DC19754C0F9B4A5112D5D4540B47885FEC09754C06E216F432D5D4540010200000002000000A8F3D611C19754C019C15D82305D4540249292AFC09754C02777A626305D4540010200000002000000A9F7A63BC19754C03C2B64A9305D4540A8F3D611C19754C019C15D82305D454001020000000200000019EC0E3EC19754C02C92F5BB2E5D4540249292AFC09754C02777A626305D454001020000000200000019EC0E3EC19754C02C92F5BB2E5D4540AB2D26D9C09754C0454791C32D5D4540010200000002000000DE48EA4EC19754C01E030D912E5D4540C536AFDEC09754C0EBDE96B02D5D4540010200000002000000DE48EA4EC19754C01E030D912E5D454019EC0E3EC19754C02C92F5BB2E5D45400102000000020000000AE96754C19754C0CC00F8F22E5D4540A8F3D611C19754C019C15D82305D45400102000000020000000AE96754C19754C0CC00F8F22E5D454019EC0E3EC19754C02C92F5BB2E5D45400102000000020000005C55F65DC19754C028FA69C9305D45408225D927C19754C05544CB7D315D45400102000000020000005C55F65DC19754C028FA69C9305D4540A9F7A63BC19754C03C2B64A9305D4540010200000002000000B5E0455FC19754C0CB32C4B12E5D4540DE48EA4EC19754C01E030D912E5D4540010200000002000000B5E0455FC19754C0CB32C4B12E5D45400AE96754C19754C0CC00F8F22E5D45400102000000020000008063CC63C19754C054BFE45B2E5D4540B47885FEC09754C06E216F432D5D45400102000000020000008063CC63C19754C054BFE45B2E5D4540DE48EA4EC19754C01E030D912E5D4540010200000002000000793BC269C19754C03012DA722E5D4540B5E0455FC19754C0CB32C4B12E5D4540010200000002000000AB9B7E6AC19754C006D16F6E2E5D45408063CC63C19754C054BFE45B2E5D4540010200000002000000AB9B7E6AC19754C006D16F6E2E5D4540793BC269C19754C03012DA722E5D45400102000000020000006C6EB66EC19754C0A5181E7A2E5D4540793BC269C19754C03012DA722E5D45400102000000020000006C6EB66EC19754C0A5181E7A2E5D4540AB9B7E6AC19754C006D16F6E2E5D4540010200000002000000EE0C476FC19754C08694AE7B2E5D4540793BC269C19754C03012DA722E5D4540010200000002000000EE0C476FC19754C08694AE7B2E5D45406C6EB66EC19754C0A5181E7A2E5D454001020000000200000063DECB74C19754C0B540A0302E5D45408063CC63C19754C054BFE45B2E5D454001020000000200000063DECB74C19754C0B540A0302E5D4540AB9B7E6AC19754C006D16F6E2E5D454001020000000200000002F1BA7EC19754C0FBD005F52D5D454001E30A0DC19754C0F9B4A5112D5D454001020000000200000002F1BA7EC19754C0FBD005F52D5D454063DECB74C19754C0B540A0302E5D45400102000000020000003EAD4786C19754C072491F042E5D454063DECB74C19754C0B540A0302E5D45400102000000020000003EAD4786C19754C072491F042E5D454002F1BA7EC19754C0FBD005F52D5D45400102000000020000000FF8C694C19754C0AFA6BD702D5D454002F1BA7EC19754C0FBD005F52D5D45400102000000020000004491B199C19754C06E0F3E532D5D4540BAB7DC8EC19754C01B4397FC2C5D45400102000000020000004491B199C19754C06E0F3E532D5D45400FF8C694C19754C0AFA6BD702D5D4540010200000002000000F14324A3C19754C07BA5C7B42F5D4540A9F7A63BC19754C03C2B64A9305D4540010200000002000000F14324A3C19754C07BA5C7B42F5D45400AE96754C19754C0CC00F8F22E5D4540010200000002000000CA60DFA3C19754C04F322B162D5D4540BAB7DC8EC19754C01B4397FC2C5D4540010200000002000000CA60DFA3C19754C04F322B162D5D45404491B199C19754C06E0F3E532D5D4540010200000002000000BFF0F8A4C19754C0440B79AD2D5D45400FF8C694C19754C0AFA6BD702D5D4540010200000002000000BFF0F8A4C19754C0440B79AD2D5D45404491B199C19754C06E0F3E532D5D45400102000000020000001BD9C7A5C19754C0264EF0B32D5D45403EAD4786C19754C072491F042E5D45400102000000020000001BD9C7A5C19754C0264EF0B32D5D4540BFF0F8A4C19754C0440B79AD2D5D4540010200000002000000888753A6C19754C0B5C08CB22D5D4540BFF0F8A4C19754C0440B79AD2D5D4540010200000002000000888753A6C19754C0B5C08CB22D5D45401BD9C7A5C19754C0264EF0B32D5D4540010200000002000000B0FF15ABC19754C065C255C82F5D45405C55F65DC19754C028FA69C9305D4540010200000002000000B0FF15ABC19754C065C255C82F5D4540F14324A3C19754C07BA5C7B42F5D45400102000000020000009D11A5BDC19754C03012DA722E5D45403EAD4786C19754C072491F042E5D45400102000000020000009D11A5BDC19754C03012DA722E5D45401BD9C7A5C19754C0264EF0B32D5D45400102000000020000009D11A5BDC19754C03012DA722E5D45409D11A5BDC19754C03112DA722E5D4540010200000002000000137664BFC19754C0875D01722F5D4540B5E0455FC19754C0CB32C4B12E5D4540010200000002000000137664BFC19754C0875D01722F5D4540F14324A3C19754C07BA5C7B42F5D4540010200000002000000D6ADFFBFC19754C0F5F3AE852E5D45409D11A5BDC19754C03112DA722E5D4540010200000002000000FF3EE3C2C19754C05FEFFE782F5D4540B0FF15ABC19754C065C255C82F5D4540010200000002000000FF3EE3C2C19754C05FEFFE782F5D4540137664BFC19754C0875D01722F5D4540010200000002000000B4BB28C4C19754C00A16BD662F5D4540EE0C476FC19754C08694AE7B2E5D4540010200000002000000B4BB28C4C19754C00A16BD662F5D4540137664BFC19754C0875D01722F5D454001020000000200000035D474C6C19754C0AAA8196D2F5D4540FF3EE3C2C19754C05FEFFE782F5D454001020000000200000035D474C6C19754C0AAA8196D2F5D4540B4BB28C4C19754C00A16BD662F5D4540010200000002000000C4995FCDC19754C099D36531315D45408225D927C19754C05544CB7D315D4540010200000002000000C4995FCDC19754C099D36531315D45405C55F65DC19754C028FA69C9305D454001020000000200000051F379D0C19754C0D31F81092F5D45406C6EB66EC19754C0A5181E7A2E5D454001020000000200000051F379D0C19754C0D31F81092F5D4540D6ADFFBFC19754C0F5F3AE852E5D454001020000000200000052F379D0C19754C0D41F81092F5D4540D6ADFFBFC19754C0F5F3AE852E5D454001020000000200000052F379D0C19754C0D41F81092F5D454051F379D0C19754C0D31F81092F5D45400102000000020000007439B0D1C19754C0E43C5B27305D4540B0FF15ABC19754C065C255C82F5D45400102000000020000007439B0D1C19754C0E43C5B27305D45409D11A5BDC19754C005172B6A305D454001020000000200000024C79DD2C19754C08D2991442F5D4540B4BB28C4C19754C00A16BD662F5D454001020000000200000024C79DD2C19754C08D2991442F5D454035D474C6C19754C0AAA8196D2F5D454001020000000200000025C79DD2C19754C077BE9F1A2F5D4540EE0C476FC19754C08694AE7B2E5D454001020000000200000025C79DD2C19754C077BE9F1A2F5D454051F379D0C19754C0D31F81092F5D454001020000000200000026C79DD2C19754C078BE9F1A2F5D454052F379D0C19754C0D41F81092F5D454001020000000200000026C79DD2C19754C078BE9F1A2F5D454025C79DD2C19754C077BE9F1A2F5D45400102000000020000007A3251D6C19754C01A193B382F5D454024C79DD2C19754C08D2991442F5D45400102000000020000007A3251D6C19754C01A193B382F5D454025C79DD2C19754C077BE9F1A2F5D45400102000000020000007A3251D6C19754C019193B382F5D454026C79DD2C19754C078BE9F1A2F5D45400102000000020000007A3251D6C19754C019193B382F5D45407A3251D6C19754C01A193B382F5D454001020000000200000037D8A9D6C19754C00347003B2F5D454024C79DD2C19754C08D2991442F5D454001020000000200000037D8A9D6C19754C00347003B2F5D45407A3251D6C19754C01A193B382F5D454001020000000200000037D8A9D6C19754C00247003B2F5D45407A3251D6C19754C019193B382F5D454001020000000200000037D8A9D6C19754C00247003B2F5D454037D8A9D6C19754C00347003B2F5D454001020000000200000018481EDBC19754C061263A282F5D454026C79DD2C19754C078BE9F1A2F5D454001020000000200000018481EDBC19754C061263A282F5D45407A3251D6C19754C019193B382F5D454001020000000200000074C232DDC19754C05B1D8E2B2F5D454037D8A9D6C19754C00247003B2F5D454001020000000200000074C232DDC19754C05B1D8E2B2F5D454018481EDBC19754C061263A282F5D4540010200000002000000E36444DEC19754C0BB1BBB1D2F5D454052F379D0C19754C0D41F81092F5D4540010200000002000000E36444DEC19754C0BB1BBB1D2F5D454018481EDBC19754C061263A282F5D4540010200000002000000DF0033DFC19754C01F739EB12F5D4540FF3EE3C2C19754C05FEFFE782F5D4540010200000002000000DF0033DFC19754C01F739EB12F5D454035D474C6C19754C0AAA8196D2F5D45400102000000020000009F7C37E1C19754C0DF930E222F5D454074C232DDC19754C05B1D8E2B2F5D45400102000000020000009F7C37E1C19754C0DF930E222F5D4540E36444DEC19754C0BB1BBB1D2F5D4540010200000002000000AE7C96E7C19754C0BD6A65C22F5D454037D8A9D6C19754C00347003B2F5D4540010200000002000000AE7C96E7C19754C0BD6A65C22F5D4540DF0033DFC19754C01F739EB12F5D4540010200000002000000AF7C96E7C19754C0BF6A65C22F5D454037D8A9D6C19754C00247003B2F5D4540010200000002000000AF7C96E7C19754C0BF6A65C22F5D4540AE7C96E7C19754C0BD6A65C22F5D4540010200000002000000845783E8C19754C06641CCC92F5D4540AE7C96E7C19754C0BD6A65C22F5D4540010200000002000000845783E8C19754C06641CCC92F5D4540AF7C96E7C19754C0BF6A65C22F5D4540010200000002000000204BD2E8C19754C051DE43CC2F5D4540204BD2E8C19754C052DE43CC2F5D4540010200000002000000204BD2E8C19754C050DE43CC2F5D4540204BD2E8C19754C052DE43CC2F5D4540010200000002000000204BD2E8C19754C050DE43CC2F5D4540204BD2E8C19754C051DE43CC2F5D4540010200000002000000204BD2E8C19754C04FDE43CC2F5D4540204BD2E8C19754C050DE43CC2F5D4540010200000002000000204BD2E8C19754C04EDE43CC2F5D4540204BD2E8C19754C04FDE43CC2F5D4540010200000002000000204BD2E8C19754C04DDE43CC2F5D4540204BD2E8C19754C04EDE43CC2F5D4540010200000002000000204BD2E8C19754C04CDE43CC2F5D4540204BD2E8C19754C04DDE43CC2F5D4540010200000002000000204BD2E8C19754C04BDE43CC2F5D4540204BD2E8C19754C04CDE43CC2F5D4540010200000002000000204BD2E8C19754C04ADE43CC2F5D4540204BD2E8C19754C04BDE43CC2F5D4540010200000002000000204BD2E8C19754C048DE43CC2F5D4540204BD2E8C19754C04ADE43CC2F5D4540010200000002000000204BD2E8C19754C047DE43CC2F5D4540204BD2E8C19754C048DE43CC2F5D4540010200000002000000204BD2E8C19754C046DE43CC2F5D4540204BD2E8C19754C047DE43CC2F5D4540010200000002000000204BD2E8C19754C045DE43CC2F5D4540204BD2E8C19754C046DE43CC2F5D4540010200000002000000204BD2E8C19754C044DE43CC2F5D4540204BD2E8C19754C045DE43CC2F5D4540010200000002000000204BD2E8C19754C043DE43CC2F5D4540845783E8C19754C06641CCC92F5D4540010200000002000000204BD2E8C19754C043DE43CC2F5D4540204BD2E8C19754C044DE43CC2F5D4540010200000002000000204BD2E8C19754C042DE43CC2F5D4540DF0033DFC19754C01F739EB12F5D4540010200000002000000204BD2E8C19754C042DE43CC2F5D4540845783E8C19754C06641CCC92F5D4540010200000002000000204BD2E8C19754C042DE43CC2F5D4540204BD2E8C19754C044DE43CC2F5D4540010200000002000000204BD2E8C19754C042DE43CC2F5D4540204BD2E8C19754C043DE43CC2F5D45400102000000020000007AB60BE9C19754C01D390FCE2F5D4540204BD2E8C19754C052DE43CC2F5D45400102000000020000007AB60BE9C19754C01D390FCE2F5D4540204BD2E8C19754C051DE43CC2F5D454001020000000200000091190EEAC19754C0D75122D62F5D45407439B0D1C19754C0E43C5B27305D454001020000000200000091190EEAC19754C0D75122D62F5D45407AB60BE9C19754C01D390FCE2F5D454001020000000200000092190EEAC19754C0D65122D62F5D45407AB60BE9C19754C01D390FCE2F5D454001020000000200000092190EEAC19754C0D65122D62F5D454091190EEAC19754C0D75122D62F5D454001020000000200000085CA1CEBC19754C0FF039CD22F5D4540204BD2E8C19754C052DE43CC2F5D454001020000000200000085CA1CEBC19754C0FF039CD22F5D454092190EEAC19754C0D65122D62F5D454001020000000200000011AAD4ECC19754C083C5E1CC2F5D4540AF7C96E7C19754C0BF6A65C22F5D454001020000000200000011AAD4ECC19754C083C5E1CC2F5D454085CA1CEBC19754C0FF039CD22F5D4540010200000002000000BC879AF0C19754C0780117C92E5D4540888753A6C19754C0B5C08CB22D5D4540010200000002000000BC879AF0C19754C0780117C92E5D45409D11A5BDC19754C03012DA722E5D454001020000000200000073D712F2C19754C0DC9DB5DB2E5D45409D11A5BDC19754C03112DA722E5D454001020000000200000073D712F2C19754C0DC9DB5DB2E5D4540E36444DEC19754C0BB1BBB1D2F5D45400102000000020000001D8DECF3C19754C0A4958AD52E5D4540BC879AF0C19754C0780117C92E5D45400102000000020000001D8DECF3C19754C0A4958AD52E5D454073D712F2C19754C0DC9DB5DB2E5D4540010200000002000000329548F5C19754C0B57A02D12E5D4540BC879AF0C19754C0780117C92E5D4540010200000002000000329548F5C19754C0B57A02D12E5D45401D8DECF3C19754C0A4958AD52E5D45400102000000020000004B6910F9C19754C08EC1B0E92E5D45409F7C37E1C19754C0DF930E222F5D45400102000000020000004B6910F9C19754C08EC1B0E92E5D454073D712F2C19754C0DC9DB5DB2E5D4540010200000002000000430035F9C19754C072455AE92E5D45401D8DECF3C19754C0A4958AD52E5D4540010200000002000000430035F9C19754C072455AE92E5D45404B6910F9C19754C08EC1B0E92E5D4540010200000002000000DC3C90F9C19754C0AE68B0EA2E5D45404B6910F9C19754C08EC1B0E92E5D4540010200000002000000DC3C90F9C19754C0AE68B0EA2E5D4540430035F9C19754C072455AE92E5D45400102000000020000000F6092FDC19754C07A3409DF2E5D4540329548F5C19754C0B57A02D12E5D45400102000000020000000F6092FDC19754C07A3409DF2E5D4540430035F9C19754C072455AE92E5D45400102000000020000000FC48C03C29754C0C5A517A2305D45407439B0D1C19754C0E43C5B27305D45400102000000020000000FC48C03C29754C0C5A517A2305D454091190EEAC19754C0D75122D62F5D454001020000000200000010C48C03C29754C0C6A517A2305D454092190EEAC19754C0D65122D62F5D454001020000000200000010C48C03C29754C0C6A517A2305D45400FC48C03C29754C0C5A517A2305D4540010200000002000000244D7608C29754C042FBC6702F5D454074C232DDC19754C05B1D8E2B2F5D4540010200000002000000244D7608C29754C042FBC6702F5D454011AAD4ECC19754C083C5E1CC2F5D45400102000000020000006693640BC29754C006D64F872E5D4540329548F5C19754C0B57A02D12E5D4540010200000002000000DBDBDE0CC29754C08C1F15622F5D45409F7C37E1C19754C0DF930E222F5D4540010200000002000000DBDBDE0CC29754C08C1F15622F5D4540244D7608C29754C042FBC6702F5D4540010200000002000000C0E78711C29754C077BE9F1A2F5D4540DC3C90F9C19754C0AE68B0EA2E5D454001020000000200000010328113C29754C03200F84B2F5D4540DC3C90F9C19754C0AE68B0EA2E5D454001020000000200000010328113C29754C03200F84B2F5D4540DBDBDE0CC29754C08C1F15622F5D45400102000000020000006743C814C29754C007BE2CA82E5D45400F6092FDC19754C07A3409DF2E5D45400102000000020000006743C814C29754C007BE2CA82E5D45406693640BC29754C006D64F872E5D454001020000000200000075E0D019C29754C0B7ED469C2E5D45406743C814C29754C007BE2CA82E5D45400102000000020000009BFBFB1EC29754C01E62917D315D4540C4995FCDC19754C099D36531315D45400102000000020000009BFBFB1EC29754C01E62917D315D454010C48C03C29754C0C6A517A2305D4540010200000002000000F46B7321C29754C04B5944802F5D4540DBDBDE0CC29754C08C1F15622F5D4540010200000002000000F46B7321C29754C04B5944802F5D454010328113C29754C03200F84B2F5D4540010200000002000000DC64CB21C29754C08801561C2F5D45400F6092FDC19754C07A3409DF2E5D4540010200000002000000DC64CB21C29754C08801561C2F5D454010328113C29754C03200F84B2F5D4540010200000002000000F1FF202CC29754C0EC51E3F92E5D45406743C814C29754C007BE2CA82E5D4540010200000002000000F1FF202CC29754C0EC51E3F92E5D4540DC64CB21C29754C08801561C2F5D45400102000000020000005BDA5F2CC29754C036CF11F92E5D454075E0D019C29754C0B7ED469C2E5D45400102000000020000005BDA5F2CC29754C036CF11F92E5D4540F1FF202CC29754C0EC51E3F92E5D454001020000000200000067B6D72CC29754C07A70FCAA2F5D4540244D7608C29754C042FBC6702F5D454001020000000200000067B6D72CC29754C07A70FCAA2F5D4540F46B7321C29754C04B5944802F5D4540010200000002000000202F7E2DC29754C01177A9FE2E5D4540F1FF202CC29754C0EC51E3F92E5D4540010200000002000000202F7E2DC29754C01177A9FE2E5D45405BDA5F2CC29754C036CF11F92E5D45400102000000020000006442232FC29754C06598CBFE315D454012DC3BDBC09754C088055C69335D45400102000000020000006442232FC29754C06598CBFE315D45409BFBFB1EC29754C01E62917D315D4540010200000002000000EA07733CC29754C001B371492F5D4540DC64CB21C29754C08801561C2F5D4540010200000002000000EA07733CC29754C001B371492F5D4540202F7E2DC29754C01177A9FE2E5D4540010200000002000000E8327644C29754C08B1C63A9325D4540E6DF4401C19754C052634670335D4540010200000002000000E8327644C29754C08B1C63A9325D45406442232FC29754C06598CBFE315D4540010200000002000000BD28DC48C29754C0B460725E2F5D4540202F7E2DC29754C01177A9FE2E5D4540010200000002000000BD28DC48C29754C0B460725E2F5D4540EA07733CC29754C001B371492F5D454001020000000200000048122C57C29754C0D7E60ECF2F5D4540F46B7321C29754C04B5944802F5D454001020000000200000048122C57C29754C0D7E60ECF2F5D4540EA07733CC29754C001B371492F5D4540010200000002000000E86DA85EC29754C048428FF92D5D4540CA60DFA3C19754C04F322B162D5D4540010200000002000000E86DA85EC29754C048428FF92D5D454075E0D019C29754C0B7ED469C2E5D45400102000000020000001E847B60C29754C005209CFD2F5D454067B6D72CC29754C07A70FCAA2F5D45400102000000020000001E847B60C29754C005209CFD2F5D454048122C57C29754C0D7E60ECF2F5D4540010200000002000000D4913668C29754C09832EAC1315D45409BFBFB1EC29754C01E62917D315D4540010200000002000000D4913668C29754C09832EAC1315D45406442232FC29754C06598CBFE315D4540010200000002000000CC20F971C29754C069E412112E5D45405BDA5F2CC29754C036CF11F92E5D4540010200000002000000CC20F971C29754C069E412112E5D4540E86DA85EC29754C048428FF92D5D4540010200000002000000C47F8F73C29754C0329BCFB5315D454010C48C03C29754C0C6A517A2305D4540010200000002000000C47F8F73C29754C0329BCFB5315D4540D4913668C29754C09832EAC1315D4540010200000002000000BD4CEB75C29754C0B65E27FC2F5D4540BD28DC48C29754C0B460725E2F5D4540010200000002000000BD4CEB75C29754C0B65E27FC2F5D454048122C57C29754C0D7E60ECF2F5D45400102000000020000009B406982C29754C0A7C45DDA315D4540D4913668C29754C09832EAC1315D45400102000000020000009B406982C29754C0A7C45DDA315D4540C47F8F73C29754C0329BCFB5315D454001020000000200000058D7BD86C29754C04103D19A2D5D4540E86DA85EC29754C048428FF92D5D454001020000000200000036C7BC88C29754C05E8B043E305D45401E847B60C29754C005209CFD2F5D454001020000000200000036C7BC88C29754C05E8B043E305D4540BD4CEB75C29754C0B65E27FC2F5D45400102000000020000003E3E5E89C29754C0DCEDF405315D454011AAD4ECC19754C083C5E1CC2F5D45400102000000020000003E3E5E89C29754C0DCEDF405315D454067B6D72CC29754C07A70FCAA2F5D4540010200000002000000EE07068FC29754C0485F8498315D454085CA1CEBC19754C0FF039CD22F5D4540010200000002000000EE07068FC29754C0485F8498315D4540C47F8F73C29754C0329BCFB5315D454001020000000200000020A80991C29754C0A77686A92D5D4540CC20F971C29754C069E412112E5D454001020000000200000020A80991C29754C0A77686A92D5D454058D7BD86C29754C04103D19A2D5D4540010200000002000000A74C579DC29754C0AF0AE72D315D45401E847B60C29754C005209CFD2F5D4540010200000002000000A74C579DC29754C0AF0AE72D315D45403E3E5E89C29754C0DCEDF405315D4540010200000002000000405D0CA9C29754C025E2C17C315D45403E3E5E89C29754C0DCEDF405315D4540010200000002000000405D0CA9C29754C025E2C17C315D4540EE07068FC29754C0485F8498315D4540010200000002000000DBC165ACC29754C0B2542F79315D4540A74C579DC29754C0AF0AE72D315D4540010200000002000000DBC165ACC29754C0B2542F79315D4540405D0CA9C29754C025E2C17C315D45400102000000020000002A6C20BBC29754C0B4497969315D4540A74C579DC29754C0AF0AE72D315D45400102000000020000002A6C20BBC29754C0B4497969315D4540DBC165ACC29754C0B2542F79315D4540010200000002000000A0DB14D6C29754C0D0D2B84C315D454036C7BC88C29754C05E8B043E305D4540010200000002000000A0DB14D6C29754C0D0D2B84C315D45402A6C20BBC29754C0B4497969315D4540
+  </op>
+</test>
+</case>
+
+</run>
diff --git a/tests/xmltester/tests/ticket/bug599.xml b/tests/xmltester/tests/ticket/bug599.xml
new file mode 100644
index 0000000..8511f47
--- /dev/null
+++ b/tests/xmltester/tests/ticket/bug599.xml
@@ -0,0 +1,31 @@
+<run>
+  <desc>
+http://trac.osgeo.org/geos/ticket/599
+  </desc>
+  <precisionModel type="FLOATING" />
+
+<case>
+  <desc>
+http://trac.osgeo.org/geos/ticket/599
+  </desc>
+  <a>
+010200000020000000CE89E2FA1C04ED3F908BC5CAC37649407D2B6DCC4602ED3FE0C4EB55BF7649407A765490FA06ED3FCF28A787B2764940533AA28C020EED3F6FC6C4419D7649400949B0822914ED3F79A40BFB877649402C1B310E8916ED3F69E9656F847649404DD070146A17ED3F650A8CAB80764940016B7AF59617ED3FCD71135A7B76494048663F9CD120ED3F46A22B6C61764940C63FC7A24426ED3F1086F01E56764940EC7E5F6DD62AED3FE64581994A7649404ADD29786532ED3F89BC40A43A76494012E22593AE34ED3F6946F58C337649406F23AF18BF3AED3F4AD6E1E82A764940EBC2B414353DED3F2E3F709527764940EBC2B414353DED3F1D7E92962576494066283806AE3CED3F8FB5752623764940A61EB3FD7538ED3FDC8BC3F418764940F90A1C1A6030ED3FAC5AD2510E76494094EB5C07BD2DED3F96B4E21B0A76494092B1DAFCBF2AED3F763E970403764940F579D67FE728ED3FDD9FE63FFF754940F43F5475EA25ED3F04159F4CED7549409F7EABD09B25ED3F4EEDB199E87549405842D2020F27ED3FBD378600E075494042DFCC9EBA28ED3F9DBB0276DA754940D5C78D6CF827ED3FD40E7F4DD6754940F050B92EA127ED3FDBBD816ED4754940D4C78D6CF827ED3FD40E7F4DD6754940D5C78D6CF827ED3FD40E7F4DD6754940650FA3D6EA21ED3F22A98592C9754940883F790E1B1BED3FEF8A85C6B8754940
+  </a>
+  <b>
+01020000001D000000CE89E2FA1C04ED3F908BC5CAC37649407D2B6DCC4602ED3FE0C4EB55BF7649407A765490FA06ED3FCF28A787B2764940533AA28C020EED3F6FC6C4419D7649400949B0822914ED3F79A40BFB877649402C1B310E8916ED3F69E9656F847649404DD070146A17ED3F650A8CAB80764940016B7AF59617ED3FCD71135A7B76494048663F9CD120ED3F46A22B6C61764940C63FC7A24426ED3F1086F01E56764940EC7E5F6DD62AED3FE64581994A7649404ADD29786532ED3F89BC40A43A76494012E22593AE34ED3F6946F58C337649406F23AF18BF3AED3F4AD6E1E82A764940EBC2B414353DED3F2E3F709527764940EBC2B414353DED3F1D7E92962576494066283806AE3CED3F8FB5752623764940A61EB3FD7538ED3FDC8BC3F418764940F90A1C1A6030ED3FAC5AD2510E76494094EB5C07BD2DED3F96B4E21B0A76494092B1DAFCBF2AED3F763E970403764940F579D67FE728ED3FDD9FE63FFF754940F43F5475EA25ED3F04159F4CED7549409F7EABD09B25ED3F4EEDB199E87549405842D2020F27ED3FBD378600E075494042DFCC9EBA28ED3F9DBB0276DA754940D4C78D6CF827ED3FD40E7F4DD6754940650FA3D6EA21ED3F22A98592C9754940883F790E1B1BED3FEF8A85C6B8754940
+  </b>
+<test>
+  <op name="isValid" arg1="A">true</op>
+</test>
+<test>
+  <op name="isValid" arg1="B">true</op>
+</test>
+<test>
+ <op name="union" arg1="A" arg2="B">
+010500000022000000010200000002000000CE89E2FA1C04ED3F908BC5CAC37649407D2B6DCC4602ED3FE0C4EB55BF7649400102000000020000007D2B6DCC4602ED3FE0C4EB55BF7649407A765490FA06ED3FCF28A787B27649400102000000020000007A765490FA06ED3FCF28A787B2764940533AA28C020EED3F6FC6C4419D764940010200000002000000533AA28C020EED3F6FC6C4419D7649400949B0822914ED3F79A40BFB877649400102000000020000000949B0822914ED3F79A40BFB877649402C1B310E8916ED3F69E9656F847649400102000000020000002C1B310E8916ED3F69E9656F847649404DD070146A17ED3F650A8CAB807649400102000000020000004DD070146A17ED3F650A8CAB80764940016B7AF59617ED3FCD71135A7B764940010200000002000000016B7AF59617ED3FCD71135A7B76494048663F9CD120ED3F46A22B6C6176494001020000000200000048663F9CD120ED3F46A22B6C61764940C63FC7A24426ED3F1086F01E56764940010200000002000000C63FC7A24426ED3F1086F01E56764940EC7E5F6DD62AED3FE64581994A764940010200000002000000EC7E5F6DD62AED3FE64581994A7649404ADD29786532ED3F89BC40A43A7649400102000000020000004ADD29786532ED3F89BC40A43A76494012E22593AE34ED3F6946F58C3376494001020000000200000012E22593AE34ED3F6946F58C337649406F23AF18BF3AED3F4AD6E1E82A7649400102000000020000006F23AF18BF3AED3F4AD6E1E82A764940EBC2B414353DED3F2E3F709527764940010200000002000000EBC2B414353DED3F2E3F709527764940EBC2B414353DED3F1D7E929625764940010200000002000000EBC2B414353DED3F1D7E92962576494066283806AE3CED3F8FB575262376494001020000000200000066283806AE3CED3F8FB5752623764940A61EB3FD7538ED3FDC8BC3F418764940010200000002000000A61EB3FD7538ED3FDC8BC3F418764940F90A1C1A6030ED3FAC5AD2510E764940010200000002000000F90A1C1A6030ED3FAC5AD2510E76494094EB5C07BD2DED3F96B4E21B0A76494001020000000200000094EB5C07BD2DED3F96B4E21B0A76494092B1DAFCBF2AED3F763E97040376494001020000000200000092B1DAFCBF2AED3F763E970403764940F579D67FE728ED3FDD9FE63FFF754940010200000002000000F579D67FE728ED3FDD9FE63FFF754940F43F5475EA25ED3F04159F4CED754940010200000002000000F43F5475EA25ED3F04159F4CED7549409F7EABD09B25ED3F4EEDB199E87549400102000000020000009F7EABD09B25ED3F4EEDB199E87549405842D2020F27ED3FBD378600E07549400102000000020000005842D2020F27ED3FBD378600E075494042DFCC9EBA28ED3F9DBB0276DA75494001020000000200000042DFCC9EBA28ED3F9DBB0276DA754940D5C78D6CF827ED3FD40E7F4DD6754940010200000003000000D5C78D6CF827ED3FD40E7F4DD6754940F050B92EA127ED3FDBBD816ED4754940D3C78D6CF827ED3FD40E7F4DD6754940010200000002000000D3C78D6CF827ED3FD40E7F4DD6754940D4C78D6CF827ED3FD40E7F4DD6754940010200000002000000D4C78D6CF827ED3FD40E7F4DD6754940D5C78D6CF827ED3FD40E7F4DD6754940010200000002000000D5C78D6CF827ED3FD40E7F4DD6754940D3C78D6CF827ED3FD40E7F4DD6754940010200000002000000D3C78D6CF827ED3FD40E7F4DD6754940650FA3D6EA21ED3F22A98592C9754940010200000002000000650FA3D6EA21ED3F22A98592C9754940883F790E1B1BED3FEF8A85C6B875494001020000000200000042DFCC9EBA28ED3F9DBB0276DA754940D4C78D6CF827ED3FD40E7F4DD6754940010200000002000000D4C78D6CF827ED3FD40E7F4DD6754940650FA3D6EA21ED3F22A98592C9754940
+ </op>
+</test>
+</case>
+
+
+</run>
diff --git a/tests/xmltester/tests/ticket/bug615.xml b/tests/xmltester/tests/ticket/bug615.xml
new file mode 100644
index 0000000..6235128
--- /dev/null
+++ b/tests/xmltester/tests/ticket/bug615.xml
@@ -0,0 +1,22 @@
+
+<run>
+  <precisionModel type="FLOATING" />
+
+  <case>
+    <desc>
+See http://trac.osgeo.org/geos/ticket/615
+    </desc>
+    <a>
+01060000000500000001030000000100000004000000239CFA9F7F9230401ABADB203141474018601F9DBA92304062D68BA19C40474027361FD7869230408D62B9A5D5404740239CFA9F7F9230401ABADB203141474001030000000100000004000000125901C0739230408653A0054F41474043CA4FAA7D923040DB5548F949414740239CFA9F7F9230401ABADB2031414740125901C0739230408653A0054F4147400103000000010000000B0000005EA791E509923040D3DDAD7E594247408BFD65F7E4913040CBA65CE15D4247406F2F698CD69130400A850838844247401A34F44F70913040D947A7AE7C424740B745990D329130400AA2EE0390424740454C89247A913040D8817346944247407E74EACA679130406E3997E2AA424740A81DFE9AAC913040CA8E8D40BC4247400C410E4A9891304074EFE192E342474036B05582C5913040E5ED08A7054347405EA791E509923040D3DDAD7E5942474001030000000100000005000000125901C0739230408653A0054F4147400DAB7823F3903040FD1873D712424740A73FFB9122923040367BA01518424740773A98D22192304096FAA9431D424740125901C0739230408653A0054F414740010300000001000000040000005EA791E509923040D3DDAD7E59424740C4D32B651992304027C286A757424740773A98D22192304096FAA9431D4247405EA791E509923040D3DDAD7E59424740
+    </a>
+    <b>
+0106000000050000000103000000010000000800000019C9CCC7889230401D2A92141A41474018601F9DBA92304062D68BA19C40474026361FD7869230408D62B9A5D5404740B48EAA26889230408CB96B09F9404740C3D8429083923040B0AC34290541474098DD938785923040C5387F130A41474026361FD786923040704221020E41474019C9CCC7889230401D2A92141A4147400103000000010000000700000035F1A79473923040BDB5C0724F41474043CA4FAA7D923040DA5548F94941474098DD938785923040F0C4AC174341474018EC866D8B9230400C59DDEA39414740A64412BD8C923040FEF15EB53241474019C9CCC7889230401D2A92141A41474035F1A79473923040BDB5C0724F414740010300000001000000130000005EA791E509923040D3DDAD7E594247408BFD65F7E4913040CAA65CE15D4247406F2F698CD69130400A85083884424740D252793BC29130401FF46C567D4247409A999999999130402D5BEB8B844247401A34F44F70913040D847A7AE7C424740B745990D329130400AA2EE0390424740459E245D33913040D881734694424740378E588B4F91304018096D3997424740444C89247A913040D8817346944247407E74EACA679130406D3997E2AA424740A81DFE9AAC913040C98E8D40BC424740E17F2BD9B19130406D73637AC24247400B410E4A9891304074EFE192E3424740280F0BB5A691304097E2AAB2EF424740D252793BC29130402D6002B7EE424740A81DFE9AAC9130400282397AFC42474036B05582C5913040E5ED08A7054347405EA791E509923040D3DDAD7E594247400103000000010000000E00000035F1A79473923040BDB5C0724F4147408A3C49BA66923040211FF46C5641474036CD3B4ED1913040C4B12E6EA3414740C47762D68B91304076374F75C8414740D3BCE3141D913040EE940ED6FF4147408CF337A110913040042159C0044247402979758E01913040F5D6C05609424740450DA661F8903040A0E062450D4247400DAB7823F3903040FC1873D71242474029965B5A0D91304020EF552B1342474099F04BFDBC913040834C327216424740A73FFB9122923040357BA01518424740773A98D22192304097FAA9431D42474035F1A79473923040BDB5C0724F414740010300000001000000040000005EA791E509923040D3DDAD7E59424740C3D32B651992304027C286A757424740773A98D22192304097FAA9431D4247405EA791E509923040D3DDAD7E59424740
+    </b>
+    <test>
+      <op name='symdifference' arg1='A' arg2='B' >
+01060000000C0000000103000000010000000C00000043CA4FAA7D923040DA5548F94941474098DD938785923040F0C4AC174341474018EC866D8B9230400C59DDEA39414740A64412BD8C923040FEF15EB53241474019C9CCC7889230401D2A92141A41474026361FD786923040704221020E41474098DD938785923040C5387F130A414740C3D8429083923040B0AC342905414740B48EAA26889230408CB96B09F940474026361FD7869230408D62B9A5D5404740239CFA9F7F9230401ABADB203141474043CA4FAA7D923040DA5548F9494147400103000000010000000A00000071D9271D0C91304001823120064247408CF337A110913040042159C004424740D3BCE3141D913040EE940ED6FF414740C47762D68B91304076374F75C841474036CD3B4ED1913040C4B12E6EA34147408A3C49BA66923040211FF46C5641474035F1A79473923040BDB5C0724F41474043CA4FAA7D923040DA5548F949414740125901C0739230408653A0054F41474071D9271D0C913040018231200642474001030000000100000005000000B745990D329130400AA2EE0390424740459E245D33913040D881734694424740378E588B4F91304018096D3997424740444C89247A913040D881734694424740B745990D329130400AA2EE0390424740010300000001000000050000000DAB7823F3903040FC1873D71242474071D9271D0C91304001823120064247402979758E01913040F5D6C05609424740450DA661F8903040A0E062450D4247400DAB7823F3903040FC1873D7124247400103000000010000000400000077459ECBAC91304054D11324814247406F2F698CD69130400A85083884424740D252793BC29130401FF46C567D42474077459ECBAC91304054D113248142474001030000000100000004000000A81DFE9AAC9130400282397AFC42474036B05582C5913040E5ED08A705434740B0C6C481B391304014A2E915F8424740A81DFE9AAC9130400282397AFC42474001030000000100000004000000D675324DA8913040353117A4EF424740B0C6C481B391304014A2E915F8424740D252793BC29130402D6002B7EE424740D675324DA8913040353117A4EF424740010300000001000000040000000B410E4A9891304074EFE192E3424740E17F2BD9B19130406D73637AC2424740A81DFE9AAC913040C98E8D40BC4247400B410E4A9891304074EFE192E3424740010300000001000000040000000B410E4A9891304074EFE192E3424740280F0BB5A691304097E2AAB2EF424740D675324DA8913040353117A4EF4247400B410E4A9891304074EFE192E3424740010300000001000000040000001A34F44F70913040D847A7AE7C4247409A999999999130402D5BEB8B8442474077459ECBAC91304054D11324814247401A34F44F70913040D847A7AE7C424740010300000001000000040000003893A64068913040B2A17BDD1442474099F04BFDBC913040834C327216424740A73FFB9122923040357BA015184247403893A64068913040B2A17BDD14424740010300000001000000040000000DAB7823F3903040FC1873D7124247403893A64068913040B2A17BDD1442474029965B5A0D91304020EF552B134247400DAB7823F3903040FC1873D712424740
+      </op>
+    </test>
+  </case>
+
+</run>
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b954fb6..8f9d149 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,

-- 
Geometry engine for Geographic Information Systems



More information about the Pkg-grass-devel mailing list