From svn_geos at osgeo.org Tue Jul 7 02:28:57 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Tue, 7 Jul 2015 02:28:57 -0700 Subject: [geos-commits] r4058 - trunk Message-ID: <20150707092857.4293439008F@trac.osgeo.org> Author: mloskot Date: 2015-07-07 02:28:57 -0700 (Tue, 07 Jul 2015) New Revision: 4058 Modified: trunk/nmake.opt Log: Update nmake.opt to recognize NMAKE 11.00.50522.1. Fixes #578. Modified: trunk/nmake.opt =================================================================== --- trunk/nmake.opt 2015-05-18 09:50:38 UTC (rev 4057) +++ trunk/nmake.opt 2015-07-07 09:28:57 UTC (rev 4058) @@ -102,12 +102,15 @@ !ELSEIF "$(_NMAKE_VER)" == "11.00.40825.2" GEOS_MSVC = 11.0 GEOS_MSC = 1700 -!ELSEIF "$(_NMAKE_VER)" == "11.00.51106.1" +!ELSEIF "$(_NMAKE_VER)" == "11.00.50522.1" GEOS_MSVC = 11.0 GEOS_MSC = 1700 !ELSEIF "$(_NMAKE_VER)" == "11.00.50727.1" GEOS_MSVC = 11.0 GEOS_MSC = 1700 +!ELSEIF "$(_NMAKE_VER)" == "11.00.51106.1" +GEOS_MSVC = 11.0 +GEOS_MSC = 1700 !ELSEIF "$(_NMAKE_VER)" == "11.00.60315.1" GEOS_MSVC = 11.0 GEOS_MSC = 1700 From svn_geos at osgeo.org Sun Jul 19 06:04:27 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Sun, 19 Jul 2015 06:04:27 -0700 Subject: [geos-commits] r4059 - trunk/src/operation/intersection Message-ID: <20150719130427.0D58B390103@trac.osgeo.org> Author: strk Date: 2015-07-19 06:04:26 -0700 (Sun, 19 Jul 2015) New Revision: 4059 Modified: trunk/src/operation/intersection/RectangleIntersectionBuilder.cpp Log: Add missing include (thanks Alessandro Furieri) Modified: trunk/src/operation/intersection/RectangleIntersectionBuilder.cpp =================================================================== --- trunk/src/operation/intersection/RectangleIntersectionBuilder.cpp 2015-07-07 09:28:57 UTC (rev 4058) +++ trunk/src/operation/intersection/RectangleIntersectionBuilder.cpp 2015-07-19 13:04:26 UTC (rev 4059) @@ -23,6 +23,8 @@ #include #include +#include // for fabs() + namespace geos { namespace operation { // geos::operation namespace intersection { // geos::operation::intersection From svn_geos at osgeo.org Mon Jul 20 10:25:26 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Mon, 20 Jul 2015 10:25:26 -0700 Subject: [geos-commits] r4060 - in trunk: . capi Message-ID: <20150720172526.8BFBD39008F@trac.osgeo.org> Author: strk Date: 2015-07-20 10:25:26 -0700 (Mon, 20 Jul 2015) New Revision: 4060 Modified: trunk/NEWS trunk/capi/geos_c.h.in trunk/capi/geos_ts_c.cpp Log: Extend error and notice notification with threadsafe variants (#663) Patch by Pepijn Van Eeckhoudt Tested by Alessandro Furieri Signed-off-by: Sandro Santilli Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2015-07-19 13:04:26 UTC (rev 4059) +++ trunk/NEWS 2015-07-20 17:25:26 UTC (rev 4060) @@ -7,7 +7,7 @@ - GEOS_USE_ONLY_R_API macro support (#695) - PHP: WKBReader->read() & WKBWriter::write() methods (Benjamin Morel) - RectangleIntersection, GEOSClipByRect (Mika Heiskanen, Sandro Santilli) - ... + - CAPI: thread-safe message handling API (#663, Pepijn Van Eeckhoudt) - Improvements: - Speed-up intersection and difference between geometries with small bounding box overlap. Modified: trunk/capi/geos_c.h.in =================================================================== --- trunk/capi/geos_c.h.in 2015-07-19 13:04:26 UTC (rev 4059) +++ trunk/capi/geos_c.h.in 2015-07-20 17:25:26 UTC (rev 4060) @@ -94,8 +94,22 @@ * ************************************************************************/ +typedef struct GEOSContextHandle_HS *GEOSContextHandle_t; + typedef void (*GEOSMessageHandler)(const char *fmt, ...); +/* + * A GEOS message handler function. + * + * @param message the message contents + * @param userdata the user data pointer that was passed to GEOS when registering this message handler. + * + * + * @see GEOSContext_setErrorMessageHandler + * @see GEOSContext_setNoticeMessageHandler + */ +typedef void (*GEOSMessageHandler_r)(const char *message, void *userdata); + /* When we're included by geos_c.cpp, those are #defined to the original * JTS definitions via preprocessor. We don't touch them to allow the * compiler to cross-check the declarations. However, for all "normal" @@ -138,8 +152,6 @@ GEOS_WKB_NDR = 1 /* Little Endian */ }; -typedef struct GEOSContextHandle_HS *GEOSContextHandle_t; - typedef void (*GEOSQueryCallback)(void *item, void *userdata); /************************************************************************ @@ -163,17 +175,54 @@ /* Cancel a pending interruption request */ extern void GEOS_DLL GEOS_interruptCancel(); - +/* + * @deprecated in 3.5.0 + * initialize using GEOS_init_r() and set the message handlers using + * GEOSContext_setNoticeHandler_r and/or GEOSContext_setErrorHandler_r + */ extern GEOSContextHandle_t GEOS_DLL initGEOS_r( GEOSMessageHandler notice_function, GEOSMessageHandler error_function); +/* + * @deprecated in 3.5.0 replaced by GEOS_finish_r. + */ extern void GEOS_DLL finishGEOS_r(GEOSContextHandle_t handle); +extern GEOSContextHandle_t GEOS_DLL GEOS_init_r(); +extern void GEOS_DLL GEOS_finish_r(GEOSContextHandle_t handle); + + extern GEOSMessageHandler GEOS_DLL GEOSContext_setNoticeHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler nf); extern GEOSMessageHandler GEOS_DLL GEOSContext_setErrorHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler ef); +/* + * Sets a notice message handler on the given GEOS context. + * + * @param extHandle the GEOS context + * @param nf the message handler + * @param userData optional user data pointer that will be passed to the message handler + * + * @return the previously configured message handler or NULL if no message handler was configured + */ +extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setNoticeMessageHandler_r(GEOSContextHandle_t extHandle, + GEOSMessageHandler_r nf, + void *userData); + +/* + * Sets an error message handler on the given GEOS context. + * + * @param extHandle the GEOS context + * @param ef the message handler + * @param userData optional user data pointer that will be passed to the message handler + * + * @return the previously configured message handler or NULL if no message handler was configured + */ +extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setErrorMessageHandler_r(GEOSContextHandle_t extHandle, + GEOSMessageHandler_r ef, + void *userData); + extern const char GEOS_DLL *GEOSversion(); Modified: trunk/capi/geos_ts_c.cpp =================================================================== --- trunk/capi/geos_ts_c.cpp 2015-07-19 13:04:26 UTC (rev 4059) +++ trunk/capi/geos_ts_c.cpp 2015-07-20 17:25:26 UTC (rev 4060) @@ -72,6 +72,7 @@ // This should go away #include // finite +#include #include #include #include @@ -136,14 +137,115 @@ typedef std::auto_ptr GeomAutoPtr; -typedef struct GEOSContextHandleInternal +typedef struct GEOSContextHandle_HS { const GeometryFactory *geomFactory; - GEOSMessageHandler NOTICE_MESSAGE; - GEOSMessageHandler ERROR_MESSAGE; + char msgBuffer[1024]; + GEOSMessageHandler noticeMessageOld; + GEOSMessageHandler_r noticeMessageNew; + void *noticeData; + GEOSMessageHandler errorMessageOld; + GEOSMessageHandler_r errorMessageNew; + void *errorData; int WKBOutputDims; int WKBByteOrder; int initialized; + + GEOSContextHandle_HS() + { + memset(msgBuffer, 0, sizeof(msgBuffer)); + geomFactory = GeometryFactory::getDefaultInstance(); + WKBOutputDims = 2; + WKBByteOrder = getMachineByteOrder(); + setNoticeHandler(NULL); + setErrorHandler(NULL); + initialized = 1; + } + + GEOSMessageHandler + setNoticeHandler(GEOSMessageHandler nf) + { + GEOSMessageHandler f = noticeMessageOld; + noticeMessageOld = nf; + noticeMessageNew = NULL; + noticeData = NULL; + + return f; + } + + GEOSMessageHandler + setErrorHandler(GEOSMessageHandler nf) + { + GEOSMessageHandler f = errorMessageOld; + errorMessageOld = nf; + errorMessageNew = NULL; + errorData = NULL; + + return f; + } + + GEOSMessageHandler_r + setNoticeHandler(GEOSMessageHandler_r nf, void *userData) { + GEOSMessageHandler_r f = noticeMessageNew; + noticeMessageOld = NULL; + noticeMessageNew = nf; + noticeData = userData; + + return f; + } + + GEOSMessageHandler_r + setErrorHandler(GEOSMessageHandler_r ef, void *userData) + { + GEOSMessageHandler_r f = errorMessageNew; + errorMessageOld = NULL; + errorMessageNew = ef; + errorData = userData; + + return f; + } + + void + NOTICE_MESSAGE(string fmt, ...) + { + if (NULL == noticeMessageOld && NULL == noticeMessageNew) { + return; + } + + va_list args; + va_start(args, fmt); + int result = vsnprintf(msgBuffer, sizeof(msgBuffer) - 1, fmt.c_str(), args); + va_end(args); + + if (result > 0) { + if (noticeMessageOld) { + noticeMessageOld("%s", msgBuffer); + } else { + noticeMessageNew(msgBuffer, noticeData); + } + } + } + + void + ERROR_MESSAGE(string fmt, ...) + { + if (NULL == errorMessageOld && NULL == errorMessageNew) { + return; + } + + va_list args; + va_start(args, fmt); + int result = vsnprintf(msgBuffer, sizeof(msgBuffer) - 1, fmt.c_str(), args); + va_end(args); + + if (result > 0) { + if (errorMessageOld) { + errorMessageOld("%s", msgBuffer); + } else { + errorMessageNew(msgBuffer, errorData); + } + } + } } GEOSContextHandleInternal_t; // CAPI_ItemVisitor is used internally by the CAPI STRtree @@ -199,30 +301,29 @@ GEOSContextHandle_t initGEOS_r(GEOSMessageHandler nf, GEOSMessageHandler ef) { - GEOSContextHandleInternal_t *handle = 0; - void *extHandle = 0; + GEOSContextHandle_t handle = GEOS_init_r(); - extHandle = malloc(sizeof(GEOSContextHandleInternal_t)); - if (0 != extHandle) - { - handle = static_cast(extHandle); - handle->NOTICE_MESSAGE = nf; - handle->ERROR_MESSAGE = ef; - handle->geomFactory = GeometryFactory::getDefaultInstance(); - handle->WKBOutputDims = 2; - handle->WKBByteOrder = getMachineByteOrder(); - handle->initialized = 1; - } + if (0 != handle) { + GEOSContext_setNoticeHandler_r(handle, nf); + GEOSContext_setErrorHandler_r(handle, ef); + } + return handle; +} + +GEOSContextHandle_t +GEOS_init_r() +{ + GEOSContextHandleInternal_t *handle = new GEOSContextHandleInternal_t(); + geos::util::Interrupt::cancel(); - return static_cast(extHandle); + return static_cast(handle); } GEOSMessageHandler GEOSContext_setNoticeHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler nf) { - GEOSMessageHandler f; GEOSContextHandleInternal_t *handle = 0; handle = reinterpret_cast(extHandle); if ( 0 == handle->initialized ) @@ -230,16 +331,12 @@ return NULL; } - f = handle->NOTICE_MESSAGE; - handle->NOTICE_MESSAGE = nf; - - return f; + return handle->setNoticeHandler(nf); } GEOSMessageHandler GEOSContext_setErrorHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler nf) { - GEOSMessageHandler f; GEOSContextHandleInternal_t *handle = 0; handle = reinterpret_cast(extHandle); if ( 0 == handle->initialized ) @@ -247,20 +344,48 @@ return NULL; } - f = handle->ERROR_MESSAGE; - handle->ERROR_MESSAGE = nf; + return handle->setErrorHandler(nf); +} - return f; +GEOSMessageHandler_r +GEOSContext_setNoticeMessageHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler_r nf, void *userData) { + GEOSContextHandleInternal_t *handle = 0; + handle = reinterpret_cast(extHandle); + if ( 0 == handle->initialized ) + { + return NULL; + } + + return handle->setNoticeHandler(nf, userData); } +GEOSMessageHandler_r +GEOSContext_setErrorMessageHandler_r(GEOSContextHandle_t extHandle, GEOSMessageHandler_r ef, void *userData) +{ + GEOSContextHandleInternal_t *handle = 0; + handle = reinterpret_cast(extHandle); + if ( 0 == handle->initialized ) + { + return NULL; + } + + return handle->setErrorHandler(ef, userData); +} + void finishGEOS_r(GEOSContextHandle_t extHandle) { // Fix up freeing handle w.r.t. malloc above - free(extHandle); + delete extHandle; extHandle = NULL; } +void +GEOS_finish_r(GEOSContextHandle_t extHandle) +{ + finishGEOS_r(extHandle); +} + void GEOSFree_r (GEOSContextHandle_t extHandle, void* buffer) { From svn_geos at osgeo.org Mon Jul 20 10:31:49 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Mon, 20 Jul 2015 10:31:49 -0700 Subject: [geos-commits] r4061 - trunk/capi Message-ID: <20150720173149.443E039008F@trac.osgeo.org> Author: strk Date: 2015-07-20 10:31:49 -0700 (Mon, 20 Jul 2015) New Revision: 4061 Modified: trunk/capi/geos_ts_c.cpp Log: Initialize all members of GEOSContextHandle_HS on construction Modified: trunk/capi/geos_ts_c.cpp =================================================================== --- trunk/capi/geos_ts_c.cpp 2015-07-20 17:25:26 UTC (rev 4060) +++ trunk/capi/geos_ts_c.cpp 2015-07-20 17:31:49 UTC (rev 4061) @@ -152,6 +152,14 @@ int initialized; GEOSContextHandle_HS() + : + geomFactory(0), + noticeMessageOld(0), + noticeMessageNew(0), + noticeData(0), + errorMessageOld(0), + errorMessageNew(0), + errorData(0) { memset(msgBuffer, 0, sizeof(msgBuffer)); geomFactory = GeometryFactory::getDefaultInstance(); From svn_geos at osgeo.org Tue Jul 28 13:45:30 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Tue, 28 Jul 2015 13:45:30 -0700 Subject: [geos-commits] r4062 - trunk Message-ID: <20150728204530.C266A3901C7@trac.osgeo.org> Author: mloskot Date: 2015-07-28 13:45:30 -0700 (Tue, 28 Jul 2015) New Revision: 4062 Modified: trunk/nmake.opt Log: Add NMAKE version from released Visual Studio 2015 Modified: trunk/nmake.opt =================================================================== --- trunk/nmake.opt 2015-07-20 17:31:49 UTC (rev 4061) +++ trunk/nmake.opt 2015-07-28 20:45:30 UTC (rev 4062) @@ -132,6 +132,9 @@ !ELSEIF "$(_NMAKE_VER)" == "14.00.22816.0" GEOS_MSVC = 14.0 GEOS_MSC = 1900 +!ELSEIF "$(_NMAKE_VER)" == "14.00.23026.0" +GEOS_MSVC = 14.0 +GEOS_MSC = 1900 !ELSE GEOS_MSVC = 0.0 GEOS_MSC = 0 From svn_geos at osgeo.org Tue Jul 28 13:59:54 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Tue, 28 Jul 2015 13:59:54 -0700 Subject: [geos-commits] r4063 - trunk/src Message-ID: <20150728205954.07B4B3901C7@trac.osgeo.org> Author: mloskot Date: 2015-07-28 13:59:53 -0700 (Tue, 28 Jul 2015) New Revision: 4063 Modified: trunk/src/Makefile.vc trunk/src/dirlist.mk Log: Add operation/intersection/*.cpp to NMAKE makefiles Modified: trunk/src/Makefile.vc =================================================================== --- trunk/src/Makefile.vc 2015-07-28 20:45:30 UTC (rev 4062) +++ trunk/src/Makefile.vc 2015-07-28 20:59:53 UTC (rev 4063) @@ -213,6 +213,9 @@ operation\distance\ConnectedElementPointFilter.$(EXT) \ operation\distance\DistanceOp.$(EXT) \ operation\distance\GeometryLocation.$(EXT) \ + operation\intersection\Rectangle.$(EXT) \ + operation\intersection\RectangleIntersection.$(EXT) \ + operation\intersection\RectangleIntersectionBuilder.$(EXT) \ operation\linemerge\EdgeString.$(EXT) \ operation\linemerge\LineMergeDirectedEdge.$(EXT) \ operation\linemerge\LineMergeEdge.$(EXT) \ Modified: trunk/src/dirlist.mk =================================================================== --- trunk/src/dirlist.mk 2015-07-28 20:45:30 UTC (rev 4062) +++ trunk/src/dirlist.mk 2015-07-28 20:59:53 UTC (rev 4063) @@ -28,6 +28,7 @@ operation \ operation\buffer \ operation\distance \ + operation\intersection \ operation\linemerge \ operation\overlay \ operation\overlay\snap \ From svn_geos at osgeo.org Tue Jul 28 14:08:47 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Tue, 28 Jul 2015 14:08:47 -0700 Subject: [geos-commits] r4064 - in trunk/src: algorithm io operation/buffer Message-ID: <20150728210847.62A433901C7@trac.osgeo.org> Author: mloskot Date: 2015-07-28 14:08:47 -0700 (Tue, 28 Jul 2015) New Revision: 4064 Modified: trunk/src/algorithm/LineIntersector.cpp trunk/src/io/WKTWriter.cpp trunk/src/operation/buffer/BufferOp.cpp trunk/src/operation/buffer/OffsetCurveSetBuilder.cpp Log: Include which defines NOMINMAX on Windows/VC++. Closes ticket #701. Modified: trunk/src/algorithm/LineIntersector.cpp =================================================================== --- trunk/src/algorithm/LineIntersector.cpp 2015-07-28 20:59:53 UTC (rev 4063) +++ trunk/src/algorithm/LineIntersector.cpp 2015-07-28 21:08:47 UTC (rev 4064) @@ -17,6 +17,7 @@ * **********************************************************************/ +#include #include #include #include Modified: trunk/src/io/WKTWriter.cpp =================================================================== --- trunk/src/io/WKTWriter.cpp 2015-07-28 20:59:53 UTC (rev 4063) +++ trunk/src/io/WKTWriter.cpp 2015-07-28 21:08:47 UTC (rev 4064) @@ -18,6 +18,7 @@ * **********************************************************************/ +#include #include #include #include Modified: trunk/src/operation/buffer/BufferOp.cpp =================================================================== --- trunk/src/operation/buffer/BufferOp.cpp 2015-07-28 20:59:53 UTC (rev 4063) +++ trunk/src/operation/buffer/BufferOp.cpp 2015-07-28 21:08:47 UTC (rev 4064) @@ -21,6 +21,7 @@ #include #include +#include #include #include #include Modified: trunk/src/operation/buffer/OffsetCurveSetBuilder.cpp =================================================================== --- trunk/src/operation/buffer/OffsetCurveSetBuilder.cpp 2015-07-28 20:59:53 UTC (rev 4063) +++ trunk/src/operation/buffer/OffsetCurveSetBuilder.cpp 2015-07-28 21:08:47 UTC (rev 4064) @@ -18,6 +18,7 @@ * **********************************************************************/ +#include #include #include #include From svn_geos at osgeo.org Fri Jul 31 07:23:38 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Fri, 31 Jul 2015 07:23:38 -0700 Subject: [geos-commits] r4065 - in branches/3.4: . src src/algorithm src/io src/operation/buffer tests/unit/capi Message-ID: <20150731142339.0D09F390135@trac.osgeo.org> Author: mloskot Date: 2015-07-31 07:23:38 -0700 (Fri, 31 Jul 2015) New Revision: 4065 Modified: branches/3.4/ branches/3.4/nmake.opt branches/3.4/src/Makefile.vc branches/3.4/src/algorithm/LineIntersector.cpp branches/3.4/src/dirlist.mk branches/3.4/src/io/WKTWriter.cpp branches/3.4/src/operation/buffer/BufferOp.cpp branches/3.4/src/operation/buffer/OffsetCurveSetBuilder.cpp branches/3.4/tests/unit/capi/GEOSPreparedGeometryTest.cpp Log: Merged revision(s) 4062-4064 from trunk: Add NMAKE version from released Visual Studio 2015 ........ Add operation/intersection/*.cpp to NMAKE makefiles ........ Include which defines NOMINMAX on Windows/VC++. Closes ticket #701. ........ Property changes on: branches/3.4 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3981,4054 + /trunk:3981,4054,4062-4064 Modified: branches/3.4/nmake.opt =================================================================== --- branches/3.4/nmake.opt 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/nmake.opt 2015-07-31 14:23:38 UTC (rev 4065) @@ -126,6 +126,9 @@ !ELSEIF "$(_NMAKE_VER)" == "14.00.22816.0" GEOS_MSVC = 14.0 GEOS_MSC = 1900 +!ELSEIF "$(_NMAKE_VER)" == "14.00.23026.0" +GEOS_MSVC = 14.0 +GEOS_MSC = 1900 !ELSE GEOS_MSVC = 0.0 GEOS_MSC = 0 Modified: branches/3.4/src/Makefile.vc =================================================================== --- branches/3.4/src/Makefile.vc 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/Makefile.vc 2015-07-31 14:23:38 UTC (rev 4065) @@ -210,6 +210,9 @@ operation\distance\ConnectedElementPointFilter.$(EXT) \ operation\distance\DistanceOp.$(EXT) \ operation\distance\GeometryLocation.$(EXT) \ + operation\intersection\Rectangle.$(EXT) \ + operation\intersection\RectangleIntersection.$(EXT) \ + operation\intersection\RectangleIntersectionBuilder.$(EXT) \ operation\linemerge\EdgeString.$(EXT) \ operation\linemerge\LineMergeDirectedEdge.$(EXT) \ operation\linemerge\LineMergeEdge.$(EXT) \ Modified: branches/3.4/src/algorithm/LineIntersector.cpp =================================================================== --- branches/3.4/src/algorithm/LineIntersector.cpp 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/algorithm/LineIntersector.cpp 2015-07-31 14:23:38 UTC (rev 4065) @@ -17,6 +17,7 @@ * **********************************************************************/ +#include #include #include #include Modified: branches/3.4/src/dirlist.mk =================================================================== --- branches/3.4/src/dirlist.mk 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/dirlist.mk 2015-07-31 14:23:38 UTC (rev 4065) @@ -28,6 +28,7 @@ operation \ operation\buffer \ operation\distance \ + operation\intersection \ operation\linemerge \ operation\overlay \ operation\overlay\snap \ Modified: branches/3.4/src/io/WKTWriter.cpp =================================================================== --- branches/3.4/src/io/WKTWriter.cpp 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/io/WKTWriter.cpp 2015-07-31 14:23:38 UTC (rev 4065) @@ -18,6 +18,7 @@ * **********************************************************************/ +#include #include #include #include Modified: branches/3.4/src/operation/buffer/BufferOp.cpp =================================================================== --- branches/3.4/src/operation/buffer/BufferOp.cpp 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/operation/buffer/BufferOp.cpp 2015-07-31 14:23:38 UTC (rev 4065) @@ -21,6 +21,7 @@ #include #include +#include #include #include #include Modified: branches/3.4/src/operation/buffer/OffsetCurveSetBuilder.cpp =================================================================== --- branches/3.4/src/operation/buffer/OffsetCurveSetBuilder.cpp 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/src/operation/buffer/OffsetCurveSetBuilder.cpp 2015-07-31 14:23:38 UTC (rev 4065) @@ -18,6 +18,7 @@ * **********************************************************************/ +#include #include #include #include Modified: branches/3.4/tests/unit/capi/GEOSPreparedGeometryTest.cpp =================================================================== --- branches/3.4/tests/unit/capi/GEOSPreparedGeometryTest.cpp 2015-07-28 21:08:47 UTC (rev 4064) +++ branches/3.4/tests/unit/capi/GEOSPreparedGeometryTest.cpp 2015-07-31 14:23:38 UTC (rev 4065) @@ -170,6 +170,44 @@ } + // Test PreparedIntersects: point on segment + template<> + template<> + void object::test<7>() + { + // POINT located between 3rd and 4th vertex of LINESTRING + // POINT(-23.1094689600055 50.5195368635957) + std::string point("01010000009a266328061c37c0e21a172f80424940"); + // LINESTRING(-23.122057005539 50.5201976774794,-23.1153476966995 50.5133404815199,-23.1094689600055 50.5223376452201,-23.1094689600055 50.5169177629559,-23.0961967920942 50.5330464848094,-23.0887991006034 50.5258515213185,-23.0852302622362 50.5264582238409) + std::string line("0102000000070000009909bf203f1f37c05c1d66d6954249404afe386d871d37c0a7eb1124b54149409c266328061c37c056d8bff5db42494098266328061c37c0034f7b5c2a42494060065c5aa01837c08ac001de3a4449408401b189bb1637c0b04e471a4f43494014ef84a6d11537c0b20dabfb62434940"); + geom1_ = GEOSGeomFromHEX_buf(reinterpret_cast(line.data()), line.size()); + geom2_ = GEOSGeomFromHEX_buf(reinterpret_cast(point.data()), point.size()); + prepGeom1_ = GEOSPrepare(geom1_); + ensure(0 != prepGeom1_); + + int ret = GEOSPreparedIntersects(prepGeom1_, geom2_); + ensure_equals(ret, 1); + } + + // Test PreparedIntersects: point on vertex + template<> + template<> + void object::test<8>() + { + // POINT located on the 3rd vertex of LINESTRING + // POINT(-23.1094689600055 50.5223376452201) + std::string point("01010000009c266328061c37c056d8bff5db424940"); + // LINESTRING(-23.122057005539 50.5201976774794,-23.1153476966995 50.5133404815199,-23.1094689600055 50.5223376452201,-23.1094689600055 50.5169177629559,-23.0961967920942 50.5330464848094,-23.0887991006034 50.5258515213185,-23.0852302622362 50.5264582238409) + std::string line("0102000000070000009909bf203f1f37c05c1d66d6954249404afe386d871d37c0a7eb1124b54149409c266328061c37c056d8bff5db42494098266328061c37c0034f7b5c2a42494060065c5aa01837c08ac001de3a4449408401b189bb1637c0b04e471a4f43494014ef84a6d11537c0b20dabfb62434940"); + geom1_ = GEOSGeomFromHEX_buf(reinterpret_cast(line.data()), line.size()); + geom2_ = GEOSGeomFromHEX_buf(reinterpret_cast(point.data()), point.size()); + prepGeom1_ = GEOSPrepare(geom1_); + ensure(0 != prepGeom1_); + + int ret = GEOSPreparedIntersects(prepGeom1_, geom2_); + ensure_equals(ret, 1); + } + // TODO: add lots of more tests } // namespace tut From svn_geos at osgeo.org Fri Jul 31 07:26:25 2015 From: svn_geos at osgeo.org (svn_geos at osgeo.org) Date: Fri, 31 Jul 2015 07:26:25 -0700 Subject: [geos-commits] r4066 - branches/3.4 Message-ID: <20150731142625.D8661390135@trac.osgeo.org> Author: mloskot Date: 2015-07-31 07:26:25 -0700 (Fri, 31 Jul 2015) New Revision: 4066 Modified: branches/3.4/NEWS Log: Add r4062-r4064 changes to NEWS Modified: branches/3.4/NEWS =================================================================== --- branches/3.4/NEWS 2015-07-31 14:23:38 UTC (rev 4065) +++ branches/3.4/NEWS 2015-07-31 14:26:25 UTC (rev 4066) @@ -13,7 +13,9 @@ - Make polygonize operation interruptable - Make relate-based operations interruptable (#711) - Update for Visual Studio 2013 (#691) - - Update for Visual Studio 2015 (r4054) + - Update for Visual Studio 2015 (r4054, r4062) + - Update for Microsoft NMAKE (r4063) + - Fix compilation issues while building with Visual C++ (#701) - Fix support of PHP bindings for version < 5.4.0 (#709) Changes in 3.4.2