[mapguide-commits] r9466 - in sandbox/jng/use_geos_c_api: . Common/Geometry Oem Oem/geos/VisualStudio Server/src/PostBuild UnitTest/WebTier/Java Web/src/MapGuideApi

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 25 04:53:04 PST 2019


Author: jng
Date: 2019-01-25 04:53:04 -0800 (Fri, 25 Jan 2019)
New Revision: 9466

Added:
   sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/geos_c.vcxproj
Removed:
   sandbox/jng/use_geos_c_api/Common/Geometry/GeosInclude.h
Modified:
   sandbox/jng/use_geos_c_api/Common/Geometry/Geometry.vcxproj
   sandbox/jng/use_geos_c_api/Common/Geometry/GeometryExceptionDef.h
   sandbox/jng/use_geos_c_api/Common/Geometry/GeometrySimplifier.cpp
   sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.cpp
   sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.h
   sandbox/jng/use_geos_c_api/Common/Geometry/PreparedGeometry.cpp
   sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.sln
   sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.vcxproj
   sandbox/jng/use_geos_c_api/Oem/oem.sln
   sandbox/jng/use_geos_c_api/Server/src/PostBuild/PostBuild.mak
   sandbox/jng/use_geos_c_api/UnitTest/WebTier/Java/build.xml
   sandbox/jng/use_geos_c_api/Web/src/MapGuideApi/copydlls.bat
   sandbox/jng/use_geos_c_api/desktop_package_excludes.txt
   sandbox/jng/use_geos_c_api/viewer_package_excludes.txt
Log:
Initial attempt to port MgGeometry over to plain GEOS C API. Add the geos_c project to GEOS and fix all existing usages of GEOS to use geos_c instead. Also, ensure that geos_c.dll is copied in addition to GEOS.dll

Most of the API surface is present except for a C equivalent of Geometry::getInteriorPoint() (needed by MgRegion::GetPointInRegion() and MgRing::GetPointInRing()). 

To implement this, requires us to implement the underlying getInteriorPoint() logic from GEOS itself. This commit doesn't fully implement all the required logic. We'll deal with that later.

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/Geometry.vcxproj
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/Geometry.vcxproj	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/Geometry.vcxproj	2019-01-25 12:53:04 UTC (rev 9466)
@@ -94,7 +94,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\capi;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GEOMETRY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -103,7 +103,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>csmapd.lib;ACEd.lib;GEOSd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>csmapd.lib;ACEd.lib;geos_cd.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgGeometryd.dll</OutputFile>
       <AdditionalLibraryDirectories>..\..\Oem\CsMap\CsMapDev\lib140\$(Configuration);..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\Oem\geos\VisualStudio\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -120,7 +120,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\capi;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GEOMETRY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -129,7 +129,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>csmapd.lib;ACEd.lib;GEOSd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>csmapd.lib;ACEd.lib;geos_cd.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgGeometryd.dll</OutputFile>
       <AdditionalLibraryDirectories>..\..\Oem\CsMap\CsMapDev\lib140\$(Configuration)64;..\..\Oem\ACE\ACE_wrappers\lib64\$(Configuration);..\..\Oem\geos\VisualStudio\$(Configuration)64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -143,7 +143,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
-      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\capi;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GEOMETRY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -151,7 +151,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>csmap.lib;ACE.lib;GEOS.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>csmap.lib;ACE.lib;geos_c.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgGeometry.dll</OutputFile>
       <AdditionalLibraryDirectories>..\..\Oem\CsMap\CsMapDev\lib140\$(Configuration);..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\Oem\geos\VisualStudio\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -170,7 +170,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
-      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\CoordinateSystem;..\Foundation;..\Geometry;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\geos\capi;..\..\Oem\geos\include;..\..\Oem\CsMap\CsMapDev\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GEOMETRY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -178,7 +178,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>csmap.lib;ACE.lib;GEOS.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>csmap.lib;ACE.lib;geos_c.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgGeometry.dll</OutputFile>
       <AdditionalLibraryDirectories>..\..\Oem\CsMap\CsMapDev\lib140\$(Configuration)64;..\..\Oem\ACE\ACE_Wrappers\lib64\$(Configuration);..\..\Oem\geos\VisualStudio\$(Configuration)64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/GeometryExceptionDef.h
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/GeometryExceptionDef.h	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/GeometryExceptionDef.h	2019-01-25 12:53:04 UTC (rev 9466)
@@ -26,14 +26,6 @@
     MG_TRY()                                                                  \
 
 #define MG_GEOMETRY_CATCH(methodName)                                         \
-    }                                                                         \
-    catch (const geos::util::GEOSException& e)                                \
-    {                                                                         \
-        MgStringCollection arguments;                                         \
-        std::string sWhat = e.what();                                         \
-        arguments.Add(MgUtil::MultiByteToWideChar(sWhat));                    \
-        mgException = NULL;                                                   \
-                                                                              \
     MG_CATCH(methodName)                                                      \
 
 #define MG_GEOMETRY_THROW()                                                   \

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/GeometrySimplifier.cpp
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/GeometrySimplifier.cpp	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/GeometrySimplifier.cpp	2019-01-25 12:53:04 UTC (rev 9466)
@@ -15,9 +15,7 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#include "GeosInclude.h"
-#include "geos/simplify/DouglasPeuckerSimplifier.h"
-#include "geos/simplify/TopologyPreservingSimplifier.h"
+#include <geos_c.h>
 
 #include "GeometryCommon.h"
 #include "GeosUtil.h"
@@ -33,46 +31,13 @@
 MgGeometry* MgGeometrySimplifier::Simplify(MgGeometry* geom, double tolerance, INT32 algorithm)
 {
     Ptr<MgGeometry> simplified;
-    std::auto_ptr<Geometry> gInput;
-    std::auto_ptr<Geometry> gOutput;
+
     MG_GEOMETRY_TRY()
 
-    CHECKARGUMENTNULL(geom, L"MgGeometrySimplifier.Simplify");
-    if (algorithm != MgGeometrySimplificationAlgorithmType::DouglasPeucker &&
-        algorithm != MgGeometrySimplificationAlgorithmType::TopologyPreserving)
-    {
-        throw new MgInvalidArgumentException(L"MgGeometrySimplifier.Simplify", __LINE__, __WFILE__, NULL, L"MgInvalidGeometrySimplficationAlgorithm", NULL);
-    }
+    simplified = MgGeosUtil::Simplify(geom, tolerance, algorithm);
 
-    STRING inputWKt = geom->ToAwkt(true);
-    PrecisionModel pm;
-    GeometryFactory gf(&pm, 10);
-    WKTReader r(&gf);
-    WKTWriter w;
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeometrySimplifier.Simplify");
 
-    gInput.reset(r.read(MgUtil::WideCharToMultiByte(inputWKt)));
-
-    switch (algorithm)
-    {
-    case MgGeometrySimplificationAlgorithmType::DouglasPeucker:
-        gOutput = geos::simplify::DouglasPeuckerSimplifier::simplify(gInput.get(), tolerance);
-        break;
-    case MgGeometrySimplificationAlgorithmType::TopologyPreserving:
-        gOutput = geos::simplify::TopologyPreservingSimplifier::simplify(gInput.get(), tolerance);
-        break;
-    }
-
-    Geometry* gSimp = gOutput.get();
-    std::string mbSimpWkt = w.write(gSimp);
-
-    if (mbSimpWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        simplified = rdrWrt.Read(MgUtil::MultiByteToWideChar(mbSimpWkt));
-    }
-    
-    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeometrySimplifier.Simplify")
-
     return simplified.Detach();
 }
 

Deleted: sandbox/jng/use_geos_c_api/Common/Geometry/GeosInclude.h
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/GeosInclude.h	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/GeosInclude.h	2019-01-25 12:53:04 UTC (rev 9466)
@@ -1,27 +0,0 @@
-//
-//  Copyright (C) 2004-2017 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef _GEOMETRY_GEOS_INCLUDE_H
-#define _GEOMETRY_GEOS_INCLUDE_H
-
-#include <geos/version.h>
-#include <geos/geom.h>
-#include <geos/util.h>
-#include <geos/io.h>
-#include <geos/unload.h>
-
-#endif
\ No newline at end of file

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.cpp
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.cpp	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.cpp	2019-01-25 12:53:04 UTC (rev 9466)
@@ -15,11 +15,7 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-// disable C4244 of io.h about int64 assigned to unsigned long
-#pragma warning(push)
-#pragma warning(disable: 4244)
-#include "GeosInclude.h"
-#pragma warning(pop)
+#include <geos_c.h>
 
 #include "GeometryCommon.h"
 #include "Buffer/buffer.h"
@@ -28,915 +24,844 @@
 #include "Spatial/SpatialUtility.h"
 #include "GeometricEntityType.h"
 
-using namespace geos;
-
-// Dummy class used to automate initialization/uninitialization of GEOS.
-class CInitGeos
+// This is a verbatim implementation of geos::algorithm::InteriorPointPoint
+// since this is not exposed through the GEOS C API
+//
+class MgGeomInteriorPointPoint
 {
 public:
-    CInitGeos()
+    MgGeomInteriorPointPoint(MgGeometry* geom)
     {
+        minDistance = std::numeric_limits<double>().max();
+        centroid = geom->GetCentroid();
+        if (NULL == centroid.p)
+        {
+            hasInterior = false;
+        }
+        else
+        {
+            hasInterior = true;
+            Add(geom);
+        }
     }
-    ~CInitGeos()
+    ~MgGeomInteriorPointPoint() 
     {
-        // free GEOS resources
-        Unload::Release();
+        centroid = NULL;
+        SAFE_RELEASE(interiorPoint);
     }
-};
 
-static CInitGeos s_InitGeos;
+    MgPoint* GetInteriorPoint()
+    {
+        if (!hasInterior)
+        {
+            return NULL;
+        }
+        return SAFE_ADDREF(interiorPoint);
+    }
+private:
+    double minDistance;
+    bool hasInterior;
 
+    Ptr<MgPoint> centroid;
+    MgPoint* interiorPoint;
 
-bool MgGeosUtil::Contains(MgGeometry* geom1, MgGeometry* geom2)
+    void Add(MgGeometry* geom)
+    {
+        INT32 gt = geom->GetGeometryType();
+        if (MgGeometryType::Point == gt)
+        {
+            Add(static_cast<MgPoint*>(geom));
+        }
+        else if (MgGeometryType::MultiGeometry)
+        {
+            MgMultiGeometry* gc = static_cast<MgMultiGeometry*>(geom);
+            for (INT32 i = 0; i < gc->GetCount(); i++)
+            {
+                Ptr<MgGeometry> itemGeom = gc->GetGeometryAt(i);
+                Add(itemGeom);
+            }
+        }
+    }
+
+    void Add(MgPoint* point)
+    {
+        double dist = point->Distance(centroid, NULL);
+        if (dist < minDistance)
+        {
+            SAFE_RELEASE(interiorPoint);
+            interiorPoint = SAFE_ADDREF(point);
+            minDistance = dist;
+        }
+    }
+};
+
+// This is a verbatim implementation of geos::algorithm::InteriorPointLine
+// since this is not exposed through the GEOS C API
+//
+class MgGeomInteriorPointLine 
 {
-    bool contains = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+public:
+    MgGeomInteriorPointLine(MgGeometry* geom) 
+    {
+        minDistance = std::numeric_limits<double>().max();
+        hasInterior = false;
+        centroid = geom->GetCentroid();
+        if (NULL != centroid.p)
+        {
+            AddInterior(geom);
+        }
+        
+        if (!hasInterior)
+            AddEndpoints(geom);
+    }
+    ~MgGeomInteriorPointLine() 
+    {
+        centroid = NULL;
+        SAFE_RELEASE(interiorPoint);
+    }
+    void AddInterior(MgGeometry* geom)
+    {
+        INT32 gt = geom->GetGeometryType();
+        if (MgGeometryType::LineString == gt)
+        {
+            MgLineString* ls = static_cast<MgLineString*>(geom);
+            Ptr<MgCoordinate> start = ls->GetStartCoordinate();
+            Ptr<MgCoordinate> end = ls->GetEndCoordinate();
+            Ptr<MgCoordinateIterator> iter = ls->GetCoordinates();
+            AddInterior(iter, start, end);
+        }
+        else if (MgGeometryType::MultiGeometry == gt)
+        {
+            MgMultiGeometry* mgeom = static_cast<MgMultiGeometry*>(geom);
+            for (INT32 i = 0; i < mgeom->GetCount(); i++)
+            {
+                Ptr<MgGeometry> g = mgeom->GetGeometryAt(i);
+                AddInterior(g);
+            }
+        }
+    }
+    void AddInterior(MgCoordinateIterator* iter, MgCoordinate* start, MgCoordinate* end)
+    {
+        while (iter->MoveNext())
+        {
+            Ptr<MgCoordinate> current = iter->GetCurrent();
+            if (current.p == start || current.p == end)
+                continue;
 
-    MG_GEOMETRY_TRY()
+            Ptr<MgPoint> pt = new MgPoint(current);
+            Add(pt);
+        }
+    }
+    void AddEndpoints(MgGeometry* geom)
+    {
+        INT32 gt = geom->GetGeometryType();
+        if (MgGeometryType::LineString == gt)
+        {
+            MgLineString* ls = static_cast<MgLineString*>(geom);
+            Ptr<MgCoordinate> start = ls->GetStartCoordinate();
+            Ptr<MgCoordinate> end = ls->GetEndCoordinate();
+            Ptr<MgCoordinateIterator> iter = ls->GetCoordinates();
+            AddEndpoints(start, end);
+        }
+        else if (MgGeometryType::MultiGeometry == gt)
+        {
+            MgMultiGeometry* mgeom = static_cast<MgMultiGeometry*>(geom);
+            for (INT32 i = 0; i < mgeom->GetCount(); i++)
+            {
+                Ptr<MgGeometry> g = mgeom->GetGeometryAt(i);
+                AddEndpoints(g);
+            }
+        }
+    }
+    void AddEndpoints(MgCoordinate* start, MgCoordinate* end)
+    {
+        Ptr<MgPoint> startPt = new MgPoint(start);
+        Add(startPt);
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+        Ptr<MgPoint> endPt = new MgPoint(end);
+        Add(endPt);
+    }
+    void Add(MgPoint* point)
+    {
+        double dist = point->Distance(centroid, NULL);
+        if (!hasInterior || dist < minDistance)
+        {
+            SAFE_RELEASE(interiorPoint);
+            interiorPoint = SAFE_ADDREF(point);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+            minDistance = dist;
+            hasInterior = true;
+        }
+    }
+    MgPoint* GetInteriorPoint()
+    {
+        if (!hasInterior)
+        {
+            return NULL;
+        }
+        return SAFE_ADDREF(interiorPoint);
+    }
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+private:
+    double minDistance;
+    bool hasInterior;
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+    Ptr<MgPoint> centroid;
+    MgPoint* interiorPoint;
+};
 
-    contains = g1->contains(g2);
+// This is a verbatim implementation of geos::algorithm::InteriorPointArea
+// since this is not exposed through the GEOS C API
+//
+class MgGeomInteriorPointArea
+{
+public:
+    MgGeomInteriorPointArea(MgGeometry* geom)
+    {
+        throw new MgNotImplementedException(L"MgGeomInteriorPointArea.MgGeomInteriorPointArea", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+    ~MgGeomInteriorPointArea()
+    {
+        centroid = NULL;
+        SAFE_RELEASE(interiorPoint);
+    }
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Contains")
+    MgPoint* GetInteriorPoint()
+    {
+        if (!hasInterior)
+        {
+            return NULL;
+        }
+        return SAFE_ADDREF(interiorPoint);
+    }
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+private:
+    double minDistance;
+    bool hasInterior;
 
-    MG_GEOMETRY_THROW()
+    Ptr<MgPoint> centroid;
+    MgPoint* interiorPoint;
+};
 
-    return contains;
+static void MgGeosErrorHandler(const char *fmt, ...)
+{
+   
 }
 
-bool MgGeosUtil::Intersects(MgGeometry* geom1, MgGeometry* geom2)
+static void MgGeosWarningHandler(const char *fmt, ...)
 {
-    bool intersects = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
 
-    MG_GEOMETRY_TRY()
+}
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+static GEOSGeometry* GeometricEntityToGeos(GEOSContextHandle_t hCtx, MgGeometricEntity* geom)
+{
+    STRING wktGeom = MgGeosUtil::ToAwkt(geom);
+    std::string wkt = MgUtil::WideCharToMultiByte(wktGeom);
+    return GEOSGeomFromWKT_r(hCtx, wkt.c_str());
+}
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+static GEOSGeometry* GeometryToGeos(GEOSContextHandle_t hCtx, MgGeometry* geom)
+{
+    Ptr<MgGeometry> tGeom = MgSpatialUtility::TesselateCurve(geom);
+    return GeometricEntityToGeos(hCtx, tGeom);
+}
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+typedef char(*geos_geom_bool_property)(GEOSContextHandle_t, const GEOSGeometry*);
+typedef int(*geos_geom_double_property)(GEOSContextHandle_t, const GEOSGeometry*, double*);
+typedef GEOSGeometry*(*geos_unary_geometry_operator)(GEOSContextHandle_t, const GEOSGeometry*);
+typedef GEOSGeometry*(*geos_binary_geometry_operator)(GEOSContextHandle_t, const GEOSGeometry*, const GEOSGeometry*);
+typedef char(*geos_binary_geometry_condition)(GEOSContextHandle_t, const GEOSGeometry*, const GEOSGeometry*);
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+static bool MgGeosBoolProperty(MgGeometricEntity* geom, geos_geom_bool_property op)
+{
+    bool bResult = false;
 
-    intersects = g1->intersects(g2);
+    GEOSGeometry* hGeom = NULL;
+    GEOSContextHandle_t hCtx = NULL;
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Intersects")
+    MG_GEOMETRY_TRY()
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
+    hGeom = GeometricEntityToGeos(hCtx, geom);
+
+    if (NULL != hGeom)
+    {
+        bResult = op(hCtx, hGeom);
+    }
+
+    MG_GEOMETRY_CATCH(L"MgGeosBoolProperty")
+
+    GEOSGeom_destroy_r(hCtx, hGeom);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
+
     MG_GEOMETRY_THROW()
 
-    return intersects;
+    return bResult;
 }
 
-bool MgGeosUtil::Crosses(MgGeometry* geom1, MgGeometry* geom2)
+static double MgGeosDoubleProperty(MgGeometricEntity* geom, geos_geom_double_property op)
 {
-    bool crosses = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    double dResult = 0.0;
 
+    GEOSGeometry* hGeom = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    hGeom = GeometricEntityToGeos(hCtx, geom);
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    if (NULL != hGeom)
+    {
+        op(hCtx, hGeom, &dResult);
+    }
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+    MG_GEOMETRY_CATCH(L"MgGeosDoubleProperty")
 
-    crosses = g1->crosses(g2);
+    GEOSGeom_destroy_r(hCtx, hGeom);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Crosses")
-
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
-
     MG_GEOMETRY_THROW()
 
-    return crosses;
+    return dResult;
 }
 
-bool MgGeosUtil::Disjoint(MgGeometry* geom1, MgGeometry* geom2)
+static bool MgGeosBinaryCondition(MgGeometry* geom1, MgGeometry* geom2, geos_binary_geometry_condition op)
 {
-    bool disjoint = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    bool bResult = false;
 
+    GEOSGeometry* hGeom1 = NULL;
+    GEOSGeometry* hGeom2 = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    hGeom1 = GeometryToGeos(hCtx, geom1);
+    hGeom2 = GeometryToGeos(hCtx, geom2);
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    if (NULL != hGeom1 && NULL != hGeom2)
+    {
+        bResult = op(hCtx, hGeom1, hGeom2);
+    }
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+    MG_GEOMETRY_CATCH(L"MgGeosBinaryCondition")
 
-    disjoint = g1->disjoint(g2);
+    GEOSGeom_destroy_r(hCtx, hGeom1);
+    GEOSGeom_destroy_r(hCtx, hGeom2);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Disjoint")
-
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
-
     MG_GEOMETRY_THROW()
 
-    return disjoint;
+    return bResult;
 }
 
-bool MgGeosUtil::Equals(MgGeometry* geom1, MgGeometry* geom2)
+static MgGeometry* MgGeosBinaryOperator(MgGeometry* geom1, MgGeometry* geom2, geos_binary_geometry_operator op, bool emptyIsNull)
 {
-    bool equals = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    Ptr<MgGeometry> geom;
 
+    GEOSGeometry* hGeom1 = NULL;
+    GEOSGeometry* hGeom2 = NULL;
+    GEOSGeometry* hResult = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    hGeom1 = GeometryToGeos(hCtx, geom1);
+    hGeom2 = GeometryToGeos(hCtx, geom2);
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    if (NULL != hGeom1 && NULL != hGeom2)
+    {
+        hResult = op(hCtx, hGeom1, hGeom2);
+        if (NULL != hResult)
+        {
+            char* szWkt = GEOSGeomToWKT_r(hCtx, hResult);
+            std::string mbWkt(szWkt);
+            GEOSFree_r(hCtx, szWkt);
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+            bool isValid = true;
+            if (emptyIsNull)
+            {
+                isValid = mbWkt.find("EMPTY", 0) == std::string::npos;
+            }
 
-    equals = g1->equals(g2);
+            if (isValid)
+            {
+                STRING wkt;
+                MgUtil::MultiByteToWideChar(mbWkt, wkt);
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Equals")
+                MgWktReaderWriter wktRw;
+                geom = wktRw.Read(wkt);
+            }
+        }
+    }
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH(L"MgGeosBinaryOperator")
 
+    GEOSGeom_destroy_r(hCtx, hGeom1);
+    GEOSGeom_destroy_r(hCtx, hGeom2);
+    GEOSGeom_destroy_r(hCtx, hResult);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
+
     MG_GEOMETRY_THROW()
 
-    return equals;
+    return SAFE_ADDREF((MgGeometry*)geom);
 }
 
-bool MgGeosUtil::Overlaps(MgGeometry* geom1, MgGeometry* geom2)
+static MgGeometry* MgGeosUnaryOperator(MgGeometry* geom, geos_unary_geometry_operator op, bool emptyIsNull)
 {
-    bool overlaps = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    Ptr<MgGeometry> result;
 
+    GEOSGeometry* hGeom = NULL;
+    GEOSGeometry* hResult = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    hGeom = GeometryToGeos(hCtx, geom);
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    if (NULL != hGeom)
+    {
+        hResult = op(hCtx, hGeom);
+        if (NULL != hResult)
+        {
+            char* szWkt = GEOSGeomToWKT_r(hCtx, hResult);
+            std::string mbWkt(szWkt);
+            GEOSFree_r(hCtx, szWkt);
+            
+            bool isValid = true;
+            if (emptyIsNull)
+            {
+                isValid = mbWkt.find("EMPTY", 0) == std::string::npos;
+            }
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+            if (isValid)
+            {
+                STRING wkt;
+                MgUtil::MultiByteToWideChar(mbWkt, wkt);
 
-    overlaps = g1->overlaps(g2);
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Overlaps")
+                MgWktReaderWriter wktRw;
+                result = wktRw.Read(wkt);
+            }
+        }
+    }
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH(L"MgGeosUnaryOperator")
 
+    GEOSGeom_destroy_r(hCtx, hGeom);
+    GEOSGeom_destroy_r(hCtx, hResult);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
+
     MG_GEOMETRY_THROW()
 
-    return overlaps;
+    return SAFE_ADDREF((MgGeometry*)result);
 }
 
-bool MgGeosUtil::Touches(MgGeometry* geom1, MgGeometry* geom2)
+bool MgGeosUtil::Contains(MgGeometry* geom1, MgGeometry* geom2)
 {
-    bool touches = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSContains_r);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Contains")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    return bResult;
+}
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+bool MgGeosUtil::Intersects(MgGeometry* geom1, MgGeometry* geom2)
+{
+    bool bResult = false;
 
-    touches = g1->touches(g2);
+    MG_GEOMETRY_TRY()
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Touches")
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSIntersects_r);
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Intersects")
 
-    MG_GEOMETRY_THROW()
-
-    return touches;
+    return bResult;
 }
 
-bool MgGeosUtil::Within(MgGeometry* geom1, MgGeometry* geom2)
+bool MgGeosUtil::Crosses(MgGeometry* geom1, MgGeometry* geom2)
 {
-    bool within = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSCrosses_r);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Crosses")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    return bResult;
+}
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
+bool MgGeosUtil::Disjoint(MgGeometry* geom1, MgGeometry* geom2)
+{
+    bool bResult = false;
 
-    within = g1->within(g2);
+    MG_GEOMETRY_TRY()
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Within")
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSDisjoint_r);
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Intersects")
 
-    MG_GEOMETRY_THROW()
-
-    return within;
+    return bResult;
 }
 
-MgGeometry* MgGeosUtil::Boundary(MgGeometry* geom1)
+bool MgGeosUtil::Equals(MgGeometry* geom1, MgGeometry* geom2)
 {
-    Ptr<MgGeometry> bndGeom;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g3 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSIntersects_r);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Equals")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g3 = g1->getBoundary();
+    return bResult;
+}
 
-    WKTWriter writer;
-    string bndWkt = writer.write(g3);
+bool MgGeosUtil::Overlaps(MgGeometry* geom1, MgGeometry* geom2)
+{
+    bool bResult = false;
 
-    if (bndWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        bndGeom = rdrWrt.Read(MgUtil::MultiByteToWideChar(bndWkt));
-    }
+    MG_GEOMETRY_TRY()
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Boundary")
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSIntersects_r);
 
-    delete g1;
-    delete g3;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Overlaps")
 
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgGeometry*)bndGeom);
+    return bResult;
 }
 
-MgGeometry* MgGeosUtil::ConvexHull(MgGeometry* geom1)
+bool MgGeosUtil::Touches(MgGeometry* geom1, MgGeometry* geom2)
 {
-    Ptr<MgGeometry> convexHull;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g3 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSTouches_r);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Touches")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g3 = g1->convexHull();
+    return bResult;
+}
 
-    WKTWriter writer;
-    string convexHullWkt = writer.write(g3);
+bool MgGeosUtil::Within(MgGeometry* geom1, MgGeometry* geom2)
+{
+    bool bResult = false;
 
-    if (convexHullWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        convexHull = rdrWrt.Read(MgUtil::MultiByteToWideChar(convexHullWkt));
-    }
+    MG_GEOMETRY_TRY()
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.ConvexHull")
+    bResult = MgGeosBinaryCondition(geom1, geom2, GEOSWithin_r);
 
-    delete g1;
-    delete g3;
-    delete gf;
-    delete pm;
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Within")
 
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgGeometry*)convexHull);
+    return bResult;
 }
 
-MgGeometry* MgGeosUtil::Difference(MgGeometry* geom1, MgGeometry* geom2)
+MgGeometry* MgGeosUtil::Boundary(MgGeometry* geom1)
 {
-    Ptr<MgGeometry> difference;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
-    Geometry* g3 = NULL;
+    Ptr<MgGeometry> result;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    result = MgGeosUnaryOperator(geom1, GEOSBoundary_r, true);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Boundary")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    return SAFE_ADDREF((MgGeometry*)result);
+}
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
-    g3 = g1->difference(g2);
+MgGeometry* MgGeosUtil::ConvexHull(MgGeometry* geom1)
+{
+    Ptr<MgGeometry> result;
 
-    WKTWriter writer;
-    string differenceWkt = writer.write(g3);
+    MG_GEOMETRY_TRY()
 
-    if (differenceWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        difference = rdrWrt.Read(MgUtil::MultiByteToWideChar(differenceWkt));
-    }
+    result = MgGeosUnaryOperator(geom1, GEOSConvexHull_r, true);
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Difference")
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.ConvexHull")
 
-    delete g1;
-    delete g2;
-    delete g3;
-    delete gf;
-    delete pm;
+    return SAFE_ADDREF((MgGeometry*)result);
+}
 
-    MG_GEOMETRY_THROW()
+MgGeometry* MgGeosUtil::Difference(MgGeometry* geom1, MgGeometry* geom2)
+{
+    Ptr<MgGeometry> result;
 
-    return SAFE_ADDREF((MgGeometry*)difference);
+    MG_GEOMETRY_TRY()
+
+    result = MgGeosBinaryOperator(geom1, geom2, GEOSDifference_r, true);
+
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Difference")
+
+    return SAFE_ADDREF((MgGeometry*)result);
 }
 
 
 double MgGeosUtil::Distance(MgGeometry* geom1, MgGeometry* geom2)
 {
-    double distance = 0.0;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
+    double dResult = false;
 
+    GEOSGeometry* hGeom1 = NULL;
+    GEOSGeometry* hGeom2 = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    hGeom1 = GeometryToGeos(hCtx, geom1);
+    hGeom2 = GeometryToGeos(hCtx, geom2);
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
+    if (NULL != hGeom1 && NULL != hGeom2)
+    {
+        GEOSDistance_r(hCtx, hGeom1, hGeom2, &dResult);
+    }
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
-
-    distance = g1->distance(g2);
-
     MG_GEOMETRY_CATCH(L"MgGeosUtil.Distance")
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
+    GEOSGeom_destroy_r(hCtx, hGeom1);
+    GEOSGeom_destroy_r(hCtx, hGeom2);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
 
     MG_GEOMETRY_THROW()
 
-    return distance;
+    return dResult;
 }
 
 MgGeometry* MgGeosUtil::Intersection(MgGeometry* geom1, MgGeometry* geom2)
 {
-    Ptr<MgGeometry> intersection;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
-    Geometry* g3 = NULL;
+    Ptr<MgGeometry> result;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    result = MgGeosBinaryOperator(geom1, geom2, GEOSIntersection_r, true);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Intersection")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
-
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
-    g3 = g1->intersection(g2);
-
-    WKTWriter writer;
-    string intersectionWkt = writer.write(g3);
-
-    if (intersectionWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        intersection = rdrWrt.Read(MgUtil::MultiByteToWideChar(intersectionWkt));
-    }
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Intersection")
-
-    delete g1;
-    delete g2;
-    delete g3;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgGeometry*)intersection);
+    return SAFE_ADDREF((MgGeometry*)result);
 }
 
 MgGeometry* MgGeosUtil::SymetricDifference(MgGeometry* geom1, MgGeometry* geom2)
 {
-    Ptr<MgGeometry> symetricDifference;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
-    Geometry* g3 = NULL;
+    Ptr<MgGeometry> result;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    result = MgGeosBinaryOperator(geom1, geom2, GEOSSymDifference_r, true);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.SymetricDifference")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
-
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
-    g3 = g1->symDifference(g2);
-
-    WKTWriter writer;
-    string symetricDifferenceWkt = writer.write(g3);
-
-    if (symetricDifferenceWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        symetricDifference = rdrWrt.Read(MgUtil::MultiByteToWideChar(symetricDifferenceWkt));
-    }
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.SymetricDifference")
-
-    delete g1;
-    delete g2;
-    delete g3;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgGeometry*)symetricDifference);
+    return SAFE_ADDREF((MgGeometry*)result);
 }
 
 MgGeometry* MgGeosUtil::Union(MgGeometry* geom1, MgGeometry* geom2)
 {
-    Ptr<MgGeometry> unionGeom;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Geometry* g2 = NULL;
-    Geometry* g3 = NULL;
+    Ptr<MgGeometry> result;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    result = MgGeosBinaryOperator(geom1, geom2, GEOSUnion_r, true);
 
-    Ptr<MgGeometry> tGeom1 = MgSpatialUtility::TesselateCurve(geom1);
-    Ptr<MgGeometry> tGeom2 = MgSpatialUtility::TesselateCurve(geom2);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Union")
 
-    STRING wktGeom1 = tGeom1->ToAwkt(true);
-    STRING wktGeom2 = tGeom2->ToAwkt(true);
-
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = r.read(MgUtil::WideCharToMultiByte(wktGeom2));
-    g3 = g1->Union(g2);
-
-    WKTWriter writer;
-    string unionGeomWkt = writer.write(g3);
-
-    if (unionGeomWkt.find("EMPTY", 0) == string::npos)
-    {
-        MgWktReaderWriter rdrWrt;
-        unionGeom = rdrWrt.Read(MgUtil::MultiByteToWideChar(unionGeomWkt));
-    }
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Union")
-
-    delete g1;
-    delete g2;
-    delete g3;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgGeometry*)unionGeom);
+    return SAFE_ADDREF((MgGeometry*)result);
 }
 
 bool MgGeosUtil::IsValid(MgGeometricEntity* geom1)
 {
-    bool isValid = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBoolProperty(geom1, GEOSisValid_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.IsValid")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    isValid = g1->isValid();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.IsValid")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return isValid;
+    return bResult;
 }
 
 bool MgGeosUtil::IsSimple(MgGeometricEntity* geom1)
 {
-    bool isSimple = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBoolProperty(geom1, GEOSisSimple_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.IsSimple")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    isSimple = g1->isSimple();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.IsSimple")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return isSimple;
+    return bResult;
 }
 
 bool MgGeosUtil::IsEmpty(MgGeometricEntity* geom1)
 {
-    bool isEmpty = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBoolProperty(geom1, GEOSisEmpty_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.IsEmpty")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    isEmpty = g1->isEmpty();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.IsEmpty")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return isEmpty;
+    return bResult;
 }
 
 bool MgGeosUtil::IsClosed(MgGeometricEntity* geom1)
 {
-    bool isClosed = false;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool bResult = false;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    bResult = MgGeosBoolProperty(geom1, GEOSisClosed_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.IsClosed")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    // isClosed = g1->isClosed();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.IsClosed")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return isClosed;
+    return bResult;
 }
 
 double MgGeosUtil::Area(MgGeometricEntity* geom1)
 {
-    double area = 0.0;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool dResult = 0.0;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    dResult = MgGeosDoubleProperty(geom1, GEOSArea_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Area")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    area = g1->getArea();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Area")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return area;
+    return dResult;
 }
 
 double MgGeosUtil::Length(MgGeometricEntity* geom1)
 {
-    double length = 0.0;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
+    bool dResult = 0.0;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    dResult = MgGeosDoubleProperty(geom1, GEOSLength_r);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.Length")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    length = g1->getLength();
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Length")
-
-    delete g1;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return length;
+    return dResult;
 }
 
 MgPoint* MgGeosUtil::Centroid(MgGeometricEntity* geom1)
 {
-    Ptr<MgPoint> point;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Point* g2 = NULL;
+    Ptr<MgPoint> geom;
 
+    GEOSGeometry* hGeom = NULL;
+    GEOSGeometry* hResult = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    hGeom = GeometricEntityToGeos(hCtx, geom);
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = g1->getCentroid();
+    if (NULL != hGeom)
+    {
+        hResult = GEOSGetCentroid_r(hCtx, hGeom);
+        if (NULL != hResult)
+        {
+            double x = std::numeric_limits<double>::quiet_NaN();
+            double y = std::numeric_limits<double>::quiet_NaN();
+            GEOSGeomGetX_r(hCtx, hResult, &x);
+            GEOSGeomGetY_r(hCtx, hResult, &y);
 
-    double x = g2->getX();
-    double y = g2->getY();
+            MgGeometryFactory geomFactory;
+            Ptr<MgCoordinate> coord = geomFactory.CreateCoordinateXY(x, y);
+            geom = geomFactory.CreatePoint(coord);
+        }
+    }
 
-    MgGeometryFactory geomFactory;
-    Ptr<MgCoordinate> coord = geomFactory.CreateCoordinateXY(x,y);
-    point = geomFactory.CreatePoint(coord);
+    MG_GEOMETRY_CATCH(L"MgGeosUnaryOperator")
 
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.Centroid")
+    GEOSGeom_destroy_r(hCtx, hGeom);
+    GEOSGeom_destroy_r(hCtx, hResult);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
 
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
-
     MG_GEOMETRY_THROW()
 
-    return SAFE_ADDREF((MgPoint*)point);
+    return SAFE_ADDREF((MgPoint*)geom);
 }
 
 MgPoint*  MgGeosUtil::GetPointInRegion(MgGeometry* geom1)
 {
-    Ptr<MgPoint> point;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Point* g2 = NULL;
+    Ptr<MgPoint> geom;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    INT32 dim = geom1->GetDimension();
+    if (MgGeometricDimension::Point == dim)
+    {
+        MgGeomInteriorPointPoint intPt(geom1);
+        geom = intPt.GetInteriorPoint();
+    }
+    else if (MgGeometricDimension::Curve == dim)
+    {
+        MgGeomInteriorPointLine intPt(geom1);
+        geom = intPt.GetInteriorPoint();
+    }
+    else if (MgGeometricDimension::Region == dim)
+    {
+        MgGeomInteriorPointArea intPt(geom1);
+        geom = intPt.GetInteriorPoint();
+    }
 
-    STRING wktGeom1 = ToAwkt(geom1);
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.GetPointInRegion")
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = g1->getInteriorPoint();
-
-    double x = g2->getX();
-    double y = g2->getY();
-
-    MgGeometryFactory geomFactory;
-    Ptr<MgCoordinate> coord = geomFactory.CreateCoordinateXY(x,y);
-    point = geomFactory.CreatePoint(coord);
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.GetInteriorPoint")
-
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgPoint*)point);
+    return SAFE_ADDREF((MgPoint*)geom);
 }
 
 MgPoint*  MgGeosUtil::GetPointInRing(MgGeometryComponent* geom1)
 {
-    Ptr<MgPoint> point;
-    PrecisionModel* pm = NULL;
-    GeometryFactory* gf = NULL;
-    Geometry* g1 = NULL;
-    Point* g2 = NULL;
+    Ptr<MgPoint> geom;
 
     MG_GEOMETRY_TRY()
 
-    pm = new PrecisionModel();
-    gf = new GeometryFactory(pm, 10);
-    WKTReader r(gf);
+    STRING wkt = geom1->ToAwkt(true);
+    MgWktReaderWriter wktRw;
+    Ptr<MgGeometry> geom2 = wktRw.Read(wkt);
 
-    STRING wktGeom1 = geom1->ToAwkt(true);
+    geom = GetPointInRegion(geom2);
 
-    g1 = r.read(MgUtil::WideCharToMultiByte(wktGeom1));
-    g2 = g1->getInteriorPoint();
+    MG_GEOMETRY_CATCH_AND_THROW(L"MgGeosUtil.GetPointInRing")
 
-    double x = g2->getX();
-    double y = g2->getY();
-
-    MgGeometryFactory geomFactory;
-    Ptr<MgCoordinate> coord = geomFactory.CreateCoordinateXY(x,y);
-    point = geomFactory.CreatePoint(coord);
-
-    MG_GEOMETRY_CATCH(L"MgGeosUtil.GetInteriorPoint")
-
-    delete g1;
-    delete g2;
-    delete gf;
-    delete pm;
-
-    MG_GEOMETRY_THROW()
-
-    return SAFE_ADDREF((MgPoint*)point);
+    return SAFE_ADDREF((MgPoint*)geom);
 }
 
 STRING MgGeosUtil::ToAwkt(MgGeometricEntity* geom1)
@@ -967,3 +892,60 @@
     }
     return wktStr;
 }
+
+MgGeometry* MgGeosUtil::Simplify(MgGeometry* geom, double tolerance, INT32 algorithm)
+{
+    Ptr<MgGeometry> simplified;
+
+    GEOSGeometry* hGeom = NULL;
+    GEOSGeometry* hResult = NULL;
+    GEOSContextHandle_t hCtx = NULL;
+
+    MG_GEOMETRY_TRY()
+
+    CHECKARGUMENTNULL(geom, L"MgGeosUtil.Simplify");
+    if (algorithm != MgGeometrySimplificationAlgorithmType::DouglasPeucker &&
+        algorithm != MgGeometrySimplificationAlgorithmType::TopologyPreserving)
+    {
+        throw new MgInvalidArgumentException(L"MgGeosUtil.Simplify", __LINE__, __WFILE__, NULL, L"MgInvalidGeometrySimplficationAlgorithm", NULL);
+    }
+
+    hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
+    hGeom = GeometryToGeos(hCtx, geom);
+
+    switch (algorithm)
+    {
+    case MgGeometrySimplificationAlgorithmType::DouglasPeucker:
+        hResult = GEOSSimplify_r(hCtx, hGeom, tolerance);
+        break;
+    case MgGeometrySimplificationAlgorithmType::TopologyPreserving:
+        hResult = GEOSTopologyPreserveSimplify_r(hCtx, hGeom, tolerance);
+        break;
+    }
+
+    if (NULL != hResult)
+    {
+        char* szWkt = GEOSGeomToWKT_r(hCtx, hResult);
+        std::string mbSimpWkt(szWkt);
+        GEOSFree_r(hCtx, szWkt);
+
+        if (mbSimpWkt.find("EMPTY", 0) == string::npos)
+        {
+            MgWktReaderWriter rdrWrt;
+            simplified = rdrWrt.Read(MgUtil::MultiByteToWideChar(mbSimpWkt));
+        }
+    }
+
+    MG_GEOMETRY_CATCH(L"MgGeosUtil.Simplify")
+
+    GEOSGeom_destroy_r(hCtx, hGeom);
+    GEOSGeom_destroy_r(hCtx, hResult);
+    if (NULL != hCtx)
+    {
+        finishGEOS_r(hCtx);
+    }
+
+    MG_GEOMETRY_THROW()
+
+    return simplified.Detach();
+}
\ No newline at end of file

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.h
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.h	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/GeosUtil.h	2019-01-25 12:53:04 UTC (rev 9466)
@@ -27,6 +27,7 @@
 class MgGeosUtil
 {
 public:
+    static MgGeometry* Simplify(MgGeometry* geom, double tolerance, INT32 algorithm);
     static bool Contains(MgGeometry* geom1, MgGeometry* geom2);
     static bool Intersects(MgGeometry* geom1, MgGeometry* geom2);
     static bool Crosses(MgGeometry* geom1, MgGeometry* geom2);
@@ -51,9 +52,12 @@
     static MgPoint* Centroid(MgGeometricEntity* geom1);
     static MgPoint* GetPointInRegion(MgGeometry* geom1);
     static MgPoint* GetPointInRing(MgGeometryComponent* geom1);
-private:
     static STRING ToAwkt(MgGeometricEntity* geom1);
 };
+
+static void MgGeosErrorHandler(const char *fmt, ...);
+static void MgGeosWarningHandler(const char *fmt, ...);
+
 /// \endcond
 
 #endif

Modified: sandbox/jng/use_geos_c_api/Common/Geometry/PreparedGeometry.cpp
===================================================================
--- sandbox/jng/use_geos_c_api/Common/Geometry/PreparedGeometry.cpp	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Common/Geometry/PreparedGeometry.cpp	2019-01-25 12:53:04 UTC (rev 9466)
@@ -16,50 +16,97 @@
 //
 
 #include "GeometryCommon.h"
-#include <geos/geom/prep/PreparedGeometry.h>
-#include <geos/geom/prep/PreparedGeometryFactory.h>
+#include "GeosUtil.h"
 
-using namespace geos::geom::prep;
-
 class MgPreparedGeometry::PreparedGeometryImpl 
 {
 public:
     PreparedGeometryImpl() 
-      : m_pg(NULL), 
-        m_pm(new PrecisionModel()), 
-        m_gf(NULL),
-        m_geom(NULL)
+      : m_pg(NULL), m_hCtx(NULL)
     {
-        m_gf.reset(new GeometryFactory(m_pm.get(), 10));
+        m_hCtx = initGEOS_r(MgGeosWarningHandler, MgGeosErrorHandler);
     }
     ~PreparedGeometryImpl() 
     {
-        PreparedGeometryFactory::destroy(m_pg);
+        GEOSPreparedGeom_destroy_r(m_hCtx, m_pg);
+        if (NULL != m_hCtx)
+        {
+            finishGEOS_r(m_hCtx);
+        }
     }
-    Geometry* Convert(MgGeometry* geom)
+    void Prepare(MgGeometry* geom)
     {
-        WKTReader r(m_gf.get());
-        Ptr<MgGeometry> tGeom = MgSpatialUtility::TesselateCurve(geom);
-        STRING wktGeom = tGeom->ToAwkt(true);
-
-        return r.read(MgUtil::WideCharToMultiByte(wktGeom));
+        GEOSGeometry* g = GeometryToGeos(geom);
+        m_pg = GEOSPrepare(g);
+        GEOSGeom_destroy_r(m_hCtx, g);
     }
-    void Prepare(MgGeometry* geom)
+    bool Contains(MgGeometry * geom)
     {
-        WKTReader r(m_gf.get());
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedContains(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Crosses(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedCrosses(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Disjoint(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedDisjoint(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Intersects(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedIntersects(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Overlaps(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedOverlaps(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Touches(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedTouches(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+    bool Within(MgGeometry * geom)
+    {
+        bool bResult = false;
+        GEOSGeometry* g = GeometryToGeos(geom);
+        bResult = GEOSPreparedWithin(m_pg, g);
+        GEOSGeom_destroy_r(m_hCtx, g);
+        return bResult;
+    }
+private:
+    const GEOSPreparedGeometry* m_pg;
+    GEOSContextHandle_t m_hCtx;
+
+    GEOSGeometry* GeometryToGeos(MgGeometry* geom)
+    {
         Ptr<MgGeometry> tGeom = MgSpatialUtility::TesselateCurve(geom);
-        STRING wktGeom = tGeom->ToAwkt(true);
-
-        m_geom.reset(r.read(MgUtil::WideCharToMultiByte(wktGeom)));
-        m_pg = PreparedGeometryFactory::prepare(m_geom.get());
+        STRING wktGeom = MgGeosUtil::ToAwkt(geom);
+        std::string wkt = MgUtil::WideCharToMultiByte(wktGeom);
+        return GEOSGeomFromWKT_r(m_hCtx, wkt.c_str());
     }
-
-    const PreparedGeometry* m_pg;
-
-private:
-    std::auto_ptr<Geometry> m_geom;
-    std::auto_ptr<PrecisionModel> m_pm;
-    std::auto_ptr<GeometryFactory> m_gf;
 };
 
 MgPreparedGeometry* MgPreparedGeometry::Create(MgGeometry* geom)
@@ -91,44 +138,37 @@
 
 bool MgPreparedGeometry::Contains(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->contains(gOther.get());
+    return d_ptr->Contains(other);
 }
 
 bool MgPreparedGeometry::Crosses(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->crosses(gOther.get());
+    return d_ptr->Crosses(other);
 }
 
 bool MgPreparedGeometry::Disjoint(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->disjoint(gOther.get());
+    return d_ptr->Disjoint(other);
 }
 
 bool MgPreparedGeometry::Intersects(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->intersects(gOther.get());
+    return d_ptr->Intersects(other);
 }
 
 bool MgPreparedGeometry::Overlaps(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->overlaps(gOther.get());
+    return d_ptr->Overlaps(other);
 }
 
 bool MgPreparedGeometry::Touches(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->touches(gOther.get());
+    return d_ptr->Touches(other);
 }
 
 bool MgPreparedGeometry::Within(MgGeometry * other)
 {
-    std::auto_ptr<Geometry> gOther(d_ptr->Convert(other));
-    return d_ptr->m_pg->within(gOther.get());
+    return d_ptr->Within(other);
 }
 
 INT32 MgPreparedGeometry::GetClassId() 

Modified: sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.sln
===================================================================
--- sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.sln	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.sln	2019-01-25 12:53:04 UTC (rev 9466)
@@ -1,37 +1,40 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Windows Desktop
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GEOS", "GEOS.vcxproj", "{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}"
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.329
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GEOS", "GEOS.vcxproj", "{1B9196BF-C194-47BC-846A-D9BBB134F2B3}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geos_c", "geos_c.vcxproj", "{C6C92B81-FF14-37DA-9509-2B33818500D4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		Debug|x64 = Debug|x64
-		MinSizeRel|Win32 = MinSizeRel|Win32
-		MinSizeRel|x64 = MinSizeRel|x64
 		Release|Win32 = Release|Win32
 		Release|x64 = Release|x64
-		RelWithDebInfo|Win32 = RelWithDebInfo|Win32
-		RelWithDebInfo|x64 = RelWithDebInfo|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Debug|Win32.Build.0 = Debug|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Debug|x64.ActiveCfg = Debug|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Debug|x64.Build.0 = Debug|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Release|Win32.ActiveCfg = Release|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Release|Win32.Build.0 = Release|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Release|x64.ActiveCfg = Release|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.Release|x64.Build.0 = Release|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
-		{0B9205CD-90A4-42B6-B61E-BF6DB5BC3F63}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Debug|Win32.Build.0 = Debug|Win32
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Debug|x64.ActiveCfg = Debug|x64
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Debug|x64.Build.0 = Debug|x64
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Release|Win32.ActiveCfg = Release|Win32
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Release|Win32.Build.0 = Release|Win32
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Release|x64.ActiveCfg = Release|x64
+		{1B9196BF-C194-47BC-846A-D9BBB134F2B3}.Release|x64.Build.0 = Release|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|Win32.Build.0 = Debug|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|x64.ActiveCfg = Debug|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|x64.Build.0 = Debug|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|Win32.ActiveCfg = Release|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|Win32.Build.0 = Release|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|x64.ActiveCfg = Release|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {7AC8B52C-6A92-4418-9CAB-D1DEC3BCCFC6}
+	EndGlobalSection
 EndGlobal

Modified: sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.vcxproj
===================================================================
--- sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.vcxproj	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/GEOS.vcxproj	2019-01-25 12:53:04 UTC (rev 9466)
@@ -9,30 +9,14 @@
       <Configuration>Debug</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="MinSizeRel|x64">
-      <Configuration>MinSizeRel</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="MinSizeRel|Win32">
-      <Configuration>MinSizeRel</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|x64">
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="RelWithDebInfo|Win32">
-      <Configuration>RelWithDebInfo</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="RelWithDebInfo|x64">
-      <Configuration>RelWithDebInfo</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGUID>{1B9196BF-C194-47BC-846A-D9BBB134F2B3}</ProjectGUID>
@@ -65,30 +49,6 @@
     <CharacterSet>MultiByte</CharacterSet>
     <PlatformToolset>v140</PlatformToolset>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v140</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v140</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v140</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v140</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -139,18 +99,10 @@
     <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">true</GenerateManifest>
     <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</GenerateManifest>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
-    <OutDir>.\$(Configuration)64\</OutDir>
-    <IntDir>.\$(Configuration)64\</IntDir>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <OutDir>.\$(Configuration)64\</OutDir>
     <IntDir>.\$(Configuration)64\</IntDir>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
-    <OutDir>.\$(Configuration)64\</OutDir>
-    <IntDir>.\$(Configuration)64\</IntDir>
-  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <OutDir>.\$(Configuration)64\</OutDir>
     <IntDir>.\$(Configuration)64\</IntDir>
@@ -341,184 +293,6 @@
       <LinkLibraryDependencies>false</LinkLibraryDependencies>
     </ProjectReference>
   </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AssemblerListingLocation>MinSizeRel/</AssemblerListingLocation>
-      <CompileAs>CompileAsCpp</CompileAs>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <Optimization>MinSpace</Optimization>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <WarningLevel>Level4</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR="MinSizeRel";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR=\"MinSizeRel\";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Midl>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <OutputDirectory>$(IntDir)</OutputDirectory>
-      <HeaderFileName>%(Filename).h</HeaderFileName>
-      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
-      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
-      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
-    </Midl>
-    <Link>
-      <AdditionalOptions> /machine:X86 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
-      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
-      <SubSystem>Console</SubSystem>
-      <Version>
-      </Version>
-    </Link>
-    <ProjectReference>
-      <LinkLibraryDependencies>false</LinkLibraryDependencies>
-    </ProjectReference>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AssemblerListingLocation>MinSizeRel/</AssemblerListingLocation>
-      <CompileAs>CompileAsCpp</CompileAs>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <Optimization>MinSpace</Optimization>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <WarningLevel>Level4</WarningLevel>
-      <DebugInformationFormat>
-      </DebugInformationFormat>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR="MinSizeRel";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR=\"MinSizeRel\";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Midl>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <OutputDirectory>$(IntDir)</OutputDirectory>
-      <HeaderFileName>%(Filename).h</HeaderFileName>
-      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
-      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
-      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
-    </Midl>
-    <Link>
-      <AdditionalOptions> /machine:X64 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
-      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
-      <SubSystem>Console</SubSystem>
-      <Version>
-      </Version>
-    </Link>
-    <ProjectReference>
-      <LinkLibraryDependencies>false</LinkLibraryDependencies>
-    </ProjectReference>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AssemblerListingLocation>RelWithDebInfo/</AssemblerListingLocation>
-      <CompileAs>CompileAsCpp</CompileAs>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <WarningLevel>Level4</WarningLevel>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR="RelWithDebInfo";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR=\"RelWithDebInfo\";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Midl>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <OutputDirectory>$(IntDir)</OutputDirectory>
-      <HeaderFileName>%(Filename).h</HeaderFileName>
-      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
-      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
-      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
-    </Midl>
-    <Link>
-      <AdditionalOptions> /machine:X86 /debug %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
-      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
-      <SubSystem>Console</SubSystem>
-      <Version>
-      </Version>
-    </Link>
-    <ProjectReference>
-      <LinkLibraryDependencies>false</LinkLibraryDependencies>
-    </ProjectReference>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AssemblerListingLocation>RelWithDebInfo/</AssemblerListingLocation>
-      <CompileAs>CompileAsCpp</CompileAs>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <Optimization>MaxSpeed</Optimization>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <RuntimeTypeInfo>true</RuntimeTypeInfo>
-      <WarningLevel>Level4</WarningLevel>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR="RelWithDebInfo";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;GEOS_INLINE;CMAKE_INTDIR=\"RelWithDebInfo\";GEOS_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <Midl>
-      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <OutputDirectory>$(IntDir)</OutputDirectory>
-      <HeaderFileName>%(Filename).h</HeaderFileName>
-      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
-      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
-      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
-    </Midl>
-    <Link>
-      <AdditionalOptions> /machine:X64 /debug %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
-      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
-      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
-      <SubSystem>Console</SubSystem>
-      <Version>
-      </Version>
-    </Link>
-    <ProjectReference>
-      <LinkLibraryDependencies>false</LinkLibraryDependencies>
-    </ProjectReference>
-  </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\include\geos\algorithm\Angle.h" />
     <ClInclude Include="..\include\geos\algorithm\BoundaryNodeRule.h" />

Added: sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/geos_c.vcxproj
===================================================================
--- sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/geos_c.vcxproj	                        (rev 0)
+++ sandbox/jng/use_geos_c_api/Oem/geos/VisualStudio/geos_c.vcxproj	2019-01-25 12:53:04 UTC (rev 9466)
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{C6C92B81-FF14-37DA-9509-2B33818500D4}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <Platform>Win32</Platform>
+    <ProjectName>geos_c</ProjectName>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\$(Configuration)\</IntDir>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)d</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)d</TargetName>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\$(Configuration)\</IntDir>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)</TargetName>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">.\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">.\$(Configuration)\</IntDir>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">$(ProjectName)</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">$(ProjectName)</TargetName>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">.dll</TargetExt>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">.dll</TargetExt>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">false</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">true</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">true</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">.\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">.\$(Configuration)\</IntDir>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">$(ProjectName)</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">$(ProjectName)</TargetName>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">.dll</TargetExt>
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">.dll</TargetExt>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">true</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">true</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>.\$(Configuration)64\</OutDir>
+    <IntDir>.\$(Configuration)64\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>.\$(Configuration)64\</OutDir>
+    <IntDir>.\$(Configuration)64\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <CompileAs>CompileAsCpp</CompileAs>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <Optimization>Disabled</Optimization>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level4</WarningLevel>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR="Debug";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ObjectFileName>$(IntDir)</ObjectFileName>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR=\"Debug\";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Midl>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <OutputDirectory>$(IntDir)</OutputDirectory>
+      <HeaderFileName>%(Filename).h</HeaderFileName>
+      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
+      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
+      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
+    </Midl>
+    <Link>
+      <AdditionalOptions> /machine:X86 /debug %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalDependencies>geosd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
+      <AdditionalLibraryDirectories>.\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
+      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
+      <SubSystem>Console</SubSystem>
+      <Version>
+      </Version>
+    </Link>
+    <ProjectReference>
+      <LinkLibraryDependencies>false</LinkLibraryDependencies>
+    </ProjectReference>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <CompileAs>CompileAsCpp</CompileAs>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <Optimization>Disabled</Optimization>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level4</WarningLevel>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR="Debug";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ObjectFileName>$(IntDir)</ObjectFileName>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR=\"Debug\";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Midl>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <OutputDirectory>$(IntDir)</OutputDirectory>
+      <HeaderFileName>%(Filename).h</HeaderFileName>
+      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
+      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
+      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
+    </Midl>
+    <Link>
+      <AdditionalOptions> /machine:X64 /debug %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalDependencies>geosd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
+      <AdditionalLibraryDirectories>.\Debug64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
+      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
+      <SubSystem>Console</SubSystem>
+      <Version>
+      </Version>
+    </Link>
+    <ProjectReference>
+      <LinkLibraryDependencies>false</LinkLibraryDependencies>
+    </ProjectReference>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <CompileAs>CompileAsCpp</CompileAs>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <Optimization>MaxSpeed</Optimization>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level4</WarningLevel>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR="Release";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ObjectFileName>$(IntDir)</ObjectFileName>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR=\"Release\";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Midl>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <OutputDirectory>$(IntDir)</OutputDirectory>
+      <HeaderFileName>%(Filename).h</HeaderFileName>
+      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
+      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
+      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
+    </Midl>
+    <Link>
+      <AdditionalOptions> /machine:X86 %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalDependencies>geos.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
+      <AdditionalLibraryDirectories>.\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
+      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
+      <SubSystem>Console</SubSystem>
+      <Version>
+      </Version>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+    <ProjectReference>
+      <LinkLibraryDependencies>false</LinkLibraryDependencies>
+    </ProjectReference>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <CompileAs>CompileAsCpp</CompileAs>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <Optimization>MaxSpeed</Optimization>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>
+      <WarningLevel>Level4</WarningLevel>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR="Release";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ObjectFileName>$(IntDir)</ObjectFileName>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;GEOS_INLINE;GEOS_DLL_EXPORT=1;CMAKE_INTDIR=\"Release\";geos_c_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Midl>
+      <AdditionalIncludeDirectories>..\include;..\capi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <OutputDirectory>$(IntDir)</OutputDirectory>
+      <HeaderFileName>%(Filename).h</HeaderFileName>
+      <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
+      <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
+      <ProxyFileName>%(Filename)_p.c</ProxyFileName>
+    </Midl>
+    <Link>
+      <AdditionalOptions> /machine:X64 %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalDependencies>geos.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
+      <AdditionalLibraryDirectories>.\Release64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
+      <ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
+      <SubSystem>Console</SubSystem>
+      <Version>
+      </Version>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+    <ProjectReference>
+      <LinkLibraryDependencies>false</LinkLibraryDependencies>
+    </ProjectReference>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\capi\geos_c.cpp"  />
+    <ClCompile Include="..\capi\geos_ts_c.cpp"  />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="geos.vcxproj">
+      <Project>{1B9196BF-C194-47BC-846A-D9BBB134F2B3}</Project>
+      <Name>geos</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

Modified: sandbox/jng/use_geos_c_api/Oem/oem.sln
===================================================================
--- sandbox/jng/use_geos_c_api/Oem/oem.sln	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Oem/oem.sln	2019-01-25 12:53:04 UTC (rev 9466)
@@ -89,6 +89,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMake", "..\BuildTools\WebTools\IMake\IMake.vcxproj", "{B601F04C-0D42-4AFC-A092-B31185E2EA8C}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geos_c", "geos\VisualStudio\geos_c.vcxproj", "{C6C92B81-FF14-37DA-9509-2B33818500D4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -384,6 +386,14 @@
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|Win32.Build.0 = Release|Win32
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.ActiveCfg = Release|x64
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.Build.0 = Release|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|Win32.Build.0 = Debug|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|x64.ActiveCfg = Debug|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Debug|x64.Build.0 = Debug|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|Win32.ActiveCfg = Release|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|Win32.Build.0 = Release|Win32
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|x64.ActiveCfg = Release|x64
+		{C6C92B81-FF14-37DA-9509-2B33818500D4}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: sandbox/jng/use_geos_c_api/Server/src/PostBuild/PostBuild.mak
===================================================================
--- sandbox/jng/use_geos_c_api/Server/src/PostBuild/PostBuild.mak	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Server/src/PostBuild/PostBuild.mak	2019-01-25 12:53:04 UTC (rev 9466)
@@ -618,6 +618,12 @@
 ..\..\bin\release\GEOS.pdb : ..\..\..\Oem\geos\VisualStudio\Release\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release\GEOS.pdb ..\..\bin\release\
 
+..\..\bin\release\geos_c.dll : ..\..\..\Oem\geos\VisualStudio\Release\geos_c.dll
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release\geos_c.dll ..\..\bin\release\
+
+..\..\bin\release\geos_c.pdb : ..\..\..\Oem\geos\VisualStudio\Release\geos_c.pdb
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release\geos_c.pdb ..\..\bin\release\
+
 ..\..\bin\release\libdb48.dll : ..\..\..\Oem\dbxml\bin\release\libdb48.dll
     xcopy /r /d /y ..\..\..\Oem\dbxml\bin\release\libdb48.dll ..\..\bin\release\
 
@@ -702,6 +708,8 @@
           ..\..\bin\release\gd.pdb \
           ..\..\bin\release\GEOS.dll \
           ..\..\bin\release\GEOS.pdb \
+          ..\..\bin\release\geos_c.dll \
+          ..\..\bin\release\geos_c.pdb \
           ..\..\bin\release\libdb48.dll \
           ..\..\bin\release\libdb48.pdb \
           ..\..\bin\release\libdbxml25.dll \
@@ -895,6 +903,12 @@
 ..\..\bin\release64\GEOS.pdb : ..\..\..\Oem\geos\VisualStudio\Release64\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release64\GEOS.pdb ..\..\bin\release64\
 
+..\..\bin\release64\geos_c.dll : ..\..\..\Oem\geos\VisualStudio\Release64\geos_c.dll
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release64\geos_c.dll ..\..\bin\release64\
+
+..\..\bin\release64\geos_c.pdb : ..\..\..\Oem\geos\VisualStudio\Release64\geos_c.pdb
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\Release64\geos_c.pdb ..\..\bin\release64\
+
 ..\..\bin\release64\libdb48.dll : ..\..\..\Oem\dbxml\bin64\release\libdb48.dll
     xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\release\libdb48.dll ..\..\bin\release64\
 
@@ -979,6 +993,8 @@
           ..\..\bin\release64\gd.pdb \
           ..\..\bin\release64\GEOS.dll \
           ..\..\bin\release64\GEOS.pdb \
+          ..\..\bin\release64\geos_c.dll \
+          ..\..\bin\release64\geos_c.pdb \
           ..\..\bin\release64\libdb48.dll \
           ..\..\bin\release64\libdb48.pdb \
           ..\..\bin\release64\libdbxml25.dll \
@@ -1419,6 +1435,8 @@
     if EXIST ..\..\bin\release\gd.pdb                        del /F ..\..\bin\release\gd.pdb
     if EXIST ..\..\bin\release\GEOS.dll                      del /F ..\..\bin\release\GEOS.dll
     if EXIST ..\..\bin\release\GEOS.pdb                      del /F ..\..\bin\release\GEOS.pdb
+    if EXIST ..\..\bin\release\geos_c.dll                    del /F ..\..\bin\release\geos_c.dll
+    if EXIST ..\..\bin\release\geos_c.pdb                    del /F ..\..\bin\release\geos_c.pdb
     if EXIST ..\..\bin\release\libdb48.dll                   del /F ..\..\bin\release\libdb48.dll
     if EXIST ..\..\bin\release\libdb48.pdb                   del /F ..\..\bin\release\libdb48.pdb
     if EXIST ..\..\bin\release\libdbxml25.dll                del /F ..\..\bin\release\libdbxml25.dll
@@ -1562,6 +1580,8 @@
     if EXIST ..\..\bin\release64\gd.pdb                        del /F ..\..\bin\release64\gd.pdb
     if EXIST ..\..\bin\release64\GEOS.dll                      del /F ..\..\bin\release64\GEOS.dll
     if EXIST ..\..\bin\release64\GEOS.pdb                      del /F ..\..\bin\release64\GEOS.pdb
+    if EXIST ..\..\bin\release64\geos_c.dll                    del /F ..\..\bin\release64\geos_c.dll
+    if EXIST ..\..\bin\release64\geos_c.pdb                    del /F ..\..\bin\release64\geos_c.pdb
     if EXIST ..\..\bin\release64\libdb48.dll                   del /F ..\..\bin\release64\libdb48.dll
     if EXIST ..\..\bin\release64\libdb48.pdb                   del /F ..\..\bin\release64\libdb48.pdb
     if EXIST ..\..\bin\release64\libdbxml25.dll                del /F ..\..\bin\release64\libdbxml25.dll
@@ -2288,6 +2308,12 @@
 ..\..\bin\release(v100)\GEOS.pdb : ..\..\..\Oem\geos\VisualStudio\release(v100)\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)\GEOS.pdb ..\..\bin\release(v100)\
 
+..\..\bin\release(v100)\geos_c.dll : ..\..\..\Oem\geos\VisualStudio\release(v100)\geos_c.dll
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)\GEOS.dll ..\..\bin\release(v100)\
+
+..\..\bin\release(v100)\geos_c.pdb : ..\..\..\Oem\geos\VisualStudio\release(v100)\geos_c.pdb
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)\geos_c.pdb ..\..\bin\release(v100)\
+
 ..\..\bin\release(v100)\libdb48.dll : ..\..\..\Oem\dbxml\bin\release(v100)\libdb48.dll
     xcopy /r /d /y ..\..\..\Oem\dbxml\bin\release(v100)\libdb48.dll ..\..\bin\release(v100)\
 
@@ -2372,6 +2398,8 @@
           ..\..\bin\release(v100)\gd.pdb \
           ..\..\bin\release(v100)\GEOS.dll \
           ..\..\bin\release(v100)\GEOS.pdb \
+          ..\..\bin\release(v100)\geos_c.dll \
+          ..\..\bin\release(v100)\geos_c.pdb \
           ..\..\bin\release(v100)\libdb48.dll \
           ..\..\bin\release(v100)\libdb48.pdb \
           ..\..\bin\release(v100)\libdbxml25.dll \
@@ -2558,6 +2586,12 @@
 ..\..\bin\release(v100)64\GEOS.pdb : ..\..\..\Oem\geos\VisualStudio\release(v100)64\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)64\GEOS.pdb ..\..\bin\release(v100)64\
 
+..\..\bin\release(v100)64\geos_c.dll : ..\..\..\Oem\geos\VisualStudio\release(v100)64\geos_c.dll
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)64\geos_c.dll ..\..\bin\release(v100)64\
+
+..\..\bin\release(v100)64\geos_c.pdb : ..\..\..\Oem\geos\VisualStudio\release(v100)64\geos_c.pdb
+    xcopy /r /d /y ..\..\..\Oem\geos\VisualStudio\release(v100)64\geos_c.pdb ..\..\bin\release(v100)64\
+
 ..\..\bin\release(v100)64\libdb48.dll : ..\..\..\Oem\dbxml\bin64\release(v100)\libdb48.dll
     xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\release(v100)\libdb48.dll ..\..\bin\release(v100)64\
 
@@ -2642,6 +2676,8 @@
           ..\..\bin\release(v100)64\gd.pdb \
           ..\..\bin\release(v100)64\GEOS.dll \
           ..\..\bin\release(v100)64\GEOS.pdb \
+          ..\..\bin\release(v100)64\geos_c.dll \
+          ..\..\bin\release(v100)64\geos_c.pdb \
           ..\..\bin\release(v100)64\libdb48.dll \
           ..\..\bin\release(v100)64\libdb48.pdb \
           ..\..\bin\release(v100)64\libdbxml25.dll \
@@ -3061,6 +3097,8 @@
     if EXIST ..\..\bin\release(v100)\gd.pdb                        del /F ..\..\bin\release(v100)\gd.pdb
     if EXIST ..\..\bin\release(v100)\GEOS.dll                      del /F ..\..\bin\release(v100)\GEOS.dll
     if EXIST ..\..\bin\release(v100)\GEOS.pdb                      del /F ..\..\bin\release(v100)\GEOS.pdb
+    if EXIST ..\..\bin\release(v100)\geos_c.dll                    del /F ..\..\bin\release(v100)\geos_c.dll
+    if EXIST ..\..\bin\release(v100)\geos_c.pdb                    del /F ..\..\bin\release(v100)\geos_c.pdb
     if EXIST ..\..\bin\release(v100)\libdb48.dll                   del /F ..\..\bin\release(v100)\libdb48.dll
     if EXIST ..\..\bin\release(v100)\libdb48.pdb                   del /F ..\..\bin\release(v100)\libdb48.pdb
     if EXIST ..\..\bin\release(v100)\libdbxml25.dll                del /F ..\..\bin\release(v100)\libdbxml25.dll
@@ -3197,6 +3235,8 @@
     if EXIST ..\..\bin\release(v100)64\gd.pdb                        del /F ..\..\bin\release(v100)64\gd.pdb
     if EXIST ..\..\bin\release(v100)64\GEOS.dll                      del /F ..\..\bin\release(v100)64\GEOS.dll
     if EXIST ..\..\bin\release(v100)64\GEOS.pdb                      del /F ..\..\bin\release(v100)64\GEOS.pdb
+    if EXIST ..\..\bin\release(v100)64\geos_c.dll                    del /F ..\..\bin\release(v100)64\geos_c.dll
+    if EXIST ..\..\bin\release(v100)64\geos_c.pdb                    del /F ..\..\bin\release(v100)64\geos_c.pdb
     if EXIST ..\..\bin\release(v100)64\libdb48.dll                   del /F ..\..\bin\release(v100)64\libdb48.dll
     if EXIST ..\..\bin\release(v100)64\libdb48.pdb                   del /F ..\..\bin\release(v100)64\libdb48.pdb
     if EXIST ..\..\bin\release(v100)64\libdbxml25.dll                del /F ..\..\bin\release(v100)64\libdbxml25.dll

Modified: sandbox/jng/use_geos_c_api/UnitTest/WebTier/Java/build.xml
===================================================================
--- sandbox/jng/use_geos_c_api/UnitTest/WebTier/Java/build.xml	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/UnitTest/WebTier/Java/build.xml	2019-01-25 12:53:04 UTC (rev 9466)
@@ -60,6 +60,7 @@
         <include name="**/Mg*.dll" />
         <include name="**/ACE.dll" />
         <include name="**/GEOS.dll" />
+        <include name="**/geos_c.dll" />
         <include name="**/lib_json.dll" />
         <include name="**/MapGuideJavaApiEx.dll" />
         <include name="**/xerces-c_3_1mg.dll" />

Modified: sandbox/jng/use_geos_c_api/Web/src/MapGuideApi/copydlls.bat
===================================================================
--- sandbox/jng/use_geos_c_api/Web/src/MapGuideApi/copydlls.bat	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/Web/src/MapGuideApi/copydlls.bat	2019-01-25 12:53:04 UTC (rev 9466)
@@ -40,6 +40,9 @@
 echo Copying GEOS Release DLL to %WEB_BIN_RELEASE%
 xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%2\GEOS.dll" %WEB_BIN_RELEASE%
 
+echo Copying geos_c Release DLL to %WEB_BIN_RELEASE%
+xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%2\geos_c.dll" %WEB_BIN_RELEASE%
+
 echo Copying JSON Release DLL to %WEB_BIN_RELEASE%
 xcopy /r /d /y "..\..\..\Oem\jsoncpp\lib\%2\lib_json.dll" %WEB_BIN_RELEASE%
 
@@ -80,6 +83,9 @@
 echo Copying GEOS Release DLL to %WEB_BIN_RELEASE%64
 xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%264\GEOS.dll" %WEB_BIN_RELEASE%64
 
+echo Copying geos_c Release DLL to %WEB_BIN_RELEASE%64
+xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%264\geos_c.dll" %WEB_BIN_RELEASE%64
+
 echo Copying JSON Release DLL to %WEB_BIN_RELEASE%64
 xcopy /r /d /y "..\..\..\Oem\jsoncpp\lib64\%2\lib_json.dll" %WEB_BIN_RELEASE%64
 
@@ -120,6 +126,9 @@
 echo Copying GEOS Debug DLL to %WEB_BIN_DEBUG%
 xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%2\GEOSd.dll" %WEB_BIN_DEBUG%
 
+echo Copying geos_c Debug DLL to %WEB_BIN_DEBUG%
+xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%2\geos_cd.dll" %WEB_BIN_DEBUG%
+
 echo Copying JSON Debug DLL to %WEB_BIN_DEBUG%
 xcopy /r /d /y "..\..\..\Oem\jsoncpp\lib\%2\lib_jsond.dll" %WEB_BIN_DEBUG%
 
@@ -160,6 +169,9 @@
 echo Copying GEOS Debug DLL to %WEB_BIN_DEBUG%64
 xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%264\GEOSd.dll" %WEB_BIN_DEBUG%64
 
+echo Copying geos_c Debug DLL to %WEB_BIN_DEBUG%64
+xcopy /r /d /y "..\..\..\Oem\geos\VisualStudio\%264\geos_c.dll" %WEB_BIN_DEBUG%64
+
 echo Copying JSON Debug DLL to %WEB_BIN_DEBUG%64
 xcopy /r /d /y "..\..\..\Oem\jsoncpp\lib64\%2\lib_jsond.dll" %WEB_BIN_DEBUG%64
 

Modified: sandbox/jng/use_geos_c_api/desktop_package_excludes.txt
===================================================================
--- sandbox/jng/use_geos_c_api/desktop_package_excludes.txt	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/desktop_package_excludes.txt	2019-01-25 12:53:04 UTC (rev 9466)
@@ -7,6 +7,7 @@
 FoundationUnmanagedApi.dll
 GeometryUnmanagedApi.dll
 GEOS.dll
+geos_c.dll
 MgFoundation.dll
 MgGeometry.dll
 MgMdfModel.dll

Modified: sandbox/jng/use_geos_c_api/viewer_package_excludes.txt
===================================================================
--- sandbox/jng/use_geos_c_api/viewer_package_excludes.txt	2019-01-25 07:04:13 UTC (rev 9465)
+++ sandbox/jng/use_geos_c_api/viewer_package_excludes.txt	2019-01-25 12:53:04 UTC (rev 9466)
@@ -22,6 +22,7 @@
 FoundationUnmanagedApi.dll
 GeometryUnmanagedApi.dll
 GEOS.dll
+geos_c.dll
 MgFoundation.dll
 MgGeometry.dll
 MgMdfModel.dll



More information about the mapguide-commits mailing list