[geos-commits] r2333 - in branches/3.1: . capi source/operation/union

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Apr 8 12:31:57 EDT 2009


Author: pramsey
Date: 2009-04-08 12:31:56 -0400 (Wed, 08 Apr 2009)
New Revision: 2333

Modified:
   branches/3.1/capi/geos_c.cpp
   branches/3.1/capi/geos_c.h.in
   branches/3.1/capi/geos_ts_c.cpp
   branches/3.1/configure.in
   branches/3.1/source/operation/union/CascadedPolygonUnion.cpp
Log:
SetSRID_r consistency fix


Modified: branches/3.1/capi/geos_c.cpp
===================================================================
--- branches/3.1/capi/geos_c.cpp	2009-04-08 16:17:45 UTC (rev 2332)
+++ branches/3.1/capi/geos_c.cpp	2009-04-08 16:31:56 UTC (rev 2333)
@@ -460,6 +460,12 @@
     return GEOSGetSRID_r( handle, g1 );
 }
 
+void
+GEOSSetSRID(Geometry *g, int srid)
+{
+    GEOSSetSRID_r( handle, g, srid);
+}
+
 char 
 GEOSHasZ(const Geometry *g)
 {

Modified: branches/3.1/capi/geos_c.h.in
===================================================================
--- branches/3.1/capi/geos_c.h.in	2009-04-08 16:17:45 UTC (rev 2332)
+++ branches/3.1/capi/geos_c.h.in	2009-04-08 16:31:56 UTC (rev 2333)
@@ -591,12 +591,12 @@
 /* Return 0 on exception */
 extern int GEOS_DLL GEOSGetSRID(const GEOSGeometry* g1);
 
-extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID);
+extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int srid);
 
 extern int GEOS_DLL GEOSGetSRID_r(GEOSContextHandle_t handle,
                                   const GEOSGeometry* g1);
 
-extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID);
+extern void GEOS_DLL GEOSSetSRID_r(GEOSContextHandle_t handle, GEOSGeometry* g, int srid);
 
 /* May be called on all geometries in GEOS 3.x, returns -1 on error and 1
  * for non-multi geometries. Older GEOS versions only accept 

Modified: branches/3.1/capi/geos_ts_c.cpp
===================================================================
--- branches/3.1/capi/geos_ts_c.cpp	2009-04-08 16:17:45 UTC (rev 2332)
+++ branches/3.1/capi/geos_ts_c.cpp	2009-04-08 16:31:56 UTC (rev 2333)
@@ -1627,12 +1627,39 @@
 }
 
 void
-GEOSSetSRID(Geometry *g, int SRID)
+GEOSSetSRID_r(GEOSContextHandle_t extHandle, Geometry *g, int srid)
 {
-	g->setSRID(SRID);
+    GEOSContextHandleInternal_t *handle;
+
+    if( extHandle == NULL )
+    {
+        return;
+    }
+
+    handle = (GEOSContextHandleInternal_t*)extHandle;
+    if( handle->initialized == 0 )
+    {
+        return;
+    }
+
+	try{
+		g->setSRID(srid);
+	}
+	catch (const std::exception &e)
+	{
+		handle->ERROR_MESSAGE("%s", e.what());
+		return;
+	}
+
+	catch (...)
+	{
+		handle->ERROR_MESSAGE("Unknown exception thrown");
+		return;
+	}
 }
 
 
+
 int
 GEOSGetNumCoordinates_r(GEOSContextHandle_t extHandle, const Geometry *g1)
 {

Modified: branches/3.1/configure.in
===================================================================
--- branches/3.1/configure.in	2009-04-08 16:17:45 UTC (rev 2332)
+++ branches/3.1/configure.in	2009-04-08 16:31:56 UTC (rev 2333)
@@ -3,10 +3,10 @@
 dnl configure.in - autoconf input template to produce ./configure script
 dnl
 dnl version 2.52 is required for Cygwin libtool support
-AC_PREREQ(2.52)
+AC_PREREQ([2.52])
 
 dnl local vars to hold user's preferences --------------------------------
-AC_INIT(source/headers/geos.h)
+AC_INIT([source/headers/geos.h])
 AC_CANONICAL_SYSTEM
 
 AC_CONFIG_MACRO_DIR([macros])
@@ -35,9 +35,9 @@
 CAPI_VERSION_PATCH=$CAPI_INTERFACE_REVISION
 CAPI_VERSION="$CAPI_VERSION_MAJOR.$CAPI_VERSION_MINOR.$CAPI_VERSION_PATCH"
 
-AM_INIT_AUTOMAKE(geos, $VERSION, no-define)
-AM_CONFIG_HEADER(source/headers/config.h)
-AM_CONFIG_HEADER(source/headers/geos/platform.h)
+AM_INIT_AUTOMAKE([geos], [$VERSION], [no-define])
+AM_CONFIG_HEADER([source/headers/config.h])
+AM_CONFIG_HEADER([source/headers/geos/platform.h])
 AC_PROG_CC
 
 dnl use libtool ----------------------------------------------------------
@@ -59,12 +59,12 @@
 AC_FUNC_ALLOCA
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS(memory.h)
-AC_CHECK_HEADERS(unistd.h)
-AC_CHECK_HEADERS(ieeefp.h)
-AC_CHECK_HEADERS(sys/file.h)
-AC_CHECK_HEADERS(sys/time.h)
-AC_CHECK_FUNCS(strchr memcpy gettimeofday)
+AC_CHECK_HEADERS([memory.h])
+AC_CHECK_HEADERS([unistd.h])
+AC_CHECK_HEADERS([ieeefp.h])
+AC_CHECK_HEADERS([sys/file.h])
+AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_FUNCS([strchr memcpy gettimeofday])
 AC_HEADER_STAT
 AC_STRUCT_TM
 AC_TYPE_SIZE_T
@@ -75,7 +75,7 @@
 dnl --------------------------------------------------------------------
 
 
-AC_ARG_ENABLE(inline, [  --disable-inline    Disable inlining],
+AC_ARG_ENABLE([inline], [  --disable-inline    Disable inlining],
 	[case "${enableval}" in
 		yes) enable_inline=true ;;
 		no)  enable_inline=false ;;
@@ -84,7 +84,7 @@
 	[enable_inline=true]
 )
 
-AC_ARG_ENABLE(cassert, [  --disable-cassert   Disable assertion checking],
+AC_ARG_ENABLE([cassert], [  --disable-cassert   Disable assertion checking],
 	[case "${enableval}" in
 		yes) enable_cassert=true ;;
 		no)  enable_cassert=false ;;
@@ -139,7 +139,7 @@
 dnl - check whether python is required for the build
 dnl --------------------------------------------------------------------
 
-AC_ARG_ENABLE(python, [  --enable-python    Enable build of python module],
+AC_ARG_ENABLE([python], [  --enable-python    Enable build of python module],
 	[case "${enableval}" in
 		yes) use_python=true ;;
 		no)  use_python=false ;;
@@ -153,7 +153,7 @@
 dnl - check whether ruby is required for the build
 dnl --------------------------------------------------------------------
 
-AC_ARG_ENABLE(ruby, [  --enable-ruby    Enable build of ruby module],
+AC_ARG_ENABLE([ruby], [  --enable-ruby    Enable build of ruby module],
 	[case "${enableval}" in
 		yes) use_ruby=true ;;
 		no)  use_ruby=false ;;

Modified: branches/3.1/source/operation/union/CascadedPolygonUnion.cpp
===================================================================
--- branches/3.1/source/operation/union/CascadedPolygonUnion.cpp	2009-04-08 16:17:45 UTC (rev 2332)
+++ branches/3.1/source/operation/union/CascadedPolygonUnion.cpp	2009-04-08 16:31:56 UTC (rev 2333)
@@ -20,7 +20,13 @@
 #include <geos/geom/MultiPolygon.h>
 #include <geos/geom/util/GeometryCombiner.h>
 #include <geos/index/strtree/STRtree.h>
+// std
+#include <cassert>
+#include <cstddef>
+#include <memory>
+#include <vector>
 
+
 namespace geos {
 namespace operation { // geos.operation
 namespace geounion {  // geos.operation.geounion



More information about the geos-commits mailing list