[geos-commits] [SCM] GEOS branch master updated. 186bbd32fbf07d8b5d419cdfd64c14e2270a418a

git at osgeo.org git at osgeo.org
Thu Dec 10 15:37:50 PST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  186bbd32fbf07d8b5d419cdfd64c14e2270a418a (commit)
       via  d271aaa9a1939fe5a51c5b5d05f1a3d547a2f900 (commit)
      from  274993b1638d22ca150e71694f576032520d6a8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 186bbd32fbf07d8b5d419cdfd64c14e2270a418a
Merge: 274993b d271aaa
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Dec 10 15:37:40 2020 -0800

    Merge branch 'namespace'

diff --cc capi/geos_ts_c.cpp
index 16e6487,55b3562..0aeda7f
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@@ -2697,10 -2702,14 +2697,10 @@@ extern "C" 
      };
  
      Geometry*
-     GEOSWKBReader_read_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* wkb, size_t size)
+     GEOSWKBReader_read_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* wkb, std::size_t size)
      {
          return execute(extHandle, [&]() {
 -            // http://stackoverflow.com/questions/2079912/simpler-way-to-create-a-c-memorystream-from-char-size-t-without-copying-t
 -            membuf mb((char*)wkb, size);
 -            istream is(&mb);
 -
 -            return reader->read(is).release();
 +            return reader->read(wkb, size).release();
          });
      }
  

commit d271aaa9a1939fe5a51c5b5d05f1a3d547a2f900
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Dec 10 14:06:57 2020 -0800

    Remove use of 'using namespace std'. References #915

diff --git a/benchmarks/ClassSizes.cpp b/benchmarks/ClassSizes.cpp
index d4fe96b..0a7f3b9 100644
--- a/benchmarks/ClassSizes.cpp
+++ b/benchmarks/ClassSizes.cpp
@@ -44,11 +44,10 @@
 #include <geos/triangulate/quadedge/QuadEdgeQuartet.h>
 #include <geos/triangulate/quadedge/Vertex.h>
 
-using namespace std;
 using namespace geos;
 
 #define check(x) \
-	{ cout << "Size of " << #x << " is " << sizeof(x) << endl; }
+	{ std::cout << "Size of " << #x << " is " << sizeof(x) << std::endl; }
 
 int
 main()
diff --git a/benchmarks/algorithm/InteriorPointAreaPerfTest.cpp b/benchmarks/algorithm/InteriorPointAreaPerfTest.cpp
index 56ea68f..c5b25e2 100644
--- a/benchmarks/algorithm/InteriorPointAreaPerfTest.cpp
+++ b/benchmarks/algorithm/InteriorPointAreaPerfTest.cpp
@@ -34,7 +34,6 @@
 
 using namespace geos::geom;
 using namespace geos::io;
-using namespace std;
 
 class InteriorPointAreaPerfTest {
 public:
@@ -65,7 +64,7 @@ public:
         std::unique_ptr<Geometry> sinePolyCrinkly(reducer.reduce(sinePoly.get()));
         sinePoly.reset();
 
-        //cout << sinePolyCrinkly->toText() << endl;
+        //std::cout << sinePolyCrinkly->toText() << std::endl;
 
         test(*sinePolyCrinkly);
     }
@@ -83,14 +82,14 @@ private:
 
     void
     showHeader() {
-        cout << "Interior Point Area perf test" << endl;
-        cout << "# Iterations: " << N_ITER << endl;
-        cout << "SineStar: origin: ("
+        std::cout << "Interior Point Area perf test" << std::endl;
+        std::cout << "# Iterations: " << N_ITER << std::endl;
+        std::cout << "SineStar: origin: ("
                 << ORG_X << ", " << ORG_Y
                 << ")  size: " << SIZE
                 << "  # arms: " << N_ARMS
                 << "  arm ratio: " << ARM_RATIO
-                << endl;
+                << std::endl;
     }
 
     void
@@ -104,7 +103,7 @@ private:
         }
 
         sw.stop();
-        cout << poly.getNumPoints() << " points: " << sw.getTotFormatted() << endl;
+        std::cout << poly.getNumPoints() << " points: " << sw.getTotFormatted() << std::endl;
     }
 
     std::unique_ptr<geos::geom::Polygon>
diff --git a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
index 70b1a9f..46929ee 100644
--- a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
+++ b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
@@ -26,7 +26,7 @@
 class SegmentUnaryUnionPerfTest {
 
 public:
-    void test(size_t num_lines) {
+    void test(std::size_t num_lines) {
         using namespace geos::geom;
 
         std::default_random_engine e(12345);
@@ -35,7 +35,7 @@ public:
 
         std::vector<std::unique_ptr<LineString>> lines;
 
-        for (size_t i = 0; i < num_lines; i++) {
+        for (std::size_t i = 0; i < num_lines; i++) {
             CoordinateArraySequence cas(2, 2);
             cas.setAt(Coordinate(dis(e), dis(e)), 0);
             cas.setAt(Coordinate(dis(e), dis(e)), 1);
diff --git a/benchmarks/algorithm/VoronoiPerfTest.cpp b/benchmarks/algorithm/VoronoiPerfTest.cpp
index df90128..dd80918 100644
--- a/benchmarks/algorithm/VoronoiPerfTest.cpp
+++ b/benchmarks/algorithm/VoronoiPerfTest.cpp
@@ -26,7 +26,7 @@
 class VoronoiPerfTest {
 
 public:
-    void test(size_t num_points) {
+    void test(std::size_t num_points) {
         using namespace geos::geom;
 
         std::default_random_engine e(12345);
@@ -89,4 +89,4 @@ int main() {
     for (auto i = 0; i < 5; i++) {
         tester.test(100000);
     }
-}
\ No newline at end of file
+}
diff --git a/benchmarks/capi/GEOSPreparedContainsPerfTest.cpp b/benchmarks/capi/GEOSPreparedContainsPerfTest.cpp
index 4665748..97e4cc0 100644
--- a/benchmarks/capi/GEOSPreparedContainsPerfTest.cpp
+++ b/benchmarks/capi/GEOSPreparedContainsPerfTest.cpp
@@ -32,7 +32,7 @@
 class GEOSPreparedContainsPerfTest {
 
 public:
-    void test(const GEOSGeometry* g, size_t num_points) {
+    void test(const GEOSGeometry* g, std::size_t num_points) {
         using namespace geos::geom;
 
         double xmin, xmax, ymin, ymax;
@@ -54,7 +54,7 @@ public:
         geos::util::Profile sw("GEOSPreparedContains");
         sw.start();
 
-        size_t hits = 0;
+        std::size_t hits = 0;
         auto prep = GEOSPrepare(g);
         for (const auto& c : coords) {
             auto pt = GEOSGeom_createPointFromXY(c.x, c.y);
diff --git a/benchmarks/operation/buffer/IteratedBufferStressTest.cpp b/benchmarks/operation/buffer/IteratedBufferStressTest.cpp
index 52910f3..b97827a 100644
--- a/benchmarks/operation/buffer/IteratedBufferStressTest.cpp
+++ b/benchmarks/operation/buffer/IteratedBufferStressTest.cpp
@@ -28,18 +28,17 @@
 
 using namespace geos::geom;
 using namespace geos::io;
-using namespace std;
 
-typedef unique_ptr<Geometry> GeomPtr;
+typedef std::unique_ptr<Geometry> GeomPtr;
 
 GeomPtr
 doBuffer(const Geometry& g, double dist)
 {
-    cout << "Buffering with dist = " << dist << endl;
+    std::cout << "Buffering with dist = " << dist << std::endl;
     GeomPtr buf(g.buffer(dist));
-    cout << "Buffer result has " <<  buf->getNumPoints() << " vertices" << endl;
+    std::cout << "Buffer result has " <<  buf->getNumPoints() << " vertices" << std::endl;
 
-//cout << *buf << endl;
+//std::cout << *buf << std::endl;
 
     return buf;
 }
@@ -61,8 +60,8 @@ run(const Geometry* base)
         GeomPtr b2 = doBuffer(*b1, -dist);
 
         totalSW.stop();
-        cout << "----------------------  "
-             << totalSW << endl; // totalSW.getTimeString() << endl;
+        std::cout << "----------------------  "
+             << totalSW << std::endl; // totalSW.getTimeString() << std::endl;
 
         dist += 1;
         base = b2.get();
@@ -81,7 +80,7 @@ main()
     GeometryFactory::Ptr gf = GeometryFactory::create(&pm);
     WKTReader rdr(gf.get());
 
-    string inputWKT =
+    std::string inputWKT =
         "POLYGON ((110 320, 190 220, 60 200, 180 120, 120 40, 290 150, 410 40, 410 230, 500 340, 320 310, 260 370, 220 310, 110 320), (220 260, 250 180, 290 220, 360 150, 350 250, 260 280, 220 260))";
 
     GeomPtr base(rdr.read(inputWKT));
diff --git a/benchmarks/operation/predicate/RectangleIntersectsPerfTest.cpp b/benchmarks/operation/predicate/RectangleIntersectsPerfTest.cpp
index e5e8138..fddcd17 100644
--- a/benchmarks/operation/predicate/RectangleIntersectsPerfTest.cpp
+++ b/benchmarks/operation/predicate/RectangleIntersectsPerfTest.cpp
@@ -33,7 +33,6 @@
 
 using namespace geos::geom;
 using namespace geos::io;
-using namespace std;
 
 class RectangleIntersectsPerfTest {
 public:
@@ -83,7 +82,7 @@ private:
     void
     testRectangles(const Geometry& target, int nRect, double rectSize)
     {
-        vector<const Geometry*> rects;
+        std::vector<const Geometry*> rects;
         createRectangles(*target.getEnvelopeInternal(), nRect, rectSize, rects);
         test(rects, target);
         for (const Geometry* g: rects) {
@@ -92,28 +91,25 @@ private:
     }
 
     void
-    test(vector<const Geometry*>& rect, const Geometry& g)
+    test(std::vector<const Geometry*>& rect, const Geometry& g)
     {
-        typedef vector<const Geometry*>::size_type size_type;
-
         geos::util::Profile sw("");
         sw.start();
 
-        for(int i = 0; i < MAX_ITER; i++) {
-            for(size_type j = 0; j < rect.size(); j++) {
+        for(std::size_t i = 0; i < MAX_ITER; i++) {
+            for(std::size_t j = 0; j < rect.size(); j++) {
                 rect[j]->intersects(&g);
             }
         }
 
         sw.stop();
-        cout << g.getNumPoints() << " points: " << sw.getTot() << " usecs" << endl;
-
+        std::cout << g.getNumPoints() << " points: " << sw.getTot() << " usecs" << std::endl;
     }
 
     // Push newly created geoms to rectLit
     void
     createRectangles(const Envelope& env, int nRect, double,
-                     vector<const Geometry*>& rectList)
+                     std::vector<const Geometry*>& rectList)
     {
         int nSide =  1 + (int)sqrt((double) nRect);
         double dx = env.getWidth() / nSide;
diff --git a/capi/geos_c.cpp b/capi/geos_c.cpp
index 9cfa0b0..34b1c75 100644
--- a/capi/geos_c.cpp
+++ b/capi/geos_c.cpp
@@ -329,13 +329,13 @@ extern "C" {
 
 // Remember to free the result!
     unsigned char*
-    GEOSGeomToWKB_buf(const Geometry* g, size_t* size)
+    GEOSGeomToWKB_buf(const Geometry* g, std::size_t* size)
     {
         return GEOSGeomToWKB_buf_r(handle, g, size);
     }
 
     Geometry*
-    GEOSGeomFromWKB_buf(const unsigned char* wkb, size_t size)
+    GEOSGeomFromWKB_buf(const unsigned char* wkb, std::size_t size)
     {
         return GEOSGeomFromWKB_buf_r(handle, wkb, size);
     }
@@ -343,13 +343,13 @@ extern "C" {
     /* Read/write wkb hex values.  Returned geometries are
        owned by the caller.*/
     unsigned char*
-    GEOSGeomToHEX_buf(const Geometry* g, size_t* size)
+    GEOSGeomToHEX_buf(const Geometry* g, std::size_t* size)
     {
         return GEOSGeomToHEX_buf_r(handle, g, size);
     }
 
     Geometry*
-    GEOSGeomFromHEX_buf(const unsigned char* hex, size_t size)
+    GEOSGeomFromHEX_buf(const unsigned char* hex, std::size_t size)
     {
         return GEOSGeomFromHEX_buf_r(handle, hex, size);
     }
@@ -1146,13 +1146,13 @@ extern "C" {
 
 
     Geometry*
-    GEOSWKBReader_read(WKBReader* reader, const unsigned char* wkb, size_t size)
+    GEOSWKBReader_read(WKBReader* reader, const unsigned char* wkb, std::size_t size)
     {
         return GEOSWKBReader_read_r(handle, reader, wkb, size);
     }
 
     Geometry*
-    GEOSWKBReader_readHEX(WKBReader* reader, const unsigned char* hex, size_t size)
+    GEOSWKBReader_readHEX(WKBReader* reader, const unsigned char* hex, std::size_t size)
     {
         return GEOSWKBReader_readHEX_r(handle, reader, hex, size);
     }
@@ -1173,14 +1173,14 @@ extern "C" {
 
     /* The caller owns the result */
     unsigned char*
-    GEOSWKBWriter_write(WKBWriter* writer, const Geometry* geom, size_t* size)
+    GEOSWKBWriter_write(WKBWriter* writer, const Geometry* geom, std::size_t* size)
     {
         return GEOSWKBWriter_write_r(handle, writer, geom, size);
     }
 
     /* The caller owns the result */
     unsigned char*
-    GEOSWKBWriter_writeHEX(WKBWriter* writer, const Geometry* geom, size_t* size)
+    GEOSWKBWriter_writeHEX(WKBWriter* writer, const Geometry* geom, std::size_t* size)
     {
         return GEOSWKBWriter_writeHEX_r(handle, writer, geom, size);
     }
@@ -1311,7 +1311,7 @@ extern "C" {
     }
 
     GEOSSTRtree*
-    GEOSSTRtree_create(size_t nodeCapacity)
+    GEOSSTRtree_create(std::size_t nodeCapacity)
     {
         return GEOSSTRtree_create_r(handle, nodeCapacity);
     }
diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index a65e260..55b3562 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -890,7 +890,7 @@ extern "C" {
 
     // Remember to free the result!
     unsigned char*
-    GEOSGeomToWKB_buf_r(GEOSContextHandle_t extHandle, const Geometry* g, size_t* size)
+    GEOSGeomToWKB_buf_r(GEOSContextHandle_t extHandle, const Geometry* g, std::size_t* size)
     {
         using geos::io::WKBWriter;
 
@@ -914,7 +914,7 @@ extern "C" {
     }
 
     Geometry*
-    GEOSGeomFromWKB_buf_r(GEOSContextHandle_t extHandle, const unsigned char* wkb, size_t size)
+    GEOSGeomFromWKB_buf_r(GEOSContextHandle_t extHandle, const unsigned char* wkb, std::size_t size)
     {
         using geos::io::WKBReader;
 
@@ -934,7 +934,7 @@ extern "C" {
     /* Read/write wkb hex values.  Returned geometries are
        owned by the caller.*/
     unsigned char*
-    GEOSGeomToHEX_buf_r(GEOSContextHandle_t extHandle, const Geometry* g, size_t* size)
+    GEOSGeomToHEX_buf_r(GEOSContextHandle_t extHandle, const Geometry* g, std::size_t* size)
     {
         using geos::io::WKBWriter;
 
@@ -957,7 +957,7 @@ extern "C" {
     }
 
     Geometry*
-    GEOSGeomFromHEX_buf_r(GEOSContextHandle_t extHandle, const unsigned char* hex, size_t size)
+    GEOSGeomFromHEX_buf_r(GEOSContextHandle_t extHandle, const unsigned char* hex, std::size_t size)
     {
         using geos::io::WKBReader;
 
@@ -1823,7 +1823,7 @@ extern "C" {
             const GeometryFactory* gf = handle->geomFactory;
 
             std::vector<std::unique_ptr<Geometry>> vgeoms(ngeoms);
-            for (size_t i = 0; i < ngeoms; i++) {
+            for (std::size_t i = 0; i < ngeoms; i++) {
                 vgeoms[i].reset(geoms[i]);
             }
 
@@ -2410,7 +2410,7 @@ extern "C" {
         return execute(extHandle, [&]() {
             auto vholes = geos::detail::make_unique<std::vector<LinearRing*>>(nholes);
 
-            for (size_t i = 0; i < nholes; i++) {
+            for (std::size_t i = 0; i < nholes; i++) {
                 (*vholes)[i] = dynamic_cast<LinearRing*>(holes[i]);
                 if ((*vholes)[i] == nullptr) {
                     throw IllegalArgumentException("Hole is not a LinearRing");
@@ -2702,7 +2702,7 @@ extern "C" {
     };
 
     Geometry*
-    GEOSWKBReader_read_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* wkb, size_t size)
+    GEOSWKBReader_read_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* wkb, std::size_t size)
     {
         return execute(extHandle, [&]() {
             // http://stackoverflow.com/questions/2079912/simpler-way-to-create-a-c-memorystream-from-char-size-t-without-copying-t
@@ -2714,7 +2714,7 @@ extern "C" {
     }
 
     Geometry*
-    GEOSWKBReader_readHEX_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* hex, size_t size)
+    GEOSWKBReader_readHEX_r(GEOSContextHandle_t extHandle, WKBReader* reader, const unsigned char* hex, std::size_t size)
     {
         return execute(extHandle, [&]() {
             std::string hexstring(reinterpret_cast<const char*>(hex), size);
@@ -2748,7 +2748,7 @@ extern "C" {
 
     /* The caller owns the result */
     unsigned char*
-    GEOSWKBWriter_write_r(GEOSContextHandle_t extHandle, WKBWriter* writer, const Geometry* geom, size_t* size)
+    GEOSWKBWriter_write_r(GEOSContextHandle_t extHandle, WKBWriter* writer, const Geometry* geom, std::size_t* size)
     {
         return execute(extHandle, [&]() {
             std::ostringstream os(std::ios_base::binary);
@@ -2766,7 +2766,7 @@ extern "C" {
 
     /* The caller owns the result */
     unsigned char*
-    GEOSWKBWriter_writeHEX_r(GEOSContextHandle_t extHandle, WKBWriter* writer, const Geometry* geom, size_t* size)
+    GEOSWKBWriter_writeHEX_r(GEOSContextHandle_t extHandle, WKBWriter* writer, const Geometry* geom, std::size_t* size)
     {
         return execute(extHandle, [&]() {
             std::ostringstream os(std::ios_base::binary);
@@ -2968,7 +2968,7 @@ extern "C" {
 
     GEOSSTRtree*
     GEOSSTRtree_create_r(GEOSContextHandle_t extHandle,
-                         size_t nodeCapacity)
+                         std::size_t nodeCapacity)
     {
         return execute(extHandle, [&]() {
             return new GEOSSTRtree(nodeCapacity);
@@ -3225,14 +3225,14 @@ extern "C" {
         // our output GeometryCollections...
 
         const GeometryFactory* factory = g1->getFactory();
-        size_t count;
+        std::size_t count;
 
         std::unique_ptr< std::vector<Geometry*> > out1(
             new std::vector<Geometry*>()
         );
         count = forw.size();
         out1->reserve(count);
-        for(size_t i = 0; i < count; ++i) {
+        for(std::size_t i = 0; i < count; ++i) {
             out1->push_back(forw[i]);
         }
         std::unique_ptr<Geometry> out1g(
@@ -3244,7 +3244,7 @@ extern "C" {
         );
         count = back.size();
         out2->reserve(count);
-        for(size_t i = 0; i < count; ++i) {
+        for(std::size_t i = 0; i < count; ++i) {
             out2->push_back(back[i]);
         }
         std::unique_ptr<Geometry> out2g(
diff --git a/doc/example.cpp b/doc/example.cpp
index 31aa562..46dc0d9 100644
--- a/doc/example.cpp
+++ b/doc/example.cpp
@@ -63,7 +63,6 @@
 #define POLYGONIZE 1
 
 
-using namespace std;
 using namespace geos;
 using namespace geos::geom;
 using namespace geos::operation::polygonize;
@@ -73,7 +72,7 @@ using geos::util::IllegalArgumentException;
 
 
 // Prototypes
-void wkt_print_geoms(vector<const Geometry*>* geoms);
+void wkt_print_geoms(std::vector<const Geometry*>* geoms);
 
 
 // This object will be used to construct our geometries.
@@ -93,104 +92,104 @@ GeometryFactory::Ptr global_factory;
 //	- remove debugging lines (on stream state)
 //
 void
-WKBtest(vector<const Geometry*>* geoms)
+WKBtest(std::vector<const Geometry*>* geoms)
 {
-    stringstream s(ios_base::binary | ios_base::in | ios_base::out);
+    std::stringstream s(std::ios_base::binary | std::ios_base::in | std::ios_base::out);
     io::WKBReader wkbReader(*global_factory);
     io::WKBWriter wkbWriter;
     Geometry* gout;
 
 #if DEBUG_STREAM_STATE
-    cout << "WKBtest: machine byte order: " << BYTE_ORDER << endl;
+    std::cout << "WKBtest: machine byte order: " << BYTE_ORDER << std::endl;
 #endif
 
 
-    size_t ngeoms = geoms->size();
+    std::size_t ngeoms = geoms->size();
     for(unsigned int i = 0; i < ngeoms; ++i) {
         const Geometry* gin = (*geoms)[i];
 
 #if DEBUG_STREAM_STATE
-        cout << "State of stream before WRITE: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream before WRITE: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
 #if DEBUG_STREAM_STATE
-        cout << "State of stream after SEEKP: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream after SEEKP: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
         wkbWriter.write(*gin, s);
 #if DEBUG_STREAM_STATE
-        cout << "wkbWriter wrote and reached ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() << endl;
+        std::cout << "wkbWriter wrote and reached ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() << std::endl;
 
-        cout << "State of stream before DUMP: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream before DUMP: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
 #if DEBUG_STREAM_STATE
-        cout << "State of stream after DUMP: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream after DUMP: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
-        s.seekg(0, ios::beg); // rewind reader pointer
+        s.seekg(0, std::ios::beg); // rewind reader pointer
 
 #if DEBUG_STREAM_STATE
-        cout << "State of stream before READ: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream before READ: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
         gout = wkbReader.read(s).release();
 
 #if DEBUG_STREAM_STATE
-        cout << "State of stream after READ: ";
-        cout << "p:" << s.tellp() << " g:" << s.tellg() <<
+        std::cout << "State of stream after READ: ";
+        std::cout << "p:" << s.tellp() << " g:" << s.tellg() <<
              " good:" << s.good() <<
              " eof:" << s.eof() <<
              " bad:" << s.bad() <<
-             " fail:" << s.fail() << endl;
+             " fail:" << s.fail() << std::endl;
 #endif
 
         const_cast<Geometry*>(gin)->normalize();
         gout->normalize();
         int failed = gin->compareTo(gout);
         if(failed) {
-            cout << "{" << i << "} (WKB) ";
+            std::cout << "{" << i << "} (WKB) ";
         }
         else {
-            cout << "[" << i << "] (WKB) ";
+            std::cout << "[" << i << "] (WKB) ";
         }
 
-        io::WKBReader::printHEX(s, cout);
-        cout << endl;
+        io::WKBReader::printHEX(s, std::cout);
+        std::cout << std::endl;
 
         if(failed) {
             io::WKTWriter wkt;
-            cout << "  IN: " << wkt.write(gin) << endl;
-            cout << " OUT: " << wkt.write(gout) << endl;
+            std::cout << "  IN: " << wkt.write(gin) << std::endl;
+            std::cout << " OUT: " << wkt.write(gout) << std::endl;
         }
 
-        s.seekp(0, ios::beg); // rewind writer pointer
+        s.seekp(0, std::ios::beg); // rewind writer pointer
 
         delete gout;
     }
@@ -202,7 +201,7 @@ WKBtest(vector<const Geometry*>* geoms)
 // format to stdout. As a side-effect, will test WKB
 // output and input, using the WKBtest function.
 void
-wkt_print_geoms(vector<const Geometry*>* geoms)
+wkt_print_geoms(std::vector<const Geometry*>* geoms)
 {
     WKBtest(geoms); // test WKB parser
 
@@ -210,8 +209,8 @@ wkt_print_geoms(vector<const Geometry*>* geoms)
     io::WKTWriter* wkt = new io::WKTWriter();
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g = (*geoms)[i];
-        string tmp = wkt->write(g);
-        cout << "[" << i << "] (WKT) " << tmp << endl;
+        std::string tmp = wkt->write(g);
+        std::cout << "[" << i << "] (WKT) " << tmp << std::endl;
     }
     delete wkt;
 }
@@ -296,7 +295,7 @@ create_square_polygon(double xoffset, double yoffset, double side)
 
     // If we need to specify any hole, we do it using
     // a vector of LinearRing pointers
-    vector<LinearRing*>* holes = new vector<LinearRing*>;
+    std::vector<LinearRing*>* holes = new std::vector<LinearRing*>;
 
     // We add the newly created geometry to the vector
     // of holes.
@@ -320,7 +319,7 @@ create_square_polygon(double xoffset, double yoffset, double side)
 // containing copies of all Geometries in given vector.
 //
 GeometryCollection*
-create_simple_collection(vector<const Geometry*>* geoms)
+create_simple_collection(std::vector<const Geometry*>* geoms)
 {
     return global_factory->createGeometryCollection(*geoms);
     // if you wanted to transfer ownership of vector end
@@ -392,7 +391,7 @@ create_arc(double llX, double llY, double width, double height, double startang,
     return shapefactory.createArc(startang, endang).release();
 }
 
-unique_ptr<Polygon>
+std::unique_ptr<Polygon>
 create_sinestar(double cx, double cy, double size, int nArms, double armLenRat)
 {
     geos::geom::util::SineStarFactory fact(global_factory.get());
@@ -408,8 +407,8 @@ create_sinestar(double cx, double cy, double size, int nArms, double armLenRat)
 void
 do_all()
 {
-    vector<const Geometry*>* geoms = new vector<const Geometry*>;
-    vector<const Geometry*>* newgeoms;
+    std::vector<const Geometry*>* geoms = new std::vector<const Geometry*>;
+    std::vector<const Geometry*>* newgeoms;
 
     // Define a precision model using 0,0 as the reference origin
     // and 2.0 as coordinates scale.
@@ -448,7 +447,7 @@ do_all()
 #endif
 
     // Print all geoms.
-    cout << "--------HERE ARE THE BASE GEOMS ----------" << endl;
+    std::cout << "--------HERE ARE THE BASE GEOMS ----------" << std::endl;
     wkt_print_geoms(geoms);
 
 
@@ -463,14 +462,14 @@ do_all()
     /////////////////////////////////////////////
 
     // Find centroid of each base geometry
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g = (*geoms)[i];
         newgeoms->push_back(g->getCentroid().release());
     }
 
     // Print all convex hulls
-    cout << endl << "------- AND HERE ARE THEIR CENTROIDS -----" << endl;
+    std::cout << std::endl << "------- AND HERE ARE THEIR CENTROIDS -----" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the centroids
@@ -483,7 +482,7 @@ do_all()
     // BUFFER
     /////////////////////////////////////////////
 
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g = (*geoms)[i];
         try {
@@ -491,11 +490,11 @@ do_all()
             newgeoms->push_back(g2);
         }
         catch(const GEOSException& exc) {
-            cerr << "GEOS Exception: geometry " << i << "->buffer(10): " << exc.what() << "\n";
+            std::cerr << "GEOS Exception: geometry " << i << "->buffer(10): " << exc.what() << "\n";
         }
     }
 
-    cout << endl << "--------HERE COMES THE BUFFERED GEOMS ----------" << endl;
+    std::cout << std::endl << "--------HERE COMES THE BUFFERED GEOMS ----------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     for(unsigned int i = 0; i < newgeoms->size(); i++) {
@@ -508,14 +507,14 @@ do_all()
     /////////////////////////////////////////////
 
     // Make convex hulls of geometries
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g = (*geoms)[i];
         newgeoms->push_back(g->convexHull().release());
     }
 
     // Print all convex hulls
-    cout << endl << "--------HERE COMES THE HULLS----------" << endl;
+    std::cout << std::endl << "--------HERE COMES THE HULLS----------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the hulls
@@ -532,271 +531,271 @@ do_all()
 // RELATIONAL OPERATORS
 ////////////////////////////////////////////////////////////////////////
 
-    cout << "-------------------------------------------------------------------------------" << endl;
-    cout << "RELATIONAL OPERATORS" << endl;
-    cout << "-------------------------------------------------------------------------------" << endl;
+    std::cout << "-------------------------------------------------------------------------------" << std::endl;
+    std::cout << "RELATIONAL OPERATORS" << std::endl;
+    std::cout << "-------------------------------------------------------------------------------" << std::endl;
 
     /////////////////////////////////////////////
     // DISJOINT
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "   DISJOINT   ";
+    std::cout << std::endl;
+    std::cout << "   DISJOINT   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->disjoint(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // TOUCHES
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "    TOUCHES   ";
+    std::cout << std::endl;
+    std::cout << "    TOUCHES   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->touches(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // INTERSECTS
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << " INTERSECTS   ";
+    std::cout << std::endl;
+    std::cout << " INTERSECTS   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->intersects(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // CROSSES
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "    CROSSES   ";
+    std::cout << std::endl;
+    std::cout << "    CROSSES   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->crosses(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // WITHIN
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "     WITHIN   ";
+    std::cout << std::endl;
+    std::cout << "     WITHIN   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->within(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // CONTAINS
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "   CONTAINS   ";
+    std::cout << std::endl;
+    std::cout << "   CONTAINS   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->contains(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // OVERLAPS
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "   OVERLAPS   ";
+    std::cout << std::endl;
+    std::cout << "   OVERLAPS   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->overlaps(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // RELATE
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "     RELATE   ";
+    std::cout << std::endl;
+    std::cout << "     RELATE   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 // second argument is intersectionPattern
-                string pattern = "212101212";
+                std::string pattern = "212101212";
                 if(g1->relate(g2, pattern)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
 
                 // get the intersectionMatrix itself
@@ -804,117 +803,117 @@ do_all()
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // EQUALS
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "     EQUALS   ";
+    std::cout << std::endl;
+    std::cout << "     EQUALS   ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 if(g1->equals(g2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // EQUALS_EXACT
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "EQUALS_EXACT  ";
+    std::cout << std::endl;
+    std::cout << "EQUALS_EXACT  ";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 // second argument is a tolerance
                 if(g1->equalsExact(g2, 0.5)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
     /////////////////////////////////////////////
     // IS_WITHIN_DISTANCE
     /////////////////////////////////////////////
 
-    cout << endl;
-    cout << "IS_WITHIN_DIST";
+    std::cout << std::endl;
+    std::cout << "IS_WITHIN_DIST";
     for(unsigned int i = 0; i < geoms->size(); i++) {
-        cout << "\t[" << i << "]";
+        std::cout << "\t[" << i << "]";
     }
-    cout << endl;
+    std::cout << std::endl;
     for(unsigned int i = 0; i < geoms->size(); i++) {
         const Geometry* g1 = (*geoms)[i];
-        cout << "      [" << i << "]\t";
+        std::cout << "      [" << i << "]\t";
         for(unsigned int j = 0; j < geoms->size(); j++) {
             const Geometry* g2 = (*geoms)[j];
             try {
                 // second argument is the distance
                 if(g1->isWithinDistance(g2, 2)) {
-                    cout << " 1\t";
+                    std::cout << " 1\t";
                 }
                 else {
-                    cout << " 0\t";
+                    std::cout << " 0\t";
                 }
             }
             // Geometry Collection is not a valid argument
             catch(const IllegalArgumentException&) {
-                cout << " X\t";
+                std::cout << " X\t";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
-        cout << endl;
+        std::cout << std::endl;
     }
 
 #endif // RELATIONAL_OPERATORS
@@ -925,17 +924,17 @@ do_all()
 // COMBINATIONS
 ////////////////////////////////////////////////////////////////////////
 
-    cout << endl;
-    cout << "-------------------------------------------------------------------------------" << endl;
-    cout << "COMBINATIONS" << endl;
-    cout << "-------------------------------------------------------------------------------" << endl;
+    std::cout << std::endl;
+    std::cout << "-------------------------------------------------------------------------------" << std::endl;
+    std::cout << "COMBINATIONS" << std::endl;
+    std::cout << "-------------------------------------------------------------------------------" << std::endl;
 
     /////////////////////////////////////////////
     // UNION
     /////////////////////////////////////////////
 
     // Make unions of all geoms
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size() - 1; i++) {
         const Geometry* g1 = (*geoms)[i];
         for(unsigned int j = i + 1; j < geoms->size(); j++) {
@@ -946,16 +945,16 @@ do_all()
             }
             // It's illegal to union a collection ...
             catch(const IllegalArgumentException&) {
-                //cerr <<ill.toString()<<"\n";
+                //std::cerr <<ill.toString()<<"\n";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
     }
 
     // Print all unions
-    cout << endl << "----- AND HERE ARE SOME UNION COMBINATIONS ------" << endl;
+    std::cout << std::endl << "----- AND HERE ARE SOME UNION COMBINATIONS ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -970,7 +969,7 @@ do_all()
     /////////////////////////////////////////////
 
     // Compute intersection of adjacent geometries
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size() - 1; i++) {
         const Geometry* g1 = (*geoms)[i];
         for(unsigned int j = i + 1; j < geoms->size(); j++) {
@@ -981,15 +980,15 @@ do_all()
             }
             // Collection are illegal as intersection argument
             catch(const IllegalArgumentException&) {
-                //cerr <<ill.toString()<<"\n";
+                //std::cerr <<ill.toString()<<"\n";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
     }
 
-    cout << endl << "----- HERE ARE SOME INTERSECTIONS COMBINATIONS ------" << endl;
+    std::cout << std::endl << "----- HERE ARE SOME INTERSECTIONS COMBINATIONS ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -1003,7 +1002,7 @@ do_all()
     /////////////////////////////////////////////
 
     // Compute difference of adhiacent geometries
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size() - 1; i++) {
         const Geometry* g1 = (*geoms)[i];
         for(unsigned int j = i + 1; j < geoms->size(); j++) {
@@ -1014,15 +1013,15 @@ do_all()
             }
             // Collection are illegal as difference argument
             catch(const IllegalArgumentException&) {
-                //cerr <<ill.toString()<<"\n";
+                //std::cerr <<ill.toString()<<"\n";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
     }
 
-    cout << endl << "----- HERE ARE SOME DIFFERENCE COMBINATIONS ------" << endl;
+    std::cout << std::endl << "----- HERE ARE SOME DIFFERENCE COMBINATIONS ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -1036,7 +1035,7 @@ do_all()
     /////////////////////////////////////////////
 
     // Compute symmetric difference of adhiacent geometries
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < geoms->size() - 1; i++) {
         const Geometry* g1 = (*geoms)[i];
         for(unsigned int j = i + 1; j < geoms->size(); j++) {
@@ -1047,15 +1046,15 @@ do_all()
             }
             // Collection are illegal as symdifference argument
             catch(const IllegalArgumentException&) {
-                //cerr <<ill.toString()<<"\n";
+                //std::cerr <<ill.toString()<<"\n";
             }
             catch(const std::exception& exc) {
-                cerr << exc.what() << endl;
+                std::cerr << exc.what() << std::endl;
             }
         }
     }
 
-    cout << endl << "----- HERE ARE SYMMETRIC DIFFERENCES ------" << endl;
+    std::cout << std::endl << "----- HERE ARE SYMMETRIC DIFFERENCES ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -1074,12 +1073,12 @@ do_all()
     LineMerger lm;
     lm.add(geoms);
     auto mls = lm.getMergedLineStrings();
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < mls.size(); i++) {
         newgeoms->push_back(mls[i].release());
     }
 
-    cout << endl << "----- HERE IS THE LINEMERGE OUTPUT ------" << endl;
+    std::cout << std::endl << "----- HERE IS THE LINEMERGE OUTPUT ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -1098,12 +1097,12 @@ do_all()
     Polygonizer plgnzr;
     plgnzr.add(geoms);
     auto polys = plgnzr.getPolygons();
-    newgeoms = new vector<const Geometry*>;
+    newgeoms = new std::vector<const Geometry*>;
     for(unsigned int i = 0; i < polys.size(); i++) {
         newgeoms->push_back(polys[i].release());
     }
 
-    cout << endl << "----- HERE IS POLYGONIZE OUTPUT ------" << endl;
+    std::cout << std::endl << "----- HERE IS POLYGONIZE OUTPUT ------" << std::endl;
     wkt_print_geoms(newgeoms);
 
     // Delete the resulting geoms
@@ -1128,23 +1127,23 @@ do_all()
 int
 main()
 {
-    cout << "GEOS " << geosversion() << " ported from JTS " << jtsport() << endl;
+    std::cout << "GEOS " << geosversion() << " ported from JTS " << jtsport() << std::endl;
     try {
         do_all();
     }
     // All exception thrown by GEOS are subclasses of this
     // one, so this is a catch-all
     catch(const GEOSException& exc) {
-        cerr << "GEOS Exception: " << exc.what() << "\n";
+        std::cerr << "GEOS Exception: " << exc.what() << "\n";
         exit(1);
     }
-    catch(const exception& e) {
-        cerr << "Standard exception thrown: " << e.what() << endl;
+    catch(const std::exception& e) {
+        std::cerr << "Standard exception thrown: " << e.what() << std::endl;
         exit(1);
     }
     // and this is a catch-all non standard ;)
     catch(...) {
-        cerr << "unknown exception trown!\n";
+        std::cerr << "unknown exception trown!\n";
         exit(1);
     }
 
diff --git a/include/geos/algorithm/CentralEndpointIntersector.h b/include/geos/algorithm/CentralEndpointIntersector.h
index 4c9145c..68c7d1e 100644
--- a/include/geos/algorithm/CentralEndpointIntersector.h
+++ b/include/geos/algorithm/CentralEndpointIntersector.h
@@ -113,7 +113,7 @@ private:
         const std::vector<geom::Coordinate>& pts)
     {
         geom::Coordinate avg(0, 0);
-        size_t n = pts.size();
+        std::size_t n = pts.size();
         if(! n) {
             return avg;
         }
diff --git a/include/geos/algorithm/LineIntersector.h b/include/geos/algorithm/LineIntersector.h
index b38c0a8..ddec20d 100644
--- a/include/geos/algorithm/LineIntersector.h
+++ b/include/geos/algorithm/LineIntersector.h
@@ -103,7 +103,7 @@ public:
      * @return <code>true</code> if either intersection point is in
      * the interior of the input segment
      */
-    bool isInteriorIntersection(size_t inputLineIndex);
+    bool isInteriorIntersection(std::size_t inputLineIndex);
 
     /// Force computed intersection to be rounded to a given precision model.
     ///
@@ -174,7 +174,7 @@ public:
     /// @return the intIndex'th intersection point
     ///
     const geom::Coordinate&
-    getIntersection(size_t intIndex) const
+    getIntersection(std::size_t intIndex) const
     {
         return intPt[intIndex];
     }
@@ -227,7 +227,7 @@ public:
      * @return the intIndex'th intersection point in the direction of the
      *         specified input line segment
      */
-    const geom::Coordinate& getIntersectionAlongSegment(size_t segmentIndex, size_t intIndex);
+    const geom::Coordinate& getIntersectionAlongSegment(std::size_t segmentIndex, std::size_t intIndex);
 
     /** \brief
      * Computes the index of the intIndex'th intersection point in the direction of
@@ -238,7 +238,7 @@ public:
      *
      * @return the index of the intersection point along the segment (0 or 1)
      */
-    size_t getIndexAlongSegment(size_t segmentIndex, size_t intIndex);
+    std::size_t getIndexAlongSegment(std::size_t segmentIndex, std::size_t intIndex);
 
     /** \brief
      * Computes the "edge distance" of an intersection point along the specified
@@ -249,7 +249,7 @@ public:
      *
      * @return the edge distance of the intersection point
      */
-    double getEdgeDistance(size_t geomIndex, size_t intIndex) const;
+    double getEdgeDistance(std::size_t geomIndex, std::size_t intIndex) const;
 
 private:
 
@@ -259,7 +259,7 @@ private:
      */
     const geom::PrecisionModel* precisionModel;
 
-    size_t result;
+    std::size_t result;
 
     const geom::Coordinate* inputLines[2][2];
 
@@ -273,7 +273,7 @@ private:
      * The indexes of the endpoints of the intersection lines, in order along
      * the corresponding line
      */
-    size_t intLineIndex[2][2];
+    std::size_t intLineIndex[2][2];
 
     bool isProperVar;
     //Coordinate &pa;
@@ -296,7 +296,7 @@ private:
 
     void computeIntLineIndex();
 
-    void computeIntLineIndex(size_t segmentIndex);
+    void computeIntLineIndex(std::size_t segmentIndex);
 
     uint8_t computeCollinearIntersection(const geom::Coordinate& p1, const geom::Coordinate& p2,
                                          const geom::Coordinate& q1, const geom::Coordinate& q2);
diff --git a/include/geos/algorithm/MinimumDiameter.h b/include/geos/algorithm/MinimumDiameter.h
index 8fb0622..d28e566 100644
--- a/include/geos/algorithm/MinimumDiameter.h
+++ b/include/geos/algorithm/MinimumDiameter.h
@@ -69,7 +69,7 @@ private:
 
     geom::LineSegment minBaseSeg;
     geom::Coordinate minWidthPt;
-    size_t minPtIndex;
+    std::size_t minPtIndex;
     double minWidth;
     void computeMinimumDiameter();
     void computeWidthConvex(const geom::Geometry* geom);
diff --git a/include/geos/algorithm/distance/DiscreteFrechetDistance.h b/include/geos/algorithm/distance/DiscreteFrechetDistance.h
index 0d9ec0f..c30ad1d 100644
--- a/include/geos/algorithm/distance/DiscreteFrechetDistance.h
+++ b/include/geos/algorithm/distance/DiscreteFrechetDistance.h
@@ -154,9 +154,9 @@ public:
     }
 
 private:
-    geom::Coordinate getSegementAt(const geom::CoordinateSequence& seq, size_t index);
+    geom::Coordinate getSegementAt(const geom::CoordinateSequence& seq, std::size_t index);
 
-    PointPairDistance& getFrecheDistance(std::vector< std::vector<PointPairDistance> >& ca, size_t i, size_t j,
+    PointPairDistance& getFrecheDistance(std::vector< std::vector<PointPairDistance> >& ca, std::size_t i, std::size_t j,
                                          const geom::CoordinateSequence& p, const geom::CoordinateSequence& q);
 
     void compute(const geom::Geometry& discreteGeom, const geom::Geometry& geom);
diff --git a/include/geos/algorithm/distance/PointPairDistance.h b/include/geos/algorithm/distance/PointPairDistance.h
index 7ab4add..4c6729e 100644
--- a/include/geos/algorithm/distance/PointPairDistance.h
+++ b/include/geos/algorithm/distance/PointPairDistance.h
@@ -71,7 +71,7 @@ public:
     }
 
     const geom::Coordinate&
-    getCoordinate(size_t i) const
+    getCoordinate(std::size_t i) const
     {
         assert(i < pt.size());
         return pt[i];
diff --git a/include/geos/geom/Coordinate.h b/include/geos/geom/Coordinate.h
index c6b5877..3b37ede 100644
--- a/include/geos/geom/Coordinate.h
+++ b/include/geos/geom/Coordinate.h
@@ -116,7 +116,7 @@ public:
     double distanceSquared(const Coordinate& p) const;
 
     struct GEOS_DLL HashCode {
-        size_t operator()(const Coordinate & c) const;
+        std::size_t operator()(const Coordinate & c) const;
     };
 
 };
diff --git a/include/geos/geom/CoordinateArraySequence.h b/include/geos/geom/CoordinateArraySequence.h
index e8e04a6..2538098 100644
--- a/include/geos/geom/CoordinateArraySequence.h
+++ b/include/geos/geom/CoordinateArraySequence.h
@@ -48,7 +48,7 @@ public:
     /// Copy Coordinate at position i to Coordinate c
     void getAt(std::size_t i, Coordinate& c) const override;
 
-    size_t getSize() const override;
+    std::size_t getSize() const override;
 
     // See dox in CoordinateSequence.h
     void toVector(std::vector<Coordinate>&) const override;
diff --git a/include/geos/geom/CoordinateSequence.h b/include/geos/geom/CoordinateSequence.h
index e8eeca5..fa27115 100644
--- a/include/geos/geom/CoordinateSequence.h
+++ b/include/geos/geom/CoordinateSequence.h
@@ -164,7 +164,7 @@ public:
     /// FIXME: return std::size_t, using numeric_limits<std::size_t>::max
     /// as 'not found' value.
     ///
-    static size_t indexOf(const Coordinate* coordinate,
+    static std::size_t indexOf(const Coordinate* coordinate,
                           const CoordinateSequence* cl);
 
     /**
diff --git a/include/geos/geom/DefaultCoordinateSequenceFactory.h b/include/geos/geom/DefaultCoordinateSequenceFactory.h
index c6b40cb..d704385 100644
--- a/include/geos/geom/DefaultCoordinateSequenceFactory.h
+++ b/include/geos/geom/DefaultCoordinateSequenceFactory.h
@@ -51,7 +51,7 @@ public:
 
     std::unique_ptr <CoordinateSequence> create(const CoordinateSequence &coordSeq) const final override {
         auto cs = create(coordSeq.size(), coordSeq.getDimension());
-        for (size_t i = 0; i < cs->size(); i++) {
+        for (std::size_t i = 0; i < cs->size(); i++) {
             cs->setAt(coordSeq[i], i);
         }
         return cs;
diff --git a/include/geos/geom/Envelope.h b/include/geos/geom/Envelope.h
index 1f02aca..5e73904 100644
--- a/include/geos/geom/Envelope.h
+++ b/include/geos/geom/Envelope.h
@@ -495,7 +495,7 @@ public:
      */
     static double distanceSquaredToCoordinate(const Coordinate & c, const Coordinate & p1, const Coordinate & p2);
 
-    size_t hashCode() const;
+    std::size_t hashCode() const;
 
 private:
 
diff --git a/include/geos/geom/FixedSizeCoordinateSequence.h b/include/geos/geom/FixedSizeCoordinateSequence.h
index 0d5f228..61ebe3e 100644
--- a/include/geos/geom/FixedSizeCoordinateSequence.h
+++ b/include/geos/geom/FixedSizeCoordinateSequence.h
@@ -32,7 +32,7 @@ namespace geom {
     template<size_t N>
     class FixedSizeCoordinateSequence : public CoordinateSequence {
     public:
-        explicit FixedSizeCoordinateSequence(size_t dimension_in = 0) : dimension(dimension_in) {}
+        explicit FixedSizeCoordinateSequence(std::size_t dimension_in = 0) : dimension(dimension_in) {}
 
         std::unique_ptr<CoordinateSequence> clone() const final override {
             auto seq = detail::make_unique<FixedSizeCoordinateSequence<N>>(dimension);
@@ -40,15 +40,15 @@ namespace geom {
             return std::move(seq); // move needed for gcc 4.8
         }
 
-        const Coordinate& getAt(size_t i) const final override {
+        const Coordinate& getAt(std::size_t i) const final override {
             return m_data[i];
         }
 
-        void getAt(size_t i, Coordinate& c) const final override {
+        void getAt(std::size_t i, Coordinate& c) const final override {
             c = m_data[i];
         }
 
-        size_t getSize() const final override {
+        std::size_t getSize() const final override {
             return N;
         }
 
@@ -56,11 +56,11 @@ namespace geom {
             return N == 0;
         }
 
-        void setAt(const Coordinate & c, size_t pos) final override {
+        void setAt(const Coordinate & c, std::size_t pos) final override {
             m_data[pos] = c;
         }
 
-        void setOrdinate(size_t index, size_t ordinateIndex, double value) final override
+        void setOrdinate(std::size_t index, std::size_t ordinateIndex, double value) final override
         {
             switch(ordinateIndex) {
                 case CoordinateSequence::X:
@@ -81,7 +81,7 @@ namespace geom {
             }
         }
 
-        size_t getDimension() const final override {
+        std::size_t getDimension() const final override {
             if(dimension != 0) {
                 return dimension;
             }
diff --git a/include/geos/geom/Geometry.h b/include/geos/geom/Geometry.h
index d05d71f..0a9d3d3 100644
--- a/include/geos/geom/Geometry.h
+++ b/include/geos/geom/Geometry.h
@@ -920,7 +920,7 @@ protected:
     static std::vector<std::unique_ptr<Geometry>> toGeometryArray(std::vector<std::unique_ptr<T>> && v) {
         static_assert(std::is_base_of<Geometry, T>::value, "");
         std::vector<std::unique_ptr<Geometry>> gv(v.size());
-        for (size_t i = 0; i < v.size(); i++) {
+        for (std::size_t i = 0; i < v.size(); i++) {
             gv[i] = std::move(v[i]);
         }
         return gv;
diff --git a/include/geos/geom/GeometryFactory.h b/include/geos/geom/GeometryFactory.h
index 9dcfa45..9953e70 100644
--- a/include/geos/geom/GeometryFactory.h
+++ b/include/geos/geom/GeometryFactory.h
@@ -362,7 +362,7 @@ public:
     buildGeometry(T from, T toofar) const
     {
         bool isHeterogeneous = false;
-        size_t count = 0;
+        std::size_t count = 0;
         int geomClass = -1;
         for(T i = from; i != toofar; ++i) {
             ++count;
diff --git a/include/geos/geom/LineSegment.h b/include/geos/geom/LineSegment.h
index 459f1b2..f19af03 100644
--- a/include/geos/geom/LineSegment.h
+++ b/include/geos/geom/LineSegment.h
@@ -362,8 +362,8 @@ public:
     std::unique_ptr<LineString> toGeometry(const GeometryFactory& gf) const;
 
     struct HashCode {
-        size_t operator()(const LineSegment & s) const {
-            size_t h = std::hash<double>{}(s.p0.x);
+        std::size_t operator()(const LineSegment & s) const {
+            std::size_t h = std::hash<double>{}(s.p0.x);
             h ^= (std::hash<double>{}(s.p0.y) << 1);
             h ^= (std::hash<double>{}(s.p1.x) << 1);
             return h ^ (std::hash<double>{}(s.p1.y) << 1);
diff --git a/include/geos/geom/LineString.h b/include/geos/geom/LineString.h
index 4253257..d9e3616 100644
--- a/include/geos/geom/LineString.h
+++ b/include/geos/geom/LineString.h
@@ -90,7 +90,7 @@ public:
     /// Returns a read-only pointer to internal CoordinateSequence
     const CoordinateSequence* getCoordinatesRO() const;
 
-    virtual const Coordinate& getCoordinateN(size_t n) const;
+    virtual const Coordinate& getCoordinateN(std::size_t n) const;
 
     /// Returns line dimension (1)
     Dimension::DimensionType getDimension() const override;
diff --git a/include/geos/geom/MultiPoint.h b/include/geos/geom/MultiPoint.h
index a3e745c..402342c 100644
--- a/include/geos/geom/MultiPoint.h
+++ b/include/geos/geom/MultiPoint.h
@@ -128,7 +128,7 @@ protected:
 
     MultiPoint(const MultiPoint& mp): GeometryCollection(mp) {}
 
-    const Coordinate* getCoordinateN(size_t n) const;
+    const Coordinate* getCoordinateN(std::size_t n) const;
 
     int
     getSortIndex() const override
diff --git a/include/geos/geom/Point.h b/include/geos/geom/Point.h
index 6f435f1..9a3ae5d 100644
--- a/include/geos/geom/Point.h
+++ b/include/geos/geom/Point.h
@@ -90,7 +90,7 @@ public:
 
     const CoordinateSequence* getCoordinatesRO() const;
 
-    size_t getNumPoints() const override;
+    std::size_t getNumPoints() const override;
     bool isEmpty() const override;
     bool isSimple() const override;
 
diff --git a/include/geos/geom/Polygon.h b/include/geos/geom/Polygon.h
index 6f3e678..8d3712a 100644
--- a/include/geos/geom/Polygon.h
+++ b/include/geos/geom/Polygon.h
@@ -86,7 +86,7 @@ public:
 
     std::unique_ptr<CoordinateSequence> getCoordinates() const override;
 
-    size_t getNumPoints() const override;
+    std::size_t getNumPoints() const override;
 
     /// Returns surface dimension (2)
     Dimension::DimensionType getDimension() const override;
@@ -111,7 +111,7 @@ public:
     const LinearRing* getExteriorRing() const;
 
     /// Returns number of interior rings (hole)
-    size_t getNumInteriorRing() const;
+    std::size_t getNumInteriorRing() const;
 
     /// Get nth interior ring (hole)
     const LinearRing* getInteriorRingN(std::size_t n) const;
diff --git a/include/geos/geomgraph/Edge.h b/include/geos/geomgraph/Edge.h
index bdf1a87..b6a480c 100644
--- a/include/geos/geomgraph/Edge.h
+++ b/include/geos/geomgraph/Edge.h
@@ -119,7 +119,7 @@ public:
     }
 
     virtual const geom::Coordinate&
-    getCoordinate(size_t i) const
+    getCoordinate(std::size_t i) const
     {
         testInvariant();
         return pts->getAt(i);
@@ -212,16 +212,16 @@ public:
      * Adds EdgeIntersections for one or both
      * intersections found for a segment of an edge to the edge intersection list.
      */
-    virtual void addIntersections(algorithm::LineIntersector* li, size_t segmentIndex,
-                                  size_t geomIndex);
+    virtual void addIntersections(algorithm::LineIntersector* li, std::size_t segmentIndex,
+                                  std::size_t geomIndex);
 
     /// Add an EdgeIntersection for intersection intIndex.
     //
     /// An intersection that falls exactly on a vertex of the edge is normalized
     /// to use the higher of the two possible segmentIndexes
     ///
-    virtual void addIntersection(algorithm::LineIntersector* li, size_t segmentIndex,
-                                 size_t geomIndex, size_t intIndex);
+    virtual void addIntersection(algorithm::LineIntersector* li, std::size_t segmentIndex,
+                                 std::size_t geomIndex, std::size_t intIndex);
 
     /// Update the IM with the contribution for this component.
     //
diff --git a/include/geos/geomgraph/EdgeIntersection.h b/include/geos/geomgraph/EdgeIntersection.h
index f8deadf..7123c66 100644
--- a/include/geos/geomgraph/EdgeIntersection.h
+++ b/include/geos/geomgraph/EdgeIntersection.h
@@ -52,10 +52,10 @@ public:
     double dist;
 
     // the index of the containing line segment in the parent edge
-    size_t segmentIndex;
+    std::size_t segmentIndex;
 
     EdgeIntersection(const geom::Coordinate& newCoord,
-                     size_t newSegmentIndex, double newDist)
+                     std::size_t newSegmentIndex, double newDist)
         :
         coord(newCoord),
         dist(newDist),
@@ -63,7 +63,7 @@ public:
     {}
 
     bool
-    isEndPoint(size_t maxSegmentIndex) const
+    isEndPoint(std::size_t maxSegmentIndex) const
     {
         if(segmentIndex == 0 && dist == 0.0) {
             return true;
diff --git a/include/geos/geomgraph/EdgeIntersectionList.h b/include/geos/geomgraph/EdgeIntersectionList.h
index abbc21c..5894df7 100644
--- a/include/geos/geomgraph/EdgeIntersectionList.h
+++ b/include/geos/geomgraph/EdgeIntersectionList.h
@@ -80,7 +80,7 @@ public:
      * The input segmentIndex and dist are expected to be normalized.
      * @return the EdgeIntersection found or added
      */
-    void add(const geom::Coordinate& coord, size_t segmentIndex, double dist);
+    void add(const geom::Coordinate& coord, std::size_t segmentIndex, double dist);
 
     const_iterator
     begin() const
diff --git a/include/geos/geomgraph/TopologyLocation.inl b/include/geos/geomgraph/TopologyLocation.inl
index 5852428..1bba170 100644
--- a/include/geos/geomgraph/TopologyLocation.inl
+++ b/include/geos/geomgraph/TopologyLocation.inl
@@ -70,7 +70,7 @@ TopologyLocation::operator= (const TopologyLocation& gl)
 
 /*public*/
 INLINE Location
-TopologyLocation::get(size_t posIndex) const
+TopologyLocation::get(std::size_t posIndex) const
 {
     // should be an assert() instead ?
     if(posIndex < locationSize) {
@@ -83,7 +83,7 @@ TopologyLocation::get(size_t posIndex) const
 INLINE bool
 TopologyLocation::isNull() const
 {
-    for(size_t i = 0; i < locationSize; ++i) {
+    for(std::size_t i = 0; i < locationSize; ++i) {
         if(location[i] != Location::NONE) {
             return false;
         }
@@ -95,7 +95,7 @@ TopologyLocation::isNull() const
 INLINE bool
 TopologyLocation::isAnyNull() const
 {
-    for(size_t i = 0; i < locationSize; ++i) {
+    for(std::size_t i = 0; i < locationSize; ++i) {
         if(location[i] == Location::NONE) {
             return true;
         }
@@ -145,7 +145,7 @@ TopologyLocation::setAllLocations(Location locValue)
 INLINE void
 TopologyLocation::setAllLocationsIfNull(Location locValue)
 {
-    for(size_t i = 0; i < locationSize; ++i) {
+    for(std::size_t i = 0; i < locationSize; ++i) {
         if(location[i] == Location::NONE) {
             location[i] = locValue;
         }
@@ -154,7 +154,7 @@ TopologyLocation::setAllLocationsIfNull(Location locValue)
 
 /*public*/
 INLINE void
-TopologyLocation::setLocation(size_t locIndex, Location locValue)
+TopologyLocation::setLocation(std::size_t locIndex, Location locValue)
 {
     location[locIndex] = locValue;
 }
@@ -187,7 +187,7 @@ TopologyLocation::setLocations(Location on, Location left, Location right)
 INLINE bool
 TopologyLocation::allPositionsEqual(Location loc) const
 {
-    for(size_t i = 0; i < locationSize; ++i) {
+    for(std::size_t i = 0; i < locationSize; ++i) {
         if(location[i] != loc) {
             return false;
         }
diff --git a/include/geos/geomgraph/index/MonotoneChain.h b/include/geos/geomgraph/index/MonotoneChain.h
index e5d8b63..f3384dd 100644
--- a/include/geos/geomgraph/index/MonotoneChain.h
+++ b/include/geos/geomgraph/index/MonotoneChain.h
@@ -45,14 +45,14 @@ namespace index { // geos::geomgraph::index
 class GEOS_DLL MonotoneChain: public SweepLineEventOBJ {
 private:
     MonotoneChainEdge* mce;
-    size_t chainIndex;
+    std::size_t chainIndex;
 
     MonotoneChain(const MonotoneChain& other) = delete;
     MonotoneChain& operator=(const MonotoneChain& rhs) = delete;
 
 public:
 
-    MonotoneChain(MonotoneChainEdge* newMce, size_t newChainIndex):
+    MonotoneChain(MonotoneChainEdge* newMce, std::size_t newChainIndex):
         mce(newMce),
         chainIndex(newChainIndex)
     {}
diff --git a/include/geos/geomgraph/index/MonotoneChainEdge.h b/include/geos/geomgraph/index/MonotoneChainEdge.h
index 131b9e1..d8c8078 100644
--- a/include/geos/geomgraph/index/MonotoneChainEdge.h
+++ b/include/geos/geomgraph/index/MonotoneChainEdge.h
@@ -50,14 +50,14 @@ public:
     MonotoneChainEdge(Edge* newE);
     const geom::CoordinateSequence* getCoordinates();
     std::vector<size_t>& getStartIndexes();
-    double getMinX(size_t chainIndex);
-    double getMaxX(size_t chainIndex);
+    double getMinX(std::size_t chainIndex);
+    double getMaxX(std::size_t chainIndex);
 
     void computeIntersects(const MonotoneChainEdge& mce,
                            SegmentIntersector& si);
 
-    void computeIntersectsForChain(size_t chainIndex0,
-                                   const MonotoneChainEdge& mce, size_t chainIndex1,
+    void computeIntersectsForChain(std::size_t chainIndex0,
+                                   const MonotoneChainEdge& mce, std::size_t chainIndex1,
                                    SegmentIntersector& si);
 
 protected:
@@ -68,12 +68,12 @@ protected:
     std::vector<size_t> startIndex;
     // these envelopes are created once and reused
 private:
-    void computeIntersectsForChain(size_t start0, size_t end0,
+    void computeIntersectsForChain(std::size_t start0, std::size_t end0,
                                    const MonotoneChainEdge& mce,
-                                   size_t start1, size_t end1,
+                                   std::size_t start1, std::size_t end1,
                                    SegmentIntersector& ei);
 
-    bool overlaps(size_t start0, size_t end0, const MonotoneChainEdge& mce, size_t start1, size_t end1);
+    bool overlaps(std::size_t start0, std::size_t end0, const MonotoneChainEdge& mce, std::size_t start1, std::size_t end1);
 
 };
 
diff --git a/include/geos/geomgraph/index/SegmentIntersector.h b/include/geos/geomgraph/index/SegmentIntersector.h
index 9139e33..f2f55b6 100644
--- a/include/geos/geomgraph/index/SegmentIntersector.h
+++ b/include/geos/geomgraph/index/SegmentIntersector.h
@@ -80,7 +80,7 @@ private:
     /// Elements are externally owned
     std::array<std::vector<Node*>*, 2> bdyNodes;
 
-    bool isTrivialIntersection(Edge* e0, size_t segIndex0, Edge* e1, size_t segIndex1);
+    bool isTrivialIntersection(Edge* e0, std::size_t segIndex0, Edge* e1, std::size_t segIndex1);
 
     bool isBoundaryPoint(algorithm::LineIntersector* li,
                          std::array<std::vector<Node*>*, 2>& tstBdyNodes);
@@ -90,7 +90,7 @@ private:
 
 public:
 
-    static bool isAdjacentSegments(size_t i1, size_t i2);
+    static bool isAdjacentSegments(std::size_t i1, std::size_t i2);
 
     // testing only
     int numTests;
@@ -130,7 +130,7 @@ public:
 
     bool hasProperInteriorIntersection();
 
-    void addIntersections(Edge* e0, size_t segIndex0, Edge* e1, size_t segIndex1);
+    void addIntersections(Edge* e0, std::size_t segIndex0, Edge* e1, std::size_t segIndex1);
 
     void setIsDoneIfProperInt(bool isDoneWhenProperInt);
 
diff --git a/include/geos/geomgraph/index/SegmentIntersector.inl b/include/geos/geomgraph/index/SegmentIntersector.inl
index bdec37b..aea971a 100644
--- a/include/geos/geomgraph/index/SegmentIntersector.inl
+++ b/include/geos/geomgraph/index/SegmentIntersector.inl
@@ -21,7 +21,7 @@ namespace geomgraph {
 namespace index {
 
 INLINE bool
-SegmentIntersector::isAdjacentSegments(size_t i1, size_t i2)
+SegmentIntersector::isAdjacentSegments(std::size_t i1, size_t i2)
 {
     return (i1 > i2 ? i1 - i2 : i2 - i1) == 1;
 }
diff --git a/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h b/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
index cfdaf2f..252a8cd 100644
--- a/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
+++ b/include/geos/geomgraph/index/SimpleMCSweepLineIntersector.h
@@ -91,7 +91,7 @@ private:
 
     void computeIntersections(SegmentIntersector* si);
 
-    void processOverlaps(size_t start, size_t end,
+    void processOverlaps(std::size_t start, std::size_t end,
                          SweepLineEvent* ev0,
                          SegmentIntersector* si);
     // Declare type as noncopyable
diff --git a/include/geos/geomgraph/index/SimpleSweepLineIntersector.h b/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
index 61bb130..040e457 100644
--- a/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
+++ b/include/geos/geomgraph/index/SimpleSweepLineIntersector.h
@@ -81,7 +81,7 @@ private:
 
     void computeIntersections(SegmentIntersector* si);
 
-    void processOverlaps(size_t start, size_t end, SweepLineEvent* ev0,
+    void processOverlaps(std::size_t start, std::size_t end, SweepLineEvent* ev0,
                          SegmentIntersector* si);
 };
 
diff --git a/include/geos/geomgraph/index/SweepLineEvent.h b/include/geos/geomgraph/index/SweepLineEvent.h
index 7386d6e..a7f5ab2 100644
--- a/include/geos/geomgraph/index/SweepLineEvent.h
+++ b/include/geos/geomgraph/index/SweepLineEvent.h
@@ -82,7 +82,7 @@ public:
     }
 
     void
-    setDeleteEventIndex(size_t newDeleteEventIndex)
+    setDeleteEventIndex(std::size_t newDeleteEventIndex)
     {
         deleteEventIndex = newDeleteEventIndex;
     }
@@ -109,7 +109,7 @@ private:
 
     SweepLineEvent* insertEvent; // null if this is an INSERT_EVENT event
 
-    size_t deleteEventIndex;
+    std::size_t deleteEventIndex;
 };
 
 class GEOS_DLL SweepLineEventLessThen {
diff --git a/include/geos/geomgraph/index/SweepLineSegment.h b/include/geos/geomgraph/index/SweepLineSegment.h
index 198081d..3934281 100644
--- a/include/geos/geomgraph/index/SweepLineSegment.h
+++ b/include/geos/geomgraph/index/SweepLineSegment.h
@@ -39,7 +39,7 @@ namespace index { // geos::geomgraph::index
 
 class GEOS_DLL SweepLineSegment: public SweepLineEventOBJ {
 public:
-    SweepLineSegment(Edge* newEdge, size_t newPtIndex);
+    SweepLineSegment(Edge* newEdge, std::size_t newPtIndex);
     ~SweepLineSegment() override = default;
     double getMinX();
     double getMaxX();
@@ -47,7 +47,7 @@ public:
 protected:
     Edge* edge;
     const geom::CoordinateSequence* pts;
-    size_t ptIndex;
+    std::size_t ptIndex;
 };
 
 
diff --git a/include/geos/index/chain/MonotoneChain.h b/include/geos/index/chain/MonotoneChain.h
index 31f4666..7e29509 100644
--- a/include/geos/index/chain/MonotoneChain.h
+++ b/include/geos/index/chain/MonotoneChain.h
@@ -162,8 +162,8 @@ public:
 private:
 
     void computeSelect(const geom::Envelope& searchEnv,
-                       size_t start0,
-                       size_t end0,
+                       std::size_t start0,
+                       std::size_t end0,
                        MonotoneChainSelectAction& mcs);
 
     void computeOverlaps(std::size_t start0, std::size_t end0, MonotoneChain& mc,
@@ -171,8 +171,8 @@ private:
                          double overlapTolerance,
                          MonotoneChainOverlapAction& mco);
 
-    bool overlaps(size_t start0, size_t end0,
-                  const MonotoneChain& mc, size_t start1, size_t end1,
+    bool overlaps(std::size_t start0, std::size_t end0,
+                  const MonotoneChain& mc, std::size_t start1, std::size_t end1,
                   double overlapTolerance) const;
 
     bool overlaps(const geom::Coordinate& p1, const geom::Coordinate& p2,
@@ -186,10 +186,10 @@ private:
     void* context;
 
     /// Index of chain start vertex into the CoordinateSequence, 0 based.
-    size_t start;
+    std::size_t start;
 
     /// Index of chain end vertex into the CoordinateSequence, 0 based.
-    size_t end;
+    std::size_t end;
 
     /// Owned by this class
     geom::Envelope env;
diff --git a/include/geos/index/chain/MonotoneChainSelectAction.h b/include/geos/index/chain/MonotoneChainSelectAction.h
index eb7b491..5e747a1 100644
--- a/include/geos/index/chain/MonotoneChainSelectAction.h
+++ b/include/geos/index/chain/MonotoneChainSelectAction.h
@@ -56,7 +56,7 @@ public:
     ~MonotoneChainSelectAction() {}
 
     /// This function can be overridden if the original chain is needed
-    virtual void select(MonotoneChain& mc, size_t start);
+    virtual void select(MonotoneChain& mc, std::size_t start);
 
     /**
      * This is a convenience function which can be overridden
diff --git a/include/geos/index/kdtree/KdTree.h b/include/geos/index/kdtree/KdTree.h
index e160663..144fbc1 100644
--- a/include/geos/index/kdtree/KdTree.h
+++ b/include/geos/index/kdtree/KdTree.h
@@ -58,7 +58,7 @@ private:
 
     std::deque<KdNode> nodeQue;
     KdNode *root;
-    size_t numberOfNodes;
+    std::size_t numberOfNodes;
     double tolerance;
 
     KdNode* findBestMatchNode(const geom::Coordinate& p);
diff --git a/include/geos/index/quadtree/NodeBase.h b/include/geos/index/quadtree/NodeBase.h
index aefb4a9..1b7de66 100644
--- a/include/geos/index/quadtree/NodeBase.h
+++ b/include/geos/index/quadtree/NodeBase.h
@@ -82,9 +82,9 @@ public:
 
     unsigned int depth() const;
 
-    size_t size() const;
+    std::size_t size() const;
 
-    size_t getNodeCount() const;
+    std::size_t getNodeCount() const;
 
     virtual std::string toString() const;
 
diff --git a/include/geos/index/quadtree/Quadtree.h b/include/geos/index/quadtree/Quadtree.h
index be07ad2..e3897c2 100644
--- a/include/geos/index/quadtree/Quadtree.h
+++ b/include/geos/index/quadtree/Quadtree.h
@@ -118,7 +118,7 @@ public:
     int depth();
 
     /// Returns the number of items in the tree.
-    size_t size();
+    std::size_t size();
 
     void insert(const geom::Envelope* itemEnv, void* item) override;
 
diff --git a/include/geos/index/strtree/AbstractNode.h b/include/geos/index/strtree/AbstractNode.h
index 2f0228e..275799a 100644
--- a/include/geos/index/strtree/AbstractNode.h
+++ b/include/geos/index/strtree/AbstractNode.h
@@ -52,7 +52,7 @@ public:
      * @param level 0 if this node is a leaf, 1 if a parent of a leaf, and so on;
      * the root node will have the highest level
      */
-    AbstractNode(int newLevel, size_t capacity = 10) : level(newLevel), bounds(nullptr) {
+    AbstractNode(int newLevel, std::size_t capacity = 10) : level(newLevel), bounds(nullptr) {
         childBoundables.reserve(capacity);
     }
 
diff --git a/include/geos/index/strtree/STRtree.h b/include/geos/index/strtree/STRtree.h
index 6f83c93..2991cac 100644
--- a/include/geos/index/strtree/STRtree.h
+++ b/include/geos/index/strtree/STRtree.h
@@ -99,7 +99,7 @@ private:
      */
     std::vector<BoundableList*>* verticalSlices(
         BoundableList* childBoundables,
-        size_t sliceCount);
+        std::size_t sliceCount);
 
     bool isWithinDistance(BoundablePair* initBndPair, double maxDistance);
 
diff --git a/include/geos/index/strtree/SimpleSTRnode.h b/include/geos/index/strtree/SimpleSTRnode.h
index 9d24e25..e67538d 100644
--- a/include/geos/index/strtree/SimpleSTRnode.h
+++ b/include/geos/index/strtree/SimpleSTRnode.h
@@ -48,7 +48,7 @@ public:
     /*
      * Constructs an AbstractNode at the given level in the tree
      */
-    SimpleSTRnode(std::size_t newLevel, const geom::Envelope *p_env, void* p_item, size_t capacity = 10)
+    SimpleSTRnode(std::size_t newLevel, const geom::Envelope *p_env, void* p_item, std::size_t capacity = 10)
         : ItemBoundable(p_env, p_item)
         , item(p_item)
         , bounds()
diff --git a/include/geos/index/sweepline/SweepLineEvent.h b/include/geos/index/sweepline/SweepLineEvent.h
index 4c51f6d..689dd9d 100644
--- a/include/geos/index/sweepline/SweepLineEvent.h
+++ b/include/geos/index/sweepline/SweepLineEvent.h
@@ -49,9 +49,9 @@ public:
 
     SweepLineEvent* getInsertEvent();
 
-    size_t getDeleteEventIndex();
+    std::size_t getDeleteEventIndex();
 
-    void setDeleteEventIndex(size_t newDeleteEventIndex);
+    void setDeleteEventIndex(std::size_t newDeleteEventIndex);
 
     SweepLineInterval* getInterval();
 
@@ -74,7 +74,7 @@ private:
     /// null if this is an INSERT_EVENT event
     SweepLineEvent* insertEvent;
 
-    size_t deleteEventIndex;
+    std::size_t deleteEventIndex;
 
     SweepLineInterval* sweepInt;
 
diff --git a/include/geos/io/WKBWriter.h b/include/geos/io/WKBWriter.h
index 48f6bea..fd15f49 100644
--- a/include/geos/io/WKBWriter.h
+++ b/include/geos/io/WKBWriter.h
@@ -25,6 +25,7 @@
 #include <geos/util/Machine.h> // for getMachineByteOrder
 #include <iosfwd>
 #include <cstdint>
+#include <cstddef>
 
 // Forward declarations
 namespace geos {
@@ -200,7 +201,7 @@ private:
     void writeCoordinateSequence(const geom::CoordinateSequence& cs, bool sized);
     // throws IOException
 
-    void writeCoordinate(const geom::CoordinateSequence& cs, size_t idx, bool is3d);
+    void writeCoordinate(const geom::CoordinateSequence& cs, std::size_t idx, bool is3d);
     // throws IOException
 
     void writeGeometryType(int geometryType, int SRID);
diff --git a/include/geos/linearref/LinearIterator.h b/include/geos/linearref/LinearIterator.h
index ad2318d..162a189 100644
--- a/include/geos/linearref/LinearIterator.h
+++ b/include/geos/linearref/LinearIterator.h
@@ -73,7 +73,7 @@ public:
      * @param componentIndex the component to start at
      * @param vertexIndex the vertex to start at
      */
-    LinearIterator(const geom::Geometry* linear, size_t componentIndex, size_t vertexIndex);
+    LinearIterator(const geom::Geometry* linear, std::size_t componentIndex, std::size_t vertexIndex);
 
     /** \brief
      * Tests whether there are any vertices left to iterator over.
@@ -99,13 +99,13 @@ public:
      * The component index of the vertex the iterator is currently at.
      * @return the current component index
      */
-    size_t getComponentIndex() const;
+    std::size_t getComponentIndex() const;
 
     /** \brief
      * The vertex index of the vertex the iterator is currently at.
      * @return the current vertex index
      */
-    size_t getVertexIndex() const;
+    std::size_t getVertexIndex() const;
 
     /** \brief
      * Gets the geom::LineString component the iterator is current at.
@@ -131,13 +131,13 @@ public:
 
 private:
 
-    static size_t segmentEndVertexIndex(const LinearLocation& loc);
+    static std::size_t segmentEndVertexIndex(const LinearLocation& loc);
 
     const geom::LineString* currentLine;
-    size_t vertexIndex;
-    size_t componentIndex;
+    std::size_t vertexIndex;
+    std::size_t componentIndex;
     const geom::Geometry* linear;
-    const size_t numLines;
+    const std::size_t numLines;
 
     /**
      * Invariant: currentLine <> null if the iterator is pointing
diff --git a/include/geos/linearref/LinearLocation.h b/include/geos/linearref/LinearLocation.h
index 2d78102..45fc7c3 100644
--- a/include/geos/linearref/LinearLocation.h
+++ b/include/geos/linearref/LinearLocation.h
@@ -43,8 +43,8 @@ namespace linearref { // geos::linearref
  */
 class LinearLocation {
 private:
-    size_t componentIndex;
-    size_t segmentIndex;
+    std::size_t componentIndex;
+    std::size_t segmentIndex;
     double segmentFraction;
 
     /** \brief
@@ -90,9 +90,9 @@ public:
     /** \brief
      * Creates a location referring to the start of a linear geometry
      */
-    LinearLocation(size_t segmentIndex = 0, double segmentFraction = 0.0);
+    LinearLocation(std::size_t segmentIndex = 0, double segmentFraction = 0.0);
 
-    LinearLocation(size_t componentIndex, size_t segmentIndex, double segmentFraction);
+    LinearLocation(std::size_t componentIndex, std::size_t segmentIndex, double segmentFraction);
 
     /** \brief
      * Ensures the indexes are valid for a given linear [Geometry](@ref geom::Geometry).
@@ -132,14 +132,14 @@ public:
      *
      * @return the component index
      */
-    size_t getComponentIndex() const;
+    std::size_t getComponentIndex() const;
 
     /** \brief
      * Gets the segment index for this location.
      *
      * @return the segment index
      */
-    size_t getSegmentIndex() const;
+    std::size_t getSegmentIndex() const;
 
     /** \brief
      * Gets the segment fraction for this location.
@@ -201,7 +201,7 @@ public:
      * @return a negative integer, zero, or a positive integer as this LinearLocation
      *         is less than, equal to, or greater than the specified locationValues
      */
-    int compareLocationValues(size_t componentIndex1, size_t segmentIndex1, double segmentFraction1) const;
+    int compareLocationValues(std::size_t componentIndex1, std::size_t segmentIndex1, double segmentFraction1) const;
 
     /** \brief
      *  Compares two sets of location values for order.
@@ -217,8 +217,8 @@ public:
      *         is less than, equal to, or greater than the second set of locationValues
      */
     static int compareLocationValues(
-        size_t componentIndex0, size_t segmentIndex0, double segmentFraction0,
-        size_t componentIndex1, size_t segmentIndex1, double segmentFraction1);
+        std::size_t componentIndex0, std::size_t segmentIndex0, double segmentFraction0,
+        std::size_t componentIndex1, std::size_t segmentIndex1, double segmentFraction1);
 
     /** \brief
      * Tests whether two locations are on the same
diff --git a/include/geos/noding/BasicSegmentString.h b/include/geos/noding/BasicSegmentString.h
index 15226d7..39a371e 100644
--- a/include/geos/noding/BasicSegmentString.h
+++ b/include/geos/noding/BasicSegmentString.h
@@ -68,7 +68,7 @@ public:
     }
 
     // see dox in SegmentString.h
-    const geom::Coordinate& getCoordinate(size_t i) const override;
+    const geom::Coordinate& getCoordinate(std::size_t i) const override;
 
     /// @see SegmentString::getCoordinates() const
     geom::CoordinateSequence* getCoordinates() const override;
@@ -86,7 +86,7 @@ public:
      *        Must not be the last index in the vertex list
      * @return the octant of the segment at the vertex
      */
-    int getSegmentOctant(size_t index) const;
+    int getSegmentOctant(std::size_t index) const;
 
 private:
 
diff --git a/include/geos/noding/BasicSegmentString.inl b/include/geos/noding/BasicSegmentString.inl
index 449ddca..7550895 100644
--- a/include/geos/noding/BasicSegmentString.inl
+++ b/include/geos/noding/BasicSegmentString.inl
@@ -29,7 +29,7 @@ namespace noding {
 
 /*public*/
 INLINE int
-BasicSegmentString::getSegmentOctant(size_t index) const
+BasicSegmentString::getSegmentOctant(std::size_t index) const
 {
     if(index >= size() - 1) {
         return -1;
@@ -39,7 +39,7 @@ BasicSegmentString::getSegmentOctant(size_t index) const
 
 /* virtual public */
 INLINE const geom::Coordinate&
-BasicSegmentString::getCoordinate(size_t i) const
+BasicSegmentString::getCoordinate(std::size_t i) const
 {
     return pts->getAt(i);
 }
diff --git a/include/geos/noding/IntersectionAdder.h b/include/geos/noding/IntersectionAdder.h
index 0ef8663..dc3c454 100644
--- a/include/geos/noding/IntersectionAdder.h
+++ b/include/geos/noding/IntersectionAdder.h
@@ -48,7 +48,7 @@ namespace noding { // geos.noding
  * and adds them to each string.
  *
  * The SegmentIntersector is passed to a Noder.
- * The NodedSegmentString::addIntersections(algorithm::LineIntersector* li, size_t segmentIndex, size_t geomIndex)
+ * The NodedSegmentString::addIntersections(algorithm::LineIntersector* li, std::size_t segmentIndex, std::size_t geomIndex)
  * method is called whenever the Noder
  * detects that two SegmentStrings *might* intersect.
  * This class is an example of the *Strategy* pattern.
@@ -80,8 +80,8 @@ private:
      * Note that closed edges require a special check for the point
      * shared by the beginning and end segments.
      */
-    bool isTrivialIntersection(const SegmentString* e0, size_t segIndex0,
-                               const SegmentString* e1, size_t segIndex1);
+    bool isTrivialIntersection(const SegmentString* e0, std::size_t segIndex0,
+                               const SegmentString* e1, std::size_t segIndex1);
 
     // Declare type as noncopyable
     IntersectionAdder(const IntersectionAdder& other) = delete;
@@ -177,12 +177,12 @@ public:
      * intersect (e.g. by an disjoint envelope test).
      */
     void processIntersections(
-        SegmentString* e0,  size_t segIndex0,
-        SegmentString* e1,  size_t segIndex1) override;
+        SegmentString* e0,  std::size_t segIndex0,
+        SegmentString* e1,  std::size_t segIndex1) override;
 
 
     static bool
-    isAdjacentSegments(size_t i1, size_t i2)
+    isAdjacentSegments(std::size_t i1, std::size_t i2)
     {
         return (i1 > i2 ? i1 - i2 : i2 - i1) == 1;
     }
diff --git a/include/geos/noding/IntersectionFinderAdder.h b/include/geos/noding/IntersectionFinderAdder.h
index 198fb4d..5d3230f 100644
--- a/include/geos/noding/IntersectionFinderAdder.h
+++ b/include/geos/noding/IntersectionFinderAdder.h
@@ -79,8 +79,8 @@ public:
      * (e.g. by an disjoint envelope test).
      */
     void processIntersections(
-        SegmentString* e0,  size_t segIndex0,
-        SegmentString* e1,  size_t segIndex1) override;
+        SegmentString* e0,  std::size_t segIndex0,
+        SegmentString* e1,  std::size_t segIndex1) override;
 
     std::vector<geom::Coordinate>&
     getInteriorIntersections()
diff --git a/include/geos/noding/NodedSegmentString.h b/include/geos/noding/NodedSegmentString.h
index a156e3e..d93bba9 100644
--- a/include/geos/noding/NodedSegmentString.h
+++ b/include/geos/noding/NodedSegmentString.h
@@ -154,7 +154,7 @@ public:
         return pts->size();
     }
 
-    const geom::Coordinate& getCoordinate(size_t i) const override;
+    const geom::Coordinate& getCoordinate(std::size_t i) const override;
 
     geom::CoordinateSequence* getCoordinates() const override;
     geom::CoordinateSequence* releaseCoordinates();
@@ -171,7 +171,7 @@ public:
      *              Must not be the last index in the vertex list
      * @return the octant of the segment at the vertex
      */
-    int getSegmentOctant(size_t index) const;
+    int getSegmentOctant(std::size_t index) const;
 
     /** \brief
      * Add {@link SegmentNode}s for one or both
@@ -179,7 +179,7 @@ public:
      * intersection list.
      */
     void addIntersections(algorithm::LineIntersector* li,
-                          size_t segmentIndex, size_t geomIndex);
+                          std::size_t segmentIndex, std::size_t geomIndex);
 
     /** \brief
      * Add an SegmentNode for intersection intIndex.
@@ -189,8 +189,8 @@ public:
      * to use the higher of the two possible segmentIndexes
      */
     void addIntersection(algorithm::LineIntersector* li,
-                         size_t segmentIndex,
-                         size_t geomIndex, size_t intIndex);
+                         std::size_t segmentIndex,
+                         std::size_t geomIndex, std::size_t intIndex);
 
     /** \brief
      * Add an SegmentNode for intersection intIndex.
@@ -200,7 +200,7 @@ public:
      * to use the higher of the two possible segmentIndexes
      */
     void addIntersection(const geom::Coordinate& intPt,
-                         size_t segmentIndex);
+                         std::size_t segmentIndex);
 
 
 private:
diff --git a/include/geos/noding/NodingIntersectionFinder.h b/include/geos/noding/NodingIntersectionFinder.h
index ebb6094..96a39cf 100644
--- a/include/geos/noding/NodingIntersectionFinder.h
+++ b/include/geos/noding/NodingIntersectionFinder.h
@@ -152,8 +152,8 @@ public:
      * (e.g. by an disjoint envelope test).
      */
     void processIntersections(
-        SegmentString* e0,  size_t segIndex0,
-        SegmentString* e1,  size_t segIndex1) override;
+        SegmentString* e0,  std::size_t segIndex0,
+        SegmentString* e1,  std::size_t segIndex1) override;
 
     bool
     isDone() const override
@@ -164,7 +164,7 @@ public:
 private:
     algorithm::LineIntersector& li;
     geom::Coordinate interiorIntersection;
-    size_t intersectionCount;
+    std::size_t intersectionCount;
     bool isCheckEndSegmentsOnly;
     bool findAllIntersections;
     std::vector<geom::Coordinate> intSegments;
@@ -216,7 +216,7 @@ private:
      * @param index the index of a segment in the segment string
      * @return true if the segment is an end segment
      */
-    bool isEndSegment(const SegmentString* segStr, size_t index);
+    bool isEndSegment(const SegmentString* segStr, std::size_t index);
 
 
 };
diff --git a/include/geos/noding/NodingValidator.h b/include/geos/noding/NodingValidator.h
index 7f17a7b..9a6ee05 100644
--- a/include/geos/noding/NodingValidator.h
+++ b/include/geos/noding/NodingValidator.h
@@ -71,8 +71,8 @@ private:
                                     const SegmentString& ss1);
 
     void checkInteriorIntersections(
-        const SegmentString& e0, size_t segIndex0,
-        const SegmentString& e1, size_t segIndex1);
+        const SegmentString& e0, std::size_t segIndex0,
+        const SegmentString& e1, std::size_t segIndex1);
 
     /**
      * Checks for intersections between an endpoint of a segment string
diff --git a/include/geos/noding/OrientedCoordinateArray.h b/include/geos/noding/OrientedCoordinateArray.h
index 2d05ac2..663c5b0 100644
--- a/include/geos/noding/OrientedCoordinateArray.h
+++ b/include/geos/noding/OrientedCoordinateArray.h
@@ -72,7 +72,7 @@ public:
     bool operator==(const OrientedCoordinateArray& other) const;
 
     struct GEOS_DLL HashCode {
-        size_t operator()(const OrientedCoordinateArray & oca) const;
+        std::size_t operator()(const OrientedCoordinateArray & oca) const;
     };
 
 private:
diff --git a/include/geos/noding/SegmentIntersectionDetector.h b/include/geos/noding/SegmentIntersectionDetector.h
index 402f9d5..f879f3b 100644
--- a/include/geos/noding/SegmentIntersectionDetector.h
+++ b/include/geos/noding/SegmentIntersectionDetector.h
@@ -168,8 +168,8 @@ public:
      *       this call for segment pairs which they have determined do not intersect
      *       (e.g. by an disjoint envelope test).
      */
-    void processIntersections(noding::SegmentString* e0, size_t segIndex0,
-                              noding::SegmentString* e1, size_t segIndex1) override;
+    void processIntersections(noding::SegmentString* e0, std::size_t segIndex0,
+                              noding::SegmentString* e1, std::size_t segIndex1) override;
 
 };
 
diff --git a/include/geos/noding/SegmentIntersector.h b/include/geos/noding/SegmentIntersector.h
index 5b9139a..bc0298d 100644
--- a/include/geos/noding/SegmentIntersector.h
+++ b/include/geos/noding/SegmentIntersector.h
@@ -56,8 +56,8 @@ public:
      * being intersected.
      */
     virtual void processIntersections(
-        SegmentString* e0,  size_t segIndex0,
-        SegmentString* e1,  size_t segIndex1) = 0;
+        SegmentString* e0,  std::size_t segIndex0,
+        SegmentString* e1,  std::size_t segIndex1) = 0;
 
     /**
      * \brief
diff --git a/include/geos/noding/SegmentNode.h b/include/geos/noding/SegmentNode.h
index 204bcc8..dba6232 100644
--- a/include/geos/noding/SegmentNode.h
+++ b/include/geos/noding/SegmentNode.h
@@ -63,7 +63,7 @@ public:
     geom::Coordinate coord;
 
     /// the index of the containing line segment in the parent edge
-    size_t segmentIndex;
+    std::size_t segmentIndex;
 
     /// Construct a node on the given NodedSegmentString
     ///
@@ -79,7 +79,7 @@ public:
     ///
     SegmentNode(const NodedSegmentString& ss,
                 const geom::Coordinate& nCoord,
-                size_t nSegmentIndex, int nSegmentOctant);
+                std::size_t nSegmentIndex, int nSegmentOctant);
 
     ~SegmentNode() {}
 
diff --git a/include/geos/noding/SegmentString.h b/include/geos/noding/SegmentString.h
index 53a2cb8..511b8cc 100644
--- a/include/geos/noding/SegmentString.h
+++ b/include/geos/noding/SegmentString.h
@@ -86,9 +86,9 @@ public:
     }
 
 
-    virtual size_t size() const = 0;
+    virtual std::size_t size() const = 0;
 
-    virtual const geom::Coordinate& getCoordinate(size_t i) const = 0;
+    virtual const geom::Coordinate& getCoordinate(std::size_t i) const = 0;
 
     /// \brief
     /// Return a pointer to the CoordinateSequence associated
diff --git a/include/geos/noding/snap/SnappingIntersectionAdder.h b/include/geos/noding/snap/SnappingIntersectionAdder.h
index 80b0b02..07641c6 100644
--- a/include/geos/noding/snap/SnappingIntersectionAdder.h
+++ b/include/geos/noding/snap/SnappingIntersectionAdder.h
@@ -65,10 +65,10 @@ private:
     */
     void processNearVertex(
         SegmentString* srcSS,
-        size_t srcIndex,
+        std::size_t srcIndex,
         const geom::Coordinate& p,
         SegmentString* ss,
-        size_t segIndex,
+        std::size_t segIndex,
         const geom::Coordinate& p0,
         const geom::Coordinate& p1);
 
@@ -77,7 +77,7 @@ private:
     * Closed segStrings require a check for the point shared by the beginning
     * and end segments.
     */
-    static bool isAdjacent(SegmentString* ss0, size_t segIndex0, SegmentString* ss1, size_t segIndex1);
+    static bool isAdjacent(SegmentString* ss0, std::size_t segIndex0, SegmentString* ss1, std::size_t segIndex1);
 
 
 public:
@@ -92,7 +92,7 @@ public:
     * this call for segment pairs which they have determined do not intersect
     * (e.g. by an disjoint envelope test).
     */
-    void processIntersections(SegmentString* e0, size_t segIndex0, SegmentString* e1, size_t segIndex1) override;
+    void processIntersections(SegmentString* e0, std::size_t segIndex0, SegmentString* e1, std::size_t segIndex1) override;
 
     bool isDone() const override { return false; };
 
diff --git a/include/geos/noding/snapround/MCIndexPointSnapper.h b/include/geos/noding/snapround/MCIndexPointSnapper.h
index 1b404ec..4608f68 100644
--- a/include/geos/noding/snapround/MCIndexPointSnapper.h
+++ b/include/geos/noding/snapround/MCIndexPointSnapper.h
@@ -72,7 +72,7 @@ public:
      * @return `true` if a node was added for this pixel
      */
     bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
-              size_t vertexIndex);
+              std::size_t vertexIndex);
 
     bool
     snap(HotPixel& hotPixel)
diff --git a/include/geos/noding/snapround/SnapRoundingIntersectionAdder.h b/include/geos/noding/snapround/SnapRoundingIntersectionAdder.h
index 644801f..c41497f 100644
--- a/include/geos/noding/snapround/SnapRoundingIntersectionAdder.h
+++ b/include/geos/noding/snapround/SnapRoundingIntersectionAdder.h
@@ -89,7 +89,7 @@ private:
     * result in the snapped segment A crossing segment B
     * without a node being introduced.
     */
-    void processNearVertex(const geom::Coordinate& p, SegmentString* edge, size_t segIndex,
+    void processNearVertex(const geom::Coordinate& p, SegmentString* edge, std::size_t segIndex,
                            const geom::Coordinate& p0, const geom::Coordinate& p1);
 
 
@@ -107,7 +107,7 @@ public:
     * this call for segment pairs which they have determined do not intersect
     * (e.g. by an disjoint envelope test).
     */
-    void processIntersections(SegmentString* e0, size_t segIndex0, SegmentString* e1, size_t segIndex1) override;
+    void processIntersections(SegmentString* e0, std::size_t segIndex0, SegmentString* e1, std::size_t segIndex1) override;
 
     /**
     * Always process all intersections
diff --git a/include/geos/noding/snapround/SnapRoundingNoder.h b/include/geos/noding/snapround/SnapRoundingNoder.h
index 1abd80c..6e5d221 100644
--- a/include/geos/noding/snapround/SnapRoundingNoder.h
+++ b/include/geos/noding/snapround/SnapRoundingNoder.h
@@ -125,7 +125,7 @@ private:
     * @param ss the segment string to add intersections to
     * @param segIndex the index of the segment
     */
-    void snapSegment(geom::Coordinate& p0, geom::Coordinate& p1, NodedSegmentString* ss, size_t segIndex);
+    void snapSegment(geom::Coordinate& p0, geom::Coordinate& p1, NodedSegmentString* ss, std::size_t segIndex);
 
     /**
     * Add nodes for any vertices in hot pixels that were
@@ -133,7 +133,7 @@ private:
     */
     void addVertexNodeSnaps(NodedSegmentString* ss);
 
-    void snapVertexNode(const geom::Coordinate& p0, NodedSegmentString* ss, size_t segIndex);
+    void snapVertexNode(const geom::Coordinate& p0, NodedSegmentString* ss, std::size_t segIndex);
 
 public:
 
diff --git a/include/geos/operation/buffer/BufferInputLineSimplifier.h b/include/geos/operation/buffer/BufferInputLineSimplifier.h
index 7d5f7d4..3c19047 100644
--- a/include/geos/operation/buffer/BufferInputLineSimplifier.h
+++ b/include/geos/operation/buffer/BufferInputLineSimplifier.h
@@ -120,11 +120,11 @@ private:
      * @return the next non-deleted index, if any
      * @return inputLine.size() if there are no more non-deleted indices
      */
-    size_t findNextNonDeletedIndex(size_t index) const;
+    std::size_t findNextNonDeletedIndex(std::size_t index) const;
 
     std::unique_ptr<geom::CoordinateSequence> collapseLine() const;
 
-    bool isDeletable(size_t i0, size_t i1, size_t i2, double distanceTol) const;
+    bool isDeletable(std::size_t i0, std::size_t i1, std::size_t i2, double distanceTol) const;
 
     bool isShallowConcavity(const geom::Coordinate& p0,
                             const geom::Coordinate& p1,
@@ -146,7 +146,7 @@ private:
      */
     bool isShallowSampled(const geom::Coordinate& p0,
                           const geom::Coordinate& p2,
-                          size_t i0, size_t i2, double distanceTol) const;
+                          std::size_t i0, std::size_t i2, double distanceTol) const;
 
     bool isShallow(const geom::Coordinate& p0,
                    const geom::Coordinate& p1,
diff --git a/include/geos/operation/buffer/OffsetSegmentString.h b/include/geos/operation/buffer/OffsetSegmentString.h
index 2da1091..e392b84 100644
--- a/include/geos/operation/buffer/OffsetSegmentString.h
+++ b/include/geos/operation/buffer/OffsetSegmentString.h
@@ -144,12 +144,12 @@ public:
     addPts(const geom::CoordinateSequence& pts, bool isForward)
     {
         if(isForward) {
-            for(size_t i = 0, n = pts.size(); i < n; ++i) {
+            for(std::size_t i = 0, n = pts.size(); i < n; ++i) {
                 addPt(pts[i]);
             }
         }
         else {
-            for(size_t i = pts.size(); i > 0; --i) {
+            for(std::size_t i = pts.size(); i > 0; --i) {
                 addPt(pts[i - 1]);
             }
         }
diff --git a/include/geos/operation/distance/FacetSequence.h b/include/geos/operation/distance/FacetSequence.h
index dc609a1..7d07ad8 100644
--- a/include/geos/operation/distance/FacetSequence.h
+++ b/include/geos/operation/distance/FacetSequence.h
@@ -31,8 +31,8 @@ namespace distance {
 class FacetSequence {
 private:
     const geom::CoordinateSequence* pts;
-    const size_t start;
-    const size_t end;
+    const std::size_t start;
+    const std::size_t end;
     const geom::Geometry* geom;
     /*
     * Unlike JTS, we store the envelope in the FacetSequence so
@@ -49,13 +49,13 @@ private:
                                     std::vector<GeometryLocation> *locs) const;
 
     void updateNearestLocationsPointLine(const geom::Coordinate& pt,
-                                         const FacetSequence& facetSeq, size_t i,
+                                         const FacetSequence& facetSeq, std::size_t i,
                                          const geom::Coordinate& q0, const geom::Coordinate &q1,
                                          std::vector<GeometryLocation> *locs) const;
 
-    void updateNearestLocationsLineLine(size_t i, const geom::Coordinate& p0, const geom::Coordinate& p1,
+    void updateNearestLocationsLineLine(std::size_t i, const geom::Coordinate& p0, const geom::Coordinate& p1,
                                         const FacetSequence& facetSeq,
-                                        size_t j, const geom::Coordinate& q0, const geom::Coordinate &q1,
+                                        std::size_t j, const geom::Coordinate& q0, const geom::Coordinate &q1,
                                         std::vector<GeometryLocation> *locs) const;
 
     void computeEnvelope();
@@ -63,17 +63,17 @@ private:
 public:
     const geom::Envelope* getEnvelope() const;
 
-    const geom::Coordinate* getCoordinate(size_t index) const;
+    const geom::Coordinate* getCoordinate(std::size_t index) const;
 
-    size_t size() const;
+    std::size_t size() const;
 
     bool isPoint() const;
 
     double distance(const FacetSequence& facetSeq) const;
 
-    FacetSequence(const geom::CoordinateSequence* pts, size_t start, size_t end);
+    FacetSequence(const geom::CoordinateSequence* pts, std::size_t start, std::size_t end);
 
-    FacetSequence(const geom::Geometry* geom, const geom::CoordinateSequence* pts, size_t start, size_t end);
+    FacetSequence(const geom::Geometry* geom, const geom::CoordinateSequence* pts, std::size_t start, std::size_t end);
 
     std::vector<GeometryLocation> nearestLocations(const FacetSequence& facetSeq) const;
 
diff --git a/include/geos/operation/distance/GeometryLocation.h b/include/geos/operation/distance/GeometryLocation.h
index deaf3eb..d6943c4 100644
--- a/include/geos/operation/distance/GeometryLocation.h
+++ b/include/geos/operation/distance/GeometryLocation.h
@@ -50,7 +50,7 @@ namespace distance { // geos::operation::distance
 class GEOS_DLL GeometryLocation {
 private:
     const geom::Geometry* component;
-    size_t segIndex;
+    std::size_t segIndex;
     bool inside_area;
     geom::Coordinate pt;
 public:
@@ -73,7 +73,7 @@ public:
      * @param pt the coordinate of the location
      */
     GeometryLocation(const geom::Geometry* component,
-                     size_t segIndex, const geom::Coordinate& pt);
+                     std::size_t segIndex, const geom::Coordinate& pt);
 
     /** \brief
      * Constructs a GeometryLocation specifying a point inside an
@@ -98,7 +98,7 @@ public:
      *
      * @return the segment index for the location, or INSIDE_AREA
      */
-    size_t getSegmentIndex();
+    std::size_t getSegmentIndex();
 
     /**
      * Returns the geom::Coordinate of this location.
diff --git a/include/geos/operation/overlay/snap/LineStringSnapper.h b/include/geos/operation/overlay/snap/LineStringSnapper.h
index 65358d7..9719659 100644
--- a/include/geos/operation/overlay/snap/LineStringSnapper.h
+++ b/include/geos/operation/overlay/snap/LineStringSnapper.h
@@ -66,7 +66,7 @@ public:
         snapTolerance(nSnapTol),
         allowSnappingToSourceVertices(false)
     {
-        size_t s = srcPts.size();
+        std::size_t s = srcPts.size();
         isClosed = s < 2 ? false : srcPts[0].equals2D(srcPts[s - 1]);
     }
 
diff --git a/include/geos/operation/overlayng/Edge.h b/include/geos/operation/overlayng/Edge.h
index ded8647..a2a2deb 100644
--- a/include/geos/operation/overlayng/Edge.h
+++ b/include/geos/operation/overlayng/Edge.h
@@ -135,7 +135,7 @@ public:
     // release the underlying points to the caller
     geom::CoordinateSequence* releaseCoordinates();
 
-    const geom::Coordinate& getCoordinate(size_t index)  const;
+    const geom::Coordinate& getCoordinate(std::size_t index)  const;
 
     std::size_t size() const;
     bool direction() const;
diff --git a/include/geos/operation/valid/IndexedNestedShellTester.h b/include/geos/operation/valid/IndexedNestedShellTester.h
index 5626ef3..3c9580a 100644
--- a/include/geos/operation/valid/IndexedNestedShellTester.h
+++ b/include/geos/operation/valid/IndexedNestedShellTester.h
@@ -52,7 +52,7 @@ namespace valid {
 class IndexedNestedShellTester {
 
 public:
-    IndexedNestedShellTester(const geomgraph::GeometryGraph& g, size_t initialCapacity);
+    IndexedNestedShellTester(const geomgraph::GeometryGraph& g, std::size_t initialCapacity);
 
     void add(const geom::Polygon& p) {
         polys.push_back(&p);
diff --git a/include/geos/profiler.h b/include/geos/profiler.h
index 83be471..966005c 100644
--- a/include/geos/profiler.h
+++ b/include/geos/profiler.h
@@ -100,7 +100,7 @@ public:
     double getAvg() const;
 
     /** \brief Return number of timings */
-    size_t getNumTimings() const;
+    std::size_t getNumTimings() const;
 
     /** \brief Profile name */
     std::string name;
diff --git a/include/geos/simplify/TaggedLineSegment.h b/include/geos/simplify/TaggedLineSegment.h
index d4be09a..a1332ed 100644
--- a/include/geos/simplify/TaggedLineSegment.h
+++ b/include/geos/simplify/TaggedLineSegment.h
@@ -58,7 +58,7 @@ public:
     TaggedLineSegment(const geom::Coordinate& p0,
                       const geom::Coordinate& p1,
                       const geom::Geometry* parent,
-                      size_t index);
+                      std::size_t index);
 
     TaggedLineSegment(const geom::Coordinate& p0,
                       const geom::Coordinate& p1);
@@ -67,13 +67,13 @@ public:
 
     const geom::Geometry* getParent() const;
 
-    size_t getIndex() const;
+    std::size_t getIndex() const;
 
 private:
 
     const geom::Geometry* parent;
 
-    size_t index;
+    std::size_t index;
 
 };
 
diff --git a/include/geos/util.h b/include/geos/util.h
index 40d51dd..e5ed10b 100644
--- a/include/geos/util.h
+++ b/include/geos/util.h
@@ -59,7 +59,7 @@ struct _Unique_if<T[]> {
     typedef std::unique_ptr<T[]> _Unknown_bound;
 };
 
-template<class T, size_t N>
+template<class T, std::size_t N>
 struct _Unique_if<T[N]> {
     typedef void _Known_bound;
 };
@@ -72,7 +72,7 @@ make_unique(Args &&... args) {
 
 template<class T>
 typename _Unique_if<T>::_Unknown_bound
-make_unique(size_t n) {
+make_unique(std::size_t n) {
     typedef typename std::remove_extent<T>::type U;
     return std::unique_ptr<T>(new U[n]());
 }
diff --git a/src/algorithm/Area.cpp b/src/algorithm/Area.cpp
index 1b3692a..39ec5db 100644
--- a/src/algorithm/Area.cpp
+++ b/src/algorithm/Area.cpp
@@ -42,7 +42,7 @@ Area::ofRing(const geom::CoordinateSequence* ring)
 double
 Area::ofRingSigned(const std::vector<geom::Coordinate>& ring)
 {
-    size_t rlen = ring.size();
+    std::size_t rlen = ring.size();
     if(rlen < 3) {
         return 0.0;
     }
@@ -53,7 +53,7 @@ Area::ofRingSigned(const std::vector<geom::Coordinate>& ring)
      * http://en.wikipedia.org/wiki/Shoelace_formula
      */
     double x0 = ring[0].x;
-    for(size_t i = 1; i < rlen - 1; i++) {
+    for(std::size_t i = 1; i < rlen - 1; i++) {
         double x = ring[i].x - x0;
         double y1 = ring[i + 1].y;
         double y2 = ring[i - 1].y;
@@ -66,7 +66,7 @@ Area::ofRingSigned(const std::vector<geom::Coordinate>& ring)
 double
 Area::ofRingSigned(const geom::CoordinateSequence* ring)
 {
-    size_t n = ring->size();
+    std::size_t n = ring->size();
     if(n < 3) {
         return 0.0;
     }
@@ -80,7 +80,7 @@ Area::ofRingSigned(const geom::CoordinateSequence* ring)
     double x0 = p1.x;
     p2.x -= x0;
     double sum = 0.0;
-    for(size_t i = 1; i < n - 1; i++) {
+    for(std::size_t i = 1; i < n - 1; i++) {
         p0.y = p1.y;
         p1.x = p2.x;
         p1.y = p2.y;
diff --git a/src/algorithm/Centroid.cpp b/src/algorithm/Centroid.cpp
index 8f65682..6dec14c 100644
--- a/src/algorithm/Centroid.cpp
+++ b/src/algorithm/Centroid.cpp
@@ -82,7 +82,7 @@ Centroid::add(const Geometry& geom)
         add(*p);
     }
     else if(const GeometryCollection* g = dynamic_cast<const GeometryCollection*>(&geom)) {
-        for(size_t i = 0; i < g->getNumGeometries(); i++) {
+        for(std::size_t i = 0; i < g->getNumGeometries(); i++) {
             add(*g->getGeometryN(i));
         }
     }
@@ -100,7 +100,7 @@ void
 Centroid::add(const Polygon& poly)
 {
     addShell(*poly.getExteriorRing()->getCoordinatesRO());
-    for(size_t i = 0; i < poly.getNumInteriorRing(); i++) {
+    for(std::size_t i = 0; i < poly.getNumInteriorRing(); i++) {
         addHole(*poly.getInteriorRingN(i)->getCoordinatesRO());
     }
 }
@@ -109,12 +109,12 @@ Centroid::add(const Polygon& poly)
 void
 Centroid::addShell(const CoordinateSequence& pts)
 {
-    size_t len = pts.size();
+    std::size_t len = pts.size();
     if(len > 0) {
         setAreaBasePoint(pts[0]);
     }
     bool isPositiveArea = ! Orientation::isCCW(&pts);
-    for(size_t i = 0; i < len - 1; ++i) {
+    for(std::size_t i = 0; i < len - 1; ++i) {
         addTriangle(*areaBasePt, pts[i], pts[i + 1], isPositiveArea);
     }
     addLineSegments(pts);
@@ -125,7 +125,7 @@ void
 Centroid::addHole(const CoordinateSequence& pts)
 {
     bool isPositiveArea = Orientation::isCCW(&pts);
-    for(size_t i = 0, e = pts.size() - 1; i < e; ++i) {
+    for(std::size_t i = 0, e = pts.size() - 1; i < e; ++i) {
         addTriangle(*areaBasePt, pts[i], pts[i + 1], isPositiveArea);
     }
     addLineSegments(pts);
@@ -165,9 +165,9 @@ Centroid::area2(const Coordinate& p1, const Coordinate& p2, const Coordinate& p3
 void
 Centroid::addLineSegments(const CoordinateSequence& pts)
 {
-    size_t npts = pts.size();
+    std::size_t npts = pts.size();
     double lineLen = 0.0;
-    for(size_t i = 0; i < npts - 1; i++) {
+    for(std::size_t i = 0; i < npts - 1; i++) {
         double segmentLen = pts[i].distance(pts[i + 1]);
         if(segmentLen == 0.0) {
             continue;
diff --git a/src/algorithm/ConvexHull.cpp b/src/algorithm/ConvexHull.cpp
index e0fd924..52df7fd 100644
--- a/src/algorithm/ConvexHull.cpp
+++ b/src/algorithm/ConvexHull.cpp
@@ -107,7 +107,7 @@ ConvexHull::toCoordinateSequence(Coordinate::ConstVect& cv)
 
     std::vector<Coordinate> vect(cv.size());
 
-    for(size_t i = 0; i < cv.size(); ++i) {
+    for(std::size_t i = 0; i < cv.size(); ++i) {
         vect[i] = *(cv[i]); // Coordinate copy
     }
 
@@ -122,7 +122,7 @@ ConvexHull::computeOctPts(const Coordinate::ConstVect& p_inputPts,
     // Initialize all slots with first input coordinate
     pts = Coordinate::ConstVect(8, p_inputPts[0]);
 
-    for(size_t i = 1, n = p_inputPts.size(); i < n; ++i) {
+    for(std::size_t i = 1, n = p_inputPts.size(); i < n; ++i) {
         if(p_inputPts[i]->x < pts[0]->x) {
             pts[0] = p_inputPts[i];
         }
@@ -199,7 +199,7 @@ ConvexHull::reduce(Coordinate::ConstVect& pts)
      *
      * @@TIP: there should be a std::algo for this
      */
-    for(size_t i = 0, n = pts.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = pts.size(); i < n; ++i) {
         if(!PointLocation::isInRing(*(pts[i]), polyPts)) {
             reducedSet.insert(pts[i]);
         }
@@ -216,7 +216,7 @@ ConvexHull::reduce(Coordinate::ConstVect& pts)
 void
 ConvexHull::padArray3(geom::Coordinate::ConstVect& pts)
 {
-    for(size_t i = pts.size(); i < 3; ++i) {
+    for(std::size_t i = pts.size(); i < 3; ++i) {
         pts.push_back(pts[0]);
     }
 }
@@ -224,7 +224,7 @@ ConvexHull::padArray3(geom::Coordinate::ConstVect& pts)
 std::unique_ptr<Geometry>
 ConvexHull::getConvexHull()
 {
-    size_t nInputPts = inputPts.size();
+    std::size_t nInputPts = inputPts.size();
 
     if(nInputPts == 0) { // Return an empty geometry
         return geomFactory->createEmptyGeometry();
@@ -269,7 +269,7 @@ ConvexHull::preSort(Coordinate::ConstVect& pts)
     // find the lowest point in the set. If two or more points have
     // the same minimum y coordinate choose the one with the minimum x.
     // This focal point is put in array location pts[0].
-    for(size_t i = 1, n = pts.size(); i < n; ++i) {
+    for(std::size_t i = 1, n = pts.size(); i < n; ++i) {
         const Coordinate* p0 = pts[0]; // this will change
         const Coordinate* pi = pts[i];
         if((pi->y < p0->y) || ((pi->y == p0->y) && (pi->x < p0->x))) {
@@ -292,7 +292,7 @@ ConvexHull::grahamScan(const Coordinate::ConstVect& c,
     ps.push_back(c[1]);
     ps.push_back(c[2]);
 
-    for(size_t i = 3, n = c.size(); i < n; ++i) {
+    for(std::size_t i = 3, n = c.size(); i < n; ++i) {
         const Coordinate* p = ps.back();
         ps.pop_back();
         while(!ps.empty() &&
@@ -358,7 +358,7 @@ void
 ConvexHull::cleanRing(const Coordinate::ConstVect& original,
                       Coordinate::ConstVect& cleaned)
 {
-    size_t npts = original.size();
+    std::size_t npts = original.size();
 
     const Coordinate* last = original[npts - 1];
 
@@ -367,7 +367,7 @@ ConvexHull::cleanRing(const Coordinate::ConstVect& original,
     assert(original[0]->equals2D(*last));
 
     const Coordinate* prev = nullptr;
-    for(size_t i = 0; i < npts - 1; ++i) {
+    for(std::size_t i = 0; i < npts - 1; ++i) {
         const Coordinate* curr = original[i];
         const Coordinate* next = original[i + 1];
 
diff --git a/src/algorithm/HCoordinate.cpp b/src/algorithm/HCoordinate.cpp
index 7b9f86a..916d1b4 100644
--- a/src/algorithm/HCoordinate.cpp
+++ b/src/algorithm/HCoordinate.cpp
@@ -32,7 +32,6 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
 using namespace geos::geom;
 
 namespace geos {
@@ -45,12 +44,12 @@ HCoordinate::intersection(const Coordinate& p1, const Coordinate& p2,
 {
 
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << ":" << endl
+    std::cerr << __FUNCTION__ << ":" << std::endl
          << setprecision(20)
-         << " p1: " << p1 << endl
-         << " p2: " << p2 << endl
-         << " q1: " << q1 << endl
-         << " q2: " << q2 << endl;
+         << " p1: " << p1 << std::endl
+         << " p2: " << p2 << std::endl
+         << " q1: " << q1 << std::endl
+         << " q2: " << q2 << std::endl;
 #endif
 
     // unrolled computation
diff --git a/src/algorithm/InteriorPointArea.cpp b/src/algorithm/InteriorPointArea.cpp
index 1236898..308c3d0 100644
--- a/src/algorithm/InteriorPointArea.cpp
+++ b/src/algorithm/InteriorPointArea.cpp
@@ -34,7 +34,6 @@
 #include <typeinfo>
 #include <memory> // for unique_ptr
 
-using namespace std;
 using namespace geos::geom;
 
 namespace geos {
@@ -86,7 +85,7 @@ public:
     getScanLineY()
     {
         process(*poly.getExteriorRing());
-        for (size_t i = 0; i < poly.getNumInteriorRing(); i++) {
+        for (std::size_t i = 0; i < poly.getNumInteriorRing(); i++) {
             process(*poly.getInteriorRingN(i));
         }
         double bisectY = avg(hiY, loY);
@@ -149,7 +148,7 @@ public:
     void
     process()
     {
-        vector<double> crossings;
+        std::vector<double> crossings;
 
         /*
          * This results in returning a null Coordinate
@@ -162,7 +161,7 @@ public:
 
         const LinearRing* shell = polygon.getExteriorRing();
         scanRing(*shell, crossings);
-        for (size_t i = 0; i < polygon.getNumInteriorRing(); i++) {
+        for (std::size_t i = 0; i < polygon.getNumInteriorRing(); i++) {
             const LinearRing* hole = polygon.getInteriorRingN(i);
             scanRing(*hole, crossings);
         }
@@ -175,21 +174,21 @@ private:
     double interiorSectionWidth = 0.0;
     Coordinate interiorPoint;
 
-    void scanRing(const LinearRing& ring, vector<double>& crossings)
+    void scanRing(const LinearRing& ring, std::vector<double>& crossings)
     {
         // skip rings which don't cross scan line
         if (! intersectsHorizontalLine(ring.getEnvelopeInternal(), interiorPointY))
             return;
 
         const CoordinateSequence* seq = ring.getCoordinatesRO();
-        for (size_t i = 1; i < seq->size(); i++) {
+        for (std::size_t i = 1; i < seq->size(); i++) {
             const Coordinate& ptPrev = seq->getAt(i - 1);
             const Coordinate& pt = seq->getAt(i);
             addEdgeCrossing(ptPrev, pt, interiorPointY, crossings);
         }
     }
 
-    void addEdgeCrossing(const Coordinate& p0, const Coordinate& p1, double scanY, vector<double>& crossings)
+    void addEdgeCrossing(const Coordinate& p0, const Coordinate& p1, double scanY, std::vector<double>& crossings)
     {
         // skip non-crossing segments
         if (!intersectsHorizontalLine(p0, p1, scanY))
@@ -202,7 +201,7 @@ private:
         crossings.push_back(xInt);
     }
 
-    void findBestMidpoint(vector<double>& crossings)
+    void findBestMidpoint(std::vector<double>& crossings)
     {
         // zero-area polygons will have no crossings
         if (crossings.empty()) return;
@@ -214,7 +213,7 @@ private:
          * Entries in crossings list are expected to occur in pairs representing a
          * section of the scan line interior to the polygon (which may be zero-length)
         */
-        for (size_t i = 0; i < crossings.size(); i += 2) {
+        for (std::size_t i = 0; i < crossings.size(); i += 2) {
             double x1 = crossings[i];
             // crossings count must be even so this should be safe
             double x2 = crossings[i + 1];
diff --git a/src/algorithm/InteriorPointLine.cpp b/src/algorithm/InteriorPointLine.cpp
index 4aa5ac1..a1c8638 100644
--- a/src/algorithm/InteriorPointLine.cpp
+++ b/src/algorithm/InteriorPointLine.cpp
@@ -113,7 +113,7 @@ InteriorPointLine::addEndpoints(const Geometry* geom)
 void
 InteriorPointLine::addEndpoints(const CoordinateSequence* pts)
 {
-    size_t npts = pts->size();
+    std::size_t npts = pts->size();
     if (npts) {
         add(pts->getAt(0));
         if (npts > 1) {
diff --git a/src/algorithm/Length.cpp b/src/algorithm/Length.cpp
index caf87e6..7a8f5ff 100644
--- a/src/algorithm/Length.cpp
+++ b/src/algorithm/Length.cpp
@@ -29,7 +29,7 @@ double
 Length::ofLine(const geom::CoordinateSequence* pts)
 {
     // optimized for processing CoordinateSequences
-    size_t n = pts->size();
+    std::size_t n = pts->size();
     if(n <= 1) {
         return 0.0;
     }
@@ -40,7 +40,7 @@ Length::ofLine(const geom::CoordinateSequence* pts)
     double x0 = p.x;
     double y0 = p.y;
 
-    for(size_t i = 1; i < n; i++) {
+    for(std::size_t i = 1; i < n; i++) {
         const geom::Coordinate& pi = pts->getAt(i);
         double x1 = pi.x;
         double y1 = pi.y;
diff --git a/src/algorithm/LineIntersector.cpp b/src/algorithm/LineIntersector.cpp
index 388431d..3f17b6b 100644
--- a/src/algorithm/LineIntersector.cpp
+++ b/src/algorithm/LineIntersector.cpp
@@ -41,8 +41,6 @@
 #include <iostream>
 #endif
 
-using namespace std;
-
 using namespace geos::geom;
 
 namespace geos {
@@ -99,10 +97,10 @@ LineIntersector::computeIntersection(const Coordinate& p1, const Coordinate& p2,
 }
 
 /*public*/
-string
+std::string
 LineIntersector::toString() const
 {
-    string str = inputLines[0][0]->toString() + "_"
+    std::string str = inputLines[0][0]->toString() + "_"
                  + inputLines[0][1]->toString() + " "
                  + inputLines[1][0]->toString() + "_"
                  + inputLines[1][1]->toString() + " : ";
@@ -140,7 +138,7 @@ LineIntersector::computeIntLineIndex()
 bool
 LineIntersector::isIntersection(const Coordinate& pt) const
 {
-    for(size_t i = 0; i < result; ++i) {
+    for(std::size_t i = 0; i < result; ++i) {
         if(intPt[i].equals2D(pt)) {
             return true;
         }
@@ -150,7 +148,7 @@ LineIntersector::isIntersection(const Coordinate& pt) const
 
 /*public*/
 const Coordinate&
-LineIntersector::getIntersectionAlongSegment(size_t segmentIndex, size_t intIndex)
+LineIntersector::getIntersectionAlongSegment(std::size_t segmentIndex, std::size_t intIndex)
 {
     // lazily compute int line array
     computeIntLineIndex();
@@ -159,7 +157,7 @@ LineIntersector::getIntersectionAlongSegment(size_t segmentIndex, size_t intInde
 
 /*public*/
 size_t
-LineIntersector::getIndexAlongSegment(size_t segmentIndex, size_t intIndex)
+LineIntersector::getIndexAlongSegment(std::size_t segmentIndex, std::size_t intIndex)
 {
     computeIntLineIndex();
     return intLineIndex[segmentIndex][intIndex];
@@ -167,7 +165,7 @@ LineIntersector::getIndexAlongSegment(size_t segmentIndex, size_t intIndex)
 
 /*private*/
 void
-LineIntersector::computeIntLineIndex(size_t segmentIndex)
+LineIntersector::computeIntLineIndex(std::size_t segmentIndex)
 {
     double dist0 = getEdgeDistance(segmentIndex, 0);
     double dist1 = getEdgeDistance(segmentIndex, 1);
@@ -183,7 +181,7 @@ LineIntersector::computeIntLineIndex(size_t segmentIndex)
 
 /*public*/
 double
-LineIntersector::getEdgeDistance(size_t segmentIndex, size_t intIndex) const
+LineIntersector::getEdgeDistance(std::size_t segmentIndex, std::size_t intIndex) const
 {
     double dist = computeEdgeDistance(intPt[intIndex],
                                       *inputLines[segmentIndex][0],
@@ -206,9 +204,9 @@ LineIntersector::isInteriorIntersection()
 
 /*public*/
 bool
-LineIntersector::isInteriorIntersection(size_t inputLineIndex)
+LineIntersector::isInteriorIntersection(std::size_t inputLineIndex)
 {
-    for(size_t i = 0; i < result; ++i) {
+    for(std::size_t i = 0; i < result; ++i) {
         if(!(intPt[i].equals2D(*inputLines[inputLineIndex][0])
                 || intPt[i].equals2D(*inputLines[inputLineIndex][1]))) {
             return true;
@@ -223,33 +221,33 @@ LineIntersector::interpolateZ(const Coordinate& p,
                               const Coordinate& p1, const Coordinate& p2)
 {
 #if GEOS_DEBUG
-    cerr << "LineIntersector::interpolateZ(" << p.toString() << ", " << p1.toString() << ", " << p2.toString() << ")" <<
-         endl;
+    std::cerr << "LineIntersector::interpolateZ(" << p.toString() << ", " << p1.toString() << ", " << p2.toString() << ")" <<
+         std::endl;
 #endif
 
     if(std::isnan(p1.z)) {
 #if GEOS_DEBUG
-        cerr << " p1 do not have a Z" << endl;
+        std::cerr << " p1 do not have a Z" << std::endl;
 #endif
         return p2.z; // might be DoubleNotANumber again
     }
 
     if(std::isnan(p2.z)) {
 #if GEOS_DEBUG
-        cerr << " p2 do not have a Z" << endl;
+        std::cerr << " p2 do not have a Z" << std::endl;
 #endif
         return p1.z; // might be DoubleNotANumber again
     }
 
     if(p == p1) {
 #if GEOS_DEBUG
-        cerr << " p==p1, returning " << p1.z << endl;
+        std::cerr << " p==p1, returning " << p1.z << std::endl;
 #endif
         return p1.z;
     }
     if(p == p2) {
 #if GEOS_DEBUG
-        cerr << " p==p2, returning " << p2.z << endl;
+        std::cerr << " p==p2, returning " << p2.z << std::endl;
 #endif
         return p2.z;
     }
@@ -258,7 +256,7 @@ LineIntersector::interpolateZ(const Coordinate& p,
     double zgap = p2.z - p1.z;
     if(zgap == 0.0) {
 #if GEOS_DEBUG
-        cerr << " no zgap, returning " << p2.z << endl;
+        std::cerr << " no zgap, returning " << p2.z << std::endl;
 #endif
         return p2.z;
     }
@@ -273,8 +271,8 @@ LineIntersector::interpolateZ(const Coordinate& p,
     //double interpolated = p1.z < p2.z ? p1.z+zoff : p1.z-zoff;
     double interpolated = p1.z + zoff;
 #if GEOS_DEBUG
-    cerr << " zgap:" << zgap << " seglen:" << seglen << " pdist:" << pdist
-         << " fract:" << fract << " z:" << interpolated << endl;
+    std::cerr << " zgap:" << zgap << " seglen:" << seglen << " pdist:" << pdist
+         << " fract:" << fract << " z:" << interpolated << std::endl;
 #endif
     return interpolated;
 
@@ -321,9 +319,9 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
                                   const Coordinate& q1, const Coordinate& q2)
 {
 #if GEOS_DEBUG
-    cerr << "LineIntersector::computeIntersect called" << endl;
-    cerr << " p1:" << p1.toString() << " p2:" << p2.toString() << " q1:" << q1.toString() << " q2:" << q2.toString() <<
-         endl;
+    std::cerr << "LineIntersector::computeIntersect called" << std::endl;
+    std::cerr << " p1:" << p1.toString() << " p2:" << p2.toString() << " q1:" << q1.toString() << " q2:" << q2.toString() <<
+         std::endl;
 #endif // GEOS_DEBUG
 
     isProperVar = false;
@@ -331,7 +329,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
     // first try a fast test to see if the envelopes of the lines intersect
     if(!Envelope::intersects(p1, p2, q1, q2)) {
 #if GEOS_DEBUG
-        cerr << " NO_INTERSECTION" << endl;
+        std::cerr << " NO_INTERSECTION" << std::endl;
 #endif
         return NO_INTERSECTION;
     }
@@ -344,7 +342,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
 
     if((Pq1 > 0 && Pq2 > 0) || (Pq1 < 0 && Pq2 < 0)) {
 #if GEOS_DEBUG
-        cerr << " NO_INTERSECTION" << endl;
+        std::cerr << " NO_INTERSECTION" << std::endl;
 #endif
         return NO_INTERSECTION;
     }
@@ -354,7 +352,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
 
     if((Qp1 > 0 && Qp2 > 0) || (Qp1 < 0 && Qp2 < 0)) {
 #if GEOS_DEBUG
-        cerr << " NO_INTERSECTION" << endl;
+        std::cerr << " NO_INTERSECTION" << std::endl;
 #endif
         return NO_INTERSECTION;
     }
@@ -365,7 +363,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
     bool collinear = Pq1 == 0 && Pq2 == 0 && Qp1 == 0 && Qp2 == 0;
     if(collinear) {
 #if GEOS_DEBUG
-        cerr << " computingCollinearIntersection" << endl;
+        std::cerr << " computingCollinearIntersection" << std::endl;
 #endif
         return computeCollinearIntersection(p1, p2, q1, q2);
     }
@@ -393,7 +391,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
         isProperVar = false;
 
 #if GEOS_DEBUG
-        cerr << " intersection is NOT proper" << endl;
+        std::cerr << " intersection is NOT proper" << std::endl;
 #endif
 
         /* Check for two equal endpoints.
@@ -451,21 +449,21 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
     }
     else {
 #if GEOS_DEBUG
-        cerr << " intersection is proper" << endl;
+        std::cerr << " intersection is proper" << std::endl;
 #endif // GEOS_DEBUG
         isProperVar = true;
         p = intersection(p1, p2, q1, q2);
 #if GEOS_DEBUG
-        cerr << " computed intersection point: " << p << endl;
+        std::cerr << " computed intersection point: " << p << std::endl;
 #endif // GEOS_DEBUG
         z = zInterpolate(p, p1, p2, q1, q2);
 #if GEOS_DEBUG
-        cerr << " computed proper intersection Z: " << z << endl;
+        std::cerr << " computed proper intersection Z: " << z << std::endl;
 #endif // GEOS_DEBUG
     }
     intPt[0] = Coordinate(p.x, p.y, z);
 #if GEOS_DEBUG
-    cerr << " POINT_INTERSECTION; intPt[0]:" << intPt[0].toString() << endl;
+    std::cerr << " POINT_INTERSECTION; intPt[0]:" << intPt[0].toString() << std::endl;
 #endif // GEOS_DEBUG
     return POINT_INTERSECTION;
 }
@@ -477,9 +475,9 @@ LineIntersector::computeCollinearIntersection(const Coordinate& p1, const Coordi
 {
 
 #if GEOS_DEBUG
-    cerr << "LineIntersector::computeCollinearIntersection called" << endl;
-    cerr << " p1:" << p1.toString() << " p2:" << p2.toString() << " q1:" << q1.toString() << " q2:" << q2.toString() <<
-         endl;
+    std::cerr << "LineIntersector::computeCollinearIntersection called" << std::endl;
+    std::cerr << " p1:" << p1.toString() << " p2:" << p2.toString() << " q1:" << q1.toString() << " q2:" << q2.toString() <<
+         std::endl;
 #endif // GEOS_DEBUG
 
     bool q1inP = Envelope::intersects(p1, p2, q1);
@@ -489,19 +487,19 @@ LineIntersector::computeCollinearIntersection(const Coordinate& p1, const Coordi
 
     if(q1inP && q2inP) {
 #if GEOS_DEBUG
-        cerr << " q1inP && q2inP" << endl;
+        std::cerr << " q1inP && q2inP" << std::endl;
 #endif
         intPt[0] = zGetOrInterpolateCopy(q1, p1, p2);
         intPt[1] = zGetOrInterpolateCopy(q2, p1, p2);
 #if GEOS_DEBUG
-        cerr << " intPt[0]: " << intPt[0].toString() << endl;
-        cerr << " intPt[1]: " << intPt[1].toString() << endl;
+        std::cerr << " intPt[0]: " << intPt[0].toString() << std::endl;
+        std::cerr << " intPt[1]: " << intPt[1].toString() << std::endl;
 #endif
         return COLLINEAR_INTERSECTION;
     }
     if(p1inQ && p2inQ) {
 #if GEOS_DEBUG
-        cerr << " p1inQ && p2inQ" << endl;
+        std::cerr << " p1inQ && p2inQ" << std::endl;
 #endif
         intPt[0] = zGetOrInterpolateCopy(p1, q1, q2);
         intPt[1] = zGetOrInterpolateCopy(p2, q1, q2);
@@ -509,55 +507,55 @@ LineIntersector::computeCollinearIntersection(const Coordinate& p1, const Coordi
     }
     if(q1inP && p1inQ) {
 #if GEOS_DEBUG
-        cerr << " q1inP && p1inQ" << endl;
+        std::cerr << " q1inP && p1inQ" << std::endl;
 #endif
         // if pts are equal Z is chosen arbitrarily
         intPt[0] = zGetOrInterpolateCopy(q1, p1, p2);
         intPt[1] = zGetOrInterpolateCopy(p1, q1, q2);
 
 #if GEOS_DEBUG
-        cerr << " intPt[0]: " << intPt[0].toString() << endl;
-        cerr << " intPt[1]: " << intPt[1].toString() << endl;
+        std::cerr << " intPt[0]: " << intPt[0].toString() << std::endl;
+        std::cerr << " intPt[1]: " << intPt[1].toString() << std::endl;
 #endif
         return (q1 == p1) && !q2inP && !p2inQ ? POINT_INTERSECTION : COLLINEAR_INTERSECTION;
     }
     if(q1inP && p2inQ) {
 #if GEOS_DEBUG
-        cerr << " q1inP && p2inQ" << endl;
+        std::cerr << " q1inP && p2inQ" << std::endl;
 #endif
         // if pts are equal Z is chosen arbitrarily
         intPt[0] = zGetOrInterpolateCopy(q1, p1, p2);
         intPt[1] = zGetOrInterpolateCopy(p2, q1, q2);
 
 #if GEOS_DEBUG
-        cerr << " intPt[0]: " << intPt[0].toString() << endl;
-        cerr << " intPt[1]: " << intPt[1].toString() << endl;
+        std::cerr << " intPt[0]: " << intPt[0].toString() << std::endl;
+        std::cerr << " intPt[1]: " << intPt[1].toString() << std::endl;
 #endif
         return (q1 == p2) && !q2inP && !p1inQ ? POINT_INTERSECTION : COLLINEAR_INTERSECTION;
     }
     if(q2inP && p1inQ) {
 #if GEOS_DEBUG
-        cerr << " q2inP && p1inQ" << endl;
+        std::cerr << " q2inP && p1inQ" << std::endl;
 #endif
         // if pts are equal Z is chosen arbitrarily
         intPt[0] = zGetOrInterpolateCopy(q2, p1, p2);
         intPt[1] = zGetOrInterpolateCopy(p1, q1, q2);
 #if GEOS_DEBUG
-        cerr << " intPt[0]: " << intPt[0].toString() << endl;
-        cerr << " intPt[1]: " << intPt[1].toString() << endl;
+        std::cerr << " intPt[0]: " << intPt[0].toString() << std::endl;
+        std::cerr << " intPt[1]: " << intPt[1].toString() << std::endl;
 #endif
         return (q2 == p1) && !q1inP && !p2inQ ? POINT_INTERSECTION : COLLINEAR_INTERSECTION;
     }
     if(q2inP && p2inQ) {
 #if GEOS_DEBUG
-        cerr << " q2inP && p2inQ" << endl;
+        std::cerr << " q2inP && p2inQ" << std::endl;
 #endif
         // if pts are equal Z is chosen arbitrarily
         intPt[0] = zGetOrInterpolateCopy(q2, p1, p2);
         intPt[1] = zGetOrInterpolateCopy(p2, q1, q2);
 #if GEOS_DEBUG
-        cerr << " intPt[0]: " << intPt[0].toString() << endl;
-        cerr << " intPt[1]: " << intPt[1].toString() << endl;
+        std::cerr << " intPt[0]: " << intPt[0].toString() << std::endl;
+        std::cerr << " intPt[1]: " << intPt[1].toString() << std::endl;
 #endif
         return (q2 == p2) && !q1inP && !p1inQ ? POINT_INTERSECTION : COLLINEAR_INTERSECTION;
     }
@@ -591,8 +589,8 @@ LineIntersector::intersection(const Coordinate& p1, const Coordinate& p2,
         //intPt = CentralEndpointIntersector::getIntersection(p1, p2, q1, q2);
         intPtOut = nearestEndpoint(p1, p2, q1, q2);
 #if GEOS_DEBUG
-        cerr << "Intersection outside segment envelopes, snapped to "
-             << intPtOut.toString() << endl;
+        std::cerr << "Intersection outside segment envelopes, snapped to "
+             << intPtOut.toString() << std::endl;
 #endif
     }
 
@@ -640,7 +638,7 @@ double
 LineIntersector::zInterpolate(const Coordinate& p, const Coordinate& p1, const Coordinate& p2)
 {
 #if GEOS_DEBUG
-    cerr << " zInterpolate " << p << ", " << p1 << ", " << p2 << std::endl;
+    std::cerr << " zInterpolate " << p << ", " << p1 << ", " << p2 << std::endl;
 #endif
     double p1z = p1.z;
     double p2z = p2.z;
@@ -661,7 +659,7 @@ LineIntersector::zInterpolate(const Coordinate& p, const Coordinate& p1, const C
       return p1z;
     }
 #if GEOS_DEBUG
-    cerr << " Interpolating Z from distance of p along p1-p2" << endl;
+    std::cerr << " Interpolating Z from distance of p along p1-p2" << std::endl;
 #endif
     // interpolate Z from distance of p along p1-p2
     double dx = (p2.x - p1.x);
@@ -675,7 +673,7 @@ LineIntersector::zInterpolate(const Coordinate& p, const Coordinate& p1, const C
     double zoff = dz * frac;
     double zInterpolated = p1z + zoff;
 #if GEOS_DEBUG
-    cerr << " interpolated Z: " << zInterpolated << std::endl;
+    std::cerr << " interpolated Z: " << zInterpolated << std::endl;
 #endif
     return zInterpolated;
 }
@@ -712,15 +710,15 @@ LineIntersector::zInterpolate(const Coordinate& p,
                               const Coordinate& q2)
 {
 #if GEOS_DEBUG
-    cerr << " zInterpolate(5 coords) called" << endl;
+    std::cerr << " zInterpolate(5 coords) called" << std::endl;
 #endif // GEOS_DEBUG
     double zp = zInterpolate(p, p1, p2);
 #if GEOS_DEBUG
-    cerr << " zp: " << zp << endl;
+    std::cerr << " zp: " << zp << std::endl;
 #endif // GEOS_DEBUG
     double zq = zInterpolate(p, q1, q2);
 #if GEOS_DEBUG
-    cerr << " zq: " << zq << endl;
+    std::cerr << " zq: " << zq << std::endl;
 #endif // GEOS_DEBUG
     if (std::isnan(zp)) {
       return zq; // may be NaN
@@ -729,7 +727,7 @@ LineIntersector::zInterpolate(const Coordinate& p,
       return zp; // may be NaN
     }
 #if GEOS_DEBUG
-    cerr << " averaging Z" << endl;
+    std::cerr << " averaging Z" << std::endl;
 #endif // GEOS_DEBUG
     // both Zs have values, so average them
     return (zp + zq) / 2.0;
diff --git a/src/algorithm/MinimumBoundingCircle.cpp b/src/algorithm/MinimumBoundingCircle.cpp
index 2cd1538..67f31cb 100644
--- a/src/algorithm/MinimumBoundingCircle.cpp
+++ b/src/algorithm/MinimumBoundingCircle.cpp
@@ -65,7 +65,7 @@ MinimumBoundingCircle::getMaximumDiameter()
 {
     compute();
     uint8_t dims = input->getCoordinateDimension();
-    size_t len = 2;
+    std::size_t len = 2;
     switch(extremalPts.size()) {
         case 0:
             return input->getFactory()->createLineString();
@@ -123,7 +123,7 @@ MinimumBoundingCircle::getDiameter()
         return std::unique_ptr<Geometry>(input->getFactory()->createPoint(centre));
     }
     uint8_t dims = input->getCoordinateDimension();
-    size_t len = 2;
+    std::size_t len = 2;
     auto cs = input->getFactory()->getCoordinateSequenceFactory()->create(len, dims);
     // TODO: handle case of 3 extremal points, by computing a line from one of
     // them through the centre point with len = 2*radius
@@ -251,7 +251,7 @@ MinimumBoundingCircle::computeCirclePoints()
      * at most <tt>pts.length</tt> iterations are required to terminate
      * with a correct result.
      */
-    size_t i = 0, n = pts.size();
+    std::size_t i = 0, n = pts.size();
     while(i++ < n) {
         Coordinate R = pointWithMinAngleWithSegment(pts, P, Q);
 
diff --git a/src/algorithm/Orientation.cpp b/src/algorithm/Orientation.cpp
index 383f36a..4d5eb9e 100644
--- a/src/algorithm/Orientation.cpp
+++ b/src/algorithm/Orientation.cpp
@@ -150,7 +150,7 @@ Orientation::isCCW(const geom::CoordinateSequence* ring)
 
     // find highest point
     const geom::Coordinate* hiPt = &ring->getAt(0);
-    size_t hiIndex = 0;
+    std::size_t hiIndex = 0;
     for(std::size_t i = 1; i <= nPts; ++i) {
         const geom::Coordinate* p = &ring->getAt(i);
         if(p->y > hiPt->y) {
diff --git a/src/algorithm/PointLocation.cpp b/src/algorithm/PointLocation.cpp
index ca38f95..f9ab6d7 100644
--- a/src/algorithm/PointLocation.cpp
+++ b/src/algorithm/PointLocation.cpp
@@ -34,13 +34,13 @@ namespace algorithm { // geos.algorithm
 bool
 PointLocation::isOnLine(const geom::Coordinate& p, const geom::CoordinateSequence* pt)
 {
-    size_t ptsize = pt->getSize();
+    std::size_t ptsize = pt->getSize();
     if(ptsize == 0) {
         return false;
     }
 
     const geom::Coordinate* pp = &(pt->getAt(0));
-    for(size_t i = 1; i < ptsize; ++i) {
+    for(std::size_t i = 1; i < ptsize; ++i) {
         const geom::Coordinate& p1 = pt->getAt(i);
         if(LineIntersector::hasIntersection(p, *pp, p1)) {
             return true;
diff --git a/src/algorithm/PointLocator.cpp b/src/algorithm/PointLocator.cpp
index 6ba90e5..00a9a3b 100644
--- a/src/algorithm/PointLocator.cpp
+++ b/src/algorithm/PointLocator.cpp
@@ -185,7 +185,7 @@ PointLocator::locate(const Coordinate& p, const Polygon* poly)
     }
 
     // now test if the point lies in or on the holes
-    for(size_t i = 0, n = poly->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = poly->getNumInteriorRing(); i < n; ++i) {
         const LinearRing* hole = poly->getInteriorRingN(i);
         Location holeLoc = locateInPolygonRing(p, hole);
         if(holeLoc == Location::INTERIOR) {
diff --git a/src/algorithm/RobustDeterminant.cpp b/src/algorithm/RobustDeterminant.cpp
index c2676cf..313b749 100644
--- a/src/algorithm/RobustDeterminant.cpp
+++ b/src/algorithm/RobustDeterminant.cpp
@@ -43,8 +43,6 @@
 #pragma warning(disable : 4127)
 #endif
 
-using namespace std; // for isfinite..
-
 namespace geos {
 namespace algorithm { // geos.algorithm
 
diff --git a/src/algorithm/distance/DiscreteFrechetDistance.cpp b/src/algorithm/distance/DiscreteFrechetDistance.cpp
index b41225f..53facaf 100644
--- a/src/algorithm/distance/DiscreteFrechetDistance.cpp
+++ b/src/algorithm/distance/DiscreteFrechetDistance.cpp
@@ -56,12 +56,12 @@ DiscreteFrechetDistance::distance(const geom::Geometry& g0,
 /* private */
 
 geom::Coordinate
-DiscreteFrechetDistance::getSegementAt(const CoordinateSequence& seq, size_t index)
+DiscreteFrechetDistance::getSegementAt(const CoordinateSequence& seq, std::size_t index)
 {
     if(densifyFrac > 0.0) {
-        size_t numSubSegs =  std::size_t(util::round(1.0 / densifyFrac));
-        size_t i = index / numSubSegs;
-        size_t j = index % numSubSegs;
+        std::size_t numSubSegs =  std::size_t(util::round(1.0 / densifyFrac));
+        std::size_t i = index / numSubSegs;
+        std::size_t j = index % numSubSegs;
         if(i >= seq.size() - 1) {
             return seq.getAt(seq.size() - 1);
         }
@@ -82,7 +82,7 @@ DiscreteFrechetDistance::getSegementAt(const CoordinateSequence& seq, size_t ind
 }
 
 PointPairDistance&
-DiscreteFrechetDistance::getFrecheDistance(std::vector< std::vector<PointPairDistance> >& ca, size_t i, size_t j,
+DiscreteFrechetDistance::getFrecheDistance(std::vector< std::vector<PointPairDistance> >& ca, std::size_t i, std::size_t j,
         const CoordinateSequence& p, const CoordinateSequence& q)
 {
     PointPairDistance p_ptDist;
@@ -122,9 +122,9 @@ DiscreteFrechetDistance::compute(
 {
     auto lp = discreteGeom.getCoordinates();
     auto lq = geom.getCoordinates();
-    size_t pSize, qSize;
+    std::size_t pSize, qSize;
     if(densifyFrac > 0) {
-        size_t numSubSegs =  std::size_t(util::round(1.0 / densifyFrac));
+        std::size_t numSubSegs =  std::size_t(util::round(1.0 / densifyFrac));
         pSize = numSubSegs * (lp->size() - 1) + 1;
         qSize = numSubSegs * (lq->size() - 1) + 1;
     }
@@ -133,8 +133,8 @@ DiscreteFrechetDistance::compute(
         qSize = lq->size();
     }
     std::vector< std::vector<PointPairDistance> > ca(pSize, std::vector<PointPairDistance>(qSize));
-    for(size_t i = 0; i < pSize; i++) {
-        for(size_t j = 0; j < qSize; j++) {
+    for(std::size_t i = 0; i < pSize; i++) {
+        for(std::size_t j = 0; j < qSize; j++) {
             ca[i][j].initialize();
         }
     }
diff --git a/src/algorithm/distance/DiscreteHausdorffDistance.cpp b/src/algorithm/distance/DiscreteHausdorffDistance.cpp
index 9b3fb9d..17a56a3 100644
--- a/src/algorithm/distance/DiscreteHausdorffDistance.cpp
+++ b/src/algorithm/distance/DiscreteHausdorffDistance.cpp
@@ -30,7 +30,7 @@ namespace distance { // geos.algorithm.distance
 
 void
 DiscreteHausdorffDistance::MaxDensifiedByFractionDistanceFilter::filter_ro(
-    const geom::CoordinateSequence& seq, size_t index)
+    const geom::CoordinateSequence& seq, std::size_t index)
 {
     /*
      * This logic also handles skipping Point geometries
@@ -45,7 +45,7 @@ DiscreteHausdorffDistance::MaxDensifiedByFractionDistanceFilter::filter_ro(
     double delx = (p1.x - p0.x) / static_cast<double>(numSubSegs);
     double dely = (p1.y - p0.y) / static_cast<double>(numSubSegs);
 
-    for(size_t i = 0; i < numSubSegs; ++i) {
+    for(std::size_t i = 0; i < numSubSegs; ++i) {
         double x = p0.x + static_cast<double>(i) * delx;
         double y = p0.y + static_cast<double>(i) * dely;
         Coordinate pt(x, y);
diff --git a/src/algorithm/distance/DistanceToPoint.cpp b/src/algorithm/distance/DistanceToPoint.cpp
index 706d7df..7ebafcf 100644
--- a/src/algorithm/distance/DistanceToPoint.cpp
+++ b/src/algorithm/distance/DistanceToPoint.cpp
@@ -47,7 +47,7 @@ DistanceToPoint::computeDistance(const geom::Geometry& geom,
         computeDistance(*pl, pt, ptDist);
     }
     else if(const GeometryCollection* gc = dynamic_cast<const GeometryCollection*>(&geom)) {
-        for(size_t i = 0; i < gc->getNumGeometries(); i++) {
+        for(std::size_t i = 0; i < gc->getNumGeometries(); i++) {
             const Geometry* g = gc->getGeometryN(i);
             computeDistance(*g, pt, ptDist);
         }
@@ -67,7 +67,7 @@ DistanceToPoint::computeDistance(const geom::LineString& line,
     const CoordinateSequence* coordsRO = line.getCoordinatesRO();
     const CoordinateSequence& coords = *coordsRO;
 
-    size_t npts = coords.size();
+    std::size_t npts = coords.size();
     if(! npts) {
         return;    // can this ever be ?
     }
@@ -77,7 +77,7 @@ DistanceToPoint::computeDistance(const geom::LineString& line,
 
     Coordinate* segPts[2] = { &(tempSegment.p0), &(tempSegment.p1) };
     tempSegment.p0 = coords.getAt(0);
-    for(size_t i = 1; i < npts; ++i) {
+    for(std::size_t i = 1; i < npts; ++i) {
         *(segPts[i % 2]) = coords.getAt(i);
 
         // this is somewhat inefficient - could do better
@@ -104,7 +104,7 @@ DistanceToPoint::computeDistance(const geom::Polygon& poly,
                                  PointPairDistance& ptDist)
 {
     computeDistance(*(poly.getExteriorRing()), pt, ptDist);
-    for(size_t i = 0, n = poly.getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = poly.getNumInteriorRing(); i < n; ++i) {
         computeDistance(*(poly.getInteriorRingN(i)), pt, ptDist);
     }
 }
diff --git a/src/algorithm/locate/IndexedPointInAreaLocator.cpp b/src/algorithm/locate/IndexedPointInAreaLocator.cpp
index c9e6c08..6e860e3 100644
--- a/src/algorithm/locate/IndexedPointInAreaLocator.cpp
+++ b/src/algorithm/locate/IndexedPointInAreaLocator.cpp
@@ -53,7 +53,7 @@ IndexedPointInAreaLocator::IntervalIndexedGeometry::init(const geom::Geometry& g
     geom::util::LinearComponentExtracter::getLines(g, lines);
 
     // pre-compute size of segment vector
-    size_t nsegs = 0;
+    std::size_t nsegs = 0;
     for(const geom::LineString* line : lines) {
         nsegs += line->getCoordinatesRO()->size() - 1;
     }
@@ -76,7 +76,7 @@ IndexedPointInAreaLocator::IntervalIndexedGeometry::init(const geom::Geometry& g
 void
 IndexedPointInAreaLocator::IntervalIndexedGeometry::addLine(const geom::CoordinateSequence* pts)
 {
-    for(size_t i = 1, ni = pts->size(); i < ni; i++) {
+    for(std::size_t i = 1, ni = pts->size(); i < ni; i++) {
         segments.emplace_back((*pts)[i - 1], (*pts)[i]);
     }
 }
diff --git a/src/algorithm/locate/SimplePointInAreaLocator.cpp b/src/algorithm/locate/SimplePointInAreaLocator.cpp
index df3a39e..ddd1f3f 100644
--- a/src/algorithm/locate/SimplePointInAreaLocator.cpp
+++ b/src/algorithm/locate/SimplePointInAreaLocator.cpp
@@ -73,7 +73,7 @@ SimplePointInAreaLocator::locateInGeometry(const Coordinate& p, const Geometry*
         }
         // Else it is a collection with a single element. Will be handled below.
     }
-    for (size_t i = 0; i < geom->getNumGeometries(); i++) {
+    for (std::size_t i = 0; i < geom->getNumGeometries(); i++) {
         const Geometry* gi = geom->getGeometryN(i);
         auto loc = locateInGeometry(p, gi);
         if(loc != Location::EXTERIOR) {
@@ -102,7 +102,7 @@ SimplePointInAreaLocator::locatePointInPolygon(const Coordinate& p, const Polygo
     }
 
     // now test if the point lies in or on the holes
-    for(size_t i = 0, n = poly->getNumInteriorRing(); i < n; i++) {
+    for(std::size_t i = 0, n = poly->getNumInteriorRing(); i < n; i++) {
         const LineString* hole = poly->getInteriorRingN(i);
         if(hole->getEnvelopeInternal()->contains(p)) {
             cl = hole->getCoordinatesRO();
diff --git a/src/geom/Coordinate.cpp b/src/geom/Coordinate.cpp
index 3ce798b..c089444 100644
--- a/src/geom/Coordinate.cpp
+++ b/src/geom/Coordinate.cpp
@@ -24,8 +24,6 @@
 # include <geos/geom/Coordinate.inl>
 #endif
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -37,10 +35,10 @@ Coordinate::getNull()
     return _nullCoord;
 }
 
-string
+std::string
 Coordinate::toString() const
 {
-    ostringstream s;
+    std::ostringstream s;
     s << std::setprecision(17) << *this;
     return s.str();
 }
diff --git a/src/geom/CoordinateArraySequence.cpp b/src/geom/CoordinateArraySequence.cpp
index 22a5fe1..429382d 100644
--- a/src/geom/CoordinateArraySequence.cpp
+++ b/src/geom/CoordinateArraySequence.cpp
@@ -33,21 +33,21 @@ CoordinateArraySequence::CoordinateArraySequence():
 {
 }
 
-CoordinateArraySequence::CoordinateArraySequence(size_t n,
-        size_t dimension_in):
+CoordinateArraySequence::CoordinateArraySequence(std::size_t n,
+        std::size_t dimension_in):
     vect(n),
     dimension(dimension_in)
 {
 }
 
-CoordinateArraySequence::CoordinateArraySequence(std::vector<Coordinate> && coords, size_t dimension_in):
+CoordinateArraySequence::CoordinateArraySequence(std::vector<Coordinate> && coords, std::size_t dimension_in):
         vect(std::move(coords)),
         dimension(dimension_in)
 {
 }
 
 CoordinateArraySequence::CoordinateArraySequence(
-    std::vector<Coordinate>* coords, size_t dimension_in)
+    std::vector<Coordinate>* coords, std::size_t dimension_in)
     : dimension(dimension_in)
 {
     std::unique_ptr<std::vector<Coordinate>> coordp(coords);
@@ -73,7 +73,7 @@ CoordinateArraySequence::CoordinateArraySequence(
     vect(c.size()),
     dimension(c.getDimension())
 {
-    for(size_t i = 0, n = vect.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = vect.size(); i < n; ++i) {
         vect[i] = c.getAt(i);
     }
 }
@@ -142,7 +142,7 @@ CoordinateArraySequence::add(const CoordinateSequence* cl, bool allowRepeated, b
 
     const auto npts = cl->size();
     if(direction) {
-        for(size_t i = 0; i < npts; ++i) {
+        for(std::size_t i = 0; i < npts; ++i) {
             add(cl->getAt(i), allowRepeated);
         }
     }
@@ -155,12 +155,12 @@ CoordinateArraySequence::add(const CoordinateSequence* cl, bool allowRepeated, b
 
 /*public*/
 void
-CoordinateArraySequence::add(size_t i, const Coordinate& coord,
+CoordinateArraySequence::add(std::size_t i, const Coordinate& coord,
                              bool allowRepeated)
 {
     // don't add duplicate coordinates
     if(! allowRepeated) {
-        size_t sz = size();
+        std::size_t sz = size();
         if(sz > 0) {
             if(i > 0) {
                 const Coordinate& prev = getAt(i - 1);
@@ -187,19 +187,19 @@ CoordinateArraySequence::getSize() const
 }
 
 const Coordinate&
-CoordinateArraySequence::getAt(size_t pos) const
+CoordinateArraySequence::getAt(std::size_t pos) const
 {
     return vect[pos];
 }
 
 void
-CoordinateArraySequence::getAt(size_t pos, Coordinate& c) const
+CoordinateArraySequence::getAt(std::size_t pos, Coordinate& c) const
 {
     c = vect[pos];
 }
 
 void
-CoordinateArraySequence::setAt(const Coordinate& c, size_t pos)
+CoordinateArraySequence::setAt(const Coordinate& c, std::size_t pos)
 {
     vect[pos] = c;
 }
@@ -213,7 +213,7 @@ CoordinateArraySequence::expandEnvelope(Envelope& env) const
 }
 
 void
-CoordinateArraySequence::setOrdinate(size_t index, size_t ordinateIndex,
+CoordinateArraySequence::setOrdinate(std::size_t index, std::size_t ordinateIndex,
                                      double value)
 {
     switch(ordinateIndex) {
diff --git a/src/geom/CoordinateSequence.cpp b/src/geom/CoordinateSequence.cpp
index addafec..a37d7ba 100644
--- a/src/geom/CoordinateSequence.cpp
+++ b/src/geom/CoordinateSequence.cpp
@@ -28,8 +28,6 @@
 #include <iterator>
 #include <sstream>
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -38,7 +36,7 @@ static Profiler* profiler = Profiler::instance();
 #endif
 
 double
-CoordinateSequence::getOrdinate(size_t index, size_t ordinateIndex) const
+CoordinateSequence::getOrdinate(std::size_t index, std::size_t ordinateIndex) const
 {
     switch(ordinateIndex) {
         case CoordinateSequence::X:
@@ -69,7 +67,7 @@ CoordinateSequence::hasRepeatedPoints() const
  * given amount, or an empty coordinate array.
  */
 CoordinateSequence*
-CoordinateSequence::atLeastNCoordinatesOrNothing(size_t n,
+CoordinateSequence::atLeastNCoordinatesOrNothing(std::size_t n,
         CoordinateSequence* c)
 {
     if(c->getSize() >= n) {
@@ -111,8 +109,8 @@ size_t
 CoordinateSequence::indexOf(const Coordinate* coordinate,
                             const CoordinateSequence* cl)
 {
-    size_t p_size = cl->size();
-    for(size_t i = 0; i < p_size; ++i) {
+    std::size_t p_size = cl->size();
+    for(std::size_t i = 0; i < p_size; ++i) {
         if((*coordinate) == cl->getAt(i)) {
             return i;
         }
@@ -132,7 +130,7 @@ CoordinateSequence::scroll(CoordinateSequence* cl,
     }
 
     const std::size_t length = cl->getSize();
-    vector<Coordinate> v(length);
+    std::vector<Coordinate> v(length);
     for(i = ind; i < length; i++) {
         v[j++] = cl->getAt(i);
     }
@@ -145,9 +143,9 @@ CoordinateSequence::scroll(CoordinateSequence* cl,
 int
 CoordinateSequence::increasingDirection(const CoordinateSequence& pts)
 {
-    size_t ptsize = pts.size();
-    for(size_t i = 0, n = ptsize / 2; i < n; ++i) {
-        size_t j = ptsize - 1 - i;
+    std::size_t ptsize = pts.size();
+    for(std::size_t i = 0, n = ptsize / 2; i < n; ++i) {
+        std::size_t j = ptsize - 1 - i;
         // skip equal points on both ends
         int comp = pts[i].compareTo(pts[j]);
         if(comp != 0) {
@@ -177,7 +175,7 @@ CoordinateSequence::reverse(CoordinateSequence* cl)
     // FIXME: use a standard algorithm
     auto last = cl->size() - 1;
     auto mid = last / 2;
-    for(size_t i = 0; i <= mid; i++) {
+    for(std::size_t i = 0; i <= mid; i++) {
         const Coordinate tmp = cl->getAt(i);
         cl->setAt(cl->getAt(last - i), i);
         cl->setAt(tmp, last - i);
@@ -196,11 +194,11 @@ CoordinateSequence::equals(const CoordinateSequence* cl1,
     if(cl1 == nullptr || cl2 == nullptr) {
         return false;
     }
-    size_t npts1 = cl1->getSize();
+    std::size_t npts1 = cl1->getSize();
     if(npts1 != cl2->getSize()) {
         return false;
     }
-    for(size_t i = 0; i < npts1; i++) {
+    for(std::size_t i = 0; i < npts1; i++) {
         if(!(cl1->getAt(i) == cl2->getAt(i))) {
             return false;
         }
@@ -228,7 +226,7 @@ std::ostream&
 operator<< (std::ostream& os, const CoordinateSequence& cs)
 {
     os << "(";
-    for(size_t i = 0, n = cs.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = cs.size(); i < n; ++i) {
         const Coordinate& c = cs[i];
         if(i) {
             os << ", ";
diff --git a/src/geom/Dimension.cpp b/src/geom/Dimension.cpp
index d4e7ccd..7f31064 100644
--- a/src/geom/Dimension.cpp
+++ b/src/geom/Dimension.cpp
@@ -17,8 +17,6 @@
 
 #include <sstream>
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -47,8 +45,8 @@ Dimension::toDimensionSymbol(int dimensionValue)
     case A:
         return '2';
     default:
-        ostringstream s;
-        s << "Unknown dimension value: " << dimensionValue << endl;
+        std::ostringstream s;
+        s << "Unknown dimension value: " << dimensionValue << std::endl;
         throw  util::IllegalArgumentException(s.str());
     }
 }
@@ -80,8 +78,8 @@ Dimension::toDimensionValue(char dimensionSymbol)
     case '2':
         return A;
     default:
-        ostringstream s;
-        s << "Unknown dimension symbol: " << dimensionSymbol << endl;
+        std::ostringstream s;
+        s << "Unknown dimension symbol: " << dimensionSymbol << std::endl;
         throw  util::IllegalArgumentException(s.str());
     }
 }
diff --git a/src/geom/Envelope.cpp b/src/geom/Envelope.cpp
index cdddcdd..f5cd212 100644
--- a/src/geom/Envelope.cpp
+++ b/src/geom/Envelope.cpp
@@ -36,8 +36,6 @@
 #include <iostream>
 #endif
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -60,20 +58,20 @@ bool
 Envelope::intersects(const Coordinate& p1, const Coordinate& p2,
                      const Coordinate& q1, const Coordinate& q2)
 {
-    double minq = min(q1.x, q2.x);
-    double maxq = max(q1.x, q2.x);
-    double minp = min(p1.x, p2.x);
-    double maxp = max(p1.x, p2.x);
+    double minq = std::min(q1.x, q2.x);
+    double maxq = std::max(q1.x, q2.x);
+    double minp = std::min(p1.x, p2.x);
+    double maxp = std::max(p1.x, p2.x);
     if(minp > maxq) {
         return false;
     }
     if(maxp < minq) {
         return false;
     }
-    minq = min(q1.y, q2.y);
-    maxq = max(q1.y, q2.y);
-    minp = min(p1.y, p2.y);
-    maxp = max(p1.y, p2.y);
+    minq = std::min(q1.y, q2.y);
+    maxq = std::max(q1.y, q2.y);
+    minp = std::min(p1.y, p2.y);
+    maxp = std::max(p1.y, p2.y);
     if(minp > maxq) {
         return false;
     }
@@ -112,17 +110,17 @@ Envelope::intersects(const Coordinate& a, const Coordinate& b) const
 }
 
 /*public*/
-Envelope::Envelope(const string& str)
+Envelope::Envelope(const std::string& str)
 {
     // The string should be in the format:
     // Env[7.2:2.3,7.1:8.2]
 
     // extract out the values between the [ and ] characters
-    string::size_type index = str.find("[");
-    string coordString = str.substr(index + 1, str.size() - 1 - 1);
+    std::string::size_type index = str.find("[");
+    std::string coordString = str.substr(index + 1, str.size() - 1 - 1);
 
     // now split apart the string on : and , characters
-    vector<string> values = split(coordString, ":,");
+    std::vector<std::string> values = split(coordString, ":,");
 
     // create a new envelopet
     init(strtod(values[0].c_str(), nullptr),
@@ -232,10 +230,10 @@ operator<< (std::ostream& os, const Envelope& o)
 
 
 /*public*/
-string
+std::string
 Envelope::toString() const
 {
-    ostringstream s;
+    std::ostringstream s;
     s << *this;
     return s.str();
 }
@@ -263,7 +261,7 @@ Envelope::hashCode() const
     auto hash = std::hash<double>{};
 
     //Algorithm from Effective Java by Joshua Bloch [Jon Aquino]
-    size_t result = 17;
+    std::size_t result = 17;
     result = 37 * result + hash(minx);
     result = 37 * result + hash(maxx);
     result = 37 * result + hash(miny);
@@ -272,16 +270,16 @@ Envelope::hashCode() const
 }
 
 /*public static*/
-vector<string>
-Envelope::split(const string& str, const string& delimiters)
+std::vector<std::string>
+Envelope::split(const std::string& str, const std::string& delimiters)
 {
-    vector<string> tokens;
+    std::vector<std::string> tokens;
 
     // Find first "non-delimiter".
-    string::size_type lastPos = 0;
-    string::size_type pos = str.find_first_of(delimiters, lastPos);
+    std::string::size_type lastPos = 0;
+    std::string::size_type pos = str.find_first_of(delimiters, lastPos);
 
-    while(string::npos != pos || string::npos != lastPos) {
+    while(std::string::npos != pos || std::string::npos != lastPos) {
         // Found a token, add it to the vector.
         tokens.push_back(str.substr(lastPos, pos - lastPos));
 
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index 3a1ba55..a90ec49 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -72,7 +72,6 @@
 #define SHORTCIRCUIT_PREDICATES 1
 //#define USE_RECTANGLE_INTERSECTION 1
 
-using namespace std;
 using namespace geos::algorithm;
 using namespace geos::operation::valid;
 using namespace geos::operation::relate;
@@ -89,7 +88,7 @@ namespace geom { // geos::geom
 /*
  * Return current GEOS version
  */
-string
+std::string
 geosversion()
 {
     return GEOS_VERSION;
@@ -99,7 +98,7 @@ geosversion()
  * Return the version of JTS this GEOS
  * release has been ported from.
  */
-string
+std::string
 jtsport()
 {
     return GEOS_JTS_PORT;
@@ -139,8 +138,8 @@ Geometry::Geometry(const Geometry& geom)
 bool
 Geometry::hasNullElements(const CoordinateSequence* list)
 {
-    size_t npts = list->getSize();
-    for(size_t i = 0; i < npts; ++i) {
+    std::size_t npts = list->getSize();
+    for(std::size_t i = 0; i < npts; ++i) {
         if(list->getAt(i).isNull()) {
             return true;
         }
@@ -275,7 +274,7 @@ Geometry::disjoint(const Geometry* g) const
         return true;
     }
 #endif
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isDisjoint();
     return res;
 }
@@ -289,7 +288,7 @@ Geometry::touches(const Geometry* g) const
         return false;
     }
 #endif
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isTouches(getDimension(), g->getDimension());
     return res;
 }
@@ -330,7 +329,7 @@ Geometry::intersects(const Geometry* g) const
         return predicate::RectangleIntersects::intersects(*p, *this);
     }
 
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isIntersects();
     return res;
 }
@@ -364,7 +363,7 @@ Geometry::covers(const Geometry* g) const
         return true;
     }
 
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     return im->isCovers();
 }
 
@@ -378,7 +377,7 @@ Geometry::crosses(const Geometry* g) const
         return false;
     }
 #endif
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isCrosses(getDimension(), g->getDimension());
     return res;
 }
@@ -421,7 +420,7 @@ Geometry::contains(const Geometry* g) const
     //	return predicate::RectangleContains::contains((const Polygon&)*g, *this);
     //}
 
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isContains();
     return res;
 }
@@ -435,15 +434,15 @@ Geometry::overlaps(const Geometry* g) const
         return false;
     }
 #endif
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isOverlaps(getDimension(), g->getDimension());
     return res;
 }
 
 bool
-Geometry::relate(const Geometry* g, const string& intersectionPattern) const
+Geometry::relate(const Geometry* g, const std::string& intersectionPattern) const
 {
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->matches(intersectionPattern);
     return res;
 }
@@ -465,7 +464,7 @@ Geometry::equals(const Geometry* g) const
         return isEmpty();
     }
 
-    unique_ptr<IntersectionMatrix> im(relate(g));
+    std::unique_ptr<IntersectionMatrix> im(relate(g));
     bool res = im->isEquals(getDimension(), g->getDimension());
     return res;
 }
@@ -476,7 +475,7 @@ Geometry::relate(const Geometry* other) const
     return RelateOp::relate(this, other);
 }
 
-string
+std::string
 Geometry::toString() const
 {
     return toText();
@@ -490,7 +489,7 @@ operator<< (std::ostream& os, const Geometry& geom)
     return os;
 }
 
-string
+std::string
 Geometry::toText() const
 {
     io::WKTWriter writer;
@@ -574,16 +573,16 @@ Geometry::Union(const Geometry* other) const
 //cerr<<"SHORTCIRCUITED-UNION engaged"<<endl;
         const GeometryCollection* coll;
 
-        size_t ngeomsThis = getNumGeometries();
-        size_t ngeomsOther = other->getNumGeometries();
+        std::size_t ngeomsThis = getNumGeometries();
+        std::size_t ngeomsOther = other->getNumGeometries();
 
         // Allocated for ownership transfer
-        vector<Geometry*>* v = new vector<Geometry*>();
+        std::vector<Geometry*>* v = new std::vector<Geometry*>();
         v->reserve(ngeomsThis + ngeomsOther);
 
 
         if(nullptr != (coll = dynamic_cast<const GeometryCollection*>(this))) {
-            for(size_t i = 0; i < ngeomsThis; ++i) {
+            for(std::size_t i = 0; i < ngeomsThis; ++i) {
                 v->push_back(coll->getGeometryN(i)->clone().release());
             }
         }
@@ -592,7 +591,7 @@ Geometry::Union(const Geometry* other) const
         }
 
         if(nullptr != (coll = dynamic_cast<const GeometryCollection*>(other))) {
-            for(size_t i = 0; i < ngeomsOther; ++i) {
+            for(std::size_t i = 0; i < ngeomsOther; ++i) {
                 v->push_back(coll->getGeometryN(i)->clone().release());
             }
         }
@@ -653,16 +652,16 @@ Geometry::symDifference(const Geometry* other) const
     if(! getEnvelopeInternal()->intersects(other->getEnvelopeInternal())) {
         const GeometryCollection* coll;
 
-        size_t ngeomsThis = getNumGeometries();
-        size_t ngeomsOther = other->getNumGeometries();
+        std::size_t ngeomsThis = getNumGeometries();
+        std::size_t ngeomsOther = other->getNumGeometries();
 
         // Allocated for ownership transfer
-        vector<Geometry*>* v = new vector<Geometry*>();
+        std::vector<Geometry*>* v = new std::vector<Geometry*>();
         v->reserve(ngeomsThis + ngeomsOther);
 
 
         if(nullptr != (coll = dynamic_cast<const GeometryCollection*>(this))) {
-            for(size_t i = 0; i < ngeomsThis; ++i) {
+            for(std::size_t i = 0; i < ngeomsThis; ++i) {
                 v->push_back(coll->getGeometryN(i)->clone().release());
             }
         }
@@ -671,7 +670,7 @@ Geometry::symDifference(const Geometry* other) const
         }
 
         if(nullptr != (coll = dynamic_cast<const GeometryCollection*>(other))) {
-            for(size_t i = 0; i < ngeomsOther; ++i) {
+            for(std::size_t i = 0; i < ngeomsOther; ++i) {
                 v->push_back(coll->getGeometryN(i)->clone().release());
             }
         }
@@ -739,10 +738,10 @@ Geometry::GeometryChangedFilter::filter_rw(Geometry* geom)
 }
 
 int
-Geometry::compare(vector<Coordinate> a, vector<Coordinate> b) const
+Geometry::compare(std::vector<Coordinate> a, std::vector<Coordinate> b) const
 {
-    size_t i = 0;
-    size_t j = 0;
+    std::size_t i = 0;
+    std::size_t j = 0;
     while(i < a.size() && j < b.size()) {
         Coordinate& aCoord = a[i];
         Coordinate& bCoord = b[j];
@@ -763,10 +762,10 @@ Geometry::compare(vector<Coordinate> a, vector<Coordinate> b) const
 }
 
 int
-Geometry::compare(vector<Geometry*> a, vector<Geometry*> b) const
+Geometry::compare(std::vector<Geometry*> a, std::vector<Geometry*> b) const
 {
-    size_t i = 0;
-    size_t j = 0;
+    std::size_t i = 0;
+    std::size_t j = 0;
     while(i < a.size() && j < b.size()) {
         Geometry* aGeom = a[i];
         Geometry* bGeom = b[j];
@@ -790,8 +789,8 @@ int
 Geometry::compare(const std::vector<std::unique_ptr<Geometry>> & a,
         const std::vector<std::unique_ptr<Geometry>> & b) const
 {
-    size_t i = 0;
-    size_t j = 0;
+    std::size_t i = 0;
+    std::size_t j = 0;
     while(i < a.size() && j < b.size()) {
         Geometry* aGeom = a[i].get();
         Geometry* bGeom = b[j].get();
diff --git a/src/geom/GeometryCollection.cpp b/src/geom/GeometryCollection.cpp
index f49d840..6742f76 100644
--- a/src/geom/GeometryCollection.cpp
+++ b/src/geom/GeometryCollection.cpp
@@ -46,7 +46,7 @@ GeometryCollection::GeometryCollection(const GeometryCollection& gc)
     Geometry(gc),
     geometries(gc.geometries.size())
 {
-    for(size_t i = 0; i < geometries.size(); ++i) {
+    for(std::size_t i = 0; i < geometries.size(); ++i) {
         geometries[i] = gc.geometries[i]->clone();
     }
 }
@@ -101,11 +101,11 @@ GeometryCollection::getCoordinates() const
 {
     std::vector<Coordinate> coordinates(getNumPoints());
 
-    size_t k = 0;
+    std::size_t k = 0;
     for(const auto& g : geometries) {
         auto childCoordinates = g->getCoordinates(); // TODO avoid this copy where getCoordinateRO() exists
-        size_t npts = childCoordinates->getSize();
-        for(size_t j = 0; j < npts; ++j) {
+        std::size_t npts = childCoordinates->getSize();
+        for(std::size_t j = 0; j < npts; ++j) {
             coordinates[k] = childCoordinates->getAt(j);
             k++;
         }
@@ -170,7 +170,7 @@ GeometryCollection::getNumGeometries() const
 }
 
 const Geometry*
-GeometryCollection::getGeometryN(size_t n) const
+GeometryCollection::getGeometryN(std::size_t n) const
 {
     return geometries[n].get();
 }
@@ -178,7 +178,7 @@ GeometryCollection::getGeometryN(size_t n) const
 size_t
 GeometryCollection::getNumPoints() const
 {
-    size_t numPoints = 0;
+    std::size_t numPoints = 0;
     for(const auto& g : geometries) {
         numPoints += g->getNumPoints();
     }
@@ -212,7 +212,7 @@ GeometryCollection::equalsExact(const Geometry* other, double tolerance) const
     if(geometries.size() != otherCollection->geometries.size()) {
         return false;
     }
-    for(size_t i = 0; i < geometries.size(); ++i) {
+    for(std::size_t i = 0; i < geometries.size(); ++i) {
         if(!(geometries[i]->equalsExact(otherCollection->geometries[i].get(), tolerance))) {
             return false;
         }
diff --git a/src/geom/GeometryFactory.cpp b/src/geom/GeometryFactory.cpp
index 3618ee7..0707043 100644
--- a/src/geom/GeometryFactory.cpp
+++ b/src/geom/GeometryFactory.cpp
@@ -54,8 +54,6 @@
 # include <geos/geom/GeometryFactory.inl>
 #endif
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -188,10 +186,10 @@ GeometryFactory::create(const PrecisionModel* pm)
 
 /*protected*/
 GeometryFactory::GeometryFactory(const PrecisionModel* pm, int newSRID)
-    :
-    SRID(newSRID),
-    coordinateListFactory(DefaultCoordinateSequenceFactory::instance())
-    , _refCount(0), _autoDestroy(false)
+    : SRID(newSRID)
+    , coordinateListFactory(DefaultCoordinateSequenceFactory::instance())
+    , _refCount(0)
+    , _autoDestroy(false)
 {
 #if GEOS_DEBUG
     std::cerr << "GEOS_DEBUG: GeometryFactory[" << this << "]::GeometryFactory(PrecisionModel[" << pm << "], SRID)" <<
@@ -212,12 +210,12 @@ GeometryFactory::create(const PrecisionModel* pm, int newSRID)
 }
 
 /*protected*/
-GeometryFactory::GeometryFactory(const GeometryFactory& gf) :
-precisionModel(gf.precisionModel),
-SRID(gf.SRID),
-coordinateListFactory(gf.coordinateListFactory),
-_refCount(0),
-_autoDestroy(false)
+GeometryFactory::GeometryFactory(const GeometryFactory& gf)
+    : precisionModel(gf.precisionModel)
+    , SRID(gf.SRID)
+    , coordinateListFactory(gf.coordinateListFactory)
+    , _refCount(0)
+    , _autoDestroy(false)
 {}
 
 /*public static*/
@@ -344,7 +342,7 @@ GeometryFactory::createMultiLineString() const
 
 /*public*/
 MultiLineString*
-GeometryFactory::createMultiLineString(vector<Geometry*>* newLines)
+GeometryFactory::createMultiLineString(std::vector<Geometry*>* newLines)
 const
 {
     return new MultiLineString(newLines, this);
@@ -357,7 +355,7 @@ const
 {
     std::vector<std::unique_ptr<Geometry>> newGeoms(fromLines.size());
 
-    for(size_t i = 0; i < fromLines.size(); i++) {
+    for(std::size_t i = 0; i < fromLines.size(); i++) {
         auto line = dynamic_cast<const LineString*>(fromLines[i]);
 
         if(!line) {
@@ -398,7 +396,7 @@ GeometryFactory::createEmptyGeometry() const
 
 /*public*/
 GeometryCollection*
-GeometryFactory::createGeometryCollection(vector<Geometry*>* newGeoms) const
+GeometryFactory::createGeometryCollection(std::vector<Geometry*>* newGeoms) const
 {
     return new GeometryCollection(newGeoms, this);
 }
@@ -409,7 +407,7 @@ GeometryFactory::createGeometryCollection(const std::vector<const Geometry*>& fr
 {
     std::vector<std::unique_ptr<Geometry>> newGeoms(fromGeoms.size());
 
-    for(size_t i = 0; i < fromGeoms.size(); i++) {
+    for(std::size_t i = 0; i < fromGeoms.size(); i++) {
         newGeoms[i] = fromGeoms[i]->clone();
     }
 
@@ -425,7 +423,7 @@ GeometryFactory::createMultiPolygon() const
 
 /*public*/
 MultiPolygon*
-GeometryFactory::createMultiPolygon(vector<Geometry*>* newPolys) const
+GeometryFactory::createMultiPolygon(std::vector<Geometry*>* newPolys) const
 {
     return new MultiPolygon(newPolys, this);
 }
@@ -450,7 +448,7 @@ GeometryFactory::createMultiPolygon(const std::vector<const Geometry*>& fromPoly
 {
     std::vector<std::unique_ptr<Geometry>> newGeoms(fromPolys.size());
 
-    for(size_t i = 0; i < fromPolys.size(); i++) {
+    for(std::size_t i = 0; i < fromPolys.size(); i++) {
         newGeoms[i] = fromPolys[i]->clone();
     }
 
@@ -491,7 +489,7 @@ GeometryFactory::createLinearRing(const CoordinateSequence& fromCoords) const
 
 /*public*/
 MultiPoint*
-GeometryFactory::createMultiPoint(vector<Geometry*>* newPoints) const
+GeometryFactory::createMultiPoint(std::vector<Geometry*>* newPoints) const
 {
     return new MultiPoint(newPoints, this);
 }
@@ -510,10 +508,10 @@ GeometryFactory::createMultiPoint(std::vector<std::unique_ptr<Geometry>> && newP
 
 /*public*/
 MultiPoint*
-GeometryFactory::createMultiPoint(const vector<const Geometry*>& fromPoints) const
+GeometryFactory::createMultiPoint(const std::vector<const Geometry*>& fromPoints) const
 {
     std::vector<std::unique_ptr<Geometry>> newGeoms(fromPoints.size());
-    for(size_t i = 0; i < fromPoints.size(); i++) {
+    for(std::size_t i = 0; i < fromPoints.size(); i++) {
         newGeoms[i] = fromPoints[i]->clone();
     }
 
@@ -531,10 +529,10 @@ GeometryFactory::createMultiPoint() const
 MultiPoint*
 GeometryFactory::createMultiPoint(const CoordinateSequence& fromCoords) const
 {
-    size_t npts = fromCoords.getSize();
-    vector<std::unique_ptr<Geometry>> pts(npts);
+    std::size_t npts = fromCoords.getSize();
+    std::vector<std::unique_ptr<Geometry>> pts(npts);
 
-    for(size_t i = 0; i < npts; ++i) {
+    for(std::size_t i = 0; i < npts; ++i) {
         pts[i].reset(createPoint(fromCoords.getAt(i)));
     }
 
@@ -545,10 +543,10 @@ GeometryFactory::createMultiPoint(const CoordinateSequence& fromCoords) const
 MultiPoint*
 GeometryFactory::createMultiPoint(const std::vector<Coordinate>& fromCoords) const
 {
-    size_t npts = fromCoords.size();
+    std::size_t npts = fromCoords.size();
     std::vector<std::unique_ptr<Geometry>> pts(npts);
 
-    for(size_t i = 0; i < npts; ++i) {
+    for(std::size_t i = 0; i < npts; ++i) {
         pts[i].reset(createPoint(fromCoords[i]));
     }
 
@@ -566,7 +564,7 @@ GeometryFactory::createPolygon(std::size_t coordinateDimension) const
 
 /*public*/
 Polygon*
-GeometryFactory::createPolygon(LinearRing* shell, vector<LinearRing*>* holes)
+GeometryFactory::createPolygon(LinearRing* shell, std::vector<LinearRing*>* holes)
 const
 {
     return new Polygon(shell, holes, this);
@@ -597,7 +595,7 @@ const
 
     std::vector<std::unique_ptr<LinearRing>> newHoles(holes.size());
 
-    for(size_t i = 0; i < holes.size(); i++) {
+    for(std::size_t i = 0; i < holes.size(); i++) {
         newHoles[i].reset(new LinearRing(*holes[i]));
     }
 
@@ -677,7 +675,7 @@ GeometryTypeId commonType(const T& geoms) {
     }
 
     GeometryTypeId type = geoms[0]->getGeometryTypeId();
-    for (size_t i = 1; i < geoms.size(); i++) {
+    for (std::size_t i = 1; i < geoms.size(); i++) {
         if (geoms[i]->getGeometryTypeId() != type) {
             return GEOS_GEOMETRYCOLLECTION;
         }
@@ -694,7 +692,7 @@ GeometryTypeId commonType(const T& geoms) {
 
 /*public*/
 Geometry*
-GeometryFactory::buildGeometry(vector<Geometry*>* newGeoms) const
+GeometryFactory::buildGeometry(std::vector<Geometry*>* newGeoms) const
 {
     if(newGeoms->empty()) {
         // we do not need the vector anymore
@@ -783,7 +781,7 @@ GeometryFactory::buildGeometry(std::vector<std::unique_ptr<Polygon>> && geoms) c
 
 /*public*/
 Geometry*
-GeometryFactory::buildGeometry(const vector<const Geometry*>& fromGeoms) const
+GeometryFactory::buildGeometry(const std::vector<const Geometry*>& fromGeoms) const
 {
     if(fromGeoms.empty()) {
         return createGeometryCollection().release();
diff --git a/src/geom/IntersectionMatrix.cpp b/src/geom/IntersectionMatrix.cpp
index a8c7a4b..82acfcf 100644
--- a/src/geom/IntersectionMatrix.cpp
+++ b/src/geom/IntersectionMatrix.cpp
@@ -25,8 +25,6 @@
 #include <sstream>
 #include <cassert>
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -41,7 +39,7 @@ IntersectionMatrix::IntersectionMatrix()
 }
 
 /*public*/
-IntersectionMatrix::IntersectionMatrix(const string& elements)
+IntersectionMatrix::IntersectionMatrix(const std::string& elements)
 {
     setAll(Dimension::False);
     set(elements);
@@ -57,8 +55,8 @@ IntersectionMatrix::IntersectionMatrix(const IntersectionMatrix& other)
 void
 IntersectionMatrix::add(IntersectionMatrix* other)
 {
-    for(size_t i = 0; i < firstDim; i++) {
-        for(size_t j = 0; j < secondDim; j++) {
+    for(std::size_t i = 0; i < firstDim; i++) {
+        for(std::size_t j = 0; j < secondDim; j++) {
             setAtLeast(static_cast<Location>(i), static_cast<Location>(j),
                     other->get(static_cast<Location>(i), static_cast<Location>(j)));
         }
@@ -68,16 +66,16 @@ IntersectionMatrix::add(IntersectionMatrix* other)
 
 /*public*/
 bool
-IntersectionMatrix::matches(const string& requiredDimensionSymbols) const
+IntersectionMatrix::matches(const std::string& requiredDimensionSymbols) const
 {
     if(requiredDimensionSymbols.length() != 9) {
-        ostringstream s;
+        std::ostringstream s;
         s << "IllegalArgumentException: Should be length 9, is "
-          << "[" << requiredDimensionSymbols << "] instead" << endl;
+          << "[" << requiredDimensionSymbols << "] instead" << std::endl;
         throw util::IllegalArgumentException(s.str());
     }
-    for(size_t ai = 0; ai < firstDim; ai++) {
-        for(size_t bi = 0; bi < secondDim; bi++) {
+    for(std::size_t ai = 0; ai < firstDim; ai++) {
+        for(std::size_t bi = 0; bi < secondDim; bi++) {
             if(!matches(matrix[ai][bi], requiredDimensionSymbols[3 * ai + bi])) {
                 return false;
             }
@@ -126,8 +124,8 @@ IntersectionMatrix::matches(int actualDimensionValue,
 
 /*public static*/
 bool
-IntersectionMatrix::matches(const string& actualDimensionSymbols,
-                            const string& requiredDimensionSymbols)
+IntersectionMatrix::matches(const std::string& actualDimensionSymbols,
+                            const std::string& requiredDimensionSymbols)
 {
     IntersectionMatrix m(actualDimensionSymbols);
     bool result = m.matches(requiredDimensionSymbols);
@@ -144,11 +142,11 @@ IntersectionMatrix::set(Location row, Location col, int dimensionValue)
 
 /*public*/
 void
-IntersectionMatrix::set(const string& dimensionSymbols)
+IntersectionMatrix::set(const std::string& dimensionSymbols)
 {
     auto limit = dimensionSymbols.length();
 
-    for(size_t i = 0; i < limit; i++) {
+    for(std::size_t i = 0; i < limit; i++) {
         auto row = i / firstDim;
         auto col = i % secondDim;
         matrix[row][col] = Dimension::toDimensionValue(dimensionSymbols[i]);
@@ -175,11 +173,11 @@ IntersectionMatrix::setAtLeastIfValid(Location row, Location col, int minimumDim
 
 /*public*/
 void
-IntersectionMatrix::setAtLeast(string minimumDimensionSymbols)
+IntersectionMatrix::setAtLeast(std::string minimumDimensionSymbols)
 {
     auto limit = minimumDimensionSymbols.length();
 
-    for(size_t i = 0; i < limit; i++) {
+    for(std::size_t i = 0; i < limit; i++) {
         auto row = static_cast<Location>(i / firstDim);
         auto col = static_cast<Location>(i % secondDim);
         setAtLeast(row, col, Dimension::toDimensionValue(minimumDimensionSymbols[i]));
@@ -381,12 +379,12 @@ IntersectionMatrix::transpose()
 }
 
 /*public*/
-string
+std::string
 IntersectionMatrix::toString() const
 {
-    string result("");
-    for(size_t ai = 0; ai < firstDim; ai++) {
-        for(size_t bi = 0; bi < secondDim; bi++) {
+    std::string result("");
+    for(std::size_t ai = 0; ai < firstDim; ai++) {
+        for(std::size_t bi = 0; bi < secondDim; bi++) {
             result += Dimension::toDimensionSymbol(matrix[ai][bi]);
         }
     }
diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp
index 2faf90e..6ac932e 100644
--- a/src/geom/LineString.cpp
+++ b/src/geom/LineString.cpp
@@ -41,7 +41,6 @@
 #include <memory>
 #include <cassert>
 
-using namespace std;
 using namespace geos::algorithm;
 
 namespace geos {
@@ -124,7 +123,7 @@ LineString::getCoordinatesRO() const
 }
 
 const Coordinate&
-LineString::getCoordinateN(size_t n) const
+LineString::getCoordinateN(std::size_t n) const
 {
     assert(points.get());
     return points->getAt(n);
@@ -158,7 +157,7 @@ LineString::isEmpty() const
     return points->isEmpty();
 }
 
-size_t
+std::size_t
 LineString::getNumPoints() const
 {
     assert(points.get());
@@ -166,7 +165,7 @@ LineString::getNumPoints() const
 }
 
 std::unique_ptr<Point>
-LineString::getPointN(size_t n) const
+LineString::getPointN(std::size_t n) const
 {
     assert(getFactory());
     assert(points.get());
@@ -208,7 +207,7 @@ LineString::isRing() const
     return isClosed() && isSimple();
 }
 
-string
+std::string
 LineString::getGeometryType() const
 {
     return "LineString";
@@ -269,11 +268,11 @@ LineString::equalsExact(const Geometry* other, double tolerance) const
 
     const LineString* otherLineString = dynamic_cast<const LineString*>(other);
     assert(otherLineString);
-    size_t npts = points->getSize();
+    std::size_t npts = points->getSize();
     if(npts != otherLineString->points->getSize()) {
         return false;
     }
-    for(size_t i = 0; i < npts; ++i) {
+    for(std::size_t i = 0; i < npts; ++i) {
         if(!equal(points->getAt(i), otherLineString->points->getAt(i), tolerance)) {
             return false;
         }
@@ -409,11 +408,11 @@ LineString::apply_ro(GeometryComponentFilter* filter) const
 void
 LineString::apply_rw(CoordinateSequenceFilter& filter)
 {
-    size_t npts = points->size();
+    std::size_t npts = points->size();
     if(!npts) {
         return;
     }
-    for(size_t i = 0; i < npts; ++i) {
+    for(std::size_t i = 0; i < npts; ++i) {
         filter.filter_rw(*points, i);
         if(filter.isDone()) {
             break;
@@ -427,11 +426,11 @@ LineString::apply_rw(CoordinateSequenceFilter& filter)
 void
 LineString::apply_ro(CoordinateSequenceFilter& filter) const
 {
-    size_t npts = points->size();
+    std::size_t npts = points->size();
     if(!npts) {
         return;
     }
-    for(size_t i = 0; i < npts; ++i) {
+    for(std::size_t i = 0; i < npts; ++i) {
         filter.filter_ro(*points, i);
         if(filter.isDone()) {
             break;
diff --git a/src/geom/Location.cpp b/src/geom/Location.cpp
index e126c46..a09573e 100644
--- a/src/geom/Location.cpp
+++ b/src/geom/Location.cpp
@@ -17,8 +17,6 @@
 
 #include <sstream>
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
diff --git a/src/geom/MultiLineString.cpp b/src/geom/MultiLineString.cpp
index 901ceef..11e2af4 100644
--- a/src/geom/MultiLineString.cpp
+++ b/src/geom/MultiLineString.cpp
@@ -138,7 +138,7 @@ MultiLineString::reverse() const
 }
 
 const LineString*
-MultiLineString::getGeometryN(size_t i) const
+MultiLineString::getGeometryN(std::size_t i) const
 {
     return static_cast<const LineString*>(geometries[i].get());
 }
diff --git a/src/geom/MultiPoint.cpp b/src/geom/MultiPoint.cpp
index be96e42..f26565a 100644
--- a/src/geom/MultiPoint.cpp
+++ b/src/geom/MultiPoint.cpp
@@ -83,7 +83,7 @@ MultiPoint::equalsExact(const Geometry* other, double tolerance) const
 }
 
 const Coordinate*
-MultiPoint::getCoordinateN(size_t n) const
+MultiPoint::getCoordinateN(std::size_t n) const
 {
     return geometries[n]->getCoordinate();
 }
@@ -94,7 +94,7 @@ MultiPoint::getGeometryTypeId() const
 }
 
 const Point*
-MultiPoint::getGeometryN(size_t i) const
+MultiPoint::getGeometryN(std::size_t i) const
 {
     return static_cast<const Point*>(geometries[i].get());
 }
diff --git a/src/geom/MultiPolygon.cpp b/src/geom/MultiPolygon.cpp
index aebeab6..18bacbd 100644
--- a/src/geom/MultiPolygon.cpp
+++ b/src/geom/MultiPolygon.cpp
@@ -84,7 +84,7 @@ MultiPolygon::getBoundary() const
         if(g->getNumGeometries() == 1) {
             allRings.push_back(std::move(g));
         } else {
-            for(size_t i = 0; i < g->getNumGeometries(); ++i) {
+            for(std::size_t i = 0; i < g->getNumGeometries(); ++i) {
                 // TODO avoid this clone
                 allRings.push_back(g->getGeometryN(i)->clone());
             }
@@ -128,7 +128,7 @@ MultiPolygon::reverse() const
 }
 
 const Polygon*
-MultiPolygon::getGeometryN(size_t i) const
+MultiPolygon::getGeometryN(std::size_t i) const
 {
     return static_cast<const Polygon*>(geometries[i].get());
 }
diff --git a/src/geom/Point.cpp b/src/geom/Point.cpp
index d439375..64c7874 100644
--- a/src/geom/Point.cpp
+++ b/src/geom/Point.cpp
@@ -36,8 +36,6 @@
 #include <string>
 #include <memory>
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -47,10 +45,9 @@ const static FixedSizeCoordinateSequence<0> emptyCoords3d(3);
 
 /*protected*/
 Point::Point(CoordinateSequence* newCoords, const GeometryFactory* factory)
-    :
-    Geometry(factory),
-    empty2d(false),
-    empty3d(false)
+    : Geometry(factory)
+    , empty2d(false)
+    , empty3d(false)
 {
     std::unique_ptr<CoordinateSequence> coords(newCoords);
 
@@ -68,27 +65,23 @@ Point::Point(CoordinateSequence* newCoords, const GeometryFactory* factory)
     } else {
         empty2d = true;
     }
-
-
 }
 
-Point::Point(const Coordinate & c, const GeometryFactory* factory) :
-    Geometry(factory),
-    empty2d(false),
-    empty3d(false)
+Point::Point(const Coordinate & c, const GeometryFactory* factory)
+    : Geometry(factory)
+    , empty2d(false)
+    , empty3d(false)
 {
     coordinates.setAt(c, 0);
 }
 
 /*protected*/
 Point::Point(const Point& p)
-    :
-    Geometry(p),
-    coordinates(p.coordinates),
-    empty2d(p.empty2d),
-    empty3d(p.empty3d)
-{
-}
+    : Geometry(p)
+    , coordinates(p.coordinates)
+    , empty2d(p.empty2d)
+    , empty3d(p.empty3d)
+{}
 
 std::unique_ptr<CoordinateSequence>
 Point::getCoordinates() const
@@ -96,7 +89,7 @@ Point::getCoordinates() const
     return getCoordinatesRO()->clone();
 }
 
-size_t
+std::size_t
 Point::getNumPoints() const
 {
     return isEmpty() ? 0 : 1;
@@ -170,7 +163,7 @@ Point::getCoordinate() const
     return isEmpty() ? nullptr : &coordinates[0];
 }
 
-string
+std::string
 Point::getGeometryType() const
 {
     return "Point";
diff --git a/src/geom/Polygon.cpp b/src/geom/Polygon.cpp
index 903ef82..4c15915 100644
--- a/src/geom/Polygon.cpp
+++ b/src/geom/Polygon.cpp
@@ -56,7 +56,7 @@ Polygon::Polygon(const Polygon& p)
     shell(detail::make_unique<LinearRing>(*p.shell)),
     holes(p.holes.size())
 {
-    for(size_t i = 0; i < holes.size(); ++i) {
+    for(std::size_t i = 0; i < holes.size(); ++i) {
         holes[i] = detail::make_unique<LinearRing>(*p.holes[i]);
     }
 }
@@ -144,7 +144,7 @@ Polygon::getCoordinates() const
 size_t
 Polygon::getNumPoints() const
 {
-    size_t numPoints = shell->getNumPoints();
+    std::size_t numPoints = shell->getNumPoints();
     for(const auto& lr : holes) {
         numPoints += lr->getNumPoints();
     }
@@ -198,7 +198,7 @@ Polygon::getNumInteriorRing() const
 }
 
 const LinearRing*
-Polygon::getInteriorRingN(size_t n) const
+Polygon::getInteriorRingN(std::size_t n) const
 {
     return holes[n].get();
 }
@@ -233,7 +233,7 @@ Polygon::getBoundary() const
     std::vector<std::unique_ptr<Geometry>> rings(holes.size() + 1);
 
     rings[0] = gf->createLineString(*shell);
-    for(size_t i = 0, n = holes.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = holes.size(); i < n; ++i) {
         const LinearRing* hole = holes[i].get();
         std::unique_ptr<LineString> ls = gf->createLineString(*hole);
         rings[i + 1] = std::move(ls);
@@ -260,13 +260,13 @@ Polygon::equalsExact(const Geometry* other, double tolerance) const
         return false;
     }
 
-    size_t nholes = holes.size();
+    std::size_t nholes = holes.size();
 
     if(nholes != otherPolygon->holes.size()) {
         return false;
     }
 
-    for(size_t i = 0; i < nholes; i++) {
+    for(std::size_t i = 0; i < nholes; i++) {
         const LinearRing* hole = holes[i].get();
         const LinearRing* otherhole = otherPolygon->holes[i].get();
         if(!hole->equalsExact(otherhole, tolerance)) {
@@ -403,7 +403,7 @@ Polygon::apply_ro(GeometryComponentFilter* filter) const
 {
     filter->filter_ro(this);
     shell->apply_ro(filter);
-    for(size_t i = 0, n = holes.size(); i < n && !filter->isDone(); ++i) {
+    for(std::size_t i = 0, n = holes.size(); i < n && !filter->isDone(); ++i) {
         holes[i]->apply_ro(filter);
     }
 }
@@ -413,7 +413,7 @@ Polygon::apply_rw(GeometryComponentFilter* filter)
 {
     filter->filter_rw(this);
     shell->apply_rw(filter);
-    for(size_t i = 0, n = holes.size(); i < n && !filter->isDone(); ++i) {
+    for(std::size_t i = 0, n = holes.size(); i < n && !filter->isDone(); ++i) {
         holes[i]->apply_rw(filter);
     }
 }
@@ -424,7 +424,7 @@ Polygon::apply_rw(CoordinateSequenceFilter& filter)
     shell->apply_rw(filter);
 
     if(! filter.isDone()) {
-        for(size_t i = 0, n = holes.size(); i < n; ++i) {
+        for(std::size_t i = 0, n = holes.size(); i < n; ++i) {
             holes[i]->apply_rw(filter);
             if(filter.isDone()) {
                 break;
@@ -442,7 +442,7 @@ Polygon::apply_ro(CoordinateSequenceFilter& filter) const
     shell->apply_ro(filter);
 
     if(! filter.isDone()) {
-        for(size_t i = 0, n = holes.size(); i < n; ++i) {
+        for(std::size_t i = 0, n = holes.size(); i < n; ++i) {
             holes[i]->apply_ro(filter);
             if(filter.isDone()) {
                 break;
diff --git a/src/geom/PrecisionModel.cpp b/src/geom/PrecisionModel.cpp
index 779a160..90a627e 100644
--- a/src/geom/PrecisionModel.cpp
+++ b/src/geom/PrecisionModel.cpp
@@ -36,8 +36,6 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
-
 namespace geos {
 namespace geom { // geos::geom
 
@@ -48,7 +46,7 @@ double
 PrecisionModel::makePrecise(double val) const
 {
 #if GEOS_DEBUG
-    cerr << "PrecisionModel[" << this << "]::makePrecise called" << endl;
+    std::cerr << "PrecisionModel[" << this << "]::makePrecise called" << std::endl;
 #endif
 
     if(modelType == FLOATING_SINGLE) {
@@ -85,7 +83,7 @@ PrecisionModel::PrecisionModel()
     scale(0.0)
 {
 #if GEOS_DEBUG
-    cerr << "PrecisionModel[" << this << "] ctor()" << endl;
+    std::cerr << "PrecisionModel[" << this << "] ctor()" << std::endl;
 #endif
     //modelType=FLOATING;
     //scale=1.0;
@@ -98,7 +96,7 @@ PrecisionModel::PrecisionModel(Type nModelType)
     scale(1.0)
 {
 #if GEOS_DEBUG
-    cerr << "PrecisionModel[" << this << "] ctor(Type)" << endl;
+    std::cerr << "PrecisionModel[" << this << "] ctor(Type)" << std::endl;
 #endif
     //modelType=nModelType;
     //if (modelType==FIXED) setScale(1.0);
@@ -116,7 +114,7 @@ PrecisionModel::PrecisionModel(double newScale, double newOffsetX, double newOff
     ::geos::ignore_unused_variable_warning(newOffsetY);
 
 #if GEOS_DEBUG
-    cerr << "PrecisionModel[" << this << "] ctor(scale,offsets)" << endl;
+    std::cerr << "PrecisionModel[" << this << "] ctor(scale,offsets)" << std::endl;
 #endif
 
     //modelType = FIXED;
@@ -130,7 +128,7 @@ PrecisionModel::PrecisionModel(double newScale)
     modelType(FIXED)
 {
 #if GEOS_DEBUG
-    cerr << "PrecisionModel[" << this << "] ctor(scale)" << endl;
+    std::cerr << "PrecisionModel[" << this << "] ctor(scale)" << std::endl;
 #endif
     setScale(newScale);
 }
@@ -192,10 +190,10 @@ PrecisionModel::getOffsetY() const
 }
 
 
-string
+std::string
 PrecisionModel::toString() const
 {
-    ostringstream s;
+    std::ostringstream s;
     if(modelType == FLOATING) {
         s << "Floating";
     }
diff --git a/src/geom/prep/BasicPreparedGeometry.cpp b/src/geom/prep/BasicPreparedGeometry.cpp
index d637401..7d15f1a 100644
--- a/src/geom/prep/BasicPreparedGeometry.cpp
+++ b/src/geom/prep/BasicPreparedGeometry.cpp
@@ -71,7 +71,7 @@ BasicPreparedGeometry::isAnyTargetComponentInTest(const geom::Geometry* testGeom
 {
     algorithm::PointLocator locator;
 
-    for(size_t i = 0, n = representativePts.size(); i < n; i++) {
+    for(std::size_t i = 0, n = representativePts.size(); i < n; i++) {
         const geom::Coordinate& c = *(representativePts[i]);
         if(locator.intersects(c, testGeom)) {
             return true;
diff --git a/src/geom/prep/PreparedLineStringIntersects.cpp b/src/geom/prep/PreparedLineStringIntersects.cpp
index e6e05b9..810bb5f 100644
--- a/src/geom/prep/PreparedLineStringIntersects.cpp
+++ b/src/geom/prep/PreparedLineStringIntersects.cpp
@@ -44,7 +44,7 @@ PreparedLineStringIntersects::isAnyTestPointInTarget(const geom::Geometry* testG
     geom::Coordinate::ConstVect coords;
     ComponentCoordinateExtracter::getCoordinates(*testGeom, coords);
 
-    for(size_t i = 0, n = coords.size(); i < n; i++) {
+    for(std::size_t i = 0, n = coords.size(); i < n; i++) {
         const geom::Coordinate& c = *(coords[i]);
         if(locator.intersects(c, &(prepLine.getGeometry()))) {
             return true;
@@ -62,7 +62,7 @@ PreparedLineStringIntersects::intersects(const geom::Geometry* g) const
     noding::FastSegmentSetIntersectionFinder* fssif = prepLine.getIntersectionFinder();
     bool segsIntersect = fssif->intersects(&lineSegStr); // prepLine.getIntersectionFinder()->intersects(lineSegStr);
 
-    for(size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
+    for(std::size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
         delete lineSegStr[ i ];
     }
 
diff --git a/src/geom/prep/PreparedPolygonContainsProperly.cpp b/src/geom/prep/PreparedPolygonContainsProperly.cpp
index 358eb29..403af5c 100644
--- a/src/geom/prep/PreparedPolygonContainsProperly.cpp
+++ b/src/geom/prep/PreparedPolygonContainsProperly.cpp
@@ -59,7 +59,7 @@ PreparedPolygonContainsProperly::containsProperly(const geom::Geometry* geom)
     noding::SegmentStringUtil::extractSegmentStrings(geom, lineSegStr);
     bool segsIntersect = prepPoly->getIntersectionFinder()->intersects(&lineSegStr);
 
-    for(size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
+    for(std::size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
         delete lineSegStr[ i ];
     }
 
diff --git a/src/geom/prep/PreparedPolygonIntersects.cpp b/src/geom/prep/PreparedPolygonIntersects.cpp
index 862f87b..66e80af 100644
--- a/src/geom/prep/PreparedPolygonIntersects.cpp
+++ b/src/geom/prep/PreparedPolygonIntersects.cpp
@@ -64,7 +64,7 @@ PreparedPolygonIntersects::intersects(const geom::Geometry* geom)
     noding::SegmentStringUtil::extractSegmentStrings(geom, lineSegStr);
     bool segsIntersect = prepPoly->getIntersectionFinder()->intersects(&lineSegStr);
 
-    for(size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
+    for(std::size_t i = 0, ni = lineSegStr.size(); i < ni; i++) {
         delete lineSegStr[ i ];
     }
 
diff --git a/src/geom/util/GeometryEditor.cpp b/src/geom/util/GeometryEditor.cpp
index 1c15a6d..e7df825 100644
--- a/src/geom/util/GeometryEditor.cpp
+++ b/src/geom/util/GeometryEditor.cpp
@@ -127,7 +127,7 @@ GeometryEditor::editPolygon(const Polygon* polygon, GeometryEditorOperation* ope
     }
 
     auto holes = detail::make_unique<std::vector<LinearRing*>>();
-    for(size_t i = 0, n = newPolygon->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = newPolygon->getNumInteriorRing(); i < n; ++i) {
 
         std::unique_ptr<LinearRing> hole(dynamic_cast<LinearRing*>(
                 edit(newPolygon->getInteriorRingN(i), operation).release()));
diff --git a/src/geom/util/GeometryTransformer.cpp b/src/geom/util/GeometryTransformer.cpp
index 38efefd..2eb45ed 100644
--- a/src/geom/util/GeometryTransformer.cpp
+++ b/src/geom/util/GeometryTransformer.cpp
@@ -164,7 +164,7 @@ GeometryTransformer::transformMultiPoint(
 
     std::vector<std::unique_ptr<Geometry>> transGeomList;
 
-    for(size_t i = 0, n = geom->getNumGeometries(); i < n; i++) {
+    for(std::size_t i = 0, n = geom->getNumGeometries(); i < n; i++) {
         const Point* p = geom->getGeometryN(i);
         assert(p);
 
@@ -240,7 +240,7 @@ GeometryTransformer::transformMultiLineString(
 
     std::vector<std::unique_ptr<Geometry>> transGeomList;
 
-    for(size_t i = 0, n = geom->getNumGeometries(); i < n; i++) {
+    for(std::size_t i = 0, n = geom->getNumGeometries(); i < n; i++) {
         const LineString* l = geom->getGeometryN(i);
         assert(l);
 
@@ -284,7 +284,7 @@ GeometryTransformer::transformPolygon(
     }
 
     std::vector<std::unique_ptr<LinearRing>> holes;
-    for(size_t i = 0, n = geom->getNumInteriorRing(); i < n; i++) {
+    for(std::size_t i = 0, n = geom->getNumInteriorRing(); i < n; i++) {
         const LinearRing* p_lr = geom->getInteriorRingN(i);
         assert(p_lr);
 
diff --git a/src/geomgraph/DirectedEdgeStar.cpp b/src/geomgraph/DirectedEdgeStar.cpp
index 41cc490..118c98e 100644
--- a/src/geomgraph/DirectedEdgeStar.cpp
+++ b/src/geomgraph/DirectedEdgeStar.cpp
@@ -38,7 +38,6 @@
 #define GEOS_DEBUG 1
 #endif
 
-//using namespace std;
 using namespace geos::geom;
 
 namespace geos {
diff --git a/src/geomgraph/Edge.cpp b/src/geomgraph/Edge.cpp
index 6afc447..1638bf2 100644
--- a/src/geomgraph/Edge.cpp
+++ b/src/geomgraph/Edge.cpp
@@ -46,7 +46,6 @@
 #include <iostream>
 #endif
 
-using namespace std;
 using namespace geos::geom;
 
 namespace geos {
@@ -151,13 +150,13 @@ Edge::getCollapsedEdge()
 
 /*public*/
 void
-Edge::addIntersections(LineIntersector* li, size_t segmentIndex, size_t geomIndex)
+Edge::addIntersections(LineIntersector* li, std::size_t segmentIndex, std::size_t geomIndex)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] Edge::addIntersections(" << li->toString() << ", " << segmentIndex << ", " << geomIndex <<
-         ") called" << endl;
+    std::cerr << "[" << this << "] Edge::addIntersections(" << li->toString() << ", " << segmentIndex << ", " << geomIndex <<
+         ") called" << std::endl;
 #endif
-    for(size_t i = 0; i < li->getIntersectionNum(); ++i) {
+    for(std::size_t i = 0; i < li->getIntersectionNum(); ++i) {
         addIntersection(li, segmentIndex, geomIndex, i);
     }
 
@@ -167,7 +166,7 @@ Edge::addIntersections(LineIntersector* li, size_t segmentIndex, size_t geomInde
 /*public*/
 void
 Edge::addIntersection(LineIntersector* li,
-                      size_t segmentIndex, size_t geomIndex, size_t intIndex)
+                      std::size_t segmentIndex, std::size_t geomIndex, std::size_t intIndex)
 {
 #if GEOS_DEBUG
     std::cerr << "[" << this << "] Edge::addIntersection(" << li->toString() << ", " << segmentIndex << ", " << geomIndex <<
@@ -194,7 +193,7 @@ Edge::addIntersection(LineIntersector* li,
      * Add the intersection point to edge intersection list.
      */
 #if GEOS_DEBUG
-    cerr << "Edge::addIntersection adding to edge intersection list point " << intPt.toString() << endl;
+    std::cerr << "Edge::addIntersection adding to edge intersection list point " << intPt.toString() << std::endl;
 #endif
     eiList.add(intPt, normalizedSegmentIndex, dist);
 
@@ -217,7 +216,7 @@ Edge::equals(const Edge& e) const
     bool isEqualForward = true;
     bool isEqualReverse = true;
 
-    for(size_t i = 0, iRev = npts1 - 1; i < npts1; ++i, --iRev) {
+    for(std::size_t i = 0, iRev = npts1 - 1; i < npts1; ++i, --iRev) {
         const Coordinate& e1pi = pts->getAt(i);
         const Coordinate& e2pi = e.pts->getAt(i);
         const Coordinate& e2piRev = e.pts->getAt(iRev);
@@ -242,7 +241,7 @@ Edge::isPointwiseEqual(const Edge* e) const
     testInvariant();
 
 #if GEOS_DEBUG > 2
-    cerr << "Edge::isPointwiseEqual call" << endl;
+    std::cerr << "Edge::isPointwiseEqual call" << std::endl;
 #endif
     auto npts = getNumPoints();
     auto enpts = e->getNumPoints();
@@ -250,7 +249,7 @@ Edge::isPointwiseEqual(const Edge* e) const
         return false;
     }
 #if GEOS_DEBUG
-    cerr << "Edge::isPointwiseEqual scanning " << enpts << "x" << npts << " points" << endl;
+    std::cerr << "Edge::isPointwiseEqual scanning " << enpts << "x" << npts << " points" << std::endl;
 #endif
     for(unsigned int i = 0; i < npts; ++i) {
         if(!pts->getAt(i).equals2D(e->pts->getAt(i))) {
@@ -260,7 +259,7 @@ Edge::isPointwiseEqual(const Edge* e) const
     return true;
 }
 
-string
+std::string
 Edge::print() const
 {
     testInvariant();
@@ -271,12 +270,12 @@ Edge::print() const
 }
 
 // Dunno how to implemente this in terms of operator<<
-string
+std::string
 Edge::printReverse() const
 {
     testInvariant();
 
-    stringstream os;
+    std::stringstream os;
 
     os << "EDGE (rev)";
 
diff --git a/src/geomgraph/EdgeEndStar.cpp b/src/geomgraph/EdgeEndStar.cpp
index d1de587..156aca6 100644
--- a/src/geomgraph/EdgeEndStar.cpp
+++ b/src/geomgraph/EdgeEndStar.cpp
@@ -35,8 +35,6 @@
 #define GEOS_DEBUG 0
 #endif
 
-//using namespace std;
-//using namespace geos::algorithm;
 using namespace geos::geom;
 
 namespace geos {
diff --git a/src/geomgraph/EdgeIntersectionList.cpp b/src/geomgraph/EdgeIntersectionList.cpp
index 9b89e64..b36679d 100644
--- a/src/geomgraph/EdgeIntersectionList.cpp
+++ b/src/geomgraph/EdgeIntersectionList.cpp
@@ -53,7 +53,7 @@ EdgeIntersectionList::EdgeIntersectionList(const Edge* newEdge):
 
 void
 EdgeIntersectionList::add(const Coordinate& coord,
-                          size_t segmentIndex, double dist)
+                          std::size_t segmentIndex, double dist)
 {
     if (nodeMap.empty()) {
         nodeMap.emplace_back(coord, segmentIndex, dist);
@@ -124,7 +124,7 @@ EdgeIntersectionList::createSplitEdge(const EdgeIntersection* ei0,
                                       const EdgeIntersection* ei1)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] EdgeIntersectionList::createSplitEdge()" << endl;
+    std::cerr << "[" << this << "] EdgeIntersectionList::createSplitEdge()" << std::endl;
 #endif // GEOS_DEBUG
     auto npts = 2ul + ei1->segmentIndex - ei0->segmentIndex;
 
@@ -142,7 +142,7 @@ EdgeIntersectionList::createSplitEdge(const EdgeIntersection* ei0,
     }
 
 #if GEOS_DEBUG
-    cerr << "    npts:" << npts << endl;
+    std::cerr << "    npts:" << npts << std::endl;
 #endif // GEOS_DEBUG
 
     std::vector<Coordinate> vc;
diff --git a/src/geomgraph/EdgeList.cpp b/src/geomgraph/EdgeList.cpp
index 534342a..eb5a0c8 100644
--- a/src/geomgraph/EdgeList.cpp
+++ b/src/geomgraph/EdgeList.cpp
@@ -112,7 +112,7 @@ EdgeList::print()
     ss << *this;
     return ss.str();
 #if 0
-    string out = "EdgeList( ";
+    std::string out = "EdgeList( ";
     for(unsigned int j = 0, s = edges.size(); j < s; ++j) {
         Edge* e = edges[j];
         if(j) {
diff --git a/src/geomgraph/EdgeNodingValidator.cpp b/src/geomgraph/EdgeNodingValidator.cpp
index b16a2d9..97b9a7d 100644
--- a/src/geomgraph/EdgeNodingValidator.cpp
+++ b/src/geomgraph/EdgeNodingValidator.cpp
@@ -24,18 +24,17 @@
 #include <geos/noding/BasicSegmentString.h>
 #include <geos/geom/CoordinateSequence.h>
 
-using namespace std;
 using namespace geos::noding;
 using namespace geos::geom;
 
 namespace geos {
 namespace geomgraph { // geos.geomgraph
 
-vector<SegmentString*>&
-EdgeNodingValidator::toSegmentStrings(vector<Edge*>& edges)
+std::vector<SegmentString*>&
+EdgeNodingValidator::toSegmentStrings(std::vector<Edge*>& edges)
 {
     // convert Edges to SegmentStrings
-    for(size_t i = 0, n = edges.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edges.size(); i < n; ++i) {
         Edge* e = edges[i];
         auto cs = e->getCoordinates()->clone();
         segStr.push_back(new BasicSegmentString(cs.get(), e));
@@ -53,7 +52,7 @@ EdgeNodingValidator::~EdgeNodingValidator()
         delete *i;
     }
 
-    for(size_t i = 0, n = newCoordSeq.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = newCoordSeq.size(); i < n; ++i) {
         delete newCoordSeq[i];
     }
 }
diff --git a/src/geomgraph/EdgeRing.cpp b/src/geomgraph/EdgeRing.cpp
index 5515209..80566ff 100644
--- a/src/geomgraph/EdgeRing.cpp
+++ b/src/geomgraph/EdgeRing.cpp
@@ -67,7 +67,7 @@ EdgeRing::EdgeRing(DirectedEdge* newStart,
     //computePoints(start);
     //computeRing();
 #ifdef GEOS_DEBUG
-    cerr << "EdgeRing[" << this << "] ctor" << endl;
+    std::cerr << "EdgeRing[" << this << "] ctor" << std::endl;
 #endif
     testInvariant();
 }
@@ -151,9 +151,9 @@ EdgeRing::toPolygon(const GeometryFactory* p_geometryFactory)
     if (holes.empty()) {
         return p_geometryFactory->createPolygon(std::move(shellLR));
     } else {
-        size_t nholes = holes.size();
+        std::size_t nholes = holes.size();
         std::vector<std::unique_ptr<LinearRing>> holeLR(nholes);
-        for(size_t i = 0; i < nholes; ++i) {
+        for(std::size_t i = 0; i < nholes; ++i) {
             holeLR[i] = detail::make_unique<LinearRing>(*(holes[i]->getLinearRing()));
         }
 
@@ -314,7 +314,7 @@ EdgeRing::addPoints(Edge* edge, bool isForward, bool isFirstEdge)
     const CoordinateSequence* edgePts = edge->getCoordinates();
 
     assert(edgePts);
-    size_t numEdgePts = edgePts->getSize();
+    std::size_t numEdgePts = edgePts->getSize();
 
     pts.reserve(pts.size() + numEdgePts);
     if(isForward) {
@@ -322,18 +322,18 @@ EdgeRing::addPoints(Edge* edge, bool isForward, bool isFirstEdge)
             edgePts->toVector(pts);
             return;
         } else {
-            for(size_t i = 1; i < numEdgePts; ++i) {
+            for(std::size_t i = 1; i < numEdgePts; ++i) {
                 pts.push_back(edgePts->getAt(i));
             }
         }
     }
 
     else { // is backward
-        size_t startIndex = numEdgePts - 1;
+        std::size_t startIndex = numEdgePts - 1;
         if(isFirstEdge) {
             startIndex = numEdgePts;
         }
-        for(size_t i = startIndex; i > 0; --i) {
+        for(std::size_t i = startIndex; i > 0; --i) {
             pts.push_back(edgePts->getAt(i - 1));
         }
     }
diff --git a/src/geomgraph/GeometryGraph.cpp b/src/geomgraph/GeometryGraph.cpp
index 1eb8c96..1d82492 100644
--- a/src/geomgraph/GeometryGraph.cpp
+++ b/src/geomgraph/GeometryGraph.cpp
@@ -53,7 +53,7 @@
 #include <geos/inline.h>
 
 #include <vector>
-#include <memory> // unique_ptr
+#include <memory> // std::unique_ptr
 #include <cassert>
 #include <typeinfo>
 
@@ -65,7 +65,6 @@
 # include "geos/geomgraph/GeometryGraph.inl"
 #endif
 
-using namespace std;
 using namespace geos::geomgraph::index;
 using namespace geos::algorithm;
 using namespace geos::geom;
@@ -115,11 +114,11 @@ GeometryGraph::createEdgeSetIntersector()
 }
 
 /*public*/
-vector<Node*>*
+std::vector<Node*>*
 GeometryGraph::getBoundaryNodes()
 {
     if(! boundaryNodes.get()) {
-        boundaryNodes.reset(new vector<Node*>());
+        boundaryNodes.reset(new std::vector<Node*>());
         getBoundaryNodes(*(boundaryNodes.get()));
     }
     return boundaryNodes.get();
@@ -132,10 +131,10 @@ GeometryGraph::getBoundaryPoints()
 
     if(! boundaryPoints.get()) {
         // Collection will be destroied by GeometryGraph dtor
-        vector<Node*>* coll = getBoundaryNodes();
+        std::vector<Node*>* coll = getBoundaryNodes();
         boundaryPoints.reset(new CoordinateArraySequence(coll->size()));
-        size_t i = 0;
-        for(vector<Node*>::iterator it = coll->begin(), endIt = coll->end();
+        std::size_t i = 0;
+        for(std::vector<Node*>::iterator it = coll->begin(), endIt = coll->end();
                 it != endIt; ++it) {
             Node* node = *it;
             boundaryPoints->setAt(node->getCoordinate(), i++);
@@ -153,22 +152,22 @@ GeometryGraph::findEdge(const LineString* line) const
 }
 
 void
-GeometryGraph::computeSplitEdges(vector<Edge*>* edgelist)
+GeometryGraph::computeSplitEdges(std::vector<Edge*>* edgelist)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] GeometryGraph::computeSplitEdges() scanning " << edges->size() << " local and " <<
-         edgelist->size() << " provided edges" << endl;
+    std::cerr << "[" << this << "] GeometryGraph::computeSplitEdges() scanning " << edges->size() << " local and " <<
+         edgelist->size() << " provided edges" << std::endl;
 #endif
-    for(vector<Edge*>::iterator i = edges->begin(), endIt = edges->end();
+    for(std::vector<Edge*>::iterator i = edges->begin(), endIt = edges->end();
             i != endIt; ++i) {
         Edge* e = *i;
 #if GEOS_DEBUG
-        cerr << "   " << e->print() << " adding split edges from arg" << endl;
+        std::cerr << "   " << e->print() << " adding split edges from arg" << std::endl;
 #endif
         e->eiList.addSplitEdges(edgelist);
     }
 #if GEOS_DEBUG
-    cerr << "[" << this << "] GeometryGraph::computeSplitEdges() completed " << endl;
+    std::cerr << "[" << this << "] GeometryGraph::computeSplitEdges() completed " << std::endl;
 #endif
 }
 
@@ -206,7 +205,7 @@ GeometryGraph::add(const Geometry* g)
     }
 
     else {
-        string out = typeid(*g).name();
+        std::string out = typeid(*g).name();
         throw util::UnsupportedOperationException("GeometryGraph::add(Geometry *): unknown geometry type: " + out);
     }
 }
@@ -214,7 +213,7 @@ GeometryGraph::add(const Geometry* g)
 void
 GeometryGraph::addCollection(const GeometryCollection* gc)
 {
-    for(size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
         const Geometry* g = gc->getGeometryN(i);
         add(g);
     }
@@ -279,7 +278,7 @@ GeometryGraph::addPolygon(const Polygon* p)
     const LinearRing* lr = p->getExteriorRing();
 
     addPolygonRing(lr, Location::EXTERIOR, Location::INTERIOR);
-    for(size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
         // Holes are topologically labelled opposite to the shell, since
         // the interior of the polygon lies on their opposite side
         // (on the left, if the hole is oriented CW)
@@ -365,15 +364,15 @@ GeometryGraph::computeSelfNodes(LineIntersector& li,
 {
     auto si = detail::make_unique<SegmentIntersector>(&li, true, false);
     si->setIsDoneIfProperInt(isDoneIfProperInt);
-    unique_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
+    std::unique_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
 
-    typedef vector<Edge*> EC;
+    typedef std::vector<Edge*> EC;
     EC* se = edges;
     EC self_edges_copy;
 
     if(env && ! env->covers(parentGeom->getEnvelopeInternal())) {
         collect_intersecting_edges(env, se->begin(), se->end(), self_edges_copy);
-        //cerr << "(computeSelfNodes) Self edges reduced from " << se->size() << " to " << self_edges_copy.size() << endl;
+        //cerr << "(computeSelfNodes) Self edges reduced from " << se->size() << " to " << self_edges_copy.size() << std::endl;
         se = &self_edges_copy;
     }
 
@@ -386,7 +385,7 @@ GeometryGraph::computeSelfNodes(LineIntersector& li,
     esi->computeIntersections(se, si.get(), computeAllSegments);
 
 #if GEOS_DEBUG
-    cerr << "SegmentIntersector # tests = " << si->numTests << endl;
+    std::cerr << "SegmentIntersector # tests = " << si->numTests << std::endl;
 #endif // GEOS_DEBUG
 
     addSelfIntersectionNodes(argIndex);
@@ -398,14 +397,14 @@ GeometryGraph::computeEdgeIntersections(GeometryGraph* g,
                                         LineIntersector* li, bool includeProper, const Envelope* env)
 {
 #if GEOS_DEBUG
-    cerr << "GeometryGraph::computeEdgeIntersections call" << endl;
+    std::cerr << "GeometryGraph::computeEdgeIntersections call" << std::endl;
 #endif
-    unique_ptr<SegmentIntersector> si(new SegmentIntersector(li, includeProper, true));
+    std::unique_ptr<SegmentIntersector> si(new SegmentIntersector(li, includeProper, true));
 
     si->setBoundaryNodes(getBoundaryNodes(), g->getBoundaryNodes());
-    unique_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
+    std::unique_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
 
-    typedef vector<Edge*> EC;
+    typedef std::vector<Edge*> EC;
 
     EC self_edges_copy;
     EC other_edges_copy;
@@ -414,17 +413,17 @@ GeometryGraph::computeEdgeIntersections(GeometryGraph* g,
     EC* oe = g->edges;
     if(env && ! env->covers(parentGeom->getEnvelopeInternal())) {
         collect_intersecting_edges(env, se->begin(), se->end(), self_edges_copy);
-        //cerr << "Self edges reduced from " << se->size() << " to " << self_edges_copy.size() << endl;
+        //cerr << "Self edges reduced from " << se->size() << " to " << self_edges_copy.size() << std::endl;
         se = &self_edges_copy;
     }
     if(env && ! env->covers(g->parentGeom->getEnvelopeInternal())) {
         collect_intersecting_edges(env, oe->begin(), oe->end(), other_edges_copy);
-        //cerr << "Other edges reduced from " << oe->size() << " to " << other_edges_copy.size() << endl;
+        //cerr << "Other edges reduced from " << oe->size() << " to " << other_edges_copy.size() << std::endl;
         oe = &other_edges_copy;
     }
     esi->computeIntersections(se, oe, si.get());
 #if GEOS_DEBUG
-    cerr << "GeometryGraph::computeEdgeIntersections returns" << endl;
+    std::cerr << "GeometryGraph::computeEdgeIntersections returns" << std::endl;
 #endif
     return si;
 }
@@ -434,7 +433,7 @@ GeometryGraph::insertPoint(int p_argIndex, const Coordinate& coord,
                            geom::Location onLocation)
 {
 #if GEOS_DEBUG > 1
-    cerr << "GeometryGraph::insertPoint(" << coord.toString() << " called" << endl;
+    std::cerr << "GeometryGraph::insertPoint(" << coord.toString() << " called" << std::endl;
 #endif
     Node* n = nodes->addNode(coord);
     Label& lbl = n->getLabel();
@@ -478,7 +477,7 @@ GeometryGraph::insertBoundaryPoint(int p_argIndex, const Coordinate& coord)
 void
 GeometryGraph::addSelfIntersectionNodes(int p_argIndex)
 {
-    for(vector<Edge*>::iterator i = edges->begin(), endIt = edges->end();
+    for(std::vector<Edge*>::iterator i = edges->begin(), endIt = edges->end();
             i != endIt; ++i) {
         Edge* e = *i;
         Location eLoc = e->getLabel().getLocation(p_argIndex);
@@ -507,7 +506,7 @@ GeometryGraph::addSelfIntersectionNode(int p_argIndex,
     }
 }
 
-vector<Edge*>*
+std::vector<Edge*>*
 GeometryGraph::getEdges()
 {
     return edges;
diff --git a/src/geomgraph/Node.cpp b/src/geomgraph/Node.cpp
index 7b28f8a..bafa21a 100644
--- a/src/geomgraph/Node.cpp
+++ b/src/geomgraph/Node.cpp
@@ -41,7 +41,6 @@
 #define COMPUTE_Z 1
 #endif
 
-using namespace std;
 using namespace geos::geom;
 
 namespace geos {
@@ -56,7 +55,7 @@ Node::Node(const Coordinate& newCoord, EdgeEndStar* newEdges)
 
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] Node::Node(" << newCoord.toString() << ")" << endl;
+    std::cerr << "[" << this << "] Node::Node(" << newCoord.toString() << ")" << std::endl;
 #endif
 
 #if COMPUTE_Z
@@ -79,7 +78,7 @@ Node::~Node()
 {
     testInvariant();
 #if GEOS_DEBUG
-    cerr << "[" << this << "] Node::~Node()" << endl;
+    std::cerr << "[" << this << "] Node::~Node()" << std::endl;
 #endif
     delete edges;
 }
@@ -137,7 +136,7 @@ Node::add(EdgeEnd* e)
 {
     assert(e);
 #if GEOS_DEBUG
-    cerr << "[" << this << "] Node::add(" << e->print() << ")" << endl;
+    std::cerr << "[" << this << "] Node::add(" << e->print() << ")" << std::endl;
 #endif
     // Assert: start pt of e is equal to node point
     if(! e->getCoordinate().equals2D(coord)) {
@@ -240,12 +239,12 @@ Node::computeMergedLocation(const Label& label2, int eltIndex)
 }
 
 /*public*/
-string
+std::string
 Node::print()
 {
     testInvariant();
 
-    ostringstream ss;
+    std::ostringstream ss;
     ss << *this;
     return ss.str();
 }
@@ -255,17 +254,17 @@ void
 Node::addZ(double z)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] Node::addZ(" << z << ")";
+    std::cerr << "[" << this << "] Node::addZ(" << z << ")";
 #endif
     if(std::isnan(z)) {
 #if GEOS_DEBUG
-        cerr << " skipped" << endl;
+        std::cerr << " skipped" << std::endl;
 #endif
         return;
     }
     if(find(zvals.begin(), zvals.end(), z) != zvals.end()) {
 #if GEOS_DEBUG
-        cerr << " already stored" << endl;
+        std::cerr << " already stored" << std::endl;
 #endif
         return;
     }
@@ -273,12 +272,12 @@ Node::addZ(double z)
     ztot += z;
     coord.z = ztot / static_cast<double>(zvals.size());
 #if GEOS_DEBUG
-    cerr << " added " << z << ": [" << ztot << "/" << zvals.size() << "=" << coord.z << "]" << endl;
+    std::cerr << " added " << z << ": [" << ztot << "/" << zvals.size() << "=" << coord.z << "]" << std::endl;
 #endif
 }
 
 /*public*/
-const vector<double>&
+const std::vector<double>&
 Node::getZ() const
 {
     return zvals;
diff --git a/src/geomgraph/NodeMap.cpp b/src/geomgraph/NodeMap.cpp
index 6a6800c..56548ae 100644
--- a/src/geomgraph/NodeMap.cpp
+++ b/src/geomgraph/NodeMap.cpp
@@ -32,7 +32,6 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
 using namespace geos::geom;
 
 namespace geos {
@@ -43,7 +42,7 @@ NodeMap::NodeMap(const NodeFactory& newNodeFact)
     nodeFact(newNodeFact)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] NodeMap::NodeMap" << endl;
+    std::cerr << "[" << this << "] NodeMap::NodeMap" << std::endl;
 #endif
 }
 
@@ -58,12 +57,12 @@ Node*
 NodeMap::addNode(const Coordinate& coord)
 {
 #if GEOS_DEBUG
-    cerr << "[" << this << "] NodeMap::addNode(" << coord.toString() << ")";
+    std::cerr << "[" << this << "] NodeMap::addNode(" << coord.toString() << ")";
 #endif
     Node* node = find(coord);
     if(node == nullptr) {
 #if GEOS_DEBUG
-        cerr << " is new" << endl;
+        std::cerr << " is new" << std::endl;
 #endif
         node = nodeFact.createNode(coord);
         Coordinate* c = const_cast<Coordinate*>(
@@ -73,7 +72,7 @@ NodeMap::addNode(const Coordinate& coord)
     }
     else {
 #if GEOS_DEBUG
-        cerr << " already found (" << node->getCoordinate().toString() << ") - adding Z" << endl;
+        std::cerr << " already found (" << node->getCoordinate().toString() << ") - adding Z" << std::endl;
 #endif
         node->addZ(coord.z);
     }
@@ -88,21 +87,21 @@ NodeMap::addNode(Node* n)
     assert(n);
 
 #if GEOS_DEBUG
-    cerr << "[" << this << "] NodeMap::addNode(" << n->print() << ")";
+    std::cerr << "[" << this << "] NodeMap::addNode(" << n->print() << ")";
 #endif
     Coordinate* c = const_cast<Coordinate*>(&n->getCoordinate());
     Node* node = find(*c);
     if(node == nullptr) {
 #if GEOS_DEBUG
-        cerr << " is new" << endl;
+        std::cerr << " is new" << std::endl;
 #endif
         nodeMap[c] = n;
         return n;
     }
 #if GEOS_DEBUG
     else {
-        cerr << " found already, merging label" << endl;
-        const vector<double>& zvals = n->getZ();
+        std::cerr << " found already, merging label" << std::endl;
+        const std::vector<double>& zvals = n->getZ();
         for(unsigned int i = 0; i < zvals.size(); i++) {
             node->addZ(zvals[i]);
         }
@@ -140,7 +139,7 @@ NodeMap::find(const Coordinate& coord) const
 }
 
 void
-NodeMap::getBoundaryNodes(int geomIndex, vector<Node*>& bdyNodes) const
+NodeMap::getBoundaryNodes(int geomIndex, std::vector<Node*>& bdyNodes) const
 {
     for(auto& it: nodeMap) {
         Node* node = it.second;
@@ -150,10 +149,10 @@ NodeMap::getBoundaryNodes(int geomIndex, vector<Node*>& bdyNodes) const
     }
 }
 
-string
+std::string
 NodeMap::print() const
 {
-    string out = "";
+    std::string out = "";
     for(auto& it: nodeMap) {
         Node* node = it.second;
         out += node->print();
diff --git a/src/geomgraph/PlanarGraph.cpp b/src/geomgraph/PlanarGraph.cpp
index 5cc06c6..d344147 100644
--- a/src/geomgraph/PlanarGraph.cpp
+++ b/src/geomgraph/PlanarGraph.cpp
@@ -44,7 +44,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geom;
 
@@ -54,18 +54,18 @@ namespace geomgraph { // geos.geomgraph
 /*public*/
 PlanarGraph::PlanarGraph(const NodeFactory& nodeFact)
     :
-    edges(new vector<Edge*>()),
+    edges(new std::vector<Edge*>()),
     nodes(new NodeMap(nodeFact)),
-    edgeEndList(new vector<EdgeEnd*>())
+    edgeEndList(new std::vector<EdgeEnd*>())
 {
 }
 
 /*public*/
 PlanarGraph::PlanarGraph()
     :
-    edges(new vector<Edge*>()),
+    edges(new std::vector<Edge*>()),
     nodes(new NodeMap(NodeFactory::instance())),
-    edgeEndList(new vector<EdgeEnd*>())
+    edgeEndList(new std::vector<EdgeEnd*>())
 {
 }
 
@@ -78,20 +78,20 @@ PlanarGraph::~PlanarGraph()
 
     delete nodes;
 #if 1 // FIXME: PlanarGraph should *not* own edges!
-    for(size_t i = 0, n = edges->size(); i < n; i++) {
+    for(std::size_t i = 0, n = edges->size(); i < n; i++) {
         delete(*edges)[i];
     }
 #endif
     delete edges;
 
-    for(size_t i = 0, n = edgeEndList->size(); i < n; i++) {
+    for(std::size_t i = 0, n = edgeEndList->size(); i < n; i++) {
         delete(*edgeEndList)[i];
     }
     delete edgeEndList;
 }
 
 /*public*/
-vector<Edge*>::iterator
+std::vector<Edge*>::iterator
 PlanarGraph::getEdgeIterator()
 {
     assert(edges);
@@ -99,7 +99,7 @@ PlanarGraph::getEdgeIterator()
 }
 
 /*public*/
-vector<EdgeEnd*>*
+std::vector<EdgeEnd*>*
 PlanarGraph::getEdgeEnds()
 {
     return edgeEndList;
@@ -157,7 +157,7 @@ PlanarGraph::getNodeIterator()
 
 /*public*/
 void
-PlanarGraph::getNodes(vector<Node*>& values)
+PlanarGraph::getNodes(std::vector<Node*>& values)
 {
     assert(nodes);
     NodeMap::iterator it = nodes->nodeMap.begin();
@@ -176,8 +176,8 @@ PlanarGraph::addNode(Node* node)
 {
     assert(nodes);
 #if GEOS_DEBUG > 1
-    cerr << "PlanarGraph::addNode(Node * " << *node
-         << ")" << endl;
+    std::cerr << "PlanarGraph::addNode(Node * " << *node
+         << ")" << std::endl;
 #endif
     return nodes->addNode(node);
 }
@@ -187,8 +187,8 @@ Node*
 PlanarGraph::addNode(const Coordinate& coord)
 {
 #if GEOS_DEBUG > 1
-    cerr << "PlanarGraph::addNode(Coordinate& "
-         << coord << ")" << endl;
+    std::cerr << "PlanarGraph::addNode(Coordinate& "
+         << coord << ")" << std::endl;
 #endif
     return nodes->addNode(coord);
 }
@@ -203,10 +203,10 @@ PlanarGraph::find(Coordinate& coord)
 
 /*public*/
 void
-PlanarGraph::addEdges(const vector<Edge*>& edgesToAdd)
+PlanarGraph::addEdges(const std::vector<Edge*>& edgesToAdd)
 {
     // create all the nodes for the edges
-    for(vector<Edge*>::const_iterator it = edgesToAdd.begin(),
+    for(std::vector<Edge*>::const_iterator it = edgesToAdd.begin(),
             endIt = edgesToAdd.end(); it != endIt; ++it) {
         Edge* e = *it;
         assert(e);
@@ -231,7 +231,7 @@ void
 PlanarGraph::linkResultDirectedEdges()
 {
 #if GEOS_DEBUG
-    cerr << "PlanarGraph::linkResultDirectedEdges called" << endl;
+    std::cerr << "PlanarGraph::linkResultDirectedEdges called" << std::endl;
 #endif
     for(auto& nodeIt: nodes->nodeMap) {
         Node* node = nodeIt.second;
@@ -255,7 +255,7 @@ void
 PlanarGraph::linkAllDirectedEdges()
 {
 #if GEOS_DEBUG
-    cerr << "PlanarGraph::linkAllDirectedEdges called" << endl;
+    std::cerr << "PlanarGraph::linkAllDirectedEdges called" << std::endl;
 #endif
     for(auto& nodeIt: nodes->nodeMap) {
         Node* node = nodeIt.second;
@@ -275,10 +275,10 @@ PlanarGraph::linkAllDirectedEdges()
 EdgeEnd*
 PlanarGraph::findEdgeEnd(Edge* e)
 {
-    vector<EdgeEnd*>* eev = getEdgeEnds();
+    std::vector<EdgeEnd*>* eev = getEdgeEnds();
     assert(eev);
 
-    for(vector<EdgeEnd*>::iterator i = eev->begin(), iEnd = eev->end();
+    for(std::vector<EdgeEnd*>::iterator i = eev->begin(), iEnd = eev->end();
             i != iEnd;
             ++i) {
         EdgeEnd* ee = *i;
@@ -296,7 +296,7 @@ PlanarGraph::findEdgeEnd(Edge* e)
 Edge*
 PlanarGraph::findEdge(const Coordinate& p0, const Coordinate& p1)
 {
-    for(size_t i = 0, n = edges->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edges->size(); i < n; ++i) {
         Edge* e = (*edges)[i];
         assert(e);
 
@@ -327,7 +327,7 @@ PlanarGraph::findEdgeInSameDirection(const Coordinate& p0,
 
         assert(eCoord);
 
-        size_t nCoords = eCoord->size();
+        std::size_t nCoords = eCoord->size();
         assert(nCoords > 1);
 
         if(matchInSameDirection(p0, p1,
@@ -362,13 +362,13 @@ PlanarGraph::matchInSameDirection(const Coordinate& p0, const Coordinate& p1,
     return false;
 }
 
-string
+std::string
 PlanarGraph::printEdges()
 {
 
     std::ostringstream oss;
     oss << "Edges: ";
-    for(size_t i = 0, n = edges->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edges->size(); i < n; ++i) {
         Edge* e = (*edges)[i];
         oss << "edge " << i << ":\n" << e->print() << e->eiList.print();
     }
diff --git a/src/geomgraph/TopologyLocation.cpp b/src/geomgraph/TopologyLocation.cpp
index 67f8414..dab70fa 100644
--- a/src/geomgraph/TopologyLocation.cpp
+++ b/src/geomgraph/TopologyLocation.cpp
@@ -40,14 +40,14 @@ void
 TopologyLocation::merge(const TopologyLocation& gl)
 {
     // if the src is an Area label & and the dest is not, increase the dest to be an Area
-    size_t sz = locationSize;
-    size_t glsz = gl.locationSize;
+    std::size_t sz = locationSize;
+    std::size_t glsz = gl.locationSize;
     if(glsz > sz) {
         locationSize = 3;
         location[Position::LEFT] = Location::NONE;
         location[Position::RIGHT] = Location::NONE;
     }
-    for(size_t i = 0; i < locationSize; ++i) {
+    for(std::size_t i = 0; i < locationSize; ++i) {
         if(location[i] == Location::NONE && i < glsz) {
             location[i] = gl.location[i];
         }
diff --git a/src/geomgraph/index/MonotoneChainEdge.cpp b/src/geomgraph/index/MonotoneChainEdge.cpp
index cd57ac6..7c1a4d4 100644
--- a/src/geomgraph/index/MonotoneChainEdge.cpp
+++ b/src/geomgraph/index/MonotoneChainEdge.cpp
@@ -23,7 +23,7 @@
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -65,14 +65,14 @@ MonotoneChainEdge::getCoordinates()
     return pts;
 }
 
-vector<size_t>&
+std::vector<size_t>&
 MonotoneChainEdge::getStartIndexes()
 {
     return startIndex;
 }
 
 double
-MonotoneChainEdge::getMinX(size_t chainIndex)
+MonotoneChainEdge::getMinX(std::size_t chainIndex)
 {
     double x1 = pts->getAt(startIndex[chainIndex]).x;
     double x2 = pts->getAt(startIndex[chainIndex + 1]).x;
@@ -80,7 +80,7 @@ MonotoneChainEdge::getMinX(size_t chainIndex)
 }
 
 double
-MonotoneChainEdge::getMaxX(size_t chainIndex)
+MonotoneChainEdge::getMaxX(std::size_t chainIndex)
 {
     double x1 = pts->getAt(startIndex[chainIndex]).x;
     double x2 = pts->getAt(startIndex[chainIndex + 1]).x;
@@ -91,18 +91,18 @@ void
 MonotoneChainEdge::computeIntersects(const MonotoneChainEdge& mce,
                                      SegmentIntersector& si)
 {
-    size_t I = startIndex.size() - 1;
-    size_t J = mce.startIndex.size() - 1;
-    for(size_t i = 0; i < I; ++i) {
-        for(size_t j = 0; j < J; ++j) {
+    std::size_t I = startIndex.size() - 1;
+    std::size_t J = mce.startIndex.size() - 1;
+    for(std::size_t i = 0; i < I; ++i) {
+        for(std::size_t j = 0; j < J; ++j) {
             computeIntersectsForChain(i, mce, j, si);
         }
     }
 }
 
 void
-MonotoneChainEdge::computeIntersectsForChain(size_t chainIndex0,
-        const MonotoneChainEdge& mce, size_t chainIndex1,
+MonotoneChainEdge::computeIntersectsForChain(std::size_t chainIndex0,
+        const MonotoneChainEdge& mce, std::size_t chainIndex1,
         SegmentIntersector& si)
 {
     computeIntersectsForChain(startIndex[chainIndex0],
@@ -113,8 +113,8 @@ MonotoneChainEdge::computeIntersectsForChain(size_t chainIndex0,
 }
 
 void
-MonotoneChainEdge::computeIntersectsForChain(size_t start0, size_t end0,
-        const MonotoneChainEdge& mce, size_t start1, size_t end1,
+MonotoneChainEdge::computeIntersectsForChain(std::size_t start0, std::size_t end0,
+        const MonotoneChainEdge& mce, std::size_t start1, std::size_t end1,
         SegmentIntersector& ei)
 {
     // terminating condition for the recursion
@@ -128,8 +128,8 @@ MonotoneChainEdge::computeIntersectsForChain(size_t start0, size_t end0,
     }
     // the chains overlap, so split each in half and iterate
     // (binary search)
-    size_t mid0 = (start0 + end0) / 2;
-    size_t mid1 = (start1 + end1) / 2;
+    std::size_t mid0 = (start0 + end0) / 2;
+    std::size_t mid1 = (start1 + end1) / 2;
 
     // Assert: mid != start or end
     // (since we checked above for end - start <= 1)
@@ -153,7 +153,7 @@ MonotoneChainEdge::computeIntersectsForChain(size_t start0, size_t end0,
 }
 
 bool
-MonotoneChainEdge::overlaps(size_t start0, size_t end0, const MonotoneChainEdge& mce, size_t start1, size_t end1)
+MonotoneChainEdge::overlaps(std::size_t start0, std::size_t end0, const MonotoneChainEdge& mce, std::size_t start1, std::size_t end1)
 {
     return Envelope::intersects(pts->getAt(start0), pts->getAt(end0),
                                 mce.pts->getAt(start1), mce.pts->getAt(end1));
diff --git a/src/geomgraph/index/MonotoneChainIndexer.cpp b/src/geomgraph/index/MonotoneChainIndexer.cpp
index 537df86..d627d93 100644
--- a/src/geomgraph/index/MonotoneChainIndexer.cpp
+++ b/src/geomgraph/index/MonotoneChainIndexer.cpp
@@ -20,7 +20,7 @@
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/Quadrant.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -29,12 +29,12 @@ namespace index { // geos.geomgraph.index
 
 void
 MonotoneChainIndexer::getChainStartIndices(const CoordinateSequence* pts,
-        vector<size_t>& startIndexList)
+        std::vector<size_t>& startIndexList)
 {
     // find the startpoint (and endpoints) of all monotone chains
     // in this edge
-    size_t start = 0;
-    //vector<int>* startIndexList=new vector<int>();
+    std::size_t start = 0;
+    //vector<int>* startIndexList=new std::vector<int>();
     startIndexList.push_back(start);
     do {
         auto last = findChainEnd(pts, start);
@@ -50,7 +50,7 @@ MonotoneChainIndexer::getChainStartIndices(const CoordinateSequence* pts,
  * @return the index of the last point in the monotone chain
  */
 size_t
-MonotoneChainIndexer::findChainEnd(const CoordinateSequence* pts, size_t start)
+MonotoneChainIndexer::findChainEnd(const CoordinateSequence* pts, std::size_t start)
 {
     // determine quadrant for chain
     auto chainQuad = Quadrant::quadrant(pts->getAt(start), pts->getAt(start + 1));
diff --git a/src/geomgraph/index/SegmentIntersector.cpp b/src/geomgraph/index/SegmentIntersector.cpp
index 88b4f39..b029751 100644
--- a/src/geomgraph/index/SegmentIntersector.cpp
+++ b/src/geomgraph/index/SegmentIntersector.cpp
@@ -57,8 +57,8 @@ using namespace geos::algorithm;
  */
 bool
 SegmentIntersector::isTrivialIntersection(Edge* e0,
-        size_t segIndex0, Edge* e1,
-        size_t segIndex1)
+        std::size_t segIndex0, Edge* e1,
+        std::size_t segIndex1)
 {
 //	if (e0->equals(e1))
     if(e0 == e1) {
@@ -85,11 +85,11 @@ SegmentIntersector::isTrivialIntersection(Edge* e0,
  * certain pairs of segments for efficiency reasons.
  */
 void
-SegmentIntersector::addIntersections(Edge* e0, size_t segIndex0, Edge* e1, size_t segIndex1)
+SegmentIntersector::addIntersections(Edge* e0, std::size_t segIndex0, Edge* e1, std::size_t segIndex1)
 {
 
 #if GEOS_DEBUG
-    cerr << "SegmentIntersector::addIntersections() called" << endl;
+    std::cerr << "SegmentIntersector::addIntersections() called" << std::endl;
 #endif
 
 //	if (e0->equals(e1) && segIndex0==segIndex1) return;
@@ -123,7 +123,7 @@ SegmentIntersector::addIntersections(Edge* e0, size_t segIndex0, Edge* e1, size_
         // only intersection.
         if(!isTrivialIntersection(e0, segIndex0, e1, segIndex1)) {
 #if GEOS_DEBUG
-            cerr << "SegmentIntersector::addIntersections(): has !TrivialIntersection" << endl;
+            std::cerr << "SegmentIntersector::addIntersections(): has !TrivialIntersection" << std::endl;
 #endif // DEBUG_INTERSECT
             hasIntersectionVar = true;
             if(includeProper || !li->isProper()) {
@@ -131,14 +131,14 @@ SegmentIntersector::addIntersections(Edge* e0, size_t segIndex0, Edge* e1, size_
                 e0->addIntersections(li, segIndex0, 0);
                 e1->addIntersections(li, segIndex1, 1);
 #if GEOS_DEBUG
-                cerr << "SegmentIntersector::addIntersections(): includeProper || !li->isProper()" << endl;
+                std::cerr << "SegmentIntersector::addIntersections(): includeProper || !li->isProper()" << std::endl;
 #endif // DEBUG_INTERSECT
             }
             if(li->isProper()) {
                 properIntersectionPoint = li->getIntersection(0);
 #if GEOS_DEBUG
-                cerr << "SegmentIntersector::addIntersections(): properIntersectionPoint: " << properIntersectionPoint.toString() <<
-                     endl;
+                std::cerr << "SegmentIntersector::addIntersections(): properIntersectionPoint: " << properIntersectionPoint.toString() <<
+                     std::endl;
 #endif // DEBUG_INTERSECT
                 hasProper = true;
                 if(isDoneWhenProperInt) {
diff --git a/src/geomgraph/index/SimpleEdgeSetIntersector.cpp b/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
index f87a56c..30f22cd 100644
--- a/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
+++ b/src/geomgraph/index/SimpleEdgeSetIntersector.cpp
@@ -20,7 +20,7 @@
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geomgraph/Edge.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -33,14 +33,14 @@ SimpleEdgeSetIntersector::SimpleEdgeSetIntersector():
 }
 
 void
-SimpleEdgeSetIntersector::computeIntersections(vector<Edge*>* edges,
+SimpleEdgeSetIntersector::computeIntersections(std::vector<Edge*>* edges,
         SegmentIntersector* si, bool testAllSegments)
 {
     nOverlaps = 0;
-    size_t nedges = edges->size();
-    for(size_t i0 = 0; i0 < nedges; ++i0) {
+    std::size_t nedges = edges->size();
+    for(std::size_t i0 = 0; i0 < nedges; ++i0) {
         Edge* edge0 = (*edges)[i0];
-        for(size_t i1 = 0; i1 < nedges; ++i1) {
+        for(std::size_t i1 = 0; i1 < nedges; ++i1) {
             Edge* edge1 = (*edges)[i1];
             if(testAllSegments || edge0 != edge1) {
                 computeIntersects(edge0, edge1, si);
@@ -51,17 +51,17 @@ SimpleEdgeSetIntersector::computeIntersections(vector<Edge*>* edges,
 
 
 void
-SimpleEdgeSetIntersector::computeIntersections(vector<Edge*>* edges0,
-        vector<Edge*>* edges1, SegmentIntersector* si)
+SimpleEdgeSetIntersector::computeIntersections(std::vector<Edge*>* edges0,
+        std::vector<Edge*>* edges1, SegmentIntersector* si)
 {
     nOverlaps = 0;
 
-    size_t nedges0 = edges0->size();
-    size_t nedges1 = edges1->size();
+    std::size_t nedges0 = edges0->size();
+    std::size_t nedges1 = edges1->size();
 
-    for(size_t i0 = 0; i0 < nedges0; ++i0) {
+    for(std::size_t i0 = 0; i0 < nedges0; ++i0) {
         Edge* edge0 = (*edges0)[i0];
-        for(size_t i1 = 0; i1 < nedges1; ++i1) {
+        for(std::size_t i1 = 0; i1 < nedges1; ++i1) {
             Edge* edge1 = (*edges1)[i1];
             computeIntersects(edge0, edge1, si);
         }
@@ -83,8 +83,8 @@ SimpleEdgeSetIntersector::computeIntersects(Edge* e0, Edge* e1,
     auto npts0 = pts0->size();
     auto npts1 = pts1->size();
 
-    for(size_t i0 = 0; i0 < npts0 - 1; ++i0) {
-        for(size_t i1 = 0; i1 < npts1 - 1; ++i1) {
+    for(std::size_t i0 = 0; i0 < npts0 - 1; ++i0) {
+        for(std::size_t i1 = 0; i1 < npts1 - 1; ++i1) {
             si->addIntersections(e0, i0, e1, i1);
         }
     }
diff --git a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
index f5749c9..e02f4d4 100644
--- a/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp
@@ -52,7 +52,7 @@ SimpleMCSweepLineIntersector::computeIntersections(std::vector<Edge*>* edges0,
 void
 SimpleMCSweepLineIntersector::add(std::vector<Edge*>* edges)
 {
-    for(size_t i = 0; i < edges->size(); ++i) {
+    for(std::size_t i = 0; i < edges->size(); ++i) {
         Edge* edge = (*edges)[i];
         // edge is its own group
         add(edge, edge);
@@ -62,7 +62,7 @@ SimpleMCSweepLineIntersector::add(std::vector<Edge*>* edges)
 void
 SimpleMCSweepLineIntersector::add(std::vector<Edge*>* edges, void* edgeSet)
 {
-    for(size_t i = 0; i < edges->size(); ++i) {
+    for(std::size_t i = 0; i < edges->size(); ++i) {
         Edge* edge = (*edges)[i];
         add(edge, edgeSet);
     }
@@ -73,9 +73,9 @@ SimpleMCSweepLineIntersector::add(Edge* edge, void* edgeSet)
 {
     MonotoneChainEdge* mce = edge->getMonotoneChainEdge();
     auto& startIndex = mce->getStartIndexes();
-    size_t n = startIndex.size() - 1;
+    std::size_t n = startIndex.size() - 1;
 
-    for(size_t i = 0; i < n; ++i) {
+    for(std::size_t i = 0; i < n; ++i) {
         GEOS_CHECK_FOR_INTERRUPTS();
         chains.emplace_back(mce, i);
         MonotoneChain* mc = &chains.back();
@@ -102,7 +102,7 @@ SimpleMCSweepLineIntersector::prepareEvents()
     }
 
     sort(events.begin(), events.end(), SweepLineEventLessThen());
-    for(size_t i = 0; i < events.size(); ++i) {
+    for(std::size_t i = 0; i < events.size(); ++i) {
         GEOS_CHECK_FOR_INTERRUPTS();
         auto& ev = events[i];
         if(ev->isDelete()) {
@@ -116,7 +116,7 @@ SimpleMCSweepLineIntersector::computeIntersections(SegmentIntersector* si)
 {
     nOverlaps = 0;
     prepareEvents();
-    for(size_t i = 0; i < events.size(); ++i) {
+    for(std::size_t i = 0; i < events.size(); ++i) {
         GEOS_CHECK_FOR_INTERRUPTS();
         auto& ev = events[i];
         if(ev->isInsert()) {
@@ -129,7 +129,7 @@ SimpleMCSweepLineIntersector::computeIntersections(SegmentIntersector* si)
 }
 
 void
-SimpleMCSweepLineIntersector::processOverlaps(size_t start, size_t end,
+SimpleMCSweepLineIntersector::processOverlaps(std::size_t start, std::size_t end,
         SweepLineEvent* ev0, SegmentIntersector* si)
 {
     MonotoneChain* mc0 = (MonotoneChain*) ev0->getObject();
diff --git a/src/geomgraph/index/SimpleSweepLineIntersector.cpp b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
index a054113..af4d83c 100644
--- a/src/geomgraph/index/SimpleSweepLineIntersector.cpp
+++ b/src/geomgraph/index/SimpleSweepLineIntersector.cpp
@@ -22,7 +22,7 @@
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geomgraph/Edge.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -30,7 +30,7 @@ namespace geomgraph { // geos.geomgraph
 namespace index { // geos.geomgraph.index
 
 SimpleSweepLineIntersector::SimpleSweepLineIntersector():
-    //events(new vector<SweepLineEvent*>()),
+    //events(new std::vector<SweepLineEvent*>()),
     nOverlaps(0)
 {
 }
@@ -43,7 +43,7 @@ SimpleSweepLineIntersector::~SimpleSweepLineIntersector()
 }
 
 void
-SimpleSweepLineIntersector::computeIntersections(vector<Edge*>* edges,
+SimpleSweepLineIntersector::computeIntersections(std::vector<Edge*>* edges,
         SegmentIntersector* si, bool testAllSegments)
 {
     if(testAllSegments) {
@@ -56,7 +56,7 @@ SimpleSweepLineIntersector::computeIntersections(vector<Edge*>* edges,
 }
 
 void
-SimpleSweepLineIntersector::computeIntersections(vector<Edge*>* edges0, vector<Edge*>* edges1, SegmentIntersector* si)
+SimpleSweepLineIntersector::computeIntersections(std::vector<Edge*>* edges0, std::vector<Edge*>* edges1, SegmentIntersector* si)
 {
     add(edges0, edges0);
     add(edges1, edges1);
@@ -64,7 +64,7 @@ SimpleSweepLineIntersector::computeIntersections(vector<Edge*>* edges0, vector<E
 }
 
 void
-SimpleSweepLineIntersector::add(vector<Edge*>* edges)
+SimpleSweepLineIntersector::add(std::vector<Edge*>* edges)
 {
     for(unsigned int i = 0; i < edges->size(); ++i) {
         Edge* edge = (*edges)[i];
@@ -74,7 +74,7 @@ SimpleSweepLineIntersector::add(vector<Edge*>* edges)
 }
 
 void
-SimpleSweepLineIntersector::add(vector<Edge*>* edges, void* edgeSet)
+SimpleSweepLineIntersector::add(std::vector<Edge*>* edges, void* edgeSet)
 {
     for(unsigned int i = 0; i < edges->size(); ++i) {
         Edge* edge = (*edges)[i];
@@ -126,7 +126,7 @@ SimpleSweepLineIntersector::computeIntersections(SegmentIntersector* si)
 }
 
 void
-SimpleSweepLineIntersector::processOverlaps(size_t start, size_t end, SweepLineEvent* ev0,
+SimpleSweepLineIntersector::processOverlaps(std::size_t start, std::size_t end, SweepLineEvent* ev0,
         SegmentIntersector* si)
 {
 
diff --git a/src/geomgraph/index/SweepLineSegment.cpp b/src/geomgraph/index/SweepLineSegment.cpp
index 6e662e1..15a0b17 100644
--- a/src/geomgraph/index/SweepLineSegment.cpp
+++ b/src/geomgraph/index/SweepLineSegment.cpp
@@ -25,7 +25,7 @@ namespace geos {
 namespace geomgraph { // geos.geomgraph
 namespace index { // geos.geomgraph.index
 
-SweepLineSegment::SweepLineSegment(Edge* newEdge, size_t newPtIndex):
+SweepLineSegment::SweepLineSegment(Edge* newEdge, std::size_t newPtIndex):
     edge(newEdge),
     pts(newEdge->getCoordinates()),
     ptIndex(newPtIndex)
diff --git a/src/index/bintree/Bintree.cpp b/src/index/bintree/Bintree.cpp
index 2a92ebc..8812733 100644
--- a/src/index/bintree/Bintree.cpp
+++ b/src/index/bintree/Bintree.cpp
@@ -23,7 +23,7 @@ namespace geos {
 namespace index { // geos.index
 namespace bintree { // geos.index.bintree
 
-using namespace std;
+
 
 Interval*
 Bintree::ensureExtent(const Interval* itemInterval, double minExtent)
@@ -116,15 +116,15 @@ Bintree::insert(Interval* itemInterval, void* item)
     */
 }
 
-vector<void*>*
+std::vector<void*>*
 Bintree::iterator()
 {
-    vector<void*>* foundItems = new vector<void*>();
+    std::vector<void*>* foundItems = new std::vector<void*>();
     root->addAllItems(foundItems);
     return foundItems;
 }
 
-vector<void*>*
+std::vector<void*>*
 Bintree::query(double x)
 {
     return query(new Interval(x, x));
@@ -133,20 +133,20 @@ Bintree::query(double x)
 /**
  * min and max may be the same value
  */
-vector<void*>*
+std::vector<void*>*
 Bintree::query(Interval* interval)
 {
     /*
      * the items that are matched are all items in intervals
      * which overlap the query interval
      */
-    vector<void*>* foundItems = new vector<void*>();
+    std::vector<void*>* foundItems = new std::vector<void*>();
     query(interval, foundItems);
     return foundItems;
 }
 
 void
-Bintree::query(Interval* interval, vector<void*>* foundItems)
+Bintree::query(Interval* interval, std::vector<void*>* foundItems)
 {
     root->addAllItemsFromOverlapping(interval, foundItems);
 }
diff --git a/src/index/bintree/NodeBase.cpp b/src/index/bintree/NodeBase.cpp
index d44b9aa..c35296f 100644
--- a/src/index/bintree/NodeBase.cpp
+++ b/src/index/bintree/NodeBase.cpp
@@ -19,7 +19,7 @@
 
 #include <vector>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -44,7 +44,7 @@ NodeBase::getSubnodeIndex(Interval* interval, double centre)
 
 NodeBase::NodeBase()
 {
-    items = new vector<void*>();
+    items = new std::vector<void*>();
     subnode[0] = nullptr;
     subnode[1] = nullptr;
 }
@@ -58,7 +58,7 @@ NodeBase::~NodeBase()
     subnode[1] = nullptr;
 }
 
-vector<void*>*
+std::vector<void*>*
 NodeBase::getItems()
 {
     return items;
@@ -70,8 +70,8 @@ NodeBase::add(void* item)
     items->push_back(item);
 }
 
-vector<void*>*
-NodeBase::addAllItems(vector<void*>* newItems)
+std::vector<void*>*
+NodeBase::addAllItems(std::vector<void*>* newItems)
 {
     items->insert(items->end(), newItems->begin(), newItems->end());
     for(int i = 0; i < 2; i++) {
@@ -82,8 +82,8 @@ NodeBase::addAllItems(vector<void*>* newItems)
     return items;
 }
 
-vector<void*>*
-NodeBase::addAllItemsFromOverlapping(Interval* interval, vector<void*>* resultItems)
+std::vector<void*>*
+NodeBase::addAllItemsFromOverlapping(Interval* interval, std::vector<void*>* resultItems)
 {
     if(!isSearchMatch(interval)) {
         return items;
diff --git a/src/index/chain/MonotoneChain.cpp b/src/index/chain/MonotoneChain.cpp
index 961be20..d0e3470 100644
--- a/src/index/chain/MonotoneChain.cpp
+++ b/src/index/chain/MonotoneChain.cpp
@@ -32,7 +32,7 @@ namespace index { // geos.index
 namespace chain { // geos.index.chain
 
 MonotoneChain::MonotoneChain(const geom::CoordinateSequence& newPts,
-                             size_t nstart, size_t nend, void* nContext)
+                             std::size_t nstart, std::size_t nend, void* nContext)
     :
     pts(newPts),
     context(nContext),
@@ -64,7 +64,7 @@ MonotoneChain::getEnvelope(double expansionDistance)
 }
 
 void
-MonotoneChain::getLineSegment(size_t index, LineSegment& ls) const
+MonotoneChain::getLineSegment(std::size_t index, LineSegment& ls) const
 {
     ls.p0 = pts[index];
     ls.p1 = pts[index + 1];
@@ -84,7 +84,7 @@ MonotoneChain::select(const Envelope& searchEnv, MonotoneChainSelectAction& mcs)
 
 void
 MonotoneChain::computeSelect(const Envelope& searchEnv,
-                             size_t start0, size_t end0,
+                             std::size_t start0, std::size_t end0,
                              MonotoneChainSelectAction& mcs)
 {
     const Coordinate& p0 = pts[start0];
@@ -100,7 +100,7 @@ MonotoneChain::computeSelect(const Envelope& searchEnv,
         return;
     }
     // the chains overlap,so split each in half and iterate (binary search)
-    size_t mid = (start0 + end0) / 2;
+    std::size_t mid = (start0 + end0) / 2;
 
     // Assert: mid != start or end (since we checked above for end-start <= 1)
     // check terminating conditions before recursing
@@ -131,9 +131,9 @@ MonotoneChain::computeOverlaps(MonotoneChain* mc, double overlapTolerance,
 
 /*private*/
 void
-MonotoneChain::computeOverlaps(size_t start0, size_t end0,
+MonotoneChain::computeOverlaps(std::size_t start0, std::size_t end0,
                                MonotoneChain& mc,
-                               size_t start1, size_t end1,
+                               std::size_t start1, std::size_t end1,
                                double overlapTolerance,
                                MonotoneChainOverlapAction& mco)
 {
@@ -149,8 +149,8 @@ MonotoneChain::computeOverlaps(size_t start0, size_t end0,
     }
 
     // the chains overlap,so split each in half and iterate (binary search)
-    size_t mid0 = (start0 + end0) / 2;
-    size_t mid1 = (start1 + end1) / 2;
+    std::size_t mid0 = (start0 + end0) / 2;
+    std::size_t mid1 = (start1 + end1) / 2;
 
     // Assert: mid != start or end (since we checked above for
     // end-start <= 1)
@@ -176,8 +176,8 @@ MonotoneChain::computeOverlaps(size_t start0, size_t end0,
 
 /*private*/
 bool
-MonotoneChain::overlaps(size_t start0, size_t end0, const MonotoneChain& mc,
-                        size_t start1, size_t end1, double overlapTolerance) const
+MonotoneChain::overlaps(std::size_t start0, std::size_t end0, const MonotoneChain& mc,
+                        std::size_t start1, std::size_t end1, double overlapTolerance) const
 {
     if (overlapTolerance > 0.0) {
         return overlaps(pts[start0], pts[end0], mc.pts[start1], mc.pts[end1], overlapTolerance);
diff --git a/src/index/chain/MonotoneChainBuilder.cpp b/src/index/chain/MonotoneChainBuilder.cpp
index 36ef8e4..a87fa74 100644
--- a/src/index/chain/MonotoneChainBuilder.cpp
+++ b/src/index/chain/MonotoneChainBuilder.cpp
@@ -33,7 +33,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -45,7 +45,7 @@ std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>>
 MonotoneChainBuilder::getChains(const CoordinateSequence* pts, void* context)
 {
     // TODO clean this up with std::make_unique (C++14)
-    std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>> mcList{new vector<std::unique_ptr<MonotoneChain>>()};
+    std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>> mcList{new std::vector<std::unique_ptr<MonotoneChain>>()};
     getChains(pts, context, *mcList);
     return mcList;
 }
@@ -99,7 +99,7 @@ MonotoneChainBuilder::findChainEnd(const CoordinateSequence& pts, std::size_t st
     const Coordinate* prev; // avoid repeated coordinate access by index (virtual call)
     const Coordinate* curr = &pts[start];
 
-    for(size_t last = start + 1; last < npts; last++) {
+    for(std::size_t last = start + 1; last < npts; last++) {
         prev = curr;
         curr = &pts[last];
 
diff --git a/src/index/chain/MonotoneChainOverlapAction.cpp b/src/index/chain/MonotoneChainOverlapAction.cpp
index 8dd479b..2d73a40 100644
--- a/src/index/chain/MonotoneChainOverlapAction.cpp
+++ b/src/index/chain/MonotoneChainOverlapAction.cpp
@@ -29,8 +29,8 @@ namespace index { // geos.index
 namespace chain { // geos.index.chain
 
 void
-MonotoneChainOverlapAction::overlap(MonotoneChain& mc1, size_t start1,
-                                    MonotoneChain& mc2, size_t start2)
+MonotoneChainOverlapAction::overlap(MonotoneChain& mc1, std::size_t start1,
+                                    MonotoneChain& mc2, std::size_t start2)
 {
     mc1.getLineSegment(start1, overlapSeg1);
     mc2.getLineSegment(start2, overlapSeg2);
diff --git a/src/index/chain/MonotoneChainSelectAction.cpp b/src/index/chain/MonotoneChainSelectAction.cpp
index 4f4478d..d79ea23 100644
--- a/src/index/chain/MonotoneChainSelectAction.cpp
+++ b/src/index/chain/MonotoneChainSelectAction.cpp
@@ -28,7 +28,7 @@ namespace index { // geos.index
 namespace chain { // geos.index.chain
 
 void
-MonotoneChainSelectAction::select(MonotoneChain& mc, size_t start)
+MonotoneChainSelectAction::select(MonotoneChain& mc, std::size_t start)
 {
     mc.getLineSegment(start, selectedSegment);
 
diff --git a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
index 633069f..fd3a001 100644
--- a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
+++ b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
@@ -85,7 +85,7 @@ SortedPackedIntervalRTree::buildLevel(IntervalRTreeNode::ConstVect& src, Interva
 
     dest.clear();
 
-    for(size_t i = 0, ni = src.size(); i < ni; i += 2) {
+    for(std::size_t i = 0, ni = src.size(); i < ni; i += 2) {
         const IntervalRTreeNode* n1 = src[i];
 
         if(i + 1 < ni) {
diff --git a/src/index/kdtree/KdTree.cpp b/src/index/kdtree/KdTree.cpp
index 1df6e48..f22cba6 100644
--- a/src/index/kdtree/KdTree.cpp
+++ b/src/index/kdtree/KdTree.cpp
@@ -38,8 +38,8 @@ KdTree::toCoordinates(std::vector<KdNode*>& kdnodes, bool includeRepeated)
 {
     std::unique_ptr<std::vector<Coordinate>> coord(new std::vector<Coordinate>);
     for (auto node: kdnodes) {
-        size_t count = includeRepeated ? node->getCount() : 1;
-        for (size_t i = 0; i < count; i++) {
+        std::size_t count = includeRepeated ? node->getCount() : 1;
+        for (std::size_t i = 0; i < count; i++) {
             coord->emplace_back(node->getCoordinate());
         }
     }
diff --git a/src/index/quadtree/IntervalSize.cpp b/src/index/quadtree/IntervalSize.cpp
index 68feb03..bc1defe 100644
--- a/src/index/quadtree/IntervalSize.cpp
+++ b/src/index/quadtree/IntervalSize.cpp
@@ -22,7 +22,7 @@
 #include <algorithm>
 #include <cmath>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -37,7 +37,7 @@ IntervalSize::isZeroWidth(double mn, double mx)
         return true;
     }
 
-    double maxAbs = max(fabs(mn), fabs(mx));
+    double maxAbs = std::max(std::fabs(mn), std::fabs(mx));
     double scaledInterval = width / maxAbs;
     int level;
     frexp(scaledInterval, &level);
diff --git a/src/index/quadtree/Node.cpp b/src/index/quadtree/Node.cpp
index 7cc1ba6..26a908e 100644
--- a/src/index/quadtree/Node.cpp
+++ b/src/index/quadtree/Node.cpp
@@ -34,7 +34,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -63,7 +63,7 @@ Node::createExpanded(std::unique_ptr<Node> node, const Envelope& addEnv)
     }
 
 #if GEOS_DEBUG
-    cerr << "Node::createExpanded computed " << expandEnv.toString() << endl;
+    std::cerr << "Node::createExpanded computed " << expandEnv.toString() << std::endl;
 #endif
 
     std::unique_ptr<Node> largerNode = createNode(expandEnv);
@@ -187,10 +187,10 @@ Node::createSubnode(int index)
     return node;
 }
 
-string
+std::string
 Node::toString() const
 {
-    ostringstream os;
+    std::ostringstream os;
     os << "L" << level << " " << env->toString() << " Ctr[" << centre.toString() << "]";
     os << " " + NodeBase::toString();
     return os.str();
diff --git a/src/index/quadtree/NodeBase.cpp b/src/index/quadtree/NodeBase.cpp
index 937bc67..dbed5b2 100644
--- a/src/index/quadtree/NodeBase.cpp
+++ b/src/index/quadtree/NodeBase.cpp
@@ -36,7 +36,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -64,7 +64,7 @@ NodeBase::getSubnodeIndex(const Envelope* env, const Coordinate& centre)
         }
     }
 #if GEOS_DEBUG
-    cerr << "getSubNodeIndex(" << env->toString() << ", " << centre.toString() << ") returning " << subnodeIndex << endl;
+    std::cerr << "getSubNodeIndex(" << env->toString() << ", " << centre.toString() << ") returning " << subnodeIndex << std::endl;
 #endif
     return subnodeIndex;
 }
@@ -89,7 +89,7 @@ NodeBase::~NodeBase()
     subnodes[3] = nullptr;
 }
 
-vector<void*>&
+std::vector<void*>&
 NodeBase::getItems()
 {
     return items;
@@ -103,8 +103,8 @@ NodeBase::add(void* item)
     //GEOS_DEBUG System.out.print(itemCount);
 }
 
-vector<void*>&
-NodeBase::addAllItems(vector<void*>& resultItems) const
+std::vector<void*>&
+NodeBase::addAllItems(std::vector<void*>& resultItems) const
 {
     // this node may have items as well as subnodes (since items may not
     // be wholly contained in any single subnode
@@ -120,7 +120,7 @@ NodeBase::addAllItems(vector<void*>& resultItems) const
 
 void
 NodeBase::addAllItemsFromOverlapping(const Envelope& searchEnv,
-                                     vector<void*>& resultItems) const
+                                     std::vector<void*>& resultItems) const
 {
     if(!isSearchMatch(searchEnv)) {
         return;
@@ -159,7 +159,7 @@ NodeBase::depth() const
 size_t
 NodeBase::size() const
 {
-    size_t subSize = 0;
+    std::size_t subSize = 0;
     for(const auto& subnode : subnodes) {
         if(subnode != nullptr) {
             subSize += subnode->size();
@@ -171,7 +171,7 @@ NodeBase::size() const
 size_t
 NodeBase::getNodeCount() const
 {
-    size_t subSize = 0;
+    std::size_t subSize = 0;
     for(const auto& subnode : subnodes) {
         if(subnode != nullptr) {
             subSize += subnode->size();
@@ -181,12 +181,12 @@ NodeBase::getNodeCount() const
     return subSize + 1;
 }
 
-string
+std::string
 NodeBase::toString() const
 {
-    ostringstream s;
-    s << "ITEMS:" << items.size() << endl;
-    for(size_t i = 0; i < subnodes.size(); i++) {
+    std::ostringstream s;
+    s << "ITEMS:" << items.size() << std::endl;
+    for(std::size_t i = 0; i < subnodes.size(); i++) {
         s << "subnode[" << i << "] ";
         if(subnodes[i] == nullptr) {
             s << "NULL";
@@ -194,7 +194,7 @@ NodeBase::toString() const
         else {
             s << subnodes[i]->toString();
         }
-        s << endl;
+        s << std::endl;
     }
     return s.str();
 }
diff --git a/src/index/quadtree/Quadtree.cpp b/src/index/quadtree/Quadtree.cpp
index cf82e3e..5c72c04 100644
--- a/src/index/quadtree/Quadtree.cpp
+++ b/src/index/quadtree/Quadtree.cpp
@@ -31,7 +31,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -93,9 +93,9 @@ Quadtree::insert(const Envelope* itemEnv, void* item)
     }
     root.insert(insertEnv, item);
 #if GEOS_DEBUG
-    cerr << "Quadtree::insert(" << itemEnv->toString() << ", " << item << ")" << endl;
-    cerr << "       insertEnv:" << insertEnv->toString() << endl;
-    cerr << "       tree:" << endl << root.toString() << endl;
+    std::cerr << "Quadtree::insert(" << itemEnv->toString() << ", " << item << ")" << std::endl;
+    std::cerr << "       insertEnv:" << insertEnv->toString() << std::endl;
+    std::cerr << "       tree:" << std::endl << root.toString() << std::endl;
 #endif
 }
 
@@ -103,7 +103,7 @@ Quadtree::insert(const Envelope* itemEnv, void* item)
 /*public*/
 void
 Quadtree::query(const Envelope* searchEnv,
-                vector<void*>& foundItems)
+                std::vector<void*>& foundItems)
 {
     /*
      * the items that are matched are the items in quads which
@@ -111,18 +111,18 @@ Quadtree::query(const Envelope* searchEnv,
      */
     root.addAllItemsFromOverlapping(*searchEnv, foundItems);
 #if GEOS_DEBUG
-    cerr << "Quadtree::query returning " << foundItems.size()
+    std::cerr << "Quadtree::query returning " << foundItems.size()
          << " items over " << size()
-         << " items in index (of depth: " << depth() << ")" << endl;
-    cerr << " Root:\n" << root.toString() << endl;
+         << " items in index (of depth: " << depth() << ")" << std::endl;
+    std::cerr << " Root:\n" << root.toString() << std::endl;
 #endif
 }
 
 /*public*/
-vector<void*>*
+std::vector<void*>*
 Quadtree::queryAll()
 {
-    vector<void*>* foundItems = new vector<void*>();
+    std::vector<void*>* foundItems = new std::vector<void*>();
     root.addAllItems(*foundItems);
     return foundItems;
 }
@@ -155,10 +155,10 @@ Quadtree::collectStats(const Envelope& itemEnv)
 }
 
 /*public*/
-string
+std::string
 Quadtree::toString() const
 {
-    string ret = root.toString();
+    std::string ret = root.toString();
     return ret;
 }
 
diff --git a/src/index/strtree/AbstractSTRtree.cpp b/src/index/strtree/AbstractSTRtree.cpp
index 1397b56..24a6ceb 100644
--- a/src/index/strtree/AbstractSTRtree.cpp
+++ b/src/index/strtree/AbstractSTRtree.cpp
@@ -25,7 +25,7 @@
 #include <cstddef>
 #include <cassert>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -114,7 +114,7 @@ AbstractSTRtree::insert(const void* bounds, void* item)
 
 /*protected*/
 void
-AbstractSTRtree::query(const void* searchBounds, vector<void*>& matches)
+AbstractSTRtree::query(const void* searchBounds, std::vector<void*>& matches)
 {
     if(!built) {
         build();
@@ -249,7 +249,7 @@ AbstractSTRtree::removeItem(AbstractNode& node, void* item)
 /*public*/
 void
 AbstractSTRtree::query(const void* searchBounds,
-                       const AbstractNode* node, vector<void*>* matches)
+                       const AbstractNode* node, std::vector<void*>* matches)
 {
     assert(node);
 
diff --git a/src/index/strtree/Interval.cpp b/src/index/strtree/Interval.cpp
index 350bf33..b982d6f 100644
--- a/src/index/strtree/Interval.cpp
+++ b/src/index/strtree/Interval.cpp
@@ -20,7 +20,7 @@
 #include <typeinfo>
 #include <cassert>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -42,8 +42,8 @@ Interval::getCentre()
 Interval*
 Interval::expandToInclude(const Interval* other)
 {
-    imax = max(imax, other->imax);
-    imin = min(imin, other->imin);
+    imax = std::max(imax, other->imax);
+    imin = std::min(imin, other->imin);
     return this;
 }
 
diff --git a/src/index/strtree/SIRtree.cpp b/src/index/strtree/SIRtree.cpp
index ee3e5d0..a5a6c31 100644
--- a/src/index/strtree/SIRtree.cpp
+++ b/src/index/strtree/SIRtree.cpp
@@ -22,7 +22,7 @@
 #include <cassert>
 #include <algorithm>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -74,7 +74,7 @@ SIRtree::SIRtree():
 }
 
 /*public*/
-SIRtree::SIRtree(size_t p_nodeCapacity):
+SIRtree::SIRtree(std::size_t p_nodeCapacity):
     AbstractSTRtree(p_nodeCapacity),
     intersectsOp(new SIRIntersectsOp())
 {
@@ -88,7 +88,7 @@ SIRtree::~SIRtree()
 
 class SIRAbstractNode: public AbstractNode {
 public:
-    SIRAbstractNode(int p_level, size_t capacity)
+    SIRAbstractNode(int p_level, std::size_t capacity)
         :
         AbstractNode(p_level, capacity)
     {}
diff --git a/src/index/strtree/STRtree.cpp b/src/index/strtree/STRtree.cpp
index ce89b64..5a6df0b 100644
--- a/src/index/strtree/STRtree.cpp
+++ b/src/index/strtree/STRtree.cpp
@@ -29,7 +29,7 @@
 #include <limits>
 #include <geos/util/GEOSException.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -38,7 +38,7 @@ namespace strtree { // geos.index.strtree
 
 
 /*public*/
-STRtree::STRtree(size_t p_nodeCapacity): AbstractSTRtree(p_nodeCapacity)
+STRtree::STRtree(std::size_t p_nodeCapacity): AbstractSTRtree(p_nodeCapacity)
 {
 }
 
@@ -57,14 +57,14 @@ STRtree::createParentBoundables(BoundableList* childBoundables, int newLevel)
 
     std::unique_ptr<BoundableList> sortedChildBoundables(sortBoundablesX(childBoundables));
 
-    std::unique_ptr< vector<BoundableList*> > verticalSlicesV(
+    std::unique_ptr< std::vector<BoundableList*> > verticalSlicesV(
         verticalSlices(sortedChildBoundables.get(), (int)ceil(sqrt((double)minLeafCount)))
     );
 
     std::unique_ptr<BoundableList> ret(
         createParentBoundablesFromVerticalSlices(verticalSlicesV.get(), newLevel)
     );
-    for(size_t i = 0, vssize = verticalSlicesV->size(); i < vssize; ++i) {
+    for(std::size_t i = 0, vssize = verticalSlicesV->size(); i < vssize; ++i) {
         BoundableList* inner = (*verticalSlicesV)[i];
         delete inner;
     }
@@ -79,7 +79,7 @@ STRtree::createParentBoundablesFromVerticalSlices(std::vector<BoundableList*>* p
     assert(!p_verticalSlices->empty());
     std::unique_ptr<BoundableList> parentBoundables(new BoundableList());
 
-    for(size_t i = 0, vssize = p_verticalSlices->size(); i < vssize; ++i) {
+    for(std::size_t i = 0, vssize = p_verticalSlices->size(); i < vssize; ++i) {
         std::unique_ptr<BoundableList> toAdd(
             createParentBoundablesFromVerticalSlice(
                 (*p_verticalSlices)[i], newLevel)
@@ -103,17 +103,17 @@ STRtree::createParentBoundablesFromVerticalSlice(BoundableList* childBoundables,
 
 /*private*/
 std::vector<BoundableList*>*
-STRtree::verticalSlices(BoundableList* childBoundables, size_t sliceCount)
+STRtree::verticalSlices(BoundableList* childBoundables, std::size_t sliceCount)
 {
-    size_t sliceCapacity = (size_t) ceil((double)childBoundables->size() / (double) sliceCount);
-    vector<BoundableList*>* slices = new vector<BoundableList*>(sliceCount);
+    std::size_t sliceCapacity = (std::size_t) ceil((double)childBoundables->size() / (double) sliceCount);
+    std::vector<BoundableList*>* slices = new std::vector<BoundableList*>(sliceCount);
 
-    size_t i = 0, nchilds = childBoundables->size();
+    std::size_t i = 0, nchilds = childBoundables->size();
 
-    for(size_t j = 0; j < sliceCount; j++) {
+    for(std::size_t j = 0; j < sliceCount; j++) {
         (*slices)[j] = new BoundableList();
         (*slices)[j]->reserve(sliceCapacity);
-        size_t boundablesAddedToSlice = 0;
+        std::size_t boundablesAddedToSlice = 0;
         while(i < nchilds && boundablesAddedToSlice < sliceCapacity) {
             Boundable* childBoundable = (*childBoundables)[i];
             ++i;
@@ -304,7 +304,7 @@ bool STRtree::isWithinDistance(BoundablePair* initBndPair, double maxDistance)
 class STRAbstractNode: public AbstractNode {
 public:
 
-    STRAbstractNode(int p_level, size_t capacity)
+    STRAbstractNode(int p_level, std::size_t capacity)
         :
         AbstractNode(p_level, capacity)
     {}
diff --git a/src/index/sweepline/SweepLineEvent.cpp b/src/index/sweepline/SweepLineEvent.cpp
index 3d0256a..a7c95b3 100644
--- a/src/index/sweepline/SweepLineEvent.cpp
+++ b/src/index/sweepline/SweepLineEvent.cpp
@@ -57,7 +57,7 @@ SweepLineEvent::getDeleteEventIndex()
 }
 
 void
-SweepLineEvent::setDeleteEventIndex(size_t newDeleteEventIndex)
+SweepLineEvent::setDeleteEventIndex(std::size_t newDeleteEventIndex)
 {
     deleteEventIndex = newDeleteEventIndex;
 }
diff --git a/src/index/sweepline/SweepLineIndex.cpp b/src/index/sweepline/SweepLineIndex.cpp
index 269242b..c29c9f6 100644
--- a/src/index/sweepline/SweepLineIndex.cpp
+++ b/src/index/sweepline/SweepLineIndex.cpp
@@ -20,7 +20,7 @@
 
 #include <algorithm>
 
-using namespace std;
+
 
 namespace geos {
 namespace index { // geos.index
@@ -69,7 +69,7 @@ SweepLineIndex::computeOverlaps(SweepLineOverlapAction* action)
     buildIndex();
 
     const std::vector<SweepLineEvent*>::size_type n = events.size();
-    for(size_t i = 0; i < n; i++) {
+    for(std::size_t i = 0; i < n; i++) {
         SweepLineEvent* ev = events[i];
         if(ev->isInsert()) {
             processOverlaps(i,
@@ -80,7 +80,7 @@ SweepLineIndex::computeOverlaps(SweepLineOverlapAction* action)
 }
 
 void
-SweepLineIndex::processOverlaps(size_t start, size_t end,
+SweepLineIndex::processOverlaps(std::size_t start, std::size_t end,
                                 SweepLineInterval* s0, SweepLineOverlapAction* action)
 {
     /*
diff --git a/src/io/CLocalizer.cpp b/src/io/CLocalizer.cpp
index a93afcd..99504da 100644
--- a/src/io/CLocalizer.cpp
+++ b/src/io/CLocalizer.cpp
@@ -21,7 +21,7 @@
 #include <string>
 #include <clocale>
 
-using namespace std;
+
 
 namespace geos {
 namespace io {
diff --git a/src/io/ParseException.cpp b/src/io/ParseException.cpp
index 123d8ee..4425a67 100644
--- a/src/io/ParseException.cpp
+++ b/src/io/ParseException.cpp
@@ -21,7 +21,7 @@
 #include <sstream>
 #include <string>
 
-using namespace std;
+
 
 namespace geos {
 namespace io { // geos.io
@@ -32,28 +32,28 @@ ParseException::ParseException()
 {
 }
 
-ParseException::ParseException(const string& msg)
+ParseException::ParseException(const std::string& msg)
     :
     GEOSException("ParseException", msg)
 {
 }
 
-ParseException::ParseException(const string& msg, const string& var)
+ParseException::ParseException(const std::string& msg, const std::string& var)
     :
     GEOSException("ParseException", msg + ": '" + var + "'")
 {
 }
 
-ParseException::ParseException(const string& msg, double num)
+ParseException::ParseException(const std::string& msg, double num)
     :
     GEOSException("ParseException", msg + ": '" + stringify(num) + "'")
 {
 }
 
-string
+std::string
 ParseException::stringify(double num)
 {
-    stringstream ss;
+    std::stringstream ss;
     ss << num;
     return ss.str();
 }
diff --git a/src/io/StringTokenizer.cpp b/src/io/StringTokenizer.cpp
index ecb0767..173c1f4 100644
--- a/src/io/StringTokenizer.cpp
+++ b/src/io/StringTokenizer.cpp
@@ -23,7 +23,7 @@
 #include <cstdlib>
 #include <limits>
 
-using namespace std;
+using std::string;
 
 namespace geos {
 namespace io { // geos.io
diff --git a/src/io/WKBReader.cpp b/src/io/WKBReader.cpp
index aa13d29..e863560 100644
--- a/src/io/WKBReader.cpp
+++ b/src/io/WKBReader.cpp
@@ -40,7 +40,7 @@
 
 //#define DEBUG_WKB_READER 1
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -57,13 +57,13 @@ WKBReader::WKBReader()
     : WKBReader(*(GeometryFactory::getDefaultInstance()))
     {}
 
-ostream&
-WKBReader::printHEX(istream& is, ostream& os)
+std::ostream&
+WKBReader::printHEX(std::istream& is, std::ostream& os)
 {
     static const char hex[] = "0123456789ABCDEF";
 
     std::streampos pos = is.tellg(); // take note of input stream get pointer
-    is.seekg(0, ios::beg); // rewind input stream
+    is.seekg(0, std::ios::beg); // rewind input stream
 
     char each = 0;
     while(is.read(&each, 1)) {
@@ -131,22 +131,22 @@ ASCIIHexToUChar(char val)
 
 }  // namespace
 
-// Must be an even number of characters in the istream.
+// Must be an even number of characters in the std::istream.
 // Throws a ParseException if there are an odd number of characters.
 std::unique_ptr<Geometry>
-WKBReader::readHEX(istream& is)
+WKBReader::readHEX(std::istream& is)
 {
     // setup input/output stream
-    stringstream os(ios_base::binary | ios_base::in | ios_base::out);
+    std::stringstream os(std::ios_base::binary | std::ios_base::in | std::ios_base::out);
 
     while(true) {
         const int input_high = is.get();
-        if(input_high == char_traits<char>::eof()) {
+        if(input_high == std::char_traits<char>::eof()) {
             break;
         }
 
         const int input_low = is.get();
-        if(input_low == char_traits<char>::eof()) {
+        if(input_low == std::char_traits<char>::eof()) {
             throw ParseException("Premature end of HEX string");
         }
 
@@ -160,7 +160,7 @@ WKBReader::readHEX(istream& is)
             static_cast<char>((result_high << 4) + result_low);
 
 #if DEBUG_HEX_READER
-        cout << "HEX " << high << low << " -> DEC " << (int)value << endl;
+        std::size_t << "HEX " << high << low << " -> DEC " << (int)value << std::endl;
 #endif
         // write the value to the output stream
         os << value;
@@ -171,7 +171,7 @@ WKBReader::readHEX(istream& is)
 }
 
 std::unique_ptr<Geometry>
-WKBReader::read(istream& is)
+WKBReader::read(std::istream& is)
 {
     dis.setInStream(&is); // will default to machine endian
     return readGeometry();
@@ -184,7 +184,7 @@ WKBReader::readGeometry()
     unsigned char byteOrder = dis.readByte();
 
 #if DEBUG_WKB_READER
-    cout << "WKB byteOrder: " << (int)byteOrder << endl;
+    std::size_t << "WKB byteOrder: " << (int)byteOrder << std::endl;
 #endif
 
     // default is machine endian
@@ -207,7 +207,7 @@ WKBReader::readGeometry()
     int sfsqlHasM = (typeInt & 0x40000000) != 0;
 
 #if DEBUG_WKB_READER
-    cout << "WKB geometryType: " << geometryType << endl;
+    std::size_t << "WKB geometryType: " << geometryType << std::endl;
 #endif
 
     hasZ = sfsqlHasZ || isoHasZ;
@@ -223,17 +223,17 @@ WKBReader::readGeometry()
     }
 
 #if DEBUG_WKB_READER
-    cout << "WKB hasZ: " << hasZ << endl;
+    std::size_t << "WKB hasZ: " << hasZ << std::endl;
 #endif
 
 #if DEBUG_WKB_READER
-    cout << "WKB dimensions: " << inputDimension << endl;
+    std::size_t << "WKB dimensions: " << inputDimension << std::endl;
 #endif
 
     bool hasSRID = ((typeInt & 0x20000000) != 0);
 
 #if DEBUG_WKB_READER
-    cout << "WKB hasSRID: " << hasSRID << endl;
+    std::size_t << "WKB hasSRID: " << hasSRID << std::endl;
 #endif
 
     int SRID = 0;
@@ -266,7 +266,7 @@ WKBReader::readGeometry()
         result = readGeometryCollection();
         break;
     default:
-        stringstream err;
+        std::stringstream err;
         err << "Unknown WKB type " << geometryType;
         throw  ParseException(err.str());
     }
@@ -298,7 +298,7 @@ WKBReader::readLineString()
 {
     int size = dis.readInt();
 #if DEBUG_WKB_READER
-    cout << "WKB npoints: " << size << endl;
+    std::size_t << "WKB npoints: " << size << std::endl;
 #endif
     auto pts = readCoordinateSequence(size);
     return factory.createLineString(std::move(pts));
@@ -309,7 +309,7 @@ WKBReader::readLinearRing()
 {
     int size = dis.readInt();
 #if DEBUG_WKB_READER
-    cout << "WKB npoints: " << size << endl;
+    std::size_t << "WKB npoints: " << size << std::endl;
 #endif
     auto pts = readCoordinateSequence(size);
     return factory.createLinearRing(std::move(pts));
@@ -321,7 +321,7 @@ WKBReader::readPolygon()
     int numRings = dis.readInt();
 
 #if DEBUG_WKB_READER
-    cout << "WKB numRings: " << numRings << endl;
+    std::size_t << "WKB numRings: " << numRings << std::endl;
 #endif
 
     if(numRings == 0) {
@@ -353,7 +353,7 @@ WKBReader::readMultiPoint()
     for(int i = 0; i < numGeoms; i++) {
         geoms[i] = readGeometry();
         if(!dynamic_cast<Point*>(geoms[i].get())) {
-            stringstream err;
+            std::stringstream err;
             err << BAD_GEOM_TYPE_MSG << " MultiPoint";
             throw ParseException(err.str());
         }
@@ -371,7 +371,7 @@ WKBReader::readMultiLineString()
     for(int i = 0; i < numGeoms; i++) {
         geoms[i] = readGeometry();
         if(!dynamic_cast<LineString*>(geoms[i].get())) {
-            stringstream err;
+            std::stringstream err;
             err << BAD_GEOM_TYPE_MSG << " LineString";
             throw  ParseException(err.str());
         }
@@ -389,7 +389,7 @@ WKBReader::readMultiPolygon()
     for(int i = 0; i < numGeoms; i++) {
         geoms[i] = readGeometry();
         if(!dynamic_cast<Polygon*>(geoms[i].get())) {
-            stringstream err;
+            std::stringstream err;
             err << BAD_GEOM_TYPE_MSG << " Polygon";
             throw ParseException(err.str());
         }
@@ -445,7 +445,7 @@ WKBReader::readCoordinate()
         }
     }
 #if DEBUG_WKB_READER
-    cout << "WKB coordinate: " << ordValues[0] << "," << ordValues[1] << endl;
+    std::size_t << "WKB coordinate: " << ordValues[0] << "," << ordValues[1] << std::endl;
 #endif
 }
 
diff --git a/src/io/WKBWriter.cpp b/src/io/WKBWriter.cpp
index d6bbb7e..8957717 100644
--- a/src/io/WKBWriter.cpp
+++ b/src/io/WKBWriter.cpp
@@ -39,7 +39,7 @@
 
 #undef DEBUG_WKB_WRITER
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -67,10 +67,10 @@ WKBWriter::setOutputDimension(uint8_t dims)
 }
 
 void
-WKBWriter::writeHEX(const Geometry& g, ostream& os)
+WKBWriter::writeHEX(const Geometry& g, std::ostream& os)
 {
     // setup input/output stream
-    stringstream stream;
+    std::stringstream stream;
 
     // write the geometry in wkb format
     this->write(g, stream);
@@ -80,7 +80,7 @@ WKBWriter::writeHEX(const Geometry& g, ostream& os)
 }
 
 void
-WKBWriter::write(const Geometry& g, ostream& os)
+WKBWriter::write(const Geometry& g, std::ostream& os)
 {
     outputDimension = defaultOutputDimension;
     if(outputDimension > g.getCoordinateDimension()) {
@@ -301,11 +301,11 @@ WKBWriter::writeCoordinateSequence(const CoordinateSequence& cs,
 }
 
 void
-WKBWriter::writeCoordinate(const CoordinateSequence& cs, size_t idx,
+WKBWriter::writeCoordinate(const CoordinateSequence& cs, std::size_t idx,
                            bool is3d)
 {
 #if DEBUG_WKB_WRITER
-    cout << "writeCoordinate: X:" << cs.getX(idx) << " Y:" << cs.getY(idx) << endl;
+    std::size_t << "writeCoordinate: X:" << cs.getX(idx) << " Y:" << cs.getY(idx) << std::endl;
 #endif
     assert(outStream);
 
diff --git a/src/io/WKTReader.cpp b/src/io/WKTReader.cpp
index d51657d..95b8304 100644
--- a/src/io/WKTReader.cpp
+++ b/src/io/WKTReader.cpp
@@ -53,14 +53,14 @@
 #include <geos/io/WKTReader.inl>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
 namespace io { // geos.io
 
 std::unique_ptr<Geometry>
-WKTReader::read(const string& wellKnownText)
+WKTReader::read(const std::string& wellKnownText)
 {
     CLocalizer clocale;
     StringTokenizer tokenizer(wellKnownText);
@@ -70,8 +70,8 @@ WKTReader::read(const string& wellKnownText)
 std::unique_ptr<CoordinateSequence>
 WKTReader::getCoordinates(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->getCoordinateSequenceFactory()->create(std::size_t(0), dim);
     }
@@ -146,10 +146,10 @@ WKTReader::getNextNumber(StringTokenizer* tokenizer)
     return 0;
 }
 
-string
+std::string
 WKTReader::getNextEmptyOrOpener(StringTokenizer* tokenizer, std::size_t& dim)
 {
-    string nextWord = getNextWord(tokenizer);
+    std::string nextWord = getNextWord(tokenizer);
 
     // Skip the Z, M or ZM of an SF1.2 3/4 dim coordinate.
     if(nextWord == "Z" || nextWord == "ZM") {
@@ -167,27 +167,27 @@ WKTReader::getNextEmptyOrOpener(StringTokenizer* tokenizer, std::size_t& dim)
     throw  ParseException("Expected 'Z', 'M', 'ZM', 'EMPTY' or '(' but encountered ", nextWord);
 }
 
-string
+std::string
 WKTReader::getNextCloserOrComma(StringTokenizer* tokenizer)
 {
-    string nextWord = getNextWord(tokenizer);
+    std::string nextWord = getNextWord(tokenizer);
     if(nextWord == "," || nextWord == ")") {
         return nextWord;
     }
     throw  ParseException("Expected ')' or ',' but encountered", nextWord);
 }
 
-string
+std::string
 WKTReader::getNextCloser(StringTokenizer* tokenizer)
 {
-    string nextWord = getNextWord(tokenizer);
+    std::string nextWord = getNextWord(tokenizer);
     if(nextWord == ")") {
         return nextWord;
     }
     throw  ParseException("Expected ')' but encountered", nextWord);
 }
 
-string
+std::string
 WKTReader::getNextWord(StringTokenizer* tokenizer)
 {
     int type = tokenizer->nextToken();
@@ -199,7 +199,7 @@ WKTReader::getNextWord(StringTokenizer* tokenizer)
     case StringTokenizer::TT_NUMBER:
         throw  ParseException("Expected word but encountered number", tokenizer->getNVal());
     case StringTokenizer::TT_WORD: {
-        string word = tokenizer->getSVal();
+        std::string word = tokenizer->getSVal();
         int i = static_cast<int>(word.size());
 
         while(--i >= 0) {
@@ -222,7 +222,7 @@ WKTReader::getNextWord(StringTokenizer* tokenizer)
 std::unique_ptr<Geometry>
 WKTReader::readGeometryTaggedText(StringTokenizer* tokenizer)
 {
-    string type = getNextWord(tokenizer);
+    std::string type = getNextWord(tokenizer);
     if(type == "POINT") {
         return readPointText(tokenizer);
     }
@@ -253,8 +253,8 @@ WKTReader::readGeometryTaggedText(StringTokenizer* tokenizer)
 std::unique_ptr<Point>
 WKTReader::readPointText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createPoint(dim);
     }
@@ -283,8 +283,8 @@ WKTReader::readLinearRingText(StringTokenizer* tokenizer)
 std::unique_ptr<MultiPoint>
 WKTReader::readMultiPointText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createMultiPoint();
     }
@@ -320,7 +320,7 @@ WKTReader::readMultiPointText(StringTokenizer* tokenizer)
     }
 
     else {
-        stringstream err;
+        std::stringstream err;
         err << "Unexpected token: ";
         switch(tok) {
         case StringTokenizer::TT_WORD:
@@ -346,7 +346,7 @@ WKTReader::readMultiPointText(StringTokenizer* tokenizer)
             err << "??";
             break;
         }
-        err << endl;
+        err << std::endl;
         throw ParseException(err.str());
     }
 }
@@ -354,8 +354,8 @@ WKTReader::readMultiPointText(StringTokenizer* tokenizer)
 std::unique_ptr<Polygon>
 WKTReader::readPolygonText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createPolygon(dim);
     }
@@ -374,8 +374,8 @@ WKTReader::readPolygonText(StringTokenizer* tokenizer)
 std::unique_ptr<MultiLineString>
 WKTReader::readMultiLineStringText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createMultiLineString();
     }
@@ -392,8 +392,8 @@ WKTReader::readMultiLineStringText(StringTokenizer* tokenizer)
 std::unique_ptr<MultiPolygon>
 WKTReader::readMultiPolygonText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createMultiPolygon();
     }
@@ -410,8 +410,8 @@ WKTReader::readMultiPolygonText(StringTokenizer* tokenizer)
 std::unique_ptr<GeometryCollection>
 WKTReader::readGeometryCollectionText(StringTokenizer* tokenizer)
 {
-    size_t dim = 2;
-    string nextToken = getNextEmptyOrOpener(tokenizer, dim);
+    std::size_t dim = 2;
+    std::string nextToken = getNextEmptyOrOpener(tokenizer, dim);
     if(nextToken == "EMPTY") {
         return geometryFactory->createGeometryCollection();
     }
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index ff35edc..95dd1f9 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -42,7 +42,7 @@
 #include <cmath>
 #include <iomanip>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -70,10 +70,10 @@ WKTWriter::setOutputDimension(uint8_t dims)
 }
 
 /*static*/
-string
+std::string
 WKTWriter::toLineString(const CoordinateSequence& seq)
 {
-    stringstream buf(ios_base::in | ios_base::out);
+    std::stringstream buf(std::ios_base::in | std::ios_base::out);
     buf << "LINESTRING ";
     auto npts = seq.size();
     if(npts == 0) {
@@ -81,7 +81,7 @@ WKTWriter::toLineString(const CoordinateSequence& seq)
     }
     else {
         buf << "(";
-        for(size_t i = 0; i < npts; ++i) {
+        for(std::size_t i = 0; i < npts; ++i) {
             if(i) {
                 buf << ", ";
             }
@@ -97,10 +97,10 @@ WKTWriter::toLineString(const CoordinateSequence& seq)
 }
 
 /*static*/
-string
+std::string
 WKTWriter::toLineString(const Coordinate& p0, const Coordinate& p1)
 {
-    stringstream ret(ios_base::in | ios_base::out);
+    std::stringstream ret(std::ios_base::in | std::ios_base::out);
     ret << "LINESTRING (" << p0.x << " " << p0.y;
 #if PRINT_Z
     ret << " " << p0.z;
@@ -115,10 +115,10 @@ WKTWriter::toLineString(const Coordinate& p0, const Coordinate& p1)
 }
 
 /*static*/
-string
+std::string
 WKTWriter::toPoint(const Coordinate& p0)
 {
-    stringstream ret(ios_base::in | ios_base::out);
+    std::stringstream ret(std::ios_base::in | std::ios_base::out);
     ret << "POINT (";
 #if PRINT_Z
     ret << p0.x << " " << p0.y  << " " << p0.z << " )";
@@ -143,12 +143,12 @@ WKTWriter::setTrim(bool p0)
     trim = p0;
 }
 
-string
+std::string
 WKTWriter::write(const Geometry* geometry)
 {
     Writer sw;
     writeFormatted(geometry, false, &sw);
-    string res = sw.toString();
+    std::string res = sw.toString();
     return res;
 }
 
@@ -158,7 +158,7 @@ WKTWriter::write(const Geometry* geometry, Writer* writer)
     writeFormatted(geometry, false, writer);
 }
 
-string
+std::string
 WKTWriter::writeFormatted(const Geometry* geometry)
 {
     Writer sw;
@@ -354,7 +354,7 @@ WKTWriter::appendCoordinate(const Coordinate* coordinate,
 }
 
 /* protected */
-string
+std::string
 WKTWriter::writeNumber(double d)
 {
 
@@ -380,7 +380,7 @@ WKTWriter::appendLineStringText(const LineString* lineString, int p_level,
             indent(p_level, writer);
         }
         writer->write("(");
-        for(size_t i = 0, n = lineString->getNumPoints(); i < n; ++i) {
+        for(std::size_t i = 0, n = lineString->getNumPoints(); i < n; ++i) {
             if(i > 0) {
                 writer->write(", ");
                 if(i % 10 == 0) {
@@ -406,7 +406,7 @@ WKTWriter::appendPolygonText(const Polygon* polygon, int /*level*/,
         }
         writer->write("(");
         appendLineStringText(polygon->getExteriorRing(), level, false, writer);
-        for(size_t i = 0, n = polygon->getNumInteriorRing(); i < n; ++i) {
+        for(std::size_t i = 0, n = polygon->getNumInteriorRing(); i < n; ++i) {
             writer->write(", ");
             const LineString* ls = polygon->getInteriorRingN(i);
             appendLineStringText(ls, level + 1, true, writer);
@@ -424,7 +424,7 @@ WKTWriter::appendMultiPointText(const MultiPoint* multiPoint,
     }
     else {
         writer->write("(");
-        for(size_t i = 0, n = multiPoint->getNumGeometries();
+        for(std::size_t i = 0, n = multiPoint->getNumGeometries();
                 i < n; ++i) {
 
             if(i > 0) {
@@ -453,7 +453,7 @@ WKTWriter::appendMultiLineStringText(const MultiLineString* multiLineString, int
         int level2 = p_level;
         bool doIndent = indentFirst;
         writer->write("(");
-        for(size_t i = 0, n = multiLineString->getNumGeometries();
+        for(std::size_t i = 0, n = multiLineString->getNumGeometries();
                 i < n; ++i) {
             if(i > 0) {
                 writer->write(", ");
@@ -477,7 +477,7 @@ WKTWriter::appendMultiPolygonText(const MultiPolygon* multiPolygon, int p_level,
         int level2 = p_level;
         bool doIndent = false;
         writer->write("(");
-        for(size_t i = 0, n = multiPolygon->getNumGeometries();
+        for(std::size_t i = 0, n = multiPolygon->getNumGeometries();
                 i < n; ++i) {
             if(i > 0) {
                 writer->write(", ");
@@ -503,7 +503,7 @@ WKTWriter::appendGeometryCollectionText(
     else {
         int level2 = p_level;
         writer->write("(");
-        for(size_t i = 0, n = geometryCollection->getNumGeometries();
+        for(std::size_t i = 0, n = geometryCollection->getNumGeometries();
                 i < n; ++i) {
             if(i > 0) {
                 writer->write(", ");
@@ -522,7 +522,7 @@ WKTWriter::indent(int p_level, Writer* writer)
         return;
     }
     writer->write("\n");
-    writer->write(string(INDENT * p_level, ' '));
+    writer->write(std::string(INDENT * p_level, ' '));
 }
 
 } // namespace geos.io
diff --git a/src/linearref/ExtractLineByLocation.cpp b/src/linearref/ExtractLineByLocation.cpp
index 6490f08..52908f3 100644
--- a/src/linearref/ExtractLineByLocation.cpp
+++ b/src/linearref/ExtractLineByLocation.cpp
@@ -31,7 +31,7 @@
 #include <cassert>
 #include <typeinfo>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
@@ -86,7 +86,7 @@ ExtractLineByLocation::computeLine(const LinearLocation& start, const LinearLoca
     auto coordinates = line->getCoordinates();
     CoordinateArraySequence newCoordinateArray;
 
-    const size_t indexStep = 1;
+    const std::size_t indexStep = 1;
     auto startSegmentIndex = start.getSegmentIndex();
 
     if(start.getSegmentFraction() > 0.0) {
diff --git a/src/linearref/LengthIndexOfPoint.cpp b/src/linearref/LengthIndexOfPoint.cpp
index a1350ce..a08e197 100644
--- a/src/linearref/LengthIndexOfPoint.cpp
+++ b/src/linearref/LengthIndexOfPoint.cpp
@@ -26,7 +26,7 @@
 
 #include <limits>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
@@ -84,7 +84,7 @@ LengthIndexOfPoint::indexOfAfter(const Coordinate& inputPt, double minIndex) con
 double
 LengthIndexOfPoint::indexOfFromStart(const Coordinate& inputPt, double minIndex) const
 {
-    double minDistance = numeric_limits<double>::max();
+    double minDistance = std::numeric_limits<double>::max();
 
     double ptMeasure = minIndex;
     double segmentStartMeasure = 0.0;
diff --git a/src/linearref/LengthIndexedLine.cpp b/src/linearref/LengthIndexedLine.cpp
index 4a262e3..012a9dc 100644
--- a/src/linearref/LengthIndexedLine.cpp
+++ b/src/linearref/LengthIndexedLine.cpp
@@ -26,7 +26,7 @@
 #include <geos/linearref/LengthIndexOfPoint.h>
 #include <geos/linearref/LocationIndexOfLine.h>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
@@ -65,7 +65,7 @@ LengthIndexedLine::extractLine(double startIndex, double endIndex) const
     const bool resolveStartLower = (startIndex2 == endIndex2);
     const LinearLocation startLoc = locationOf(startIndex2, resolveStartLower);
     const LinearLocation endLoc = locationOf(endIndex2);
-//    LinearLocation endLoc = locationOf(endIndex2, true);
+//    LinearLocation std::endloc = locationOf(endIndex2, true);
 //    LinearLocation startLoc = locationOf(startIndex2);
     return ExtractLineByLocation::extract(linearGeom, startLoc, endLoc);
 }
diff --git a/src/linearref/LengthLocationMap.cpp b/src/linearref/LengthLocationMap.cpp
index d715ae5..2a25344 100644
--- a/src/linearref/LengthLocationMap.cpp
+++ b/src/linearref/LengthLocationMap.cpp
@@ -24,7 +24,7 @@
 #include <geos/linearref/LinearLocation.h>
 #include <geos/linearref/LengthLocationMap.h>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
diff --git a/src/linearref/LinearGeometryBuilder.cpp b/src/linearref/LinearGeometryBuilder.cpp
index 941e815..4160ba9 100644
--- a/src/linearref/LinearGeometryBuilder.cpp
+++ b/src/linearref/LinearGeometryBuilder.cpp
@@ -30,7 +30,7 @@
 
 #include <cassert>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
diff --git a/src/linearref/LinearIterator.cpp b/src/linearref/LinearIterator.cpp
index a1deb72..83664ee 100644
--- a/src/linearref/LinearIterator.cpp
+++ b/src/linearref/LinearIterator.cpp
@@ -57,7 +57,7 @@ LinearIterator::LinearIterator(const Geometry* p_linear, const LinearLocation& s
     loadCurrentLine();
 }
 
-LinearIterator::LinearIterator(const Geometry* p_linear, size_t p_componentIndex, size_t p_vertexIndex) :
+LinearIterator::LinearIterator(const Geometry* p_linear, std::size_t p_componentIndex, std::size_t p_vertexIndex) :
     vertexIndex(p_vertexIndex),
     componentIndex(p_componentIndex),
     linear(p_linear),
diff --git a/src/linearref/LinearLocation.cpp b/src/linearref/LinearLocation.cpp
index 7d929cf..5511c76 100644
--- a/src/linearref/LinearLocation.cpp
+++ b/src/linearref/LinearLocation.cpp
@@ -24,7 +24,7 @@
 #include <geos/linearref/LengthLocationMap.h>
 #include <geos/util/IllegalArgumentException.h>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
@@ -60,7 +60,7 @@ LinearLocation::pointAlongSegmentByFraction(const Coordinate& p0, const Coordina
 }
 
 /* public */
-LinearLocation::LinearLocation(size_t p_segmentIndex,
+LinearLocation::LinearLocation(std::size_t p_segmentIndex,
                                double p_segmentFraction)
     :
     componentIndex(0),
@@ -70,8 +70,8 @@ LinearLocation::LinearLocation(size_t p_segmentIndex,
 
 
 /* public */
-LinearLocation::LinearLocation(size_t p_componentIndex,
-                               size_t p_segmentIndex, double p_segmentFraction)
+LinearLocation::LinearLocation(std::size_t p_componentIndex,
+                               std::size_t p_segmentIndex, double p_segmentFraction)
     :
     componentIndex(p_componentIndex),
     segmentIndex(p_segmentIndex),
@@ -137,7 +137,7 @@ LinearLocation::getSegmentLength(const Geometry* linearGeom) const
     const LineString* lineComp = dynamic_cast<const LineString*>(linearGeom->getGeometryN(componentIndex));
 
     // ensure segment index is valid
-    size_t segIndex = segmentIndex;
+    std::size_t segIndex = segmentIndex;
     if(segmentIndex >= lineComp->getNumPoints() - 1) {
         segIndex = lineComp->getNumPoints() - 2;
     }
@@ -279,8 +279,8 @@ LinearLocation::compareTo(const LinearLocation& other) const
 
 /* public */
 int
-LinearLocation::compareLocationValues(size_t componentIndex1,
-                                      size_t segmentIndex1, double segmentFraction1) const
+LinearLocation::compareLocationValues(std::size_t componentIndex1,
+                                      std::size_t segmentIndex1, double segmentFraction1) const
 {
     // compare component indices
     if(componentIndex < componentIndex1) {
@@ -311,9 +311,9 @@ LinearLocation::compareLocationValues(size_t componentIndex1,
 /* public static */
 int
 LinearLocation::compareLocationValues(
-    size_t componentIndex0, size_t segmentIndex0,
+    std::size_t componentIndex0, std::size_t segmentIndex0,
     double segmentFraction0,
-    size_t componentIndex1, size_t segmentIndex1,
+    std::size_t componentIndex1, std::size_t segmentIndex1,
     double segmentFraction1)
 {
     // compare component indices
@@ -377,8 +377,8 @@ LinearLocation::isEndpoint(const Geometry& linearGeom) const
 }
 
 
-ostream&
-operator<<(ostream& out, const LinearLocation& obj)
+std::ostream&
+operator<<(std::ostream& out, const LinearLocation& obj)
 {
     return out << "LinearLoc[" << obj.componentIndex << ", " <<
            obj.segmentIndex << ", " << obj.segmentFraction << "]";
diff --git a/src/linearref/LocationIndexOfLine.cpp b/src/linearref/LocationIndexOfLine.cpp
index d25e244..927bc65 100644
--- a/src/linearref/LocationIndexOfLine.cpp
+++ b/src/linearref/LocationIndexOfLine.cpp
@@ -23,7 +23,7 @@
 #include <geos/linearref/LocationIndexOfLine.h>
 #include <geos/linearref/LocationIndexOfPoint.h>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
diff --git a/src/linearref/LocationIndexOfPoint.cpp b/src/linearref/LocationIndexOfPoint.cpp
index c959a7d..a347f61 100644
--- a/src/linearref/LocationIndexOfPoint.cpp
+++ b/src/linearref/LocationIndexOfPoint.cpp
@@ -28,7 +28,7 @@
 #include <cassert>
 #include <limits>
 
-using namespace std;
+
 
 using namespace geos::geom;
 
@@ -39,9 +39,9 @@ LinearLocation
 LocationIndexOfPoint::indexOfFromStart(const Coordinate& inputPt,
                                        const LinearLocation* minIndex) const
 {
-    double minDistance = numeric_limits<double>::max();
-    size_t minComponentIndex = 0;
-    size_t minSegmentIndex = 0;
+    double minDistance = std::numeric_limits<double>::max();
+    std::size_t minComponentIndex = 0;
+    std::size_t minSegmentIndex = 0;
     double minFrac = -1.0;
 
     LineSegment seg;
diff --git a/src/noding/GeometryNoder.cpp b/src/noding/GeometryNoder.cpp
index ed475d9..11fd77d 100644
--- a/src/noding/GeometryNoder.cpp
+++ b/src/noding/GeometryNoder.cpp
@@ -127,7 +127,7 @@ GeometryNoder::getNoded()
         nodedEdges = p_noder.getNodedSubstrings();
     }
     catch(const std::exception&) {
-        for(size_t i = 0, n = p_lineList.size(); i < n; ++i) {
+        for(std::size_t i = 0, n = p_lineList.size(); i < n; ++i) {
             delete p_lineList[i];
         }
         throw;
diff --git a/src/noding/IntersectionAdder.cpp b/src/noding/IntersectionAdder.cpp
index 91b560b..fba4847 100644
--- a/src/noding/IntersectionAdder.cpp
+++ b/src/noding/IntersectionAdder.cpp
@@ -31,7 +31,7 @@ namespace noding { // geos.noding
 /*private*/
 bool
 IntersectionAdder::isTrivialIntersection(const SegmentString* e0,
-        size_t segIndex0, const SegmentString* e1, size_t segIndex1)
+        std::size_t segIndex0, const SegmentString* e1, std::size_t segIndex1)
 {
     if(e0 != e1) {
         return false;
@@ -61,8 +61,8 @@ IntersectionAdder::isTrivialIntersection(const SegmentString* e0,
 /*public*/
 void
 IntersectionAdder::processIntersections(
-    SegmentString* e0,  size_t segIndex0,
-    SegmentString* e1,  size_t segIndex1)
+    SegmentString* e0,  std::size_t segIndex0,
+    SegmentString* e1,  std::size_t segIndex1)
 {
     // don't bother intersecting a segment with itself
     if(e0 == e1 && segIndex0 == segIndex1) {
diff --git a/src/noding/IntersectionFinderAdder.cpp b/src/noding/IntersectionFinderAdder.cpp
index 7efa694..9e192ea 100644
--- a/src/noding/IntersectionFinderAdder.cpp
+++ b/src/noding/IntersectionFinderAdder.cpp
@@ -32,8 +32,8 @@ namespace noding { // geos.noding
 
 void
 IntersectionFinderAdder::processIntersections(
-    SegmentString* e0,  size_t segIndex0,
-    SegmentString* e1,  size_t segIndex1)
+    SegmentString* e0,  std::size_t segIndex0,
+    SegmentString* e1,  std::size_t segIndex1)
 {
     // don't bother intersecting a segment with itself
     if(e0 == e1 && segIndex0 == segIndex1) {
@@ -50,7 +50,7 @@ IntersectionFinderAdder::processIntersections(
 
     if(li.hasIntersection()) {
         if(li.isInteriorIntersection()) {
-            for(size_t intIndex = 0, n = li.getIntersectionNum(); intIndex < n; ++intIndex) {
+            for(std::size_t intIndex = 0, n = li.getIntersectionNum(); intIndex < n; ++intIndex) {
                 interiorIntersections.push_back(li.getIntersection(intIndex));
             }
 
diff --git a/src/noding/MCIndexNoder.cpp b/src/noding/MCIndexNoder.cpp
index 504eaf4..12a8a5c 100644
--- a/src/noding/MCIndexNoder.cpp
+++ b/src/noding/MCIndexNoder.cpp
@@ -36,7 +36,7 @@
 # include <geos/noding/MCIndexNoder.inl>
 #endif
 
-using namespace std;
+
 using namespace geos::index::chain;
 
 namespace geos {
@@ -65,7 +65,7 @@ MCIndexNoder::intersectChains()
 
     SegmentOverlapAction overlapAction(*segInt);
 
-    vector<void*> overlapChains;
+    std::vector<void*> overlapChains;
     for(MonotoneChain* queryChain : monoChains) {
         GEOS_CHECK_FOR_INTERRUPTS();
 
@@ -100,7 +100,7 @@ MCIndexNoder::intersectChains()
 void
 MCIndexNoder::add(SegmentString* segStr)
 {
-    vector<std::unique_ptr<MonotoneChain>> segChains;
+    std::vector<std::unique_ptr<MonotoneChain>> segChains;
 
     // segChains will contain nelwy allocated MonotoneChain objects
     MonotoneChainBuilder::getChains(segStr->getCoordinates(),
@@ -127,8 +127,8 @@ MCIndexNoder::~MCIndexNoder()
 }
 
 void
-MCIndexNoder::SegmentOverlapAction::overlap(MonotoneChain& mc1, size_t start1,
-        MonotoneChain& mc2, size_t start2)
+MCIndexNoder::SegmentOverlapAction::overlap(MonotoneChain& mc1, std::size_t start1,
+        MonotoneChain& mc2, std::size_t start2)
 {
     SegmentString* ss1 = const_cast<SegmentString*>(
                              static_cast<const SegmentString*>(mc1.getContext())
diff --git a/src/noding/MCIndexSegmentSetMutualIntersector.cpp b/src/noding/MCIndexSegmentSetMutualIntersector.cpp
index a8e07a6..afc3470 100644
--- a/src/noding/MCIndexSegmentSetMutualIntersector.cpp
+++ b/src/noding/MCIndexSegmentSetMutualIntersector.cpp
@@ -140,7 +140,7 @@ MCIndexSegmentSetMutualIntersector::process(SegmentString::ConstVect* segStrings
 /* public */
 void
 MCIndexSegmentSetMutualIntersector::SegmentOverlapAction::overlap(
-    MonotoneChain& mc1, size_t start1, MonotoneChain& mc2, size_t start2)
+    MonotoneChain& mc1, std::size_t start1, MonotoneChain& mc2, std::size_t start2)
 {
     SegmentString* ss1 = (SegmentString*)(mc1.getContext());
     SegmentString* ss2 = (SegmentString*)(mc2.getContext());
diff --git a/src/noding/NodedSegmentString.cpp b/src/noding/NodedSegmentString.cpp
index 3c3ad4a..3855594 100644
--- a/src/noding/NodedSegmentString.cpp
+++ b/src/noding/NodedSegmentString.cpp
@@ -54,7 +54,7 @@ NodedSegmentString::safeOctant(const Coordinate& p0, const Coordinate& p1)
 
 /*public*/
 int
-NodedSegmentString::getSegmentOctant(size_t index) const
+NodedSegmentString::getSegmentOctant(std::size_t index) const
 {
     if(index >= size() - 1) {
         return -1;
@@ -66,9 +66,9 @@ NodedSegmentString::getSegmentOctant(size_t index) const
 /*public*/
 void
 NodedSegmentString::addIntersections(LineIntersector* li,
-                                     size_t segmentIndex, size_t geomIndex)
+                                     std::size_t segmentIndex, std::size_t geomIndex)
 {
-    for(size_t i = 0, n = li->getIntersectionNum(); i < n; ++i) {
+    for(std::size_t i = 0, n = li->getIntersectionNum(); i < n; ++i) {
         addIntersection(li, segmentIndex, geomIndex, i);
     }
 }
@@ -76,8 +76,8 @@ NodedSegmentString::addIntersections(LineIntersector* li,
 /*public*/
 void
 NodedSegmentString::addIntersection(LineIntersector* li,
-                                    size_t segmentIndex,
-                                    size_t geomIndex, size_t intIndex)
+                                    std::size_t segmentIndex,
+                                    std::size_t geomIndex, std::size_t intIndex)
 {
     ::geos::ignore_unused_variable_warning(geomIndex);
 
@@ -88,9 +88,9 @@ NodedSegmentString::addIntersection(LineIntersector* li,
 /*public*/
 void
 NodedSegmentString::addIntersection(const Coordinate& intPt,
-                                    size_t segmentIndex)
+                                    std::size_t segmentIndex)
 {
-    size_t normalizedSegmentIndex = segmentIndex;
+    std::size_t normalizedSegmentIndex = segmentIndex;
 
     if(segmentIndex > size() - 2) {
         throw util::IllegalArgumentException("SegmentString::addIntersection: SegmentIndex out of range");
@@ -152,7 +152,7 @@ NodedSegmentString::getNodedSubstrings(
 
 /* virtual public */
 const geom::Coordinate&
-NodedSegmentString::getCoordinate(size_t i) const
+NodedSegmentString::getCoordinate(std::size_t i) const
 {
     return pts->getAt(i);
 }
diff --git a/src/noding/NodingIntersectionFinder.cpp b/src/noding/NodingIntersectionFinder.cpp
index f043f53..d50c7bd 100644
--- a/src/noding/NodingIntersectionFinder.cpp
+++ b/src/noding/NodingIntersectionFinder.cpp
@@ -30,7 +30,7 @@ namespace noding { // geos.noding
 
 /* private */
 bool
-NodingIntersectionFinder::isEndSegment(const SegmentString* segStr, size_t index)
+NodingIntersectionFinder::isEndSegment(const SegmentString* segStr, std::size_t index)
 {
     if(index == 0) {
         return true;
@@ -85,8 +85,8 @@ NodingIntersectionFinder::isInteriorVertexIntersection(
 /* public (override) */
 void
 NodingIntersectionFinder::processIntersections(
-    SegmentString* e0,  size_t segIndex0,
-    SegmentString* e1,  size_t segIndex1)
+    SegmentString* e0,  std::size_t segIndex0,
+    SegmentString* e1,  std::size_t segIndex1)
 {
     using geos::geom::Coordinate;
 
diff --git a/src/noding/NodingValidator.cpp b/src/noding/NodingValidator.cpp
index a43d6de..26a8d3d 100644
--- a/src/noding/NodingValidator.cpp
+++ b/src/noding/NodingValidator.cpp
@@ -27,7 +27,7 @@
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geom;
 
@@ -61,7 +61,7 @@ void
 NodingValidator::checkCollapses(const SegmentString& ss) const
 {
     const CoordinateSequence& pts = *(ss.getCoordinates());
-    for(size_t i = 0, n = pts.size() - 2; i < n; ++i) {
+    for(std::size_t i = 0, n = pts.size() - 2; i < n; ++i) {
         checkCollapse(pts[i], pts[i + 1], pts[i + 2]);
     }
 }
@@ -104,8 +104,8 @@ NodingValidator::checkInteriorIntersections(const SegmentString& ss0,
 {
     const CoordinateSequence& pts0 = *(ss0.getCoordinates());
     const CoordinateSequence& pts1 = *(ss1.getCoordinates());
-    for(size_t i0 = 0, n0 = pts0.size(); i0 < n0 - 1; ++i0) {
-        for(size_t i1 = 0, n1 = pts1.size(); i1 < n1 - 1; ++i1) {
+    for(std::size_t i0 = 0, n0 = pts0.size(); i0 < n0 - 1; ++i0) {
+        for(std::size_t i1 = 0, n1 = pts1.size(); i1 < n1 - 1; ++i1) {
             checkInteriorIntersections(ss0, i0, ss1, i1);
         }
     }
@@ -115,8 +115,8 @@ NodingValidator::checkInteriorIntersections(const SegmentString& ss0,
 /* private */
 void
 NodingValidator::checkInteriorIntersections(
-    const SegmentString& e0, size_t segIndex0,
-    const SegmentString& e1, size_t segIndex1)
+    const SegmentString& e0, std::size_t segIndex0,
+    const SegmentString& e1, std::size_t segIndex1)
 {
     if(&e0 == &e1 && segIndex0 == segIndex1) {
         return;
@@ -166,9 +166,9 @@ NodingValidator::checkEndPtVertexIntersections(const Coordinate& testPt,
             ++it) {
         const SegmentString* ss0 = *it;
         const CoordinateSequence& pts = *(ss0->getCoordinates());
-        for(size_t j = 1, n = pts.size() - 1; j < n; ++j) {
+        for(std::size_t j = 1, n = pts.size() - 1; j < n; ++j) {
             if(pts[j].equals(testPt)) {
-                stringstream s;
+                std::stringstream s;
                 s << "found endpt/interior pt intersection ";
                 s << "at index " << j << " :pt " << testPt;
                 throw util::TopologyException(s.str());
@@ -186,7 +186,7 @@ bool
 NodingValidator::hasInteriorIntersection(const LineIntersector& aLi,
         const Coordinate& p0, const Coordinate& p1) const
 {
-    for(size_t i = 0, n = aLi.getIntersectionNum(); i < n; ++i) {
+    for(std::size_t i = 0, n = aLi.getIntersectionNum(); i < n; ++i) {
         const Coordinate& intPt = aLi.getIntersection(i);
         if(!(intPt == p0 || intPt == p1)) {
             return true;
diff --git a/src/noding/Octant.cpp b/src/noding/Octant.cpp
index 5f545a8..da1ce4c 100644
--- a/src/noding/Octant.cpp
+++ b/src/noding/Octant.cpp
@@ -23,7 +23,7 @@
 #include <geos/noding/Octant.h>
 #include <geos/geom/Coordinate.h>
 
-//using namespace std;
+//
 using namespace geos::geom;
 
 namespace geos {
diff --git a/src/noding/OrientedCoordinateArray.cpp b/src/noding/OrientedCoordinateArray.cpp
index 0906286..99d4fd0 100644
--- a/src/noding/OrientedCoordinateArray.cpp
+++ b/src/noding/OrientedCoordinateArray.cpp
@@ -107,13 +107,13 @@ OrientedCoordinateArray::operator==(const OrientedCoordinateArray& other) const
     }
 
     if (orientationVar == other.orientationVar) {
-        for (size_t i = 0; i < sz1; i++) {
+        for (std::size_t i = 0; i < sz1; i++) {
             if (pts->getAt(i) != other.pts->getAt(i)) {
                 return false;
             }
         }
     } else {
-        for (size_t i = 0; i < sz1; i++) {
+        for (std::size_t i = 0; i < sz1; i++) {
             if (pts->getAt(i) != other.pts->getAt(sz2 - i - 1)) {
                 return false;
             }
@@ -129,14 +129,14 @@ OrientedCoordinateArray::HashCode::operator()(const geos::noding::OrientedCoordi
 
     auto sz = oca.pts->getSize();
 
-    size_t result = std::hash<size_t>{}(sz);
+    std::size_t result = std::hash<size_t>{}(sz);
 
     if (oca.orientationVar) {
-        for (size_t i = 0; i < sz; i++) {
+        for (std::size_t i = 0; i < sz; i++) {
             result ^= coordHash(oca.pts->getAt(i));
         }
     } else {
-        for (size_t i = sz; i > 0; i--) {
+        for (std::size_t i = sz; i > 0; i--) {
             result ^= coordHash(oca.pts->getAt(i-1));
         }
     }
diff --git a/src/noding/ScaledNoder.cpp b/src/noding/ScaledNoder.cpp
index 57c5c28..389ae0c 100644
--- a/src/noding/ScaledNoder.cpp
+++ b/src/noding/ScaledNoder.cpp
@@ -59,7 +59,7 @@ sqlPrint(const std::string& table, std::vector<SegmentString*>& ssv)
     std::cerr << "COPY \"" << table
               << "\" FROM stdin;" << std::endl;
 
-    for(size_t i = 0, n = ssv.size(); i < n; i++) {
+    for(std::size_t i = 0, n = ssv.size(); i < n; i++) {
         SegmentString* ss = ssv[i];
         geom::CoordinateSequence* cs = ss->getCoordinates();
         assert(cs);
@@ -155,13 +155,13 @@ void
 ScaledNoder::scale(SegmentString::NonConstVect& segStrings) const
 {
     Scaler scaler(*this);
-    for(size_t i = 0; i < segStrings.size(); i++) {
+    for(std::size_t i = 0; i < segStrings.size(); i++) {
         SegmentString* ss = segStrings[i];
 
         CoordinateSequence* cs = ss->getCoordinates();
 
 #ifndef NDEBUG
-        size_t npts = cs->size();
+        std::size_t npts = cs->size();
 #endif
         cs->apply_rw(&scaler);
         assert(cs->size() == npts);
diff --git a/src/noding/SegmentIntersectionDetector.cpp b/src/noding/SegmentIntersectionDetector.cpp
index cf71286..28c11dc 100644
--- a/src/noding/SegmentIntersectionDetector.cpp
+++ b/src/noding/SegmentIntersectionDetector.cpp
@@ -29,8 +29,8 @@ namespace noding { // geos::noding
 void
 SegmentIntersectionDetector::
 processIntersections(
-    noding::SegmentString* e0, size_t segIndex0,
-    noding::SegmentString* e1, size_t segIndex1)
+    noding::SegmentString* e0, std::size_t segIndex0,
+    noding::SegmentString* e1, std::size_t segIndex1)
 {
     // don't bother intersecting a segment with itself
     if(e0 == e1 && segIndex0 == segIndex1) {
diff --git a/src/noding/SegmentNode.cpp b/src/noding/SegmentNode.cpp
index 840d518..64732df 100644
--- a/src/noding/SegmentNode.cpp
+++ b/src/noding/SegmentNode.cpp
@@ -30,7 +30,7 @@
 #include <geos/noding/NodedSegmentString.h>
 #include <geos/geom/Coordinate.h>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -39,7 +39,7 @@ namespace noding { // geos.noding
 
 /*public*/
 SegmentNode::SegmentNode(const NodedSegmentString& ss, const Coordinate& nCoord,
-                         size_t nSegmentIndex, int nSegmentOctant)
+                         std::size_t nSegmentIndex, int nSegmentOctant)
     :
     segString(ss),
     segmentOctant(nSegmentOctant),
@@ -83,20 +83,20 @@ SegmentNode::compareTo(const SegmentNode& other)
     }
 
 #if GEOS_DEBUG
-    cerr << setprecision(17) << "compareTo: " << *this << ", " << other << endl;
+    std::cerr << setprecision(17) << "compareTo: " << *this << ", " << other << std::endl;
 #endif
 
     if(coord.equals2D(other.coord)) {
 
 #if GEOS_DEBUG
-        cerr << " Coordinates equal!" << endl;
+        std::cerr << " Coordinates equal!" << std::endl;
 #endif
 
         return 0;
     }
 
 #if GEOS_DEBUG
-    cerr << " Coordinates do not equal!" << endl;
+    std::cerr << " Coordinates do not equal!" << std::endl;
 #endif
 
     // an exterior node is the segment start point,
@@ -110,10 +110,10 @@ SegmentNode::compareTo(const SegmentNode& other)
                                            other.coord);
 }
 
-ostream&
-operator<< (ostream& os, const SegmentNode& n)
+std::ostream&
+operator<< (std::ostream& os, const SegmentNode& n)
 {
-    return os << n.coord << " seg#=" << n.segmentIndex << " octant#=" << n.segmentOctant << endl;
+    return os << n.coord << " seg#=" << n.segmentIndex << " octant#=" << n.segmentOctant << std::endl;
 }
 
 } // namespace geos.noding
diff --git a/src/noding/SegmentNodeList.cpp b/src/noding/SegmentNodeList.cpp
index ec5cebc..bb52d39 100644
--- a/src/noding/SegmentNodeList.cpp
+++ b/src/noding/SegmentNodeList.cpp
@@ -39,7 +39,7 @@
 #include <iostream>
 #endif
 
-//using namespace std;
+//
 using namespace geos::geom;
 
 namespace geos {
@@ -51,7 +51,7 @@ static Profiler* profiler = Profiler::instance();
 
 
 SegmentNode*
-SegmentNodeList::add(const Coordinate& intPt, size_t segmentIndex)
+SegmentNodeList::add(const Coordinate& intPt, std::size_t segmentIndex)
 {
     nodeQue.emplace_back(edge, intPt, segmentIndex, edge.getSegmentOctant(segmentIndex));
     SegmentNode* eiNew = &(nodeQue.back());
@@ -76,7 +76,7 @@ SegmentNodeList::~SegmentNodeList()
 void
 SegmentNodeList::addEndpoints()
 {
-    size_t maxSegIndex = edge.size() - 1;
+    std::size_t maxSegIndex = edge.size() - 1;
     add(&(edge.getCoordinate(0)), 0);
     add(&(edge.getCoordinate(maxSegIndex)), maxSegIndex);
 }
@@ -106,7 +106,7 @@ SegmentNodeList::findCollapsesFromExistingVertices(
         return;    // or we'll never exit the loop below
     }
 
-    for(size_t i = 0, n = edge.size() - 2; i < n; ++i) {
+    for(std::size_t i = 0, n = edge.size() - 2; i < n; ++i) {
         const Coordinate& p0 = edge.getCoordinate(i);
         const Coordinate& p2 = edge.getCoordinate(i + 2);
         if(p0.equals2D(p2)) {
@@ -121,7 +121,7 @@ void
 SegmentNodeList::findCollapsesFromInsertedNodes(
     std::vector<size_t>& collapsedVertexIndexes) const
 {
-    size_t collapsedVertexIndex;
+    std::size_t collapsedVertexIndex;
 
     // there should always be at least two entries in the list,
     // since the endpoints are nodes
@@ -276,7 +276,7 @@ SegmentNodeList::createSplitEdgePts(const SegmentNode* ei0, const SegmentNode* e
     //}
 
     pts.emplace_back(ei0->coord);
-    for (size_t i = ei0->segmentIndex + 1; i <= ei1->segmentIndex; i++) {
+    for (std::size_t i = ei0->segmentIndex + 1; i <= ei1->segmentIndex; i++) {
         pts.emplace_back(edge.getCoordinate(i));
     }
     if (useIntPt1) {
diff --git a/src/noding/SimpleNoder.cpp b/src/noding/SimpleNoder.cpp
index 81e4f85..d4a6dd0 100644
--- a/src/noding/SimpleNoder.cpp
+++ b/src/noding/SimpleNoder.cpp
@@ -35,8 +35,8 @@ SimpleNoder::computeIntersects(SegmentString* e0, SegmentString* e1)
 
     const CoordinateSequence* pts0 = e0->getCoordinates();
     const CoordinateSequence* pts1 = e1->getCoordinates();
-    for(size_t i0 = 0, n0 = pts0->getSize() - 1; i0 < n0; i0++) {
-        for(size_t i1 = 0, n1 = pts1->getSize() - 1; i1 < n1; i1++) {
+    for(std::size_t i0 = 0, n0 = pts0->getSize() - 1; i0 < n0; i0++) {
+        for(std::size_t i1 = 0, n1 = pts1->getSize() - 1; i1 < n1; i1++) {
             segInt->processIntersections(e0, i0, e1, i1);
         }
     }
diff --git a/src/noding/snap/SnappingIntersectionAdder.cpp b/src/noding/snap/SnappingIntersectionAdder.cpp
index cc71f4c..2a7b504 100644
--- a/src/noding/snap/SnappingIntersectionAdder.cpp
+++ b/src/noding/snap/SnappingIntersectionAdder.cpp
@@ -43,7 +43,7 @@ SnappingIntersectionAdder::SnappingIntersectionAdder(double p_snapTolerance, Sna
 
 /*public*/
 void
-SnappingIntersectionAdder::processIntersections(SegmentString* seg0, size_t segIndex0, SegmentString* seg1, size_t segIndex1)
+SnappingIntersectionAdder::processIntersections(SegmentString* seg0, std::size_t segIndex0, SegmentString* seg1, std::size_t segIndex1)
 {
     // don't bother intersecting a segment with itself
     if (seg0 == seg1 && segIndex0 == segIndex1) return;
@@ -85,8 +85,8 @@ SnappingIntersectionAdder::processIntersections(SegmentString* seg0, size_t segI
 
 /*private*/
 void
-SnappingIntersectionAdder::processNearVertex(SegmentString* srcSS, size_t srcIndex, const geom::Coordinate& p,
-        SegmentString* ss, size_t segIndex, const geom::Coordinate& p0, const geom::Coordinate& p1)
+SnappingIntersectionAdder::processNearVertex(SegmentString* srcSS, std::size_t srcIndex, const geom::Coordinate& p,
+        SegmentString* ss, std::size_t segIndex, const geom::Coordinate& p0, const geom::Coordinate& p1)
 {
     /**
     * Don't add intersection if candidate vertex is near endpoints of segment.
@@ -109,7 +109,7 @@ SnappingIntersectionAdder::processNearVertex(SegmentString* srcSS, size_t srcInd
 
 /*private static*/
 bool
-SnappingIntersectionAdder::isAdjacent(SegmentString* ss0, size_t segIndex0, SegmentString* ss1, size_t segIndex1)
+SnappingIntersectionAdder::isAdjacent(SegmentString* ss0, std::size_t segIndex0, SegmentString* ss1, std::size_t segIndex1)
 {
     if (ss0 != ss1) return false;
     long l0 = segIndex0;
diff --git a/src/noding/snap/SnappingNoder.cpp b/src/noding/snap/SnappingNoder.cpp
index c8492c2..bf3a842 100644
--- a/src/noding/snap/SnappingNoder.cpp
+++ b/src/noding/snap/SnappingNoder.cpp
@@ -74,7 +74,7 @@ std::unique_ptr<std::vector<Coordinate>>
 SnappingNoder::snap(CoordinateSequence* cs)
 {
     std::unique_ptr<std::vector<Coordinate>> snapCoords(new std::vector<Coordinate>);
-    for (size_t i = 0, sz = cs->size(); i < sz; i++) {
+    for (std::size_t i = 0, sz = cs->size(); i < sz; i++) {
         const Coordinate& pt = snapIndex.snap(cs->getAt(i));
         snapCoords->push_back(pt);
     }
diff --git a/src/noding/snapround/HotPixelIndex.cpp b/src/noding/snapround/HotPixelIndex.cpp
index 58e1533..ffda34d 100644
--- a/src/noding/snapround/HotPixelIndex.cpp
+++ b/src/noding/snapround/HotPixelIndex.cpp
@@ -87,7 +87,7 @@ HotPixelIndex::add(const CoordinateSequence *pts)
     * spatially autocorrelated coordinates
     */
     std::vector<std::size_t> idxs;
-    for (size_t i = 0, sz = pts->size(); i < sz; i++)
+    for (std::size_t i = 0, sz = pts->size(); i < sz; i++)
         idxs.push_back(i);
 
     std::random_device rd;
@@ -104,7 +104,7 @@ void
 HotPixelIndex::add(const std::vector<geom::Coordinate>& pts)
 {
     std::vector<std::size_t> idxs;
-    for (size_t i = 0, sz = pts.size(); i < sz; i++)
+    for (std::size_t i = 0, sz = pts.size(); i < sz; i++)
         idxs.push_back(i);
 
     std::random_device rd;
@@ -120,7 +120,7 @@ HotPixelIndex::add(const std::vector<geom::Coordinate>& pts)
 void
 HotPixelIndex::addNodes(const CoordinateSequence *pts)
 {
-    for (size_t i = 0, sz = pts->size(); i < sz; i++) {
+    for (std::size_t i = 0, sz = pts->size(); i < sz; i++) {
         HotPixel* hp = add(pts->getAt(i));
         hp->setToNode();
     }
diff --git a/src/noding/snapround/MCIndexPointSnapper.cpp b/src/noding/snapround/MCIndexPointSnapper.cpp
index 86c764c..54169e4 100644
--- a/src/noding/snapround/MCIndexPointSnapper.cpp
+++ b/src/noding/snapround/MCIndexPointSnapper.cpp
@@ -42,7 +42,7 @@ public:
 
     HotPixelSnapAction(HotPixel& nHotPixel,
                        SegmentString* nParentEdge,
-                       size_t nHotPixelVertexIndex)
+                       std::size_t nHotPixelVertexIndex)
         :
         MonotoneChainSelectAction(),
         hotPixel(nHotPixel),
@@ -72,7 +72,7 @@ public:
      * would cause every vertex to be noded).
      */
     void
-    select(chain::MonotoneChain& mc, size_t startIndex) override
+    select(chain::MonotoneChain& mc, std::size_t startIndex) override
     {
         // This is casting away 'constness'!
         NodedSegmentString& ss = *(static_cast<NodedSegmentString*>(mc.getContext()));
@@ -87,7 +87,7 @@ public:
     }
 
     bool
-    addSnappedNode(HotPixel& p_hotPixel, NodedSegmentString* segStr, size_t segIndex)
+    addSnappedNode(HotPixel& p_hotPixel, NodedSegmentString* segStr, std::size_t segIndex)
     {
         const Coordinate& p0 = segStr->getCoordinate(segIndex);
         const Coordinate& p1 = segStr->getCoordinate(segIndex + 1);
@@ -107,7 +107,7 @@ public:
 private:
     HotPixel& hotPixel;
     SegmentString* parentEdge;
-    size_t hotPixelVertexIndex;
+    std::size_t hotPixelVertexIndex;
     bool isNodeAddedVar;
 
     // Declare type as noncopyable
@@ -147,7 +147,7 @@ private:
 bool
 MCIndexPointSnapper::snap(HotPixel& hotPixel,
                           SegmentString* parentEdge,
-                          size_t vertexIndex)
+                          std::size_t vertexIndex)
 {
     Envelope pixelEnv = getSafeEnvelope(hotPixel);
     HotPixelSnapAction hotPixelSnapAction(hotPixel, parentEdge, vertexIndex);
diff --git a/src/noding/snapround/MCIndexSnapRounder.cpp b/src/noding/snapround/MCIndexSnapRounder.cpp
index 86b6ec2..4f0112d 100644
--- a/src/noding/snapround/MCIndexSnapRounder.cpp
+++ b/src/noding/snapround/MCIndexSnapRounder.cpp
@@ -29,7 +29,7 @@
 #include <vector>
 
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -40,7 +40,7 @@ namespace snapround { // geos.noding.snapround
 void
 MCIndexSnapRounder::findInteriorIntersections(MCIndexNoder& noder,
         NodedSegmentString::NonConstVect* segStrings,
-        vector<Coordinate>& intersections)
+        std::vector<Coordinate>& intersections)
 {
     IntersectionFinderAdder intFinderAdder(li, intersections);
     noder.setSegmentIntersector(&intFinderAdder);
@@ -49,7 +49,7 @@ MCIndexSnapRounder::findInteriorIntersections(MCIndexNoder& noder,
 
 /* private */
 void
-MCIndexSnapRounder::computeIntersectionSnaps(vector<Coordinate>& snapPts)
+MCIndexSnapRounder::computeIntersectionSnaps(std::vector<Coordinate>& snapPts)
 {
     for (Coordinate& snapPt: snapPts) {
         HotPixel hotPixel(snapPt, scaleFactor);
@@ -63,7 +63,7 @@ void
 MCIndexSnapRounder::computeVertexSnaps(NodedSegmentString* e)
 {
     CoordinateSequence& pts0 = *(e->getCoordinates());
-    for(size_t i = 0, n = pts0.size() - 1; i < n; ++i) {
+    for(std::size_t i = 0, n = pts0.size() - 1; i < n; ++i) {
         HotPixel hotPixel(pts0.getAt(i), scaleFactor);
         bool isNodeAdded = pointSnapper->snap(hotPixel, e, i);
         // if a node is created for a vertex, that vertex must be noded too
@@ -91,7 +91,7 @@ void
 MCIndexSnapRounder::snapRound(MCIndexNoder& noder,
                               SegmentString::NonConstVect* segStrings)
 {
-    vector<Coordinate> intersections;
+    std::vector<Coordinate> intersections;
     findInteriorIntersections(noder, segStrings, intersections);
     computeIntersectionSnaps(intersections);
     computeVertexSnaps(*segStrings);
@@ -118,7 +118,7 @@ void
 MCIndexSnapRounder::checkCorrectness(
     SegmentString::NonConstVect& inputSegmentStrings)
 {
-    unique_ptr<SegmentString::NonConstVect> resultSegStrings(
+    std::unique_ptr<SegmentString::NonConstVect> resultSegStrings(
         NodedSegmentString::getNodedSubstrings(inputSegmentStrings)
     );
 
diff --git a/src/noding/snapround/SnapRoundingIntersectionAdder.cpp b/src/noding/snapround/SnapRoundingIntersectionAdder.cpp
index c90756d..5e536a0 100644
--- a/src/noding/snapround/SnapRoundingIntersectionAdder.cpp
+++ b/src/noding/snapround/SnapRoundingIntersectionAdder.cpp
@@ -29,7 +29,7 @@
 #include <iostream>
 #include <cassert>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geom;
 
@@ -50,8 +50,8 @@ SnapRoundingIntersectionAdder::SnapRoundingIntersectionAdder(const geom::Precisi
 /*public*/
 void
 SnapRoundingIntersectionAdder::processIntersections(
-    SegmentString* e0, size_t segIndex0,
-    SegmentString* e1, size_t segIndex1)
+    SegmentString* e0, std::size_t segIndex0,
+    SegmentString* e1, std::size_t segIndex1)
 {
     // don't bother intersecting a segment with itself
     if (e0 == e1 && segIndex0 == segIndex1) return;
@@ -89,7 +89,7 @@ SnapRoundingIntersectionAdder::processIntersections(
 /*private*/
 void
 SnapRoundingIntersectionAdder::processNearVertex(
-    const geom::Coordinate& p, SegmentString* edge, size_t segIndex,
+    const geom::Coordinate& p, SegmentString* edge, std::size_t segIndex,
     const geom::Coordinate& p0, const geom::Coordinate& p1)
 {
     /**
diff --git a/src/noding/snapround/SnapRoundingNoder.cpp b/src/noding/snapround/SnapRoundingNoder.cpp
index 1155ef2..78363ea 100644
--- a/src/noding/snapround/SnapRoundingNoder.cpp
+++ b/src/noding/snapround/SnapRoundingNoder.cpp
@@ -168,8 +168,8 @@ SnapRoundingNoder::computeSegmentSnaps(NodedSegmentString* ss)
     // Create new nodedSS to allow adding any hot pixel nodes
     NodedSegmentString* snapSS = new NodedSegmentString(ptsRound.release(), ss->getData());
 
-    size_t snapSSindex = 0;
-    for (size_t i = 0, sz = pts->size()-1; i < sz; i++ ) {
+    std::size_t snapSSindex = 0;
+    for (std::size_t i = 0, sz = pts->size()-1; i < sz; i++ ) {
 
         const geom::Coordinate& currSnap = snapSS->getCoordinate(snapSSindex);
 
@@ -205,16 +205,16 @@ SnapRoundingNoder::computeSegmentSnaps(NodedSegmentString* ss)
 */
 /*private*/
 void
-SnapRoundingNoder::snapSegment(Coordinate& p0, Coordinate& p1, NodedSegmentString* ss, size_t segIndex)
+SnapRoundingNoder::snapSegment(Coordinate& p0, Coordinate& p1, NodedSegmentString* ss, std::size_t segIndex)
 {
     /* First define a visitor to use in the pixelIndex.query() */
     struct SnapRoundingVisitor : KdNodeVisitor {
         const Coordinate& p0;
         const Coordinate& p1;
         NodedSegmentString* ss;
-        size_t segIndex;
+        std::size_t segIndex;
 
-        SnapRoundingVisitor(const Coordinate& pp0, const Coordinate& pp1, NodedSegmentString* pss, size_t psegIndex)
+        SnapRoundingVisitor(const Coordinate& pp0, const Coordinate& pp1, NodedSegmentString* pss, std::size_t psegIndex)
             : p0(pp0), p1(pp1), ss(pss), segIndex(psegIndex) {};
 
         void visit(KdNode* node) override {
@@ -261,7 +261,7 @@ SnapRoundingNoder::addVertexNodeSnaps(NodedSegmentString* ss)
 }
 
 void
-SnapRoundingNoder::snapVertexNode(const Coordinate& p0, NodedSegmentString* ss, size_t segIndex)
+SnapRoundingNoder::snapVertexNode(const Coordinate& p0, NodedSegmentString* ss, std::size_t segIndex)
 {
 
     /* First define a visitor to use in the pixelIndex.query() */
@@ -269,9 +269,9 @@ SnapRoundingNoder::snapVertexNode(const Coordinate& p0, NodedSegmentString* ss,
 
         const Coordinate& p0;
         NodedSegmentString* ss;
-        size_t segIndex;
+        std::size_t segIndex;
 
-        SnapRoundingVertexNodeVisitor(const Coordinate& pp0, NodedSegmentString* pss, size_t psegIndex)
+        SnapRoundingVertexNodeVisitor(const Coordinate& pp0, NodedSegmentString* pss, std::size_t psegIndex)
             : p0(pp0), ss(pss), segIndex(psegIndex) {};
 
         void visit(KdNode* node) override {
diff --git a/src/operation/IsSimpleOp.cpp b/src/operation/IsSimpleOp.cpp
index c91a1a8..df4b451 100644
--- a/src/operation/IsSimpleOp.cpp
+++ b/src/operation/IsSimpleOp.cpp
@@ -39,7 +39,7 @@
 #include <set>
 #include <cassert>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geomgraph;
 using namespace geos::geomgraph::index;
@@ -148,7 +148,7 @@ IsSimpleOp::isSimpleMultiPoint(const MultiPoint& mp)
     if(mp.isEmpty()) {
         return true;
     }
-    set<const Coordinate*, CoordinateLessThen> points;
+    std::set<const Coordinate*, CoordinateLessThen> points;
 
     for(std::size_t i = 0, n = mp.getNumGeometries(); i < n; ++i) {
         const Point* pt = mp.getGeometryN(i);
@@ -202,7 +202,7 @@ IsSimpleOp::isSimpleLinearGeometry(const Geometry* p_geom)
 bool
 IsSimpleOp::hasNonEndpointIntersection(GeometryGraph& graph)
 {
-    vector<Edge*>* edges = graph.getEdges();
+    std::vector<Edge*>* edges = graph.getEdges();
     for(Edge* e: *edges) {
         auto maxSegmentIndex = e->getMaximumSegmentIndex();
         EdgeIntersectionList& eiL = e->getEdgeIntersectionList();
@@ -287,8 +287,8 @@ IsSimpleOp::isSimplePolygonal(const geom::Geometry* g)
 bool
 IsSimpleOp::hasClosedEndpointIntersection(GeometryGraph& graph)
 {
-    map<const Coordinate*, EndpointInfo*, CoordinateLessThen> endPoints;
-    vector<Edge*>* edges = graph.getEdges();
+    std::map<const Coordinate*, EndpointInfo*, CoordinateLessThen> endPoints;
+    std::vector<Edge*>* edges = graph.getEdges();
     for(Edge* e: *edges) {
         //int maxSegmentIndex=e->getMaximumSegmentIndex();
         bool isClosed = e->isClosed();
@@ -298,7 +298,7 @@ IsSimpleOp::hasClosedEndpointIntersection(GeometryGraph& graph)
         addEndpoint(endPoints, p1, isClosed);
     }
 
-    map<const Coordinate*, EndpointInfo*, CoordinateLessThen>::iterator it = endPoints.begin();
+    std::map<const Coordinate*, EndpointInfo*, CoordinateLessThen>::iterator it = endPoints.begin();
     for(; it != endPoints.end(); ++it) {
         EndpointInfo* eiInfo = it->second;
         if(eiInfo->isClosed && eiInfo->degree != 2) {
@@ -327,10 +327,10 @@ IsSimpleOp::hasClosedEndpointIntersection(GeometryGraph& graph)
 /*private*/
 void
 IsSimpleOp::addEndpoint(
-    map<const Coordinate*, EndpointInfo*, CoordinateLessThen>& endPoints,
+    std::map<const Coordinate*, EndpointInfo*, CoordinateLessThen>& endPoints,
     const Coordinate* p, bool isClosed)
 {
-    map<const Coordinate*, EndpointInfo*, CoordinateLessThen>::iterator it = endPoints.find(p);
+    std::map<const Coordinate*, EndpointInfo*, CoordinateLessThen>::iterator it = endPoints.find(p);
     EndpointInfo* eiInfo;
     if(it == endPoints.end()) {
         eiInfo = nullptr;
diff --git a/src/operation/buffer/BufferBuilder.cpp b/src/operation/buffer/BufferBuilder.cpp
index 45543f4..514f219 100644
--- a/src/operation/buffer/BufferBuilder.cpp
+++ b/src/operation/buffer/BufferBuilder.cpp
@@ -71,7 +71,7 @@
 #define JTS_DEBUG 0
 #endif
 
-//using namespace std;
+//
 using namespace geos::geom;
 using namespace geos::geomgraph;
 using namespace geos::noding;
@@ -223,7 +223,7 @@ BufferBuilder::bufferLineSingleSided(const Geometry* g, double distance,
 
     delete nodedEdges;
 
-    for(size_t i = 0, n = curveList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = curveList.size(); i < n; ++i) {
         delete curveList[i];
     }
     curveList.clear();
@@ -279,9 +279,9 @@ BufferBuilder::bufferLineSingleSided(const Geometry* g, double distance,
             // epsilon is removed.
             const double segLengthAllowance = 1.02 * distance;
 
-            size_t front = 0;
-            size_t back = coords->size() - 1;
-            size_t sz = back - front + 1;
+            std::size_t front = 0;
+            std::size_t back = coords->size() - 1;
+            std::size_t sz = back - front + 1;
 
             // Clean up the front of the list.
             // Loop until the line's end is not inside the buffer width from
@@ -336,7 +336,7 @@ BufferBuilder::bufferLineSingleSided(const Geometry* g, double distance,
 
                     auto newSeq = seqFactory->create(sz, coords->getDimension());
 
-                    for (size_t i = 0; i < sz; i++) {
+                    for (std::size_t i = 0; i < sz; i++) {
                         newSeq->setAt(coords->getAt(i + front), i);
                     }
 
@@ -439,7 +439,7 @@ BufferBuilder::buffer(const Geometry* g, double distance)
 #if GEOS_DEBUG
         std::cerr << "Created " << subgraphList.size() << " subgraphs" << std::endl;
 #if GEOS_DEBUG > 1
-        for(size_t i = 0, n = subgraphList.size(); i < n; i++) {
+        for(std::size_t i = 0, n = subgraphList.size(); i < n; i++) {
             std::cerr << std::setprecision(10) << *(subgraphList[i]) << std::endl;
         }
 #endif
@@ -456,7 +456,7 @@ BufferBuilder::buffer(const Geometry* g, double distance)
         }
 
         // Get rid of the subgraphs, shouldn't be needed anymore
-        for(size_t i = 0, n = subgraphList.size(); i < n; i++) {
+        for(std::size_t i = 0, n = subgraphList.size(); i < n; i++) {
             delete subgraphList[i];
         }
         subgraphList.clear();
@@ -465,7 +465,7 @@ BufferBuilder::buffer(const Geometry* g, double distance)
         std::cerr << "PolygonBuilder got " << resultPolyList->size()
                   << " polygons" << std::endl;
 #if GEOS_DEBUG > 1
-        for(size_t i = 0, n = resultPolyList->size(); i < n; i++) {
+        for(std::size_t i = 0, n = resultPolyList->size(); i < n; i++) {
             std::cerr << (*resultPolyList)[i]->toString() << std::endl;
         }
 #endif
@@ -483,7 +483,7 @@ BufferBuilder::buffer(const Geometry* g, double distance)
     catch(const util::GEOSException& /* exc */) {
 
         // In case they're still around
-        for(size_t i = 0, n = subgraphList.size(); i < n; i++) {
+        for(std::size_t i = 0, n = subgraphList.size(); i < n; i++) {
             delete subgraphList[i];
         }
         subgraphList.clear();
@@ -518,7 +518,7 @@ BufferBuilder::getNoder(const PrecisionModel* pm)
 
 #if 0
     /* CoordinateArraySequence.cpp:84:
-     * virtual const geos::Coordinate& geos::CoordinateArraySequence::getAt(size_t) const:
+     * virtual const geos::Coordinate& geos::CoordinateArraySequence::getAt(std::size_t) const:
      * Assertion `pos<vect->size()' failed.
      */
 
@@ -651,7 +651,7 @@ BufferBuilder::createSubgraphs(PlanarGraph* graph, std::vector<BufferSubgraph*>&
 {
     std::vector<Node*> nodes;
     graph->getNodes(nodes);
-    for(size_t i = 0, n = nodes.size(); i < n; i++) {
+    for(std::size_t i = 0, n = nodes.size(); i < n; i++) {
         Node* node = nodes[i];
         if(!node->isVisited()) {
             BufferSubgraph* subgraph = new BufferSubgraph();
@@ -679,7 +679,7 @@ BufferBuilder::buildSubgraphs(const std::vector<BufferSubgraph*>& subgraphList,
     std::cerr << __FUNCTION__ << " got " << subgraphList.size() << " subgraphs" << std::endl;
 #endif
     std::vector<BufferSubgraph*> processedGraphs;
-    for(size_t i = 0, n = subgraphList.size(); i < n; i++) {
+    for(std::size_t i = 0, n = subgraphList.size(); i < n; i++) {
         BufferSubgraph* subgraph = subgraphList[i];
         Coordinate* p = subgraph->getRightmostCoordinate();
         assert(p);
diff --git a/src/operation/buffer/BufferInputLineSimplifier.cpp b/src/operation/buffer/BufferInputLineSimplifier.cpp
index 1ada936..b3f3e3d 100644
--- a/src/operation/buffer/BufferInputLineSimplifier.cpp
+++ b/src/operation/buffer/BufferInputLineSimplifier.cpp
@@ -83,7 +83,7 @@ BufferInputLineSimplifier::deleteShallowConcavities()
      * Do not simplify end line segments of the line string.
      * This ensures that end caps are generated consistently.
      */
-    size_t index = 1;
+    std::size_t index = 1;
 
     auto midIndex = findNextNonDeletedIndex(index);
     auto lastIndex = findNextNonDeletedIndex(midIndex);
@@ -114,7 +114,7 @@ BufferInputLineSimplifier::deleteShallowConcavities()
 
 /* private */
 size_t
-BufferInputLineSimplifier::findNextNonDeletedIndex(size_t index) const
+BufferInputLineSimplifier::findNextNonDeletedIndex(std::size_t index) const
 {
     std::size_t next = index + 1;
     const std::size_t len = inputLine.size();
@@ -130,7 +130,7 @@ BufferInputLineSimplifier::collapseLine() const
 {
     auto coordList = new CoordinateArraySequence();
 
-    for(size_t i = 0, n = inputLine.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = inputLine.size(); i < n; ++i) {
         if(isDeleted[i] != DELETE) {
             coordList->add(inputLine[i], false);
         }
@@ -141,7 +141,7 @@ BufferInputLineSimplifier::collapseLine() const
 
 /* private */
 bool
-BufferInputLineSimplifier::isDeletable(size_t i0, size_t i1, size_t i2,
+BufferInputLineSimplifier::isDeletable(std::size_t i0, std::size_t i1, std::size_t i2,
                                        double p_distanceTol) const
 {
     const Coordinate& p0 = inputLine[i0];
@@ -182,7 +182,7 @@ BufferInputLineSimplifier::isShallowConcavity(const geom::Coordinate& p0,
 bool
 BufferInputLineSimplifier::isShallowSampled(const geom::Coordinate& p0,
         const geom::Coordinate& p2,
-        size_t i0, size_t i2,
+        std::size_t i0, std::size_t i2,
         double p_distanceTol) const
 {
     // check every n'th point to see if it is within tolerance
@@ -191,7 +191,7 @@ BufferInputLineSimplifier::isShallowSampled(const geom::Coordinate& p0,
         inc = 1;
     }
 
-    for(size_t i = i0; i < i2; i += inc) {
+    for(std::size_t i = i0; i < i2; i += inc) {
         if(! isShallow(p0, p2, inputLine[i], p_distanceTol)) {
             return false;
         }
diff --git a/src/operation/buffer/BufferSubgraph.cpp b/src/operation/buffer/BufferSubgraph.cpp
index e5c6409..5c0211d 100644
--- a/src/operation/buffer/BufferSubgraph.cpp
+++ b/src/operation/buffer/BufferSubgraph.cpp
@@ -38,7 +38,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::algorithm;
 using namespace geos::operation;
@@ -85,7 +85,7 @@ BufferSubgraph::create(Node* node)
 void
 BufferSubgraph::addReachable(Node* startNode)
 {
-    vector<Node*> nodeStack;
+    std::vector<Node*> nodeStack;
     nodeStack.push_back(startNode);
     while(!nodeStack.empty()) {
         Node* node = nodeStack.back();
@@ -96,7 +96,7 @@ BufferSubgraph::addReachable(Node* startNode)
 
 /*private*/
 void
-BufferSubgraph::add(Node* node, vector<Node*>* nodeStack)
+BufferSubgraph::add(Node* node, std::vector<Node*>* nodeStack)
 {
     node->setVisited(true);
     nodes.push_back(node);
@@ -123,7 +123,7 @@ BufferSubgraph::add(Node* node, vector<Node*>* nodeStack)
 void
 BufferSubgraph::clearVisitedEdges()
 {
-    for(size_t i = 0, n = dirEdgeList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = dirEdgeList.size(); i < n; ++i) {
         DirectedEdge* de = dirEdgeList[i];
         de->setVisited(false);
     }
@@ -137,7 +137,7 @@ BufferSubgraph::computeDepth(int outsideDepth)
     // find an outside edge to assign depth to
     DirectedEdge* de = finder.getEdge();
 #if GEOS_DEBUG
-    cerr << "outside depth: " << outsideDepth << endl;
+    std::cerr << "outside depth: " << outsideDepth << std::endl;
 #endif
     //Node *n=de->getNode();
     //Label *label=de->getLabel();
@@ -194,9 +194,9 @@ void
 BufferSubgraph::copySymDepths(DirectedEdge* de)
 {
 #if GEOS_DEBUG
-    cerr << "copySymDepths: " << de->getDepth(Position::LEFT)
+    std::cerr << "copySymDepths: " << de->getDepth(Position::LEFT)
          << ", " << de->getDepth(Position::RIGHT)
-         << endl;
+         << std::endl;
 #endif
     DirectedEdge* sym = de->getSym();
     sym->setDepth(Position::LEFT, de->getDepth(Position::RIGHT));
@@ -208,9 +208,9 @@ void
 BufferSubgraph::findResultEdges()
 {
 #if GEOS_DEBUG
-    cerr << "BufferSubgraph::findResultEdges got " << dirEdgeList.size() << " edges" << endl;
+    std::cerr << "BufferSubgraph::findResultEdges got " << dirEdgeList.size() << " edges" << std::endl;
 #endif
-    for(size_t i = 0, n = dirEdgeList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = dirEdgeList.size(); i < n; ++i) {
         DirectedEdge* de = dirEdgeList[i];
 
         /*
@@ -222,17 +222,17 @@ BufferSubgraph::findResultEdges()
          */
         // <FIX> - handle negative depths
 #if GEOS_DEBUG
-        cerr << " dirEdge " << i << ": " << de->printEdge() << endl
-             << "         depth right: " << de->getDepth(Position::RIGHT) << endl
-             << "          depth left: " << de->getDepth(Position::LEFT) << endl
-             << "    interiorAreaEdge: " << de->isInteriorAreaEdge() << endl;
+        std::cerr << " dirEdge " << i << ": " << de->printEdge() << std::endl
+             << "         depth right: " << de->getDepth(Position::RIGHT) << std::endl
+             << "          depth left: " << de->getDepth(Position::LEFT) << std::endl
+             << "    interiorAreaEdge: " << de->isInteriorAreaEdge() << std::endl;
 #endif
         if(de->getDepth(Position::RIGHT) >= 1
                 &&  de->getDepth(Position::LEFT) <= 0
                 && !de->isInteriorAreaEdge()) {
             de->setInResult(true);
 #if GEOS_DEBUG
-            cerr << "   IN RESULT" << endl;
+            std::cerr << "   IN RESULT" << std::endl;
 #endif
         }
     }
@@ -256,8 +256,8 @@ BufferSubgraph::compareTo(BufferSubgraph* graph)
 void
 BufferSubgraph::computeDepths(DirectedEdge* startEdge)
 {
-    set<Node*> nodesVisited;
-    list<Node*> nodeQueue; // Used to be a vector
+    std::set<Node*> nodesVisited;
+    std::list<Node*> nodeQueue; // Used to be a vector
     Node* startNode = startEdge->getNode();
     nodeQueue.push_back(startNode);
     //nodesVisited.push_back(startNode);
@@ -299,7 +299,7 @@ BufferSubgraph::computeDepths(DirectedEdge* startEdge)
 
 /*private*/
 bool
-BufferSubgraph::contains(set<Node*>& nodeSet, Node* node)
+BufferSubgraph::contains(std::set<Node*>& nodeSet, Node* node)
 {
     //bool result=false;
     if(nodeSet.find(node) != nodeSet.end()) {
@@ -334,11 +334,11 @@ operator<< (std::ostream& os, const BufferSubgraph& bs)
        << bs.nodes.size() << " nodes, "
        << bs.dirEdgeList.size() << " directed edges" << std::endl;
 
-    for(size_t i = 0, n = bs.nodes.size(); i < n; i++) {
+    for(std::size_t i = 0, n = bs.nodes.size(); i < n; i++) {
         os << "  Node " << i << ": " << *(bs.nodes[i]) << std::endl;
     }
 
-    for(size_t i = 0, n = bs.dirEdgeList.size(); i < n; i++) {
+    for(std::size_t i = 0, n = bs.dirEdgeList.size(); i < n; i++) {
         os << "  DirEdge " << i << ": " << std::endl
            << bs.dirEdgeList[i]->printEdge() << std::endl;
     }
diff --git a/src/operation/buffer/OffsetCurveBuilder.cpp b/src/operation/buffer/OffsetCurveBuilder.cpp
index b839c1a..b51b514 100644
--- a/src/operation/buffer/OffsetCurveBuilder.cpp
+++ b/src/operation/buffer/OffsetCurveBuilder.cpp
@@ -41,7 +41,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geom;
 
@@ -55,7 +55,7 @@ const double OffsetCurveBuilder::SIMPLIFY_FACTOR = 100.0;
 /*public*/
 void
 OffsetCurveBuilder::getLineCurve(const CoordinateSequence* inputPts,
-                                 double nDistance, vector<CoordinateSequence*>& lineList)
+                                 double nDistance, std::vector<CoordinateSequence*>& lineList)
 {
     distance = nDistance;
 
@@ -103,7 +103,7 @@ OffsetCurveBuilder::computePointCurve(const Coordinate& pt,
 /*public*/
 void
 OffsetCurveBuilder::getSingleSidedLineCurve(const CoordinateSequence* inputPts,
-        double p_distance, vector<CoordinateSequence*>& lineList, bool leftSide,
+        double p_distance, std::vector<CoordinateSequence*>& lineList, bool leftSide,
         bool rightSide)
 {
     // A zero or negative width buffer of a line/point is empty.
@@ -134,7 +134,7 @@ OffsetCurveBuilder::getSingleSidedLineCurve(const CoordinateSequence* inputPts,
         }
         segGen->initSideSegments(simp1[0], simp1[1], Position::LEFT);
         segGen->addFirstSegment();
-        for(size_t i = 2; i <= n1; ++i) {
+        for(std::size_t i = 2; i <= n1; ++i) {
             segGen->addNextSegment(simp1[i], true);
         }
         segGen->addLastSegment();
@@ -154,7 +154,7 @@ OffsetCurveBuilder::getSingleSidedLineCurve(const CoordinateSequence* inputPts,
         }
         segGen->initSideSegments(simp2[n2], simp2[n2 - 1], Position::LEFT);
         segGen->addFirstSegment();
-        for(size_t i = n2 - 1; i > 0; --i) {
+        for(std::size_t i = n2 - 1; i > 0; --i) {
             segGen->addNextSegment(simp2[i - 1], true);
         }
         segGen->addLastSegment();
@@ -180,7 +180,7 @@ OffsetCurveBuilder::isLineOffsetEmpty(double p_distance)
 void
 OffsetCurveBuilder::getRingCurve(const CoordinateSequence* inputPts,
                                  int side, double nDistance,
-                                 vector<CoordinateSequence*>& lineList)
+                                 std::vector<CoordinateSequence*>& lineList)
 {
     distance = nDistance;
 
@@ -223,7 +223,7 @@ OffsetCurveBuilder::computeLineBufferCurve(const CoordinateSequence& inputPts,
 
     auto n1 = simp1.size() - 1;
     segGen.initSideSegments(simp1[0], simp1[1], Position::LEFT);
-    for(size_t i = 2; i <= n1; ++i) {
+    for(std::size_t i = 2; i <= n1; ++i) {
         segGen.addNextSegment(simp1[i], true);
     }
     segGen.addLastSegment();
@@ -238,7 +238,7 @@ OffsetCurveBuilder::computeLineBufferCurve(const CoordinateSequence& inputPts,
 
     auto n2 = simp2.size() - 1;
     segGen.initSideSegments(simp2[n2], simp2[n2 - 1], Position::LEFT);
-    for(size_t i = n2 - 1; i > 0; --i) {
+    for(std::size_t i = n2 - 1; i > 0; --i) {
         segGen.addNextSegment(simp2[i - 1], true);
     }
     segGen.addLastSegment();
@@ -265,7 +265,7 @@ OffsetCurveBuilder::computeRingBufferCurve(const CoordinateSequence& inputPts,
 
     auto n = simp.size() - 1;
     segGen.initSideSegments(simp[n - 1], simp[0], side);
-    for(size_t i = 1; i <= n; i++) {
+    for(std::size_t i = 1; i <= n; i++) {
         bool addStartPoint = i != 1;
         segGen.addNextSegment(simp[i], addStartPoint);
     }
@@ -294,7 +294,7 @@ OffsetCurveBuilder::computeSingleSidedBufferCurve(
         auto n2 = simp2.size() - 1;
         segGen.initSideSegments(simp2[n2], simp2[n2 - 1], Position::LEFT);
         segGen.addFirstSegment();
-        for(size_t  i = n2 - 1; i > 0; --i) {
+        for(std::size_t  i = n2 - 1; i > 0; --i) {
             segGen.addNextSegment(simp2[i - 1], true);
         }
 
@@ -313,7 +313,7 @@ OffsetCurveBuilder::computeSingleSidedBufferCurve(
         auto n1 = simp1.size() - 1;
         segGen.initSideSegments(simp1[0], simp1[1], Position::LEFT);
         segGen.addFirstSegment();
-        for(size_t i = 2; i <= n1; ++i) {
+        for(std::size_t i = 2; i <= n1; ++i) {
             segGen.addNextSegment(simp1[i], true);
         }
 
diff --git a/src/operation/buffer/OffsetCurveSetBuilder.cpp b/src/operation/buffer/OffsetCurveSetBuilder.cpp
index 810bddf..b261a97 100644
--- a/src/operation/buffer/OffsetCurveSetBuilder.cpp
+++ b/src/operation/buffer/OffsetCurveSetBuilder.cpp
@@ -73,11 +73,11 @@ OffsetCurveSetBuilder::OffsetCurveSetBuilder(const Geometry& newInputGeom,
 
 OffsetCurveSetBuilder::~OffsetCurveSetBuilder()
 {
-    for(size_t i = 0, n = curveList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = curveList.size(); i < n; ++i) {
         SegmentString* ss = curveList[i];
         delete ss;
     }
-    for(size_t i = 0, n = newLabels.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = newLabels.size(); i < n; ++i) {
         delete newLabels[i];
     }
 }
@@ -95,7 +95,7 @@ void
 OffsetCurveSetBuilder::addCurves(const std::vector<CoordinateSequence*>& lineList,
                                  geom::Location leftLoc, geom::Location rightLoc)
 {
-    for(size_t i = 0, n = lineList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = lineList.size(); i < n; ++i) {
         CoordinateSequence* coords = lineList[i];
         addCurve(coords, leftLoc, rightLoc);
     }
@@ -174,7 +174,7 @@ OffsetCurveSetBuilder::add(const Geometry& g)
 void
 OffsetCurveSetBuilder::addCollection(const GeometryCollection* gc)
 {
-    for(size_t i = 0, n = gc->getNumGeometries(); i < n; i++) {
+    for(std::size_t i = 0, n = gc->getNumGeometries(); i < n; i++) {
         const Geometry* g = gc->getGeometryN(i);
         add(*g);
     }
@@ -264,7 +264,7 @@ OffsetCurveSetBuilder::addPolygon(const Polygon* p)
         Location::EXTERIOR,
         Location::INTERIOR);
 
-    for(size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
         const LineString* hls = p->getInteriorRingN(i);
         const LinearRing* hole = detail::down_cast<const LinearRing*>(hls);
 
diff --git a/src/operation/buffer/OffsetSegmentGenerator.cpp b/src/operation/buffer/OffsetSegmentGenerator.cpp
index aa55e83..9d76427 100644
--- a/src/operation/buffer/OffsetSegmentGenerator.cpp
+++ b/src/operation/buffer/OffsetSegmentGenerator.cpp
@@ -40,7 +40,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geom;
 
diff --git a/src/operation/buffer/RightmostEdgeFinder.cpp b/src/operation/buffer/RightmostEdgeFinder.cpp
index 309838d..a45208b 100644
--- a/src/operation/buffer/RightmostEdgeFinder.cpp
+++ b/src/operation/buffer/RightmostEdgeFinder.cpp
@@ -55,15 +55,15 @@ RightmostEdgeFinder::findEdge(std::vector<DirectedEdge*>* dirEdgeList)
 {
 
 #ifndef NDEBUG
-    size_t checked = 0;
+    std::size_t checked = 0;
 #endif
 
     /*
      * Check all forward DirectedEdges only.  This is still general,
      * because each edge has a forward DirectedEdge.
      */
-    size_t dirEdgeListSize = dirEdgeList->size();
-    for(size_t i = 0; i < dirEdgeListSize; ++i) {
+    std::size_t dirEdgeListSize = dirEdgeList->size();
+    for(std::size_t i = 0; i < dirEdgeListSize; ++i) {
         DirectedEdge* de = (*dirEdgeList)[i];
         assert(de);
         if(!de->isForward()) {
@@ -163,7 +163,7 @@ RightmostEdgeFinder::findRightmostEdgeAtVertex()
 
     // rightmost point expected to be interior vertex of edge
     assert(minIndex > 0);
-    assert((size_t)minIndex < pts->getSize());
+    assert((std::size_t)minIndex < pts->getSize());
 
     const Coordinate& pPrev = pts->getAt(minIndex - 1);
     const Coordinate& pNext = pts->getAt(minIndex + 1);
@@ -202,8 +202,8 @@ RightmostEdgeFinder::checkForRightmostCoordinate(DirectedEdge* de)
 
     // only check vertices which are the starting point of
     // a non-horizontal segment
-    size_t n = coord->getSize() - 1;
-    for(size_t i = 0; i < n; i++) {
+    std::size_t n = coord->getSize() - 1;
+    for(std::size_t i = 0; i < n; i++) {
         // only check vertices which are the start or end point
         // of a non-horizontal segment
         // <FIX> MD 19 Sep 03 - NO!  we can test all vertices,
diff --git a/src/operation/buffer/SubgraphDepthLocater.cpp b/src/operation/buffer/SubgraphDepthLocater.cpp
index dbb8b5b..3017a1a 100644
--- a/src/operation/buffer/SubgraphDepthLocater.cpp
+++ b/src/operation/buffer/SubgraphDepthLocater.cpp
@@ -37,7 +37,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::algorithm;
 using namespace geos::geom;
@@ -155,7 +155,7 @@ struct DepthSegmentLessThen {
 int
 SubgraphDepthLocater::getDepth(const Coordinate& p)
 {
-    vector<DepthSegment*> stabbedSegments;
+    std::vector<DepthSegment*> stabbedSegments;
     findStabbedSegments(p, stabbedSegments);
 
     // if no segments on stabbing line subgraph must be outside all others
@@ -168,10 +168,10 @@ SubgraphDepthLocater::getDepth(const Coordinate& p)
     int ret = ds->leftDepth;
 
 #if GEOS_DEBUG
-    cerr << "SubgraphDepthLocater::getDepth(" << p.toString() << "): " << ret << endl;
+    std::cerr << "SubgraphDepthLocater::getDepth(" << p.toString() << "): " << ret << std::endl;
 #endif
 
-    for(vector<DepthSegment*>::iterator
+    for(std::vector<DepthSegment*>::iterator
             it = stabbedSegments.begin(), itEnd = stabbedSegments.end();
             it != itEnd;
             ++it) {
@@ -186,8 +186,8 @@ void
 SubgraphDepthLocater::findStabbedSegments(const Coordinate& stabbingRayLeftPt,
         std::vector<DepthSegment*>& stabbedSegments)
 {
-    size_t size = subgraphs->size();
-    for(size_t i = 0; i < size; ++i) {
+    std::size_t size = subgraphs->size();
+    for(std::size_t i = 0; i < size; ++i) {
         BufferSubgraph* bsg = (*subgraphs)[i];
 
         // optimization - don't bother checking subgraphs
@@ -209,15 +209,15 @@ SubgraphDepthLocater::findStabbedSegments(const Coordinate& stabbingRayLeftPt,
 void
 SubgraphDepthLocater::findStabbedSegments(
     const Coordinate& stabbingRayLeftPt,
-    vector<DirectedEdge*>* dirEdges,
-    vector<DepthSegment*>& stabbedSegments)
+    std::vector<DirectedEdge*>* dirEdges,
+    std::vector<DepthSegment*>& stabbedSegments)
 {
 
     /*
      * Check all forward DirectedEdges only. This is still general,
      * because each Edge has a forward DirectedEdge.
      */
-    for(size_t i = 0, n = dirEdges->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = dirEdges->size(); i < n; ++i) {
         DirectedEdge* de = (*dirEdges)[i];
         if(!de->isForward()) {
             continue;
@@ -231,7 +231,7 @@ void
 SubgraphDepthLocater::findStabbedSegments(
     const Coordinate& stabbingRayLeftPt,
     DirectedEdge* dirEdge,
-    vector<DepthSegment*>& stabbedSegments)
+    std::vector<DepthSegment*>& stabbedSegments)
 {
     const CoordinateSequence* pts = dirEdge->getEdge()->getCoordinates();
 
@@ -245,12 +245,12 @@ SubgraphDepthLocater::findStabbedSegments(
 #define SKIP_LS 1
 
     auto n = pts->getSize() - 1;
-    for(size_t i = 0; i < n; ++i) {
+    for(std::size_t i = 0; i < n; ++i) {
 #ifndef SKIP_LS
         seg.p0 = pts->getAt(i);
         seg.p1 = pts->getAt(i + 1);
 #if GEOS_DEBUG
-        cerr << " SubgraphDepthLocater::findStabbedSegments: segment " << i
+        std::cerr << " SubgraphDepthLocater::findStabbedSegments: segment " << i
              << " (" << seg << ") ";
 #endif
 
@@ -267,7 +267,7 @@ SubgraphDepthLocater::findStabbedSegments(
         {
             seg.reverse();
 #if GEOS_DEBUG
-            cerr << " reverse (" << seg << ") ";
+            std::cerr << " reverse (" << seg << ") ";
 #endif
         }
 #else
@@ -281,13 +281,13 @@ SubgraphDepthLocater::findStabbedSegments(
         // skip segment if it is left of the stabbing line
         // skip if segment is above or below stabbing line
 #ifndef SKIP_LS
-        double maxx = max(seg.p0.x, seg.p1.x);
+        double maxx = std::max(seg.p0.x, seg.p1.x);
 #else
-        double maxx = max(low->x, high->x);
+        double maxx = std::max(low->x, high->x);
 #endif
         if(maxx < stabbingRayLeftPt.x) {
 #if GEOS_DEBUG
-            cerr << " segment is left to stabbing line, skipping " << endl;
+            std::cerr << " segment is left to stabbing line, skipping " << std::endl;
 #endif
             continue;
         }
@@ -301,7 +301,7 @@ SubgraphDepthLocater::findStabbedSegments(
 #endif
         {
 #if GEOS_DEBUG
-            cerr << " segment is horizontal, skipping " << endl;
+            std::cerr << " segment is horizontal, skipping " << std::endl;
 #endif
             continue;
         }
@@ -316,7 +316,7 @@ SubgraphDepthLocater::findStabbedSegments(
 #endif
         {
 #if GEOS_DEBUG
-            cerr << " segment above or below stabbing line, skipping " << endl;
+            std::cerr << " segment above or below stabbing line, skipping " << std::endl;
 #endif
             continue;
         }
@@ -329,7 +329,7 @@ SubgraphDepthLocater::findStabbedSegments(
 #endif
                               stabbingRayLeftPt) == Orientation::RIGHT) {
 #if GEOS_DEBUG
-            cerr << " stabbing ray right of segment, skipping" << endl;
+            std::cerr << " stabbing ray right of segment, skipping" << std::endl;
 #endif
             continue;
         }
@@ -348,7 +348,7 @@ SubgraphDepthLocater::findStabbedSegments(
 #endif
 
 #if GEOS_DEBUG
-        cerr << " depth: " << depth << endl;
+        std::cerr << " depth: " << depth << std::endl;
 #endif
 
 #ifdef SKIP_LS
diff --git a/src/operation/distance/ConnectedElementLocationFilter.cpp b/src/operation/distance/ConnectedElementLocationFilter.cpp
index 5c36acb..71feb28 100644
--- a/src/operation/distance/ConnectedElementLocationFilter.cpp
+++ b/src/operation/distance/ConnectedElementLocationFilter.cpp
@@ -27,7 +27,7 @@
 #include <vector>
 #include <typeinfo>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -35,7 +35,7 @@ namespace operation { // geos.operation
 namespace distance { // geos.operation.distance
 
 /*public*/
-vector<unique_ptr<GeometryLocation>>
+std::vector<std::unique_ptr<GeometryLocation>>
 ConnectedElementLocationFilter::getLocations(const Geometry* geom)
 {
     ConnectedElementLocationFilter c;
diff --git a/src/operation/distance/ConnectedElementPointFilter.cpp b/src/operation/distance/ConnectedElementPointFilter.cpp
index e214ee6..cdc4ea6 100644
--- a/src/operation/distance/ConnectedElementPointFilter.cpp
+++ b/src/operation/distance/ConnectedElementPointFilter.cpp
@@ -25,7 +25,7 @@
 #include <vector>
 #include <typeinfo>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -37,10 +37,10 @@ namespace distance { // geos.operation.distance
  * found inside the specified geometry. Thus, if the specified geometry is
  * not a GeometryCollection, an empty list will be returned.
  */
-vector<const Coordinate*>*
+std::vector<const Coordinate*>*
 ConnectedElementPointFilter::getCoordinates(const Geometry* geom)
 {
-    vector<const Coordinate*>* points = new vector<const Coordinate*>();
+    std::vector<const Coordinate*>* points = new std::vector<const Coordinate*>();
     ConnectedElementPointFilter c(points);
     geom->apply_ro(&c);
     return points;
diff --git a/src/operation/distance/DistanceOp.cpp b/src/operation/distance/DistanceOp.cpp
index 82b27d2..c79af7a 100644
--- a/src/operation/distance/DistanceOp.cpp
+++ b/src/operation/distance/DistanceOp.cpp
@@ -44,7 +44,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 //using namespace geos::algorithm;
 
@@ -143,7 +143,7 @@ DistanceOp::nearestPoints()
 }
 
 void
-DistanceOp::updateMinDistance(array<unique_ptr<GeometryLocation>, 2> & locGeom, bool flip)
+DistanceOp::updateMinDistance(std::array<std::unique_ptr<GeometryLocation>, 2> & locGeom, bool flip)
 {
     // if not set then don't update
     if(locGeom[0] == nullptr) {
@@ -210,7 +210,7 @@ DistanceOp::computeContainmentDistance()
     // Expected to fill minDistanceLocation items
     // if minDistance <= terminateDistance
 
-    array<std::unique_ptr<GeometryLocation>, 2> locPtPoly;
+    std::array<std::unique_ptr<GeometryLocation>, 2> locPtPoly;
     // test if either geometry has a vertex inside the other
     if(! polys1.empty()) {
         auto insideLocs0 = ConnectedElementLocationFilter::getLocations(geom[0]);
@@ -254,9 +254,9 @@ DistanceOp::computeContainmentDistance()
 
 /*private*/
 void
-DistanceOp::computeInside(vector<unique_ptr<GeometryLocation>> & locs,
+DistanceOp::computeInside(std::vector<std::unique_ptr<GeometryLocation>> & locs,
                           const Polygon::ConstVect& polys,
-                          array<unique_ptr<GeometryLocation>, 2> & locPtPoly)
+                          std::array<std::unique_ptr<GeometryLocation>, 2> & locPtPoly)
 {
     for(auto& loc : locs) {
         for(const auto& poly : polys) {
@@ -279,7 +279,7 @@ DistanceOp::computeFacetDistance()
     using geom::util::LinearComponentExtracter;
     using geom::util::PointExtracter;
 
-    array<unique_ptr<GeometryLocation>, 2> locGeom;
+    std::array<std::unique_ptr<GeometryLocation>, 2> locGeom;
 
     /*
      * Geometries are not wholly inside, so compute distance from lines
@@ -375,7 +375,7 @@ void
 DistanceOp::computeMinDistancePoints(
     const Point::ConstVect& points0,
     const Point::ConstVect& points1,
-    array<unique_ptr<GeometryLocation>, 2> & locGeom)
+    std::array<std::unique_ptr<GeometryLocation>, 2> & locGeom)
 {
     for(const Point* pt0 : points0) {
         for(const Point* pt1 : points1) {
@@ -437,11 +437,11 @@ DistanceOp::computeMinDistance(
 
     const CoordinateSequence* coord0 = line0->getCoordinatesRO();
     const CoordinateSequence* coord1 = line1->getCoordinatesRO();
-    size_t npts0 = coord0->getSize();
-    size_t npts1 = coord1->getSize();
+    std::size_t npts0 = coord0->getSize();
+    std::size_t npts1 = coord1->getSize();
 
     // brute force approach!
-    for(size_t i = 0; i < npts0 - 1; ++i) {
+    for(std::size_t i = 0; i < npts0 - 1; ++i) {
         const Coordinate& p00 = coord0->getAt(i);
         const Coordinate& p01 = coord0->getAt(i+1);
 
@@ -451,7 +451,7 @@ DistanceOp::computeMinDistance(
             continue;
         }
 
-        for(size_t j = 0; j < npts1 - 1; ++j) {
+        for(std::size_t j = 0; j < npts1 - 1; ++j) {
             const Coordinate& p10 = coord1->getAt(j);
             const Coordinate& p11 = coord1->getAt(j+1);
 
@@ -499,8 +499,8 @@ DistanceOp::computeMinDistance(const LineString* line,
     const Coordinate* coord = pt->getCoordinate();
 
     // brute force approach!
-    size_t npts0 = coord0->getSize();
-    for(size_t i = 0; i < npts0 - 1; ++i) {
+    std::size_t npts0 = coord0->getSize();
+    for(std::size_t i = 0; i < npts0 - 1; ++i) {
         double dist = Distance::pointToSegment(*coord, coord0->getAt(i), coord0->getAt(i + 1));
         if(dist < minDistance) {
             minDistance = dist;
diff --git a/src/operation/distance/FacetSequence.cpp b/src/operation/distance/FacetSequence.cpp
index 67580e1..402303d 100644
--- a/src/operation/distance/FacetSequence.cpp
+++ b/src/operation/distance/FacetSequence.cpp
@@ -25,7 +25,7 @@ using namespace geos::geom;
 using namespace geos::operation::distance;
 using namespace geos::algorithm;
 
-FacetSequence::FacetSequence(const Geometry *p_geom, const CoordinateSequence* p_pts, size_t p_start, size_t p_end) :
+FacetSequence::FacetSequence(const Geometry *p_geom, const CoordinateSequence* p_pts, std::size_t p_start, std::size_t p_end) :
     pts(p_pts),
     start(p_start),
     end(p_end),
@@ -34,7 +34,7 @@ FacetSequence::FacetSequence(const Geometry *p_geom, const CoordinateSequence* p
     computeEnvelope();
 }
 
-FacetSequence::FacetSequence(const CoordinateSequence* p_pts, size_t p_start, size_t p_end) :
+FacetSequence::FacetSequence(const CoordinateSequence* p_pts, std::size_t p_start, std::size_t p_end) :
     pts(p_pts),
     start(p_start),
     end(p_end),
@@ -124,7 +124,7 @@ FacetSequence::computeDistancePointLine(const Coordinate& pt,
 {
     double minDistance = std::numeric_limits<double>::infinity();
 
-    for(size_t i = facetSeq.start; i < facetSeq.end - 1; i++) {
+    for(std::size_t i = facetSeq.start; i < facetSeq.end - 1; i++) {
         const Coordinate& q0 = facetSeq.pts->getAt(i);
         const Coordinate& q1 = facetSeq.pts->getAt(i + 1);
         double dist = Distance::pointToSegment(pt, q0, q1);
@@ -144,7 +144,7 @@ FacetSequence::computeDistancePointLine(const Coordinate& pt,
 
 void
 FacetSequence::updateNearestLocationsPointLine(const Coordinate& pt,
-        const FacetSequence& facetSeq, size_t i,
+        const FacetSequence& facetSeq, std::size_t i,
         const Coordinate& q0, const Coordinate &q1,
         std::vector<GeometryLocation> *locs) const
 {
@@ -162,7 +162,7 @@ FacetSequence::computeDistanceLineLine(const FacetSequence& facetSeq, std::vecto
 {
     double minDistance = std::numeric_limits<double>::infinity();
 
-    for(size_t i = start; i < end - 1; i++) {
+    for(std::size_t i = start; i < end - 1; i++) {
         const Coordinate& p0 = pts->getAt(i);
         const Coordinate& p1 = pts->getAt(i + 1);
 
@@ -175,7 +175,7 @@ FacetSequence::computeDistanceLineLine(const FacetSequence& facetSeq, std::vecto
             continue;
         }
 
-        for(size_t j = facetSeq.start; j < facetSeq.end - 1; j++) {
+        for(std::size_t j = facetSeq.start; j < facetSeq.end - 1; j++) {
             const Coordinate& q0 = facetSeq.pts->getAt(j);
             const Coordinate& q1 = facetSeq.pts->getAt(j + 1);
 
@@ -203,9 +203,9 @@ FacetSequence::computeDistanceLineLine(const FacetSequence& facetSeq, std::vecto
 }
 
 void
-FacetSequence::updateNearestLocationsLineLine(size_t i, const Coordinate& p0, const Coordinate& p1,
+FacetSequence::updateNearestLocationsLineLine(std::size_t i, const Coordinate& p0, const Coordinate& p1,
         const FacetSequence& facetSeq,
-        size_t j, const Coordinate& q0, const Coordinate &q1,
+        std::size_t j, const Coordinate& q0, const Coordinate &q1,
         std::vector<GeometryLocation> *locs) const
 {
     LineSegment seg0(p0, p1);
@@ -222,7 +222,7 @@ void
 FacetSequence::computeEnvelope()
 {
     env = Envelope();
-    for(size_t i = start; i < end; i++) {
+    for(std::size_t i = start; i < end; i++) {
         env.expandToInclude(pts->getAt(i));
     }
 }
@@ -234,7 +234,7 @@ FacetSequence::getEnvelope() const
 }
 
 const Coordinate*
-FacetSequence::getCoordinate(size_t index) const
+FacetSequence::getCoordinate(std::size_t index) const
 {
     return &(pts->getAt(start + index));
 }
diff --git a/src/operation/distance/FacetSequenceTreeBuilder.cpp b/src/operation/distance/FacetSequenceTreeBuilder.cpp
index b737810..c9adca2 100644
--- a/src/operation/distance/FacetSequenceTreeBuilder.cpp
+++ b/src/operation/distance/FacetSequenceTreeBuilder.cpp
@@ -71,12 +71,12 @@ void
 FacetSequenceTreeBuilder::addFacetSequences(const Geometry* geom, const CoordinateSequence* pts,
         std::vector<FacetSequence> & sections)
 {
-    size_t i = 0;
-    size_t size = pts->size();
+    std::size_t i = 0;
+    std::size_t size = pts->size();
     if ( size == 0 ) return;
 
     while(i <= size - 1) {
-        size_t end = i + FACET_SEQUENCE_SIZE + 1;
+        std::size_t end = i + FACET_SEQUENCE_SIZE + 1;
         // if only one point remains after this section, include it in this
         // section
         if(end >= size - 1) {
diff --git a/src/operation/distance/GeometryLocation.cpp b/src/operation/distance/GeometryLocation.cpp
index 593a908..fef2c3e 100644
--- a/src/operation/distance/GeometryLocation.cpp
+++ b/src/operation/distance/GeometryLocation.cpp
@@ -31,7 +31,7 @@ namespace distance { // geos.operation.distance
  * Constructs a GeometryLocation specifying a point on a geometry, as well as the
  * segment that the point is on (or INSIDE_AREA if the point is not on a segment).
  */
-GeometryLocation::GeometryLocation(const Geometry* newComponent, size_t newSegIndex, const Coordinate& newPt)
+GeometryLocation::GeometryLocation(const Geometry* newComponent, std::size_t newSegIndex, const Coordinate& newPt)
 {
     component = newComponent;
     segIndex = newSegIndex;
@@ -46,7 +46,7 @@ GeometryLocation::GeometryLocation(const Geometry* newComponent, const Coordinat
 {
     component = newComponent;
     inside_area = true;
-    segIndex = (size_t) INSIDE_AREA;
+    segIndex = (std::size_t) INSIDE_AREA;
     pt = newPt;
 }
 
diff --git a/src/operation/intersection/RectangleIntersection.cpp b/src/operation/intersection/RectangleIntersection.cpp
index 6518deb..0b2164e 100644
--- a/src/operation/intersection/RectangleIntersection.cpp
+++ b/src/operation/intersection/RectangleIntersection.cpp
@@ -157,7 +157,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
 
     // Start iterating
 
-    size_t i = 0;
+    std::size_t i = 0;
 
     while(i < n) {
         // Establish initial position
@@ -418,7 +418,7 @@ RectangleIntersection::clip_polygon_to_linestrings(const geom::Polygon* g,
     // - Clipped ones become linestrings
     // - Intact ones become new polygons without holes
 
-    for(size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i) {
         if(clip_linestring_parts(g->getInteriorRingN(i), parts, rect)) {
             // clones
             LinearRing* hole = new LinearRing(*(g->getInteriorRingN(i)));
@@ -488,7 +488,7 @@ RectangleIntersection::clip_polygon_to_polygons(const geom::Polygon* g,
     // - Intact ones become holes in new polygons formed by exterior parts
 
 
-    for(size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumInteriorRing(); i < n; ++i) {
         RectangleIntersectionBuilder holeparts(*_gf);
         const LinearRing* hole = g->getInteriorRingN(i);
         if(clip_linestring_parts(hole, holeparts, rect)) {
@@ -572,7 +572,7 @@ RectangleIntersection::clip_multipoint(const geom::MultiPoint* g,
     if(g == nullptr || g->isEmpty()) {
         return;
     }
-    for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
         clip_point(g->getGeometryN(i), parts, rect);
     }
 }
@@ -586,7 +586,7 @@ RectangleIntersection::clip_multilinestring(const geom::MultiLineString* g,
         return;
     }
 
-    for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
         clip_linestring(g->getGeometryN(i), parts, rect);
     }
 }
@@ -601,7 +601,7 @@ RectangleIntersection::clip_multipolygon(const geom::MultiPolygon* g,
         return;
     }
 
-    for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
         clip_polygon(g->getGeometryN(i), parts, rect, keep_polygons);
     }
 }
@@ -617,7 +617,7 @@ RectangleIntersection::clip_geometrycollection(
         return;
     }
 
-    for(size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g->getNumGeometries(); i < n; ++i) {
         clip_geom(g->getGeometryN(i),
                   parts, rect, keep_polygons);
     }
diff --git a/src/operation/intersection/RectangleIntersectionBuilder.cpp b/src/operation/intersection/RectangleIntersectionBuilder.cpp
index ffb52f6..a63f6d2 100644
--- a/src/operation/intersection/RectangleIntersectionBuilder.cpp
+++ b/src/operation/intersection/RectangleIntersectionBuilder.cpp
@@ -276,7 +276,7 @@ distance(const Rectangle& rect,
  * \brief Reverse given segment in a coordinate vector
  */
 void
-reverse_points(std::vector<Coordinate>& v, size_t start, size_t end)
+reverse_points(std::vector<Coordinate>& v, std::size_t start, std::size_t end)
 {
     geom::Coordinate p1;
     geom::Coordinate p2;
@@ -302,9 +302,9 @@ normalize_ring(std::vector<Coordinate>& ring)
 
     // Find the "smallest" coordinate
 
-    size_t best_pos = 0;
+    std::size_t best_pos = 0;
     auto n = ring.size();
-    for(size_t pos = 0; pos < n; ++pos) {
+    for(std::size_t pos = 0; pos < n; ++pos) {
         // TODO: use CoordinateLessThan ?
         if(ring[pos].x < ring[best_pos].x) {
             best_pos = pos;
@@ -466,7 +466,7 @@ RectangleIntersectionBuilder::reconnectPolygons(const Rectangle& rect)
                                cs[0].x,
                                cs[0].y);
                 // above function adds the 1st point
-                for(size_t i = 1; i < cs.size(); ++i) {
+                for(std::size_t i = 1; i < cs.size(); ++i) {
                     ring->push_back(cs[i]);
                 }
                 //ring->addSubLineString(line,1);
diff --git a/src/operation/linemerge/EdgeString.cpp b/src/operation/linemerge/EdgeString.cpp
index 4b152f4..3e48951 100644
--- a/src/operation/linemerge/EdgeString.cpp
+++ b/src/operation/linemerge/EdgeString.cpp
@@ -31,7 +31,7 @@
 #include <vector>
 #include <cassert>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
diff --git a/src/operation/linemerge/LineMergeGraph.cpp b/src/operation/linemerge/LineMergeGraph.cpp
index d3c2197..9876a08 100644
--- a/src/operation/linemerge/LineMergeGraph.cpp
+++ b/src/operation/linemerge/LineMergeGraph.cpp
@@ -38,7 +38,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 //using namespace geos::planargraph;
 using namespace geos::geom;
 
@@ -54,7 +54,7 @@ LineMergeGraph::addEdge(const LineString* lineString)
     }
 
 #if GEOS_DEBUG
-    cerr << "Adding LineString " << lineString->toString() << endl;
+    std::cerr << "Adding LineString " << lineString->toString() << std::endl;
 #endif
 
     auto coordinates = valid::RepeatedPointRemover::removeRepeatedPoints(lineString->getCoordinatesRO());
@@ -72,8 +72,8 @@ LineMergeGraph::addEdge(const LineString* lineString)
     planargraph::Node* startNode = getNode(startCoordinate);
     planargraph::Node* endNode = getNode(endCoordinate);
 #if GEOS_DEBUG
-    cerr << " startNode: " << *startNode << endl;
-    cerr << " endNode: " << *endNode << endl;
+    std::cerr << " startNode: " << *startNode << std::endl;
+    std::cerr << " endNode: " << *endNode << std::endl;
 #endif
 
     planargraph::DirectedEdge* directedEdge0 = new LineMergeDirectedEdge(startNode,
@@ -91,15 +91,15 @@ LineMergeGraph::addEdge(const LineString* lineString)
     edge->setDirectedEdges(directedEdge0, directedEdge1);
 
 #if GEOS_DEBUG
-    cerr << " planargraph::Edge: " << *edge << endl;
+    std::cerr << " planargraph::Edge: " << *edge << std::endl;
 #endif
 
     add(edge);
 
 #if GEOS_DEBUG
-    cerr << " After addition to the graph:" << endl;
-    cerr << "  startNode: " << *startNode << endl;
-    cerr << "  endNode: " << *endNode << endl;
+    std::cerr << " After addition to the graph:" << std::endl;
+    std::cerr << "  startNode: " << *startNode << std::endl;
+    std::cerr << "  endNode: " << *endNode << std::endl;
 #endif
 
 }
diff --git a/src/operation/linemerge/LineMerger.cpp b/src/operation/linemerge/LineMerger.cpp
index af7c4ca..c3c41d2 100644
--- a/src/operation/linemerge/LineMerger.cpp
+++ b/src/operation/linemerge/LineMerger.cpp
@@ -32,7 +32,7 @@
 #include <functional>
 #include <vector>
 
-using namespace std;
+
 using namespace geos::planargraph;
 using namespace geos::geom;
 
@@ -45,7 +45,7 @@ namespace operation { // geos.operation
 namespace linemerge { // geos.operation.linemerge
 
 void
-LineMerger::add(vector<const Geometry*>* geometries)
+LineMerger::add(std::vector<const Geometry*>* geometries)
 {
     for(const Geometry* g : *geometries) {
         add(g);
@@ -59,7 +59,7 @@ LineMerger::LineMerger():
 
 LineMerger::~LineMerger()
 {
-    for(size_t i = 0, n = edgeStrings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edgeStrings.size(); i < n; ++i) {
         delete edgeStrings[i];
     }
 }
@@ -115,7 +115,7 @@ LineMerger::merge()
     GraphComponent::setMarked(graph.edgeIterator(), graph.edgeEnd(),
                               false);
 
-    for(size_t i = 0, n = edgeStrings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edgeStrings.size(); i < n; ++i) {
         delete edgeStrings[i];
     }
     edgeStrings.clear();
@@ -125,7 +125,7 @@ LineMerger::merge()
 
     auto numEdgeStrings = edgeStrings.size();
     mergedLineStrings.reserve(numEdgeStrings);
-    for(size_t i = 0; i < numEdgeStrings; ++i) {
+    for(std::size_t i = 0; i < numEdgeStrings; ++i) {
         EdgeString* edgeString = edgeStrings[i];
         mergedLineStrings.emplace_back(edgeString->toLineString());
     }
@@ -147,7 +147,7 @@ void
 LineMerger::buildEdgeStringsForUnprocessedNodes()
 {
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << endl;
+    std::cerr << __FUNCTION__ << std::endl;
 #endif
     typedef std::vector<Node*> Nodes;
 
@@ -156,14 +156,14 @@ LineMerger::buildEdgeStringsForUnprocessedNodes()
     for(Nodes::size_type i = 0, in = nodes.size(); i < in; ++i) {
         Node* node = nodes[i];
 #if GEOS_DEBUG
-        cerr << "Node " << i << ": " << *node << endl;
+        std::cerr << "Node " << i << ": " << *node << std::endl;
 #endif
         if(!node->isMarked()) {
             assert(node->getDegree() == 2);
             buildEdgeStringsStartingAt(node);
             node->setMarked(true);
 #if GEOS_DEBUG
-            cerr << " setMarked(true) : " << *node << endl;
+            std::cerr << " setMarked(true) : " << *node << std::endl;
 #endif
         }
     }
@@ -173,7 +173,7 @@ void
 LineMerger::buildEdgeStringsForNonDegree2Nodes()
 {
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << endl;
+    std::cerr << __FUNCTION__ << std::endl;
 #endif
     typedef std::vector<Node*> Nodes;
 
@@ -182,13 +182,13 @@ LineMerger::buildEdgeStringsForNonDegree2Nodes()
     for(Nodes::size_type i = 0, in = nodes.size(); i < in; ++i) {
         Node* node = nodes[i];
 #if GEOS_DEBUG
-        cerr << "Node " << i << ": " << *node << endl;
+        std::cerr << "Node " << i << ": " << *node << std::endl;
 #endif
         if(node->getDegree() != 2) {
             buildEdgeStringsStartingAt(node);
             node->setMarked(true);
 #if GEOS_DEBUG
-            cerr << " setMarked(true) : " << *node << endl;
+            std::cerr << " setMarked(true) : " << *node << std::endl;
 #endif
         }
     }
@@ -197,9 +197,9 @@ LineMerger::buildEdgeStringsForNonDegree2Nodes()
 void
 LineMerger::buildEdgeStringsStartingAt(Node* node)
 {
-    vector<planargraph::DirectedEdge*>& edges = node->getOutEdges()->getEdges();
-    size_t size = edges.size();
-    for(size_t i = 0; i < size; i++) {
+    std::vector<planargraph::DirectedEdge*>& edges = node->getOutEdges()->getEdges();
+    std::size_t size = edges.size();
+    for(std::size_t i = 0; i < size; i++) {
         LineMergeDirectedEdge* directedEdge =
                             detail::down_cast<LineMergeDirectedEdge*>(edges[i]);
         if(directedEdge->getEdge()->isMarked()) {
diff --git a/src/operation/linemerge/LineSequencer.cpp b/src/operation/linemerge/LineSequencer.cpp
index 3739d7a..08360e0 100644
--- a/src/operation/linemerge/LineSequencer.cpp
+++ b/src/operation/linemerge/LineSequencer.cpp
@@ -36,7 +36,7 @@
 #include <limits>
 #include <vector>
 
-using namespace std;
+
 //using namespace geos::planargraph;
 using namespace geos::geom;
 //using namespace geos::planargraph::algorithm;
@@ -131,9 +131,9 @@ LineSequencer::findSequences()
 {
     Sequences* sequences = new Sequences();
     planargraph::algorithm::ConnectedSubgraphFinder csFinder(graph);
-    vector<planargraph::Subgraph*> subgraphs;
+    std::vector<planargraph::Subgraph*> subgraphs;
     csFinder.getConnectedSubgraphs(subgraphs);
-    for(vector<planargraph::Subgraph*>::const_iterator
+    for(std::vector<planargraph::Subgraph*>::const_iterator
             it = subgraphs.begin(), endIt = subgraphs.end();
             it != endIt;
             ++it) {
@@ -179,7 +179,7 @@ LineSequencer::computeSequence()
         return;
     }
 
-    sequencedGeometry = unique_ptr<Geometry>(buildSequencedGeometry(*sequences));
+    sequencedGeometry = std::unique_ptr<Geometry>(buildSequencedGeometry(*sequences));
     isSequenceableVar = true;
 
     delAll(*sequences);
@@ -197,7 +197,7 @@ LineSequencer::computeSequence()
 Geometry*
 LineSequencer::buildSequencedGeometry(const Sequences& sequences)
 {
-    unique_ptr<Geometry::NonConstVect> lines(new Geometry::NonConstVect);
+    std::unique_ptr<Geometry::NonConstVect> lines(new Geometry::NonConstVect);
 
     for(Sequences::const_iterator
             i1 = sequences.begin(), i1End = sequences.end();
@@ -248,7 +248,7 @@ LineSequencer::reverse(const LineString* line)
 const planargraph::Node*
 LineSequencer::findLowestDegreeNode(const planargraph::Subgraph& graph)
 {
-    size_t minDegree = numeric_limits<size_t>::max();
+    std::size_t minDegree = std::numeric_limits<size_t>::max();
     const planargraph::Node* minDegreeNode = nullptr;
     for(planargraph::NodeMap::container::const_iterator
             it = graph.nodeBegin(), itEnd = graph.nodeEnd();
diff --git a/src/operation/overlay/EdgeSetNoder.cpp b/src/operation/overlay/EdgeSetNoder.cpp
index 27a78c5..8d2448c 100644
--- a/src/operation/overlay/EdgeSetNoder.cpp
+++ b/src/operation/overlay/EdgeSetNoder.cpp
@@ -25,7 +25,7 @@
 #include <geos/geomgraph/index/SimpleMCSweepLineIntersector.h>
 #include <geos/geomgraph/index/SegmentIntersector.h>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geomgraph;
 using namespace geos::geomgraph::index;
@@ -36,19 +36,19 @@ namespace overlay { // geos.operation.overlay
 
 
 void
-EdgeSetNoder::addEdges(vector<Edge*>* edges)
+EdgeSetNoder::addEdges(std::vector<Edge*>* edges)
 {
     inputEdges->insert(inputEdges->end(), edges->begin(), edges->end());
 }
 
-vector<Edge*>*
+std::vector<Edge*>*
 EdgeSetNoder::getNodedEdges()
 {
     EdgeSetIntersector* esi = new SimpleMCSweepLineIntersector();
     SegmentIntersector* si = new SegmentIntersector(li, true, false);
     esi->computeIntersections(inputEdges, si, true);
     //Debug.println("has proper int = " + si.hasProperIntersection());
-    vector<Edge*>* splitEdges = new vector<Edge*>();
+    std::vector<Edge*>* splitEdges = new std::vector<Edge*>();
     for(int i = 0; i < (int)inputEdges->size(); i++) {
         Edge* e = (*inputEdges)[i];
         e->getEdgeIntersectionList().addSplitEdges(splitEdges);
diff --git a/src/operation/overlay/ElevationMatrix.cpp b/src/operation/overlay/ElevationMatrix.cpp
index 74fc7b5..128c368 100644
--- a/src/operation/overlay/ElevationMatrix.cpp
+++ b/src/operation/overlay/ElevationMatrix.cpp
@@ -38,7 +38,7 @@
 #pragma warning(disable:4355)
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -53,8 +53,8 @@ void
 ElevationMatrixFilter::filter_rw(Coordinate* c) const
 {
 #if GEOS_DEBUG
-    cerr << "ElevationMatrixFilter::filter_rw(" << c->toString() << ") called"
-         << endl;
+    std::cerr << "ElevationMatrixFilter::filter_rw(" << c->toString() << ") called"
+         << std::endl;
 #endif
 
     // already has a Z value, nothing to do
@@ -71,7 +71,7 @@ ElevationMatrixFilter::filter_rw(Coordinate* c) const
             c->z = p_avgElevation;
         }
 #if GEOS_DEBUG
-        cerr << "  z set to " << c->z << endl;
+        std::cerr << "  z set to " << c->z << std::endl;
 #endif
     }
     catch(const util::IllegalArgumentException& /* ex */) {
@@ -83,8 +83,8 @@ void
 ElevationMatrixFilter::filter_ro(const Coordinate* c)
 {
 #if GEOS_DEBUG
-    cerr << "ElevationMatrixFilter::filter_ro(" << c->toString() << ") called"
-         << endl;
+    std::cerr << "ElevationMatrixFilter::filter_ro(" << c->toString() << ") called"
+         << std::endl;
 #endif
     em.add(*c);
 }
@@ -112,7 +112,7 @@ void
 ElevationMatrix::add(const Geometry* geom)
 {
 #if GEOS_DEBUG
-    cerr << "ElevationMatrix::add(Geometry *) called" << endl;
+    std::cerr << "ElevationMatrix::add(Geometry *) called" << std::endl;
 #endif // GEOS_DEBUG
 
     // Cannot add Geometries to an ElevationMatrix after it's average
@@ -147,9 +147,9 @@ ElevationMatrix::add(const Coordinate& c)
     }
     catch(const util::IllegalArgumentException& exp) {
         // coordinate do not overlap matrix
-        cerr << "ElevationMatrix::add(" << c.toString()
+        std::cerr << "ElevationMatrix::add(" << c.toString()
              << "): Coordinate does not overlap grid extent: "
-             << exp.what() << endl;
+             << exp.what() << std::endl;
         return;
     }
 }
@@ -182,7 +182,7 @@ ElevationMatrix::getCell(const Coordinate& c)
     int celloffset = (cols * row) + col;
 
     if(celloffset < 0 || celloffset >= (int)(cols * rows)) {
-        ostringstream s;
+        std::ostringstream s;
         s << "ElevationMatrix::getCell got a Coordinate out of grid extent (" << env.toString() << ") - cols:" << cols <<
           " rows:" << rows;
         throw util::IllegalArgumentException(s.str());
@@ -228,16 +228,16 @@ ElevationMatrix::getAvgElevation() const
     return avgElevation;
 }
 
-string
+std::string
 ElevationMatrix::print() const
 {
-    ostringstream ret;
-    ret << "Cols:" << cols << " Rows:" << rows << " AvgElevation:" << getAvgElevation() << endl;
+    std::ostringstream ret;
+    ret << "Cols:" << cols << " Rows:" << rows << " AvgElevation:" << getAvgElevation() << std::endl;
     for(unsigned int r = 0; r < rows; r++) {
         for(unsigned int c = 0; c < cols; c++) {
             ret << cells[(r * cols) + c].print() << '\t';
         }
-        ret << endl;
+        ret << std::endl;
     }
     return ret.str();
 }
diff --git a/src/operation/overlay/ElevationMatrixCell.cpp b/src/operation/overlay/ElevationMatrixCell.cpp
index a574a63..0993d70 100644
--- a/src/operation/overlay/ElevationMatrixCell.cpp
+++ b/src/operation/overlay/ElevationMatrixCell.cpp
@@ -25,7 +25,7 @@
 #include <vector>
 #include <cmath>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -70,10 +70,10 @@ ElevationMatrixCell::getAvg() const
             DoubleNotANumber;
 }
 
-string
+std::string
 ElevationMatrixCell::print() const
 {
-    ostringstream ret;
+    std::ostringstream ret;
     //ret<<"["<<ztot<<"/"<<zvals.size()<<"]";
     ret << "[" << getAvg() << "]";
     return ret.str();
diff --git a/src/operation/overlay/LineBuilder.cpp b/src/operation/overlay/LineBuilder.cpp
index c3d64ef..d7b7707 100644
--- a/src/operation/overlay/LineBuilder.cpp
+++ b/src/operation/overlay/LineBuilder.cpp
@@ -37,7 +37,7 @@
 #endif
 #define COMPUTE_Z 1
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geomgraph;
 using namespace geos::geom;
@@ -52,8 +52,8 @@ LineBuilder::LineBuilder(OverlayOp* newOp,
     op(newOp),
     geometryFactory(newGeometryFactory),
     ptLocator(newPtLocator),
-    //lineEdgesList(new vector<Edge *>()),
-    resultLineList(new vector<LineString *>())
+    //lineEdgesList(new std::vector<Edge *>()),
+    resultLineList(new std::vector<LineString *>())
 {
 }
 
@@ -61,7 +61,7 @@ LineBuilder::LineBuilder(OverlayOp* newOp,
  * @return a list of the LineStrings in the result of the
  *         specified overlay operation
  */
-vector<LineString*>*
+std::vector<LineString*>*
 LineBuilder::build(OverlayOp::OpCode opCode)
 {
     findCoveredLineEdges();
@@ -95,8 +95,8 @@ LineBuilder::findCoveredLineEdges()
      * For all L edges which weren't handled by the above,
      * use a point-in-poly test to determine whether they are covered
      */
-    vector<EdgeEnd*>* ee = op->getGraph().getEdgeEnds();
-    for(size_t i = 0, s = ee->size(); i < s; ++i) {
+    std::vector<EdgeEnd*>* ee = op->getGraph().getEdgeEnds();
+    for(std::size_t i = 0, s = ee->size(); i < s; ++i) {
         DirectedEdge* de = detail::down_cast<DirectedEdge*>((*ee)[i]);
         Edge* e = de->getEdge();
         if(de->isLineEdge() && !e->isCoveredSet()) {
@@ -109,8 +109,8 @@ LineBuilder::findCoveredLineEdges()
 void
 LineBuilder::collectLines(OverlayOp::OpCode opCode)
 {
-    vector<EdgeEnd*>* ee = op->getGraph().getEdgeEnds();
-    for(size_t i = 0, s = ee->size(); i < s; ++i) {
+    std::vector<EdgeEnd*>* ee = op->getGraph().getEdgeEnds();
+    for(std::size_t i = 0, s = ee->size(); i < s; ++i) {
         DirectedEdge* de = detail::down_cast<DirectedEdge*>((*ee)[i]);
         collectLineEdge(de, opCode, &lineEdgesList);
         collectBoundaryTouchEdge(de, opCode, &lineEdgesList);
@@ -119,7 +119,7 @@ LineBuilder::collectLines(OverlayOp::OpCode opCode)
 
 void
 LineBuilder::collectLineEdge(DirectedEdge* de, OverlayOp::OpCode opCode,
-                             vector<Edge*>* edges)
+                             std::vector<Edge*>* edges)
 {
 
     // include L edges which are in the result
@@ -145,7 +145,7 @@ LineBuilder::collectLineEdge(DirectedEdge* de, OverlayOp::OpCode opCode,
 /*private*/
 void
 LineBuilder::collectBoundaryTouchEdge(DirectedEdge* de,
-                                      OverlayOp::OpCode opCode, vector<Edge*>* edges)
+                                      OverlayOp::OpCode opCode, std::vector<Edge*>* edges)
 {
     if(de->isLineEdge()) {
         return;    // only interested in area edges
@@ -182,7 +182,7 @@ LineBuilder::collectBoundaryTouchEdge(DirectedEdge* de,
 void
 LineBuilder::buildLines(OverlayOp::OpCode /* opCode */)
 {
-    for(size_t i = 0, s = lineEdgesList.size(); i < s; ++i) {
+    for(std::size_t i = 0, s = lineEdgesList.size(); i < s; ++i) {
         Edge* e = lineEdgesList[i];
         auto cs = e->getCoordinates()->clone();
 #if COMPUTE_Z
@@ -204,24 +204,24 @@ void
 LineBuilder::propagateZ(CoordinateSequence* cs)
 {
 #if GEOS_DEBUG
-    cerr << "LineBuilder::propagateZ() called" << endl;
+    std::cerr << "LineBuilder::propagateZ() called" << std::endl;
 #endif
 
-    vector<size_t> v3d; // vertex 3d
-    size_t cssize = cs->getSize();
-    for(size_t i = 0; i < cssize; ++i) {
+    std::vector<size_t> v3d; // vertex 3d
+    std::size_t cssize = cs->getSize();
+    for(std::size_t i = 0; i < cssize; ++i) {
         if(!std::isnan(cs->getAt(i).z)) {
             v3d.push_back(i);
         }
     }
 
 #if GEOS_DEBUG
-    cerr << "  found " << v3d.size() << " 3d vertexes" << endl;
+    std::cerr << "  found " << v3d.size() << " 3d vertexes" << std::endl;
 #endif
 
     if(v3d.empty()) {
 #if GEOS_DEBUG
-        cerr << "  nothing to do" << endl;
+        std::cerr << "  nothing to do" << std::endl;
 #endif
         return;
     }
@@ -231,7 +231,7 @@ LineBuilder::propagateZ(CoordinateSequence* cs)
     // fill initial part
     if(v3d[0] != 0) {
         double z = cs->getAt(v3d[0]).z;
-        for(size_t j = 0; j < v3d[0]; ++j) {
+        for(std::size_t j = 0; j < v3d[0]; ++j) {
             buf = cs->getAt(j);
             buf.z = z;
             cs->setAt(buf, j);
@@ -239,8 +239,8 @@ LineBuilder::propagateZ(CoordinateSequence* cs)
     }
 
     // interpolate inbetweens
-    size_t prev = v3d[0];
-    for(size_t i = 1; i < v3d.size(); ++i) {
+    std::size_t prev = v3d[0];
+    for(std::size_t i = 1; i < v3d.size(); ++i) {
         auto curr = v3d[i];
         auto dist = curr - prev;
         if(dist > 1) {
@@ -249,7 +249,7 @@ LineBuilder::propagateZ(CoordinateSequence* cs)
             double gap = cto.z - cfrom.z;
             double zstep = gap / static_cast<double>(dist);
             double z = cfrom.z;
-            for(size_t j = prev + 1; j < curr; ++j) {
+            for(std::size_t j = prev + 1; j < curr; ++j) {
                 buf = cs->getAt(j);
                 z += zstep;
                 buf.z = z;
@@ -262,7 +262,7 @@ LineBuilder::propagateZ(CoordinateSequence* cs)
     // fill final part
     if(prev < cssize - 1) {
         double z = cs->getAt(prev).z;
-        for(size_t j = prev + 1; j < cssize; j++) {
+        for(std::size_t j = prev + 1; j < cssize; j++) {
             buf = cs->getAt(j);
             buf.z = z;
             cs->setAt(buf, j);
@@ -274,9 +274,9 @@ LineBuilder::propagateZ(CoordinateSequence* cs)
 
 
 void
-LineBuilder::labelIsolatedLines(vector<Edge*>* edgesList)
+LineBuilder::labelIsolatedLines(std::vector<Edge*>* edgesList)
 {
-    for(size_t i = 0, s = edgesList->size(); i < s; ++i) {
+    for(std::size_t i = 0, s = edgesList->size(); i < s; ++i) {
         Edge* e = (*edgesList)[i];
         const Label& label = e->getLabel();
         //n.print(System.out);
diff --git a/src/operation/overlay/MaximalEdgeRing.cpp b/src/operation/overlay/MaximalEdgeRing.cpp
index 5f5e4c8..6221944 100644
--- a/src/operation/overlay/MaximalEdgeRing.cpp
+++ b/src/operation/overlay/MaximalEdgeRing.cpp
@@ -37,7 +37,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 
@@ -55,7 +55,7 @@ MaximalEdgeRing::MaximalEdgeRing(DirectedEdge* start,
     computePoints(start);
     computeRing();
 #if GEOS_DEBUG
-    cerr << "MaximalEdgeRing[" << this << "] ctor" << endl;
+    std::cerr << "MaximalEdgeRing[" << this << "] ctor" << std::endl;
 #endif
 }
 
@@ -93,17 +93,17 @@ MaximalEdgeRing::linkDirectedEdgesForMinimalEdgeRings()
 }
 
 /*public*/
-vector<MinimalEdgeRing*>*
+std::vector<MinimalEdgeRing*>*
 MaximalEdgeRing::buildMinimalRings()
 {
-    vector<MinimalEdgeRing*>* minEdgeRings = new vector<MinimalEdgeRing*>;
+    std::vector<MinimalEdgeRing*>* minEdgeRings = new std::vector<MinimalEdgeRing*>;
     buildMinimalRings(*minEdgeRings);
     return minEdgeRings;
 }
 
 /*public*/
 void
-MaximalEdgeRing::buildMinimalRings(vector<MinimalEdgeRing*>& minEdgeRings)
+MaximalEdgeRing::buildMinimalRings(std::vector<MinimalEdgeRing*>& minEdgeRings)
 {
     DirectedEdge* de = startDe;
     do {
@@ -118,7 +118,7 @@ MaximalEdgeRing::buildMinimalRings(vector<MinimalEdgeRing*>& minEdgeRings)
 
 /*public*/
 void
-MaximalEdgeRing::buildMinimalRings(vector<EdgeRing*>& minEdgeRings)
+MaximalEdgeRing::buildMinimalRings(std::vector<EdgeRing*>& minEdgeRings)
 {
     DirectedEdge* de = startDe;
     do {
diff --git a/src/operation/overlay/OverlayOp.cpp b/src/operation/overlay/OverlayOp.cpp
index 2631416..cfcd342 100644
--- a/src/operation/overlay/OverlayOp.cpp
+++ b/src/operation/overlay/OverlayOp.cpp
@@ -74,7 +74,7 @@
 // Other validators, not found in JTS
 //#define ENABLE_OTHER_OVERLAY_RESULT_VALIDATORS 1
 
-using namespace std;
+
 using namespace geos::geom;
 using namespace geos::geomgraph;
 using namespace geos::algorithm;
@@ -164,7 +164,7 @@ OverlayOp::OverlayOp(const Geometry* g0, const Geometry* g1)
     elevationMatrix->add(g0);
     elevationMatrix->add(g1);
 #if GEOS_DEBUG
-    cerr << elevationMatrix->print() << endl;
+    std::cerr << elevationMatrix->print() << std::endl;
 #endif
 #endif // USE_ELEVATION_MATRIX
 #endif // COMPUTE_Z
@@ -175,7 +175,7 @@ OverlayOp::~OverlayOp()
     delete resultPolyList;
     delete resultLineList;
     delete resultPointList;
-    for(size_t i = 0; i < dupEdges.size(); i++) {
+    for(std::size_t i = 0; i < dupEdges.size(); i++) {
         delete dupEdges[i];
     }
 #if USE_ELEVATION_MATRIX
@@ -194,16 +194,16 @@ OverlayOp::getResultGeometry(OverlayOp::OpCode funcCode)
 
 /*private*/
 void
-OverlayOp::insertUniqueEdges(vector<Edge*>* edges, const Envelope* env)
+OverlayOp::insertUniqueEdges(std::vector<Edge*>* edges, const Envelope* env)
 {
-    for(size_t i = 0, n = edges->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edges->size(); i < n; ++i) {
         Edge* e = (*edges)[i];
         if(env && ! env->intersects(e->getEnvelope())) {
             dupEdges.push_back(e); // or could it be deleted directly ?
             continue;
         }
 #if GEOS_DEBUG
-        cerr << " " << e->print() << endl;
+        std::cerr << " " << e->print() << std::endl;
 #endif
         insertUniqueEdge(e);
     }
@@ -213,14 +213,14 @@ OverlayOp::insertUniqueEdges(vector<Edge*>* edges, const Envelope* env)
 void
 OverlayOp::replaceCollapsedEdges()
 {
-    vector<Edge*>& edges = edgeList.getEdges();
+    std::vector<Edge*>& edges = edgeList.getEdges();
 
-    for(size_t i = 0, nedges = edges.size(); i < nedges; ++i) {
+    for(std::size_t i = 0, nedges = edges.size(); i < nedges; ++i) {
         Edge* e = edges[i];
         assert(e);
         if(e->isCollapsed()) {
 #if GEOS_DEBUG
-            cerr << " replacing collapsed edge " << i << endl;
+            std::cerr << " replacing collapsed edge " << i << std::endl;
 #endif // GEOS_DEBUG
             //Debug.print(e);
             edges[i] = e->getCollapsedEdge();
@@ -266,7 +266,7 @@ OverlayOp::copyPoints(int argIndex, const Envelope* env)
     }
 
 #ifdef GEOS_DEBUG_COPY_POINTS
-    cerr << "Copied " << copied << " nodes out of " << nodeMap.size() << " for geom " << argIndex << endl;
+    std::cerr << "Copied " << copied << " nodes out of " << nodeMap.size() << " for geom " << argIndex << std::endl;
 #endif
 }
 
@@ -278,31 +278,31 @@ OverlayOp::computeLabelling()
     NodeMap::container& nodeMap = graph.getNodeMap()->nodeMap;
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeLabelling(): at call time: " << edgeList.print() << endl;
+    std::cerr << "OverlayOp::computeLabelling(): at call time: " << edgeList.print() << std::endl;
 #endif
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeLabelling() scanning " << nodeMap.size() << " nodes from map:" << endl;
+    std::cerr << "OverlayOp::computeLabelling() scanning " << nodeMap.size() << " nodes from map:" << std::endl;
 #endif
 
     for(NodeMap::const_iterator it = nodeMap.begin(), itEnd = nodeMap.end();
             it != itEnd; ++it) {
         Node* node = it->second;
 #if GEOS_DEBUG
-        cerr << "     " << node->print() << " has " << node->getEdges()->getEdges().size() << " edgeEnds" << endl;
+        std::cerr << "     " << node->print() << " has " << node->getEdges()->getEdges().size() << " edgeEnds" << std::endl;
 #endif
         node->getEdges()->computeLabelling(&arg);
     }
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeLabelling(): after edge labelling: " << edgeList.print() << endl;
+    std::cerr << "OverlayOp::computeLabelling(): after edge labelling: " << edgeList.print() << std::endl;
 #endif
     mergeSymLabels();
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeLabelling(): after labels sym merging: " << edgeList.print() << endl;
+    std::cerr << "OverlayOp::computeLabelling(): after labels sym merging: " << edgeList.print() << std::endl;
 #endif
     updateNodeLabelling();
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeLabelling(): after node labeling update: " << edgeList.print() << endl;
+    std::cerr << "OverlayOp::computeLabelling(): after node labeling update: " << edgeList.print() << std::endl;
 #endif
 }
 
@@ -313,7 +313,7 @@ OverlayOp::mergeSymLabels()
     NodeMap::container& nodeMap = graph.getNodeMap()->nodeMap;
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::mergeSymLabels() scanning " << nodeMap.size() << " nodes from map:" << endl;
+    std::cerr << "OverlayOp::mergeSymLabels() scanning " << nodeMap.size() << " nodes from map:" << std::endl;
 #endif
 
     for(NodeMap::const_iterator it = nodeMap.begin(), itEnd = nodeMap.end();
@@ -323,7 +323,7 @@ OverlayOp::mergeSymLabels()
         detail::down_cast<DirectedEdgeStar*>(ees)->mergeSymLabels();
         //((DirectedEdgeStar*)node->getEdges())->mergeSymLabels();
 #if GEOS_DEBUG
-        cerr << "     " << node->print() << endl;
+        std::cerr << "     " << node->print() << std::endl;
 #endif
         //node.print(System.out);
     }
@@ -341,8 +341,8 @@ OverlayOp::updateNodeLabelling()
     NodeMap::container& nodeMap = graph.getNodeMap()->nodeMap;
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::updateNodeLabelling() scanning "
-         << nodeMap.size() << " nodes from map:" << endl;
+    std::cerr << "OverlayOp::updateNodeLabelling() scanning "
+         << nodeMap.size() << " nodes from map:" << std::endl;
 #endif
 
     for(NodeMap::const_iterator it = nodeMap.begin(), itEnd = nodeMap.end();
@@ -353,7 +353,7 @@ OverlayOp::updateNodeLabelling()
         Label& lbl = des->getLabel();
         node->getLabel().merge(lbl);
 #if GEOS_DEBUG
-        cerr << "     " << node->print() << endl;
+        std::cerr << "     " << node->print() << std::endl;
 #endif
     }
 }
@@ -365,7 +365,7 @@ OverlayOp::labelIncompleteNodes()
     NodeMap::container& nodeMap = graph.getNodeMap()->nodeMap;
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::labelIncompleteNodes() scanning " << nodeMap.size() << " nodes from map:" << endl;
+    std::cerr << "OverlayOp::labelIncompleteNodes() scanning " << nodeMap.size() << " nodes from map:" << std::endl;
 #endif
 
     for(NodeMap::const_iterator it = nodeMap.begin(), itEnd = nodeMap.end();
@@ -395,14 +395,14 @@ void
 OverlayOp::labelIncompleteNode(Node* n, int targetIndex)
 {
 #if GEOS_DEBUG
-    cerr << "OverlayOp::labelIncompleteNode(" << n->print() << ", " << targetIndex << ")" << endl;
+    std::cerr << "OverlayOp::labelIncompleteNode(" << n->print() << ", " << targetIndex << ")" << std::endl;
 #endif
     const Geometry* targetGeom = arg[targetIndex]->getGeometry();
     Location loc = ptLocator.locate(n->getCoordinate(), targetGeom);
     n->getLabel().setLocation(targetIndex, loc);
 
 #if GEOS_DEBUG
-    cerr << "   after location set: " << n->print() << endl;
+    std::cerr << "   after location set: " << n->print() << std::endl;
 #endif
 
 #if COMPUTE_Z
@@ -445,8 +445,8 @@ OverlayOp::getAverageZ(const Polygon* poly)
 
     const CoordinateSequence* pts =
         poly->getExteriorRing()->getCoordinatesRO();
-    size_t npts = pts->getSize();
-    for(size_t i = 0; i < npts; ++i) {
+    std::size_t npts = pts->getSize();
+    for(std::size_t i = 0; i < npts; ++i) {
         const Coordinate& c = pts->getAt(i);
         if(!std::isnan(c.z)) {
             totz += c.z;
@@ -492,7 +492,7 @@ OverlayOp::mergeZ(Node* n, const Polygon* poly) const
     if(found) {
         return 1;
     }
-    for(size_t i = 0, nr = poly->getNumInteriorRing(); i < nr; ++i) {
+    for(std::size_t i = 0, nr = poly->getNumInteriorRing(); i < nr; ++i) {
         ls = poly->getInteriorRingN(i);
         found = mergeZ(n, ls);
         if(found) {
@@ -509,7 +509,7 @@ OverlayOp::mergeZ(Node* n, const LineString* line) const
     const CoordinateSequence* pts = line->getCoordinatesRO();
     const Coordinate& p = n->getCoordinate();
     LineIntersector p_li;
-    for(size_t i = 1, size = pts->size(); i < size; ++i) {
+    for(std::size_t i = 1, size = pts->size(); i < size; ++i) {
         const Coordinate& p0 = pts->getAt(i - 1);
         const Coordinate& p1 = pts->getAt(i);
         p_li.computeIntersection(p, p0, p1);
@@ -534,8 +534,8 @@ OverlayOp::mergeZ(Node* n, const LineString* line) const
 void
 OverlayOp::findResultAreaEdges(OverlayOp::OpCode opCode)
 {
-    vector<EdgeEnd*>* ee = graph.getEdgeEnds();
-    for(size_t i = 0, e = ee->size(); i < e; ++i) {
+    std::vector<EdgeEnd*>* ee = graph.getEdgeEnds();
+    for(std::size_t i = 0, e = ee->size(); i < e; ++i) {
         DirectedEdge* de = (DirectedEdge*)(*ee)[i];
         // mark all dirEdges with the appropriate label
         const Label& label = de->getLabel();
@@ -557,8 +557,8 @@ OverlayOp::cancelDuplicateResultEdges()
 {
     // remove any dirEdges whose sym is also included
     // (they "cancel each other out")
-    vector<EdgeEnd*>* ee = graph.getEdgeEnds();
-    for(size_t i = 0, eesize = ee->size(); i < eesize; ++i) {
+    std::vector<EdgeEnd*>* ee = graph.getEdgeEnds();
+    for(std::size_t i = 0, eesize = ee->size(); i < eesize; ++i) {
         DirectedEdge* de = static_cast<DirectedEdge*>((*ee)[i]);
         DirectedEdge* sym = de->getSym();
         if(de->isInResult() && sym->isInResult()) {
@@ -594,9 +594,9 @@ OverlayOp::isCoveredByA(const Coordinate& coord)
 
 /*private*/
 bool
-OverlayOp::isCovered(const Coordinate& coord, vector<Geometry*>* geomList)
+OverlayOp::isCovered(const Coordinate& coord, std::vector<Geometry*>* geomList)
 {
-    for(size_t i = 0, n = geomList->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = geomList->size(); i < n; ++i) {
         Geometry* geom = (*geomList)[i];
         Location loc = ptLocator.locate(coord, geom);
         if(loc != Location::EXTERIOR) {
@@ -608,9 +608,9 @@ OverlayOp::isCovered(const Coordinate& coord, vector<Geometry*>* geomList)
 
 /*private*/
 bool
-OverlayOp::isCovered(const Coordinate& coord, vector<LineString*>* geomList)
+OverlayOp::isCovered(const Coordinate& coord, std::vector<LineString*>* geomList)
 {
-    for(size_t i = 0, n = geomList->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = geomList->size(); i < n; ++i) {
         Geometry* geom = (Geometry*)(*geomList)[i];
         Location loc = ptLocator.locate(coord, geom);
         if(loc != Location::EXTERIOR) {
@@ -622,9 +622,9 @@ OverlayOp::isCovered(const Coordinate& coord, vector<LineString*>* geomList)
 
 /*private*/
 bool
-OverlayOp::isCovered(const Coordinate& coord, vector<Polygon*>* geomList)
+OverlayOp::isCovered(const Coordinate& coord, std::vector<Polygon*>* geomList)
 {
-    for(size_t i = 0, n = geomList->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = geomList->size(); i < n; ++i) {
         Geometry* geom = (Geometry*)(*geomList)[i];
         Location loc = ptLocator.locate(coord, geom);
         if(loc != Location::EXTERIOR) {
@@ -644,16 +644,16 @@ OverlayOp::resultDimension(OverlayOp::OpCode overlayOpCode,
     Dimension::DimensionType resultDimension = Dimension::False;
     switch(overlayOpCode) {
     case OverlayOp::opINTERSECTION:
-        resultDimension = min(dim0, dim1);
+        resultDimension = std::min(dim0, dim1);
         break;
     case OverlayOp::opUNION:
-        resultDimension = max(dim0, dim1);
+        resultDimension = std::max(dim0, dim1);
         break;
     case OverlayOp::opDIFFERENCE:
         resultDimension = dim0;
         break;
     case OverlayOp::opSYMDIFFERENCE:
-        resultDimension = max(dim0, dim1);
+        resultDimension = std::max(dim0, dim1);
         break;
     }
     return resultDimension;
@@ -684,16 +684,16 @@ OverlayOp::createEmptyResult(OverlayOp::OpCode overlayOpCode,
 
 /*private*/
 Geometry*
-OverlayOp::computeGeometry(vector<Point*>* nResultPointList,
-                           vector<LineString*>* nResultLineList,
-                           vector<Polygon*>* nResultPolyList,
+OverlayOp::computeGeometry(std::vector<Point*>* nResultPointList,
+                           std::vector<LineString*>* nResultLineList,
+                           std::vector<Polygon*>* nResultPolyList,
                            OverlayOp::OpCode opCode)
 {
-    size_t nPoints = nResultPointList->size();
-    size_t nLines = nResultLineList->size();
-    size_t nPolys = nResultPolyList->size();
+    std::size_t nPoints = nResultPointList->size();
+    std::size_t nLines = nResultLineList->size();
+    std::size_t nPolys = nResultPolyList->size();
 
-    std::unique_ptr<vector<Geometry*>> geomList{new vector<Geometry*>()};
+    std::unique_ptr<std::vector<Geometry*>> geomList{new std::vector<Geometry*>()};
     geomList->reserve(nPoints + nLines + nPolys);
 
     // element geometries of the result are always in the order P,L,A
@@ -761,7 +761,7 @@ OverlayOp::computeOverlay(OverlayOp::OpCode opCode)
     arg[1]->computeSelfNodes(li, false, env);
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeOverlay: computed SelfNodes" << endl;
+    std::cerr << "OverlayOp::computeOverlay: computed SelfNodes" << std::endl;
 #endif
 
     GEOS_CHECK_FOR_INTERRUPTS();
@@ -770,14 +770,14 @@ OverlayOp::computeOverlay(OverlayOp::OpCode opCode)
     arg[0]->computeEdgeIntersections(arg[1], &li, true, env);
 
 #if GEOS_DEBUG
-    cerr << "OverlayOp::computeOverlay: computed EdgeIntersections" << endl;
-    cerr << "OverlayOp::computeOverlay: li: " << li.toString() << endl;
+    std::cerr << "OverlayOp::computeOverlay: computed EdgeIntersections" << std::endl;
+    std::cerr << "OverlayOp::computeOverlay: li: " << li.toString() << std::endl;
 #endif
 
 
     GEOS_CHECK_FOR_INTERRUPTS();
 
-    vector<Edge*> baseSplitEdges;
+    std::vector<Edge*> baseSplitEdges;
     arg[0]->computeSplitEdges(&baseSplitEdges);
     GEOS_CHECK_FOR_INTERRUPTS();
     arg[1]->computeSplitEdges(&baseSplitEdges);
@@ -806,18 +806,18 @@ OverlayOp::computeOverlay(OverlayOp::OpCode opCode)
      */
     try {
 #ifdef GEOS_DEBUG_VALIDATION
-        cout << "EdgeNodingValidator about to evaluate " << edgeList.getEdges().size() << " edges" << endl;
+        std::size_t << "EdgeNodingValidator about to evaluate " << edgeList.getEdges().size() << " edges" << std::endl;
 #endif
         // Will throw TopologyException if noding is
         // found to be invalid
         EdgeNodingValidator::checkValid(edgeList.getEdges());
 #ifdef GEOS_DEBUG_VALIDATION
-        cout << "EdgeNodingValidator accepted the noding" << endl;
+        std::size_t << "EdgeNodingValidator accepted the noding" << std::endl;
 #endif
     }
     catch(const util::TopologyException& ex) {
 #ifdef GEOS_DEBUG_VALIDATION
-        cout << "EdgeNodingValidator found noding invalid: " << ex.what() << endl;
+        std::size_t << "EdgeNodingValidator found noding invalid: " << ex.what() << std::endl;
 #endif
 
         // In the error scenario, the edgeList is not properly
@@ -865,10 +865,10 @@ OverlayOp::computeOverlay(OverlayOp::OpCode opCode)
     // might throw a TopologyException *
     polyBuilder.add(&graph);
 
-    vector<Geometry*>* gv = polyBuilder.getPolygons();
-    size_t gvsize = gv->size();
-    resultPolyList = new vector<Polygon*>(gvsize);
-    for(size_t i = 0; i < gvsize; ++i) {
+    std::vector<Geometry*>* gv = polyBuilder.getPolygons();
+    std::size_t gvsize = gv->size();
+    resultPolyList = new std::vector<Polygon*>(gvsize);
+    for(std::size_t i = 0; i < gvsize; ++i) {
         Polygon* p = dynamic_cast<Polygon*>((*gv)[i]);
         (*resultPolyList)[i] = p;
     }
@@ -899,7 +899,7 @@ OverlayOp::insertUniqueEdge(Edge* e)
 {
     //Debug.println(e);
 #if GEOS_DEBUG
-    cerr << "OverlayOp::insertUniqueEdge(" << e->print() << ")" << endl;
+    std::cerr << "OverlayOp::insertUniqueEdge(" << e->print() << ")" << std::endl;
 #endif
 
     //<FIX> MD 8 Oct 03  speed up identical edge lookup
@@ -910,7 +910,7 @@ OverlayOp::insertUniqueEdge(Edge* e)
     if(existingEdge) {
 
 #if GEOS_DEBUG
-        cerr << "  found identical edge, should merge Z" << endl;
+        std::cerr << "  found identical edge, should merge Z" << std::endl;
 #endif
 
         Label& existingLabel = existingEdge->getLabel();
@@ -941,7 +941,7 @@ OverlayOp::insertUniqueEdge(Edge* e)
     else {
         // no matching existing edge was found
 #if GEOS_DEBUG
-        cerr << "  no matching existing edge" << endl;
+        std::cerr << "  no matching existing edge" << std::endl;
 #endif
         // add this new edge to the list of edges in this graph
         //e.setName(name+edges.size());
@@ -997,16 +997,16 @@ OverlayOp::computeLabelsFromDepths()
 }
 
 struct PointCoveredByAny: public geom::CoordinateFilter {
-    const vector<const Geometry*>& geoms;
+    const std::vector<const Geometry*>& geoms;
     PointLocator locator;
-    PointCoveredByAny(const vector<const Geometry*>& nGeoms)
+    PointCoveredByAny(const std::vector<const Geometry*>& nGeoms)
         : geoms(nGeoms)
     {}
 
     void
     filter_ro(const Coordinate* coord) override
     {
-        for(size_t i = 0, n = geoms.size(); i < n; ++i) {
+        for(std::size_t i = 0, n = geoms.size(); i < n; ++i) {
             Location loc = locator.locate(*coord, geoms[i]);
             if(loc == Location::INTERIOR ||
                     loc == Location::BOUNDARY) {
@@ -1068,7 +1068,7 @@ OverlayOp::checkObviouslyWrongResult(OverlayOp::OpCode opCode)
         // less obvious check:
         // each vertex in first geom must be either covered by
         // result or second geom
-        vector<const Geometry*> testGeoms;
+        std::vector<const Geometry*> testGeoms;
         testGeoms.reserve(2);
         testGeoms.push_back(resultGeom);
         testGeoms.push_back(arg[1]->getGeometry());
@@ -1090,7 +1090,7 @@ OverlayOp::checkObviouslyWrongResult(OverlayOp::OpCode opCode)
         bool isvalid = validator.isValid(opCode);
         if(! isvalid) {
 #ifdef GEOS_DEBUG_VALIDATION
-            cout << "OverlayResultValidator considered result INVALID" << endl;
+            std::size_t << "OverlayResultValidator considered result INVALID" << std::endl;
 #endif
             throw util::TopologyException(
                 "Obviously wrong result: "
@@ -1098,18 +1098,18 @@ OverlayOp::checkObviouslyWrongResult(OverlayOp::OpCode opCode)
                 "the result: \n"
                 "Invalid point: " +
                 validator.getInvalidLocation().toString() +
-                string("\nInvalid result: ") +
+                std::string("\nInvalid result: ") +
                 resultGeom->toString());
         }
 #ifdef GEOS_DEBUG_VALIDATION
         else {
-            cout << "OverlayResultValidator considered result valid" << endl;
+            std::size_t << "OverlayResultValidator considered result valid" << std::endl;
         }
 #endif
     }
 #ifdef GEOS_DEBUG_VALIDATION
     else {
-        cout << "Did not run OverlayResultValidator as the precision model is not floating" << endl;
+        std::size_t << "Did not run OverlayResultValidator as the precision model is not floating" << std::endl;
     }
 #endif // ndef GEOS_DEBUG
 #endif
diff --git a/src/operation/overlay/PointBuilder.cpp b/src/operation/overlay/PointBuilder.cpp
index c92325f..0c70e93 100644
--- a/src/operation/overlay/PointBuilder.cpp
+++ b/src/operation/overlay/PointBuilder.cpp
@@ -30,7 +30,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 
@@ -43,7 +43,7 @@ namespace overlay { // geos.operation.overlay
  * @return a list of the Points in the result of the specified
  * overlay operation
  */
-vector<Point*>*
+std::vector<Point*>*
 PointBuilder::build(OverlayOp::OpCode opCode)
 {
     extractNonCoveredResultNodes(opCode);
diff --git a/src/operation/overlay/PolygonBuilder.cpp b/src/operation/overlay/PolygonBuilder.cpp
index 0069edc..1a59dec 100644
--- a/src/operation/overlay/PolygonBuilder.cpp
+++ b/src/operation/overlay/PolygonBuilder.cpp
@@ -42,7 +42,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::algorithm;
 using namespace geos::geom;
@@ -59,7 +59,7 @@ PolygonBuilder::PolygonBuilder(const GeometryFactory* newGeometryFactory)
 
 PolygonBuilder::~PolygonBuilder()
 {
-    for(size_t i = 0, n = shellList.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = shellList.size(); i < n; ++i) {
         delete shellList[i];
     }
 }
@@ -69,24 +69,24 @@ void
 PolygonBuilder::add(PlanarGraph* graph)
 //throw(TopologyException *)
 {
-    const vector<EdgeEnd*>* eeptr = graph->getEdgeEnds();
+    const std::vector<EdgeEnd*>* eeptr = graph->getEdgeEnds();
     assert(eeptr);
-    const vector<EdgeEnd*>& ee = *eeptr;
+    const std::vector<EdgeEnd*>& ee = *eeptr;
 
-    size_t eeSize = ee.size();
+    std::size_t eeSize = ee.size();
 
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << ": PlanarGraph has " << eeSize << " EdgeEnds" << endl;
+    std::cerr << __FUNCTION__ << ": PlanarGraph has " << eeSize << " EdgeEnds" << std::endl;
 #endif
 
-    vector<DirectedEdge*> dirEdges(eeSize);
-    for(size_t i = 0; i < eeSize; ++i) {
+    std::vector<DirectedEdge*> dirEdges(eeSize);
+    for(std::size_t i = 0; i < eeSize; ++i) {
         DirectedEdge* de = detail::down_cast<DirectedEdge*>(ee[i]);
         dirEdges[i] = de;
     }
 
     NodeMap::container& nodeMap = graph->getNodeMap()->nodeMap;
-    vector<Node*> nodes;
+    std::vector<Node*> nodes;
     nodes.reserve(nodeMap.size());
     for(NodeMap::iterator it = nodeMap.begin(), itEnd = nodeMap.end();
             it != itEnd; ++it) {
@@ -99,22 +99,22 @@ PolygonBuilder::add(PlanarGraph* graph)
 
 /*public*/
 void
-PolygonBuilder::add(const vector<DirectedEdge*>* dirEdges,
-                    const vector<Node*>* nodes)
+PolygonBuilder::add(const std::vector<DirectedEdge*>* dirEdges,
+                    const std::vector<Node*>* nodes)
 //throw(TopologyException *)
 {
     PlanarGraph::linkResultDirectedEdges(nodes->begin(), nodes->end());
 
-    vector<MaximalEdgeRing*> maxEdgeRings;
+    std::vector<MaximalEdgeRing*> maxEdgeRings;
     buildMaximalEdgeRings(dirEdges, maxEdgeRings);
 
-    vector<EdgeRing*> freeHoleList;
-    vector<MaximalEdgeRing*> edgeRings;
+    std::vector<EdgeRing*> freeHoleList;
+    std::vector<MaximalEdgeRing*> edgeRings;
     buildMinimalEdgeRings(maxEdgeRings, shellList, freeHoleList, edgeRings);
 
     sortShellsAndHoles(edgeRings, shellList, freeHoleList);
 
-    vector<FastPIPRing> indexedshellist;
+    std::vector<FastPIPRing> indexedshellist;
     for(auto const& shell : shellList) {
         FastPIPRing pipRing { shell, new geos::algorithm::locate::IndexedPointInAreaLocator(*shell->getLinearRing()) };
         indexedshellist.push_back(pipRing);
@@ -128,33 +128,33 @@ PolygonBuilder::add(const vector<DirectedEdge*>* dirEdges,
 }
 
 /*public*/
-vector<Geometry*>*
+std::vector<Geometry*>*
 PolygonBuilder::getPolygons()
 {
-    vector<Geometry*>* resultPolyList = computePolygons(shellList);
+    std::vector<Geometry*>* resultPolyList = computePolygons(shellList);
     return resultPolyList;
 }
 
 
 /*private*/
 void
-PolygonBuilder::buildMaximalEdgeRings(const vector<DirectedEdge*>* dirEdges,
-                                      vector<MaximalEdgeRing*>& maxEdgeRings)
+PolygonBuilder::buildMaximalEdgeRings(const std::vector<DirectedEdge*>* dirEdges,
+                                      std::vector<MaximalEdgeRing*>& maxEdgeRings)
 // throw(const TopologyException &)
 {
 #if GEOS_DEBUG
-    cerr << "PolygonBuilder::buildMaximalEdgeRings got " << dirEdges->size() << " dirEdges" << endl;
+    std::cerr << "PolygonBuilder::buildMaximalEdgeRings got " << dirEdges->size() << " dirEdges" << std::endl;
 #endif
 
-    vector<MaximalEdgeRing*>::size_type oldSize = maxEdgeRings.size();
+    std::vector<MaximalEdgeRing*>::size_type oldSize = maxEdgeRings.size();
 
-    for(size_t i = 0, n = dirEdges->size(); i < n; i++) {
+    for(std::size_t i = 0, n = dirEdges->size(); i < n; i++) {
         DirectedEdge* de = (*dirEdges)[i];
 #if GEOS_DEBUG
-        cerr << "  dirEdge " << i << endl
-             << de->printEdge() << endl
-             << " inResult:" << de->isInResult() << endl
-             << " isArea:" << de->getLabel().isArea() << endl;
+        std::cerr << "  dirEdge " << i << std::endl
+             << de->printEdge() << std::endl
+             << " inResult:" << de->isInResult() << std::endl
+             << " isArea:" << de->getLabel().isArea() << std::endl;
 #endif
         if(de->isInResult() && de->getLabel().isArea()) {
             // if this edge has not yet been processed
@@ -166,10 +166,10 @@ PolygonBuilder::buildMaximalEdgeRings(const vector<DirectedEdge*>* dirEdges,
                 }
                 catch(util::GEOSException&) {
                     // cleanup if that happens (see stmlf-cases-20061020.xml)
-                    for(size_t p_i = oldSize, p_n = maxEdgeRings.size(); p_i < p_n; p_i++) {
+                    for(std::size_t p_i = oldSize, p_n = maxEdgeRings.size(); p_i < p_n; p_i++) {
                         delete maxEdgeRings[p_i];
                     }
-                    //cerr << "Exception! " << e.what() << endl;
+                    //cerr << "Exception! " << e.what() << std::endl;
                     throw;
                 }
                 maxEdgeRings.push_back(er);
@@ -179,25 +179,25 @@ PolygonBuilder::buildMaximalEdgeRings(const vector<DirectedEdge*>* dirEdges,
         }
     }
 #if GEOS_DEBUG
-    cerr << "  pushed " << maxEdgeRings.size() - oldSize << " maxEdgeRings" << endl;
+    std::cerr << "  pushed " << maxEdgeRings.size() - oldSize << " maxEdgeRings" << std::endl;
 #endif
 }
 
 /*private*/
 void
 PolygonBuilder::buildMinimalEdgeRings(
-    vector<MaximalEdgeRing*>& maxEdgeRings,
-    vector<EdgeRing*>& newShellList, vector<EdgeRing*>& freeHoleList,
-    vector<MaximalEdgeRing*>& edgeRings)
+    std::vector<MaximalEdgeRing*>& maxEdgeRings,
+    std::vector<EdgeRing*>& newShellList, std::vector<EdgeRing*>& freeHoleList,
+    std::vector<MaximalEdgeRing*>& edgeRings)
 {
-    for(size_t i = 0, n = maxEdgeRings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = maxEdgeRings.size(); i < n; ++i) {
         MaximalEdgeRing* er = maxEdgeRings[i];
 #if GEOS_DEBUG
-        cerr << "buildMinimalEdgeRings: maxEdgeRing " << i << " has " << er->getMaxNodeDegree() << " maxNodeDegree" << endl;
+        std::cerr << "buildMinimalEdgeRings: maxEdgeRing " << i << " has " << er->getMaxNodeDegree() << " maxNodeDegree" << std::endl;
 #endif
         if(er->getMaxNodeDegree() > 2) {
             er->linkDirectedEdgesForMinimalEdgeRings();
-            vector<MinimalEdgeRing*> minEdgeRings;
+            std::vector<MinimalEdgeRing*> minEdgeRings;
             er->buildMinimalRings(minEdgeRings);
             // at this point we can go ahead and attempt to place
             // holes, if this EdgeRing is a polygon
@@ -221,16 +221,16 @@ PolygonBuilder::buildMinimalEdgeRings(
 
 /*private*/
 EdgeRing*
-PolygonBuilder::findShell(vector<MinimalEdgeRing*>* minEdgeRings)
+PolygonBuilder::findShell(std::vector<MinimalEdgeRing*>* minEdgeRings)
 {
     int shellCount = 0;
     EdgeRing* shell = nullptr;
 
 #if GEOS_DEBUG
-    cerr << "PolygonBuilder::findShell got " << minEdgeRings->size() << " minEdgeRings" << endl;
+    std::cerr << "PolygonBuilder::findShell got " << minEdgeRings->size() << " minEdgeRings" << std::endl;
 #endif
 
-    for(size_t i = 0, n = minEdgeRings->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = minEdgeRings->size(); i < n; ++i) {
         EdgeRing* er = (*minEdgeRings)[i];
         if(! er->isHole()) {
             shell = er;
@@ -248,9 +248,9 @@ PolygonBuilder::findShell(vector<MinimalEdgeRing*>* minEdgeRings)
 /*private*/
 void
 PolygonBuilder::placePolygonHoles(EdgeRing* shell,
-                                  vector<MinimalEdgeRing*>* minEdgeRings)
+                                  std::vector<MinimalEdgeRing*>* minEdgeRings)
 {
-    for(size_t i = 0, n = minEdgeRings->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = minEdgeRings->size(); i < n; ++i) {
         MinimalEdgeRing* er = (*minEdgeRings)[i];
         if(er->isHole()) {
             er->setShell(shell);
@@ -260,10 +260,10 @@ PolygonBuilder::placePolygonHoles(EdgeRing* shell,
 
 /*private*/
 void
-PolygonBuilder::sortShellsAndHoles(vector<MaximalEdgeRing*>& edgeRings,
-                                   vector<EdgeRing*>& newShellList, vector<EdgeRing*>& freeHoleList)
+PolygonBuilder::sortShellsAndHoles(std::vector<MaximalEdgeRing*>& edgeRings,
+                                   std::vector<EdgeRing*>& newShellList, std::vector<EdgeRing*>& freeHoleList)
 {
-    for(size_t i = 0, n = edgeRings.size(); i < n; i++) {
+    for(std::size_t i = 0, n = edgeRings.size(); i < n; i++) {
         EdgeRing* er = edgeRings[i];
         //er->setInResult();
         if(er->isHole()) {
@@ -277,7 +277,7 @@ PolygonBuilder::sortShellsAndHoles(vector<MaximalEdgeRing*>& edgeRings,
 
 /*private*/
 void
-PolygonBuilder::placeFreeHoles(vector<FastPIPRing>& newShellList,
+PolygonBuilder::placeFreeHoles(std::vector<FastPIPRing>& newShellList,
                                std::vector<EdgeRing*>& freeHoleList)
 {
     for(std::vector<EdgeRing*>::iterator
@@ -319,7 +319,7 @@ PolygonBuilder::placeFreeHoles(vector<FastPIPRing>& newShellList,
 /*private*/
 EdgeRing*
 PolygonBuilder::findEdgeRingContaining(EdgeRing* testEr,
-                                       vector<FastPIPRing>& newShellList)
+                                       std::vector<FastPIPRing>& newShellList)
 {
     LinearRing* testRing = testEr->getLinearRing();
     const Envelope* testEnv = testRing->getEnvelopeInternal();
@@ -361,16 +361,16 @@ PolygonBuilder::findEdgeRingContaining(EdgeRing* testEr,
 }
 
 /*private*/
-vector<Geometry*>*
-PolygonBuilder::computePolygons(vector<EdgeRing*>& newShellList)
+std::vector<Geometry*>*
+PolygonBuilder::computePolygons(std::vector<EdgeRing*>& newShellList)
 {
 #if GEOS_DEBUG
-    cerr << "PolygonBuilder::computePolygons: got " << newShellList.size() << " shells" << endl;
+    std::cerr << "PolygonBuilder::computePolygons: got " << newShellList.size() << " shells" << std::endl;
 #endif
-    vector<Geometry*>* resultPolyList = new vector<Geometry*>();
+    std::vector<Geometry*>* resultPolyList = new std::vector<Geometry*>();
 
     // add Polygons for all shells
-    for(size_t i = 0, n = newShellList.size(); i < n; i++) {
+    for(std::size_t i = 0, n = newShellList.size(); i < n; i++) {
         EdgeRing* er = newShellList[i];
         Polygon* poly = er->toPolygon(geometryFactory).release();
         resultPolyList->push_back(poly);
diff --git a/src/operation/overlay/snap/GeometrySnapper.cpp b/src/operation/overlay/snap/GeometrySnapper.cpp
index adffeb3..43c78d0 100644
--- a/src/operation/overlay/snap/GeometrySnapper.cpp
+++ b/src/operation/overlay/snap/GeometrySnapper.cpp
@@ -34,7 +34,7 @@
 #include <memory>
 #include <algorithm>
 
-//using namespace std;
+//
 using namespace geos::geom;
 
 namespace geos {
@@ -62,10 +62,10 @@ private:
         std::vector<Coordinate> coords;
         srcPts->toVector(coords);
         LineStringSnapper snapper(coords, snapTol);
-        unique_ptr<Coordinate::Vect> newPts = snapper.snapTo(snapPts);
+        std::unique_ptr<Coordinate::Vect> newPts = snapper.snapTo(snapPts);
 
         const CoordinateSequenceFactory* cfact = factory->getCoordinateSequenceFactory();
-        return unique_ptr<CoordinateSequence>(cfact->create(newPts.release()));
+        return std::unique_ptr<CoordinateSequence>(cfact->create(newPts.release()));
     }
 
 public:
@@ -111,11 +111,11 @@ GeometrySnapper::snapTo(const geom::Geometry& g, double snapTolerance)
     using geom::util::GeometryTransformer;
 
     // Get snap points
-    unique_ptr<Coordinate::ConstVect> snapPts = extractTargetCoordinates(g);
+    std::unique_ptr<Coordinate::ConstVect> snapPts = extractTargetCoordinates(g);
 
     // Apply a SnapTransformer to source geometry
     // (we need a pointer for dynamic polymorphism)
-    unique_ptr<GeometryTransformer> snapTrans(new SnapTransformer(snapTolerance, *snapPts));
+    std::unique_ptr<GeometryTransformer> snapTrans(new SnapTransformer(snapTolerance, *snapPts));
     return snapTrans->transform(&srcGeom);
 }
 
@@ -128,11 +128,11 @@ GeometrySnapper::snapToSelf(double snapTolerance, bool cleanResult)
     using geom::util::GeometryTransformer;
 
     // Get snap points
-    unique_ptr<Coordinate::ConstVect> snapPts = extractTargetCoordinates(srcGeom);
+    std::unique_ptr<Coordinate::ConstVect> snapPts = extractTargetCoordinates(srcGeom);
 
     // Apply a SnapTransformer to source geometry
     // (we need a pointer for dynamic polymorphism)
-    unique_ptr<GeometryTransformer> snapTrans(new SnapTransformer(snapTolerance, *snapPts));
+    std::unique_ptr<GeometryTransformer> snapTrans(new SnapTransformer(snapTolerance, *snapPts));
 
     GeomPtr result = snapTrans->transform(&srcGeom);
 
@@ -207,8 +207,8 @@ GeometrySnapper::snap(const geom::Geometry& g0,
     GeometrySnapper snapper1(g1);
     snapGeom.second = snapper1.snapTo(*snapGeom.first, snapTolerance);
 
-//	cout << *snapGeom.first << endl;
-//	cout << *snapGeom.second << endl;
+//	std::size_t << *snapGeom.first << std::endl;
+//	std::size_t << *snapGeom.second << std::endl;
 
 }
 
diff --git a/src/operation/overlay/snap/LineStringSnapper.cpp b/src/operation/overlay/snap/LineStringSnapper.cpp
index 9b89580..610cb90 100644
--- a/src/operation/overlay/snap/LineStringSnapper.cpp
+++ b/src/operation/overlay/snap/LineStringSnapper.cpp
@@ -43,7 +43,7 @@ using std::cerr;
 using std::endl;
 #endif
 
-//using namespace std;
+//
 using namespace geos::geom;
 
 namespace geos {
@@ -78,24 +78,24 @@ LineStringSnapper::findVertexToSnap(
         Coordinate& c0 = *from;
 
 #if GEOS_DEBUG
-        cerr << " Checking vertex " << c0 << endl;
+        std::cerr << " Checking vertex " << c0 << std::endl;
 #endif
 
         double dist = c0.distance(snapPt);
         if(dist >= minDist) {
 #if GEOS_DEBUG
-            cerr << "   snap point distance " << dist
+            std::cerr << "   snap point distance " << dist
                  << " not smaller than tolerance "
                  << snapTolerance << " or previous closest "
-                 << minDist << endl;
+                 << minDist << std::endl;
 #endif
             continue;
         }
 
 #if GEOS_DEBUG
-        cerr << "   snap point distance " << dist << " within tolerance "
+        std::cerr << "   snap point distance " << dist << " within tolerance "
              << snapTolerance << " and closer than previous candidate "
-             << minDist << endl;
+             << minDist << std::endl;
 #endif
 
         if(dist == 0.0) {
@@ -122,7 +122,7 @@ LineStringSnapper::snapVertices(geom::CoordinateList& srcCoords,
     }
 
 #if GEOS_DEBUG
-    cerr << "Snapping vertices of: " << srcCoords << endl;
+    std::cerr << "Snapping vertices of: " << srcCoords << std::endl;
 #endif
 
     for(Coordinate::ConstVect::const_iterator
@@ -134,7 +134,7 @@ LineStringSnapper::snapVertices(geom::CoordinateList& srcCoords,
         const Coordinate& snapPt = *(*it);
 
 #if GEOS_DEBUG
-        cerr << "Checking for a vertex to snap to snapPt " << snapPt << endl;
+        std::cerr << "Checking for a vertex to snap to snapPt " << snapPt << std::endl;
 #endif
 
         CoordinateList::iterator too_far = srcCoords.end();
@@ -145,13 +145,13 @@ LineStringSnapper::snapVertices(geom::CoordinateList& srcCoords,
             findVertexToSnap(snapPt, srcCoords.begin(), too_far);
         if(vertpos == too_far) {
 #if GEOS_DEBUG
-            cerr << " No vertex to snap" << endl;
+            std::cerr << " No vertex to snap" << std::endl;
 #endif
             continue;
         }
 
 #if GEOS_DEBUG
-        cerr << " Vertex to be snapped found, snapping" << endl;
+        std::cerr << " Vertex to be snapped found, snapping" << std::endl;
 #endif
         *vertpos = snapPt;
 
@@ -160,19 +160,19 @@ LineStringSnapper::snapVertices(geom::CoordinateList& srcCoords,
             vertpos = srcCoords.end();
             --vertpos;
 #if GEOS_DEBUG
-            cerr << " Snapped vertex was first in a closed line, also snapping last" << endl;
+            std::cerr << " Snapped vertex was first in a closed line, also snapping last" << std::endl;
 #endif
             *vertpos = snapPt;
         }
 
 #if GEOS_DEBUG
-        cerr << " After snapping of vertex " << snapPt << ", srcCoors are: " << srcCoords << endl;
+        std::cerr << " After snapping of vertex " << snapPt << ", srcCoors are: " << srcCoords << std::endl;
 #endif
 
     }
 
 #if GEOS_DEBUG
-    cerr << " After vertices snapping, srcCoors are: " << srcCoords << endl;
+    std::cerr << " After vertices snapping, srcCoors are: " << srcCoords << std::endl;
 #endif
 
 }
@@ -196,14 +196,14 @@ LineStringSnapper::findSnapForVertex(const Coordinate& pt,
 
         if(snapPt.equals2D(pt)) {
 #if GEOS_DEBUG
-            cerr << " points are equal, returning not-found " << endl;
+            std::cerr << " points are equal, returning not-found " << std::endl;
 #endif
             return end;
         }
 
         double dist = snapPt.distance(pt);
 #if GEOS_DEBUG
-        cerr << " distance from snap point " << snapPt << ": " << dist << endl;
+        std::cerr << " distance from snap point " << snapPt << ": " << dist << std::endl;
 #endif
 
         if(dist < minDist) {
@@ -214,7 +214,7 @@ LineStringSnapper::findSnapForVertex(const Coordinate& pt,
 
 #if GEOS_DEBUG
     if(candidate == end) {
-        cerr << " no snap point within distance, returning not-found" << endl;
+        std::cerr << " no snap point within distance, returning not-found" << std::endl;
     }
 #endif
 
@@ -236,7 +236,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
     GEOS_CHECK_FOR_INTERRUPTS();
 
 #if GEOS_DEBUG
-    cerr << "Snapping segments of: " << srcCoords << endl;
+    std::cerr << "Snapping segments of: " << srcCoords << std::endl;
 #endif
 
     for(Coordinate::ConstVect::const_iterator
@@ -247,7 +247,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
         const Coordinate& snapPt = *(*it);
 
 #if GEOS_DEBUG
-        cerr << "Checking for a segment to snap to snapPt " << snapPt << endl;
+        std::cerr << "Checking for a segment to snap to snapPt " << snapPt << std::endl;
 #endif
 
         CoordinateList::iterator too_far = srcCoords.end();
@@ -256,7 +256,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             findSegmentToSnap(snapPt, srcCoords.begin(), too_far);
         if(segpos == too_far) {
 #if GEOS_DEBUG
-            cerr << " No segment to snap" << endl;
+            std::cerr << " No segment to snap" << std::endl;
 #endif
             continue;
         }
@@ -278,7 +278,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
         double pf = seg.projectionFactor(snapPt);
         if(pf >= 1.0) {
 #if GEOS_DEBUG
-            cerr << " Segment to be snapped is closer on his end point" << endl;
+            std::cerr << " Segment to be snapped is closer on his end point" << std::endl;
 #endif
             Coordinate newSnapPt = seg.p1;
             *to = seg.p1 = snapPt;
@@ -286,14 +286,14 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             if(to == too_far) {
                 if(isClosed) {
 #if GEOS_DEBUG
-                    cerr << " His end point is the last one, but is closed " << endl;
+                    std::cerr << " His end point is the last one, but is closed " << std::endl;
 #endif
                     *(srcCoords.begin()) = snapPt; // sync to start point
                     to = srcCoords.begin();
                 }
                 else {
 #if GEOS_DEBUG
-                    cerr << " His end point is the last one, inserting " << newSnapPt << " before it" << endl;
+                    std::cerr << " His end point is the last one, inserting " << newSnapPt << " before it" << std::endl;
 #endif
                     srcCoords.insert(to, newSnapPt);
                     continue;
@@ -303,14 +303,14 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             LineSegment nextSeg(seg.p1, *to);
             if(nextSeg.distance(newSnapPt) < seg.distance(newSnapPt)) {
 #if GEOS_DEBUG
-                cerr << " Next segment closer, inserting " << newSnapPt << " into " << nextSeg << endl;
+                std::cerr << " Next segment closer, inserting " << newSnapPt << " into " << nextSeg << std::endl;
 #endif
                 // insert into next segment
                 srcCoords.insert(to, newSnapPt);
             }
             else {
 #if GEOS_DEBUG
-                cerr << " This segment closer, inserting " << newSnapPt << " into " << seg << endl;
+                std::cerr << " This segment closer, inserting " << newSnapPt << " into " << seg << std::endl;
 #endif
                 // insert must happen one-past first point (before next point)
                 ++segpos;
@@ -319,7 +319,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
         }
         else if(pf <= 0.0) {
 #if GEOS_DEBUG
-            cerr << " Segment to be snapped is closer on his start point" << endl;
+            std::cerr << " Segment to be snapped is closer on his start point" << std::endl;
 #endif
             Coordinate newSnapPt = seg.p0;
             *segpos = seg.p0 = snapPt;
@@ -327,7 +327,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             if(segpos == srcCoords.begin()) {
                 if(isClosed) {
 #if GEOS_DEBUG
-                    cerr << " His start point is the first one, but is closed " << endl;
+                    std::cerr << " His start point is the first one, but is closed " << std::endl;
 #endif
                     segpos = srcCoords.end();
                     --segpos;
@@ -335,7 +335,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
                 }
                 else {
 #if GEOS_DEBUG
-                    cerr << " His start point is the first one, inserting " << newSnapPt << " before it" << endl;
+                    std::cerr << " His start point is the first one, inserting " << newSnapPt << " before it" << std::endl;
 #endif
                     ++segpos;
                     srcCoords.insert(segpos, newSnapPt);
@@ -344,15 +344,15 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             }
 
 #if GEOS_DEBUG
-            cerr << " Before seg-snapping, srcCoors are: " << srcCoords << endl;
+            std::cerr << " Before seg-snapping, srcCoors are: " << srcCoords << std::endl;
 #endif
 
             --segpos;
             LineSegment prevSeg(*segpos, seg.p0);
             if(prevSeg.distance(newSnapPt) < seg.distance(newSnapPt)) {
 #if GEOS_DEBUG
-                cerr << " Prev segment closer, inserting " << newSnapPt << " into "
-                     << prevSeg << endl;
+                std::cerr << " Prev segment closer, inserting " << newSnapPt << " into "
+                     << prevSeg << std::endl;
 #endif
                 // insert into prev segment
                 ++segpos;
@@ -360,7 +360,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
             }
             else {
 #if GEOS_DEBUG
-                cerr << " This segment closer, inserting " << newSnapPt << " into " << seg << endl;
+                std::cerr << " This segment closer, inserting " << newSnapPt << " into " << seg << std::endl;
 #endif
                 // insert must happen one-past first point (before next point)
                 srcCoords.insert(to, newSnapPt);
@@ -369,7 +369,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
         else {
             //assert(pf != 0.0);
 #if GEOS_DEBUG
-            cerr << " Segment to be snapped found, projection factor is " << pf << ", inserting point" << endl;
+            std::cerr << " Segment to be snapped found, projection factor is " << pf << ", inserting point" << std::endl;
 #endif
             // insert must happen one-past first point (before next point)
             ++segpos;
@@ -378,7 +378,7 @@ LineStringSnapper::snapSegments(geom::CoordinateList& srcCoords,
     }
 
 #if GEOS_DEBUG
-    cerr << " After segment snapping, srcCoors are: " << srcCoords << endl;
+    std::cerr << " After segment snapping, srcCoors are: " << srcCoords << std::endl;
 #endif
 
 }
@@ -404,7 +404,7 @@ LineStringSnapper::findSegmentToSnap(
         seg.p1 = *to;
 
 #if GEOS_DEBUG
-        cerr << " Checking segment " << seg << endl;
+        std::cerr << " Checking segment " << seg << std::endl;
 #endif
 
         /*
@@ -419,14 +419,14 @@ LineStringSnapper::findSegmentToSnap(
 
             if(allowSnappingToSourceVertices) {
 #if GEOS_DEBUG
-                cerr << "   snap point matches a segment endpoint, checking next segment"
-                     << endl;
+                std::cerr << "   snap point matches a segment endpoint, checking next segment"
+                     << std::endl;
 #endif
                 continue;
             }
             else {
 #if GEOS_DEBUG
-                cerr << "   snap point matches a segment endpoint, giving up seek" << endl;
+                std::cerr << "   snap point matches a segment endpoint, giving up seek" << std::endl;
 #endif
                 return too_far;
             }
@@ -439,18 +439,18 @@ LineStringSnapper::findSegmentToSnap(
         double dist = seg.distance(snapPt);
         if(dist >= minDist) {
 #if GEOS_DEBUG
-            cerr << "   snap point distance " << dist
+            std::cerr << "   snap point distance " << dist
                  << " not smaller than tolerance "
                  << snapTolerance << " or previous closest "
-                 << minDist << endl;
+                 << minDist << std::endl;
 #endif
             continue;
         }
 
 #if GEOS_DEBUG
-        cerr << "   snap point distance " << dist << " within tolerance "
+        std::cerr << "   snap point distance " << dist << " within tolerance "
              << snapTolerance << " and closer than previous candidate "
-             << minDist << endl;
+             << minDist << std::endl;
 #endif
 
         if(dist == 0.0) {
diff --git a/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp b/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp
index 6834343..7fd2df4 100644
--- a/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp
+++ b/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp
@@ -30,7 +30,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -39,12 +39,12 @@ namespace overlay { // geos.operation.overlay
 namespace snap { // geos.operation.overlay.snap
 
 /* public */
-unique_ptr<Geometry>
+std::unique_ptr<Geometry>
 SnapIfNeededOverlayOp::getResultGeometry(OverlayOp::OpCode opCode)
 {
     using geos::util::TopologyException;
 
-    unique_ptr<Geometry> result;
+    std::unique_ptr<Geometry> result;
 
     TopologyException origEx;
 
diff --git a/src/operation/overlay/snap/SnapOverlayOp.cpp b/src/operation/overlay/snap/SnapOverlayOp.cpp
index ed2f3f6..4150657 100644
--- a/src/operation/overlay/snap/SnapOverlayOp.cpp
+++ b/src/operation/overlay/snap/SnapOverlayOp.cpp
@@ -29,7 +29,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -44,11 +44,11 @@ SnapOverlayOp::computeSnapTolerance()
     snapTolerance = GeometrySnapper::computeOverlaySnapTolerance(geom0,
                     geom1);
 
-    // cout << "Snap tol = " <<  snapTolerance << endl;
+    // std::size_t << "Snap tol = " <<  snapTolerance << std::endl;
 }
 
 /* public */
-unique_ptr<Geometry>
+std::unique_ptr<Geometry>
 SnapOverlayOp::getResultGeometry(OverlayOp::OpCode opCode)
 {
     geom::GeomPtrPair prepGeom;
diff --git a/src/operation/overlay/validate/FuzzyPointLocator.cpp b/src/operation/overlay/validate/FuzzyPointLocator.cpp
index ac2ffdd..c17e85a 100644
--- a/src/operation/overlay/validate/FuzzyPointLocator.cpp
+++ b/src/operation/overlay/validate/FuzzyPointLocator.cpp
@@ -63,7 +63,7 @@ FuzzyPointLocator::extractLineWork(const geom::Geometry& geom)
 
     std::vector<std::unique_ptr<Geometry>> lineGeoms;
 
-    for(size_t i = 0, n = g.getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g.getNumGeometries(); i < n; ++i) {
         const Geometry* gComp = g.getGeometryN(i);
 
         // only get linework for polygonal components
@@ -81,7 +81,7 @@ FuzzyPointLocator::getLineWork(const geom::Geometry& geom)
     ::geos::ignore_unused_variable_warning(geom);
 
     std::vector<std::unique_ptr<Geometry>> lineGeoms;
-    for(size_t i = 0, n = g.getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = g.getNumGeometries(); i < n; ++i) {
         const Geometry* gComp = g.getGeometryN(i);
 
         if(gComp->getDimension() == 2) {
diff --git a/src/operation/overlay/validate/OffsetPointGenerator.cpp b/src/operation/overlay/validate/OffsetPointGenerator.cpp
index 7d9c44a..7cb38d9 100644
--- a/src/operation/overlay/validate/OffsetPointGenerator.cpp
+++ b/src/operation/overlay/validate/OffsetPointGenerator.cpp
@@ -35,7 +35,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 using namespace geos::algorithm;
 
@@ -58,9 +58,9 @@ std::unique_ptr< std::vector<geom::Coordinate> >
 OffsetPointGenerator::getPoints()
 {
     assert(offsetPts.get() == nullptr);
-    offsetPts.reset(new vector<Coordinate>());
+    offsetPts.reset(new std::vector<Coordinate>());
 
-    vector<const LineString*> lines;
+    std::vector<const LineString*> lines;
     geos::geom::util::LinearComponentExtracter::getLines(g, lines);
 
     for (const auto& line : lines) {
@@ -78,7 +78,7 @@ OffsetPointGenerator::extractPoints(const LineString* line)
     const CoordinateSequence& pts = *(line->getCoordinatesRO());
     assert(pts.size() > 1);
 
-    for(size_t i = 0, n = pts.size() - 1; i < n; ++i) {
+    for(std::size_t i = 0, n = pts.size() - 1; i < n; ++i) {
         computeOffsets(pts[i], pts[i + 1]);
     }
 }
diff --git a/src/operation/overlay/validate/OverlayResultValidator.cpp b/src/operation/overlay/validate/OverlayResultValidator.cpp
index 44e3974..db8261d 100644
--- a/src/operation/overlay/validate/OverlayResultValidator.cpp
+++ b/src/operation/overlay/validate/OverlayResultValidator.cpp
@@ -43,7 +43,7 @@
 #define USE_ELEVATION_MATRIX 1
 #define USE_INPUT_AVGZ 0
 
-using namespace std;
+
 using namespace geos::geom;
 using namespace geos::geomgraph;
 using namespace geos::algorithm;
@@ -56,17 +56,17 @@ namespace validate { // geos.operation.overlay.validate
 namespace { // anonymous namespace
 
 #if GEOS_DEBUG
-unique_ptr<MultiPoint>
-toMultiPoint(vector<Coordinate>& coords)
+std::unique_ptr<MultiPoint>
+toMultiPoint(std::vector<Coordinate>& coords)
 {
     const GeometryFactory& gf = *(GeometryFactory::getDefaultInstance());
     const CoordinateSequenceFactory& csf =
         *(gf.getCoordinateSequenceFactory());
 
-    unique_ptr< vector<Coordinate> > nc(new vector<Coordinate>(coords));
-    unique_ptr<CoordinateSequence> cs(csf.create(nc.release()));
+    std::unique_ptr< std::vector<Coordinate> > nc(new std::vector<Coordinate>(coords));
+    std::unique_ptr<CoordinateSequence> cs(csf.create(nc.release()));
 
-    unique_ptr<MultiPoint> mp(gf.createMultiPoint(*cs));
+    std::unique_ptr<MultiPoint> mp(gf.createMultiPoint(*cs));
 
     return mp;
 }
@@ -115,13 +115,13 @@ OverlayResultValidator::isValid(OverlayOp::OpCode overlayOp)
 
     if(! testValid(overlayOp)) {
 #if GEOS_DEBUG
-        cerr << "OverlayResultValidator:" << endl
-             << "Points:" << *toMultiPoint(testCoords) << endl
-             << "Geom0: " << g0 << endl
-             << "Geom1: " << g1 << endl
-             << "Reslt: " << gres << endl
+        std::cerr << "OverlayResultValidator:" << std::endl
+             << "Points:" << *toMultiPoint(testCoords) << std::endl
+             << "Geom0: " << g0 << std::endl
+             << "Geom1: " << g1 << std::endl
+             << "Reslt: " << gres << std::endl
              << "Locat: " << getInvalidLocation()
-             << endl;
+             << std::endl;
 #endif
         return false;
     }
@@ -135,7 +135,7 @@ void
 OverlayResultValidator::addTestPts(const Geometry& g)
 {
     OffsetPointGenerator ptGen(g, 5 * boundaryDistanceTolerance);
-    unique_ptr< vector<geom::Coordinate> > pts = ptGen.getPoints();
+    std::unique_ptr< std::vector<geom::Coordinate> > pts = ptGen.getPoints();
     testCoords.insert(testCoords.end(), pts->begin(), pts->end());
 }
 
@@ -145,10 +145,10 @@ OverlayResultValidator::addVertices(const Geometry& g)
 {
     // TODO: optimize this by not copying coordinates
     //       and pre-allocating memory
-    unique_ptr<CoordinateSequence> cs(g.getCoordinates());
+    std::unique_ptr<CoordinateSequence> cs(g.getCoordinates());
 
     testCoords.reserve(testCoords.size() + cs->size());
-    for (size_t i = 0; i < cs->size(); i++) {
+    for (std::size_t i = 0; i < cs->size(); i++) {
         testCoords.push_back(cs->getAt(i));
     }
 }
@@ -157,7 +157,7 @@ OverlayResultValidator::addVertices(const Geometry& g)
 bool
 OverlayResultValidator::testValid(OverlayOp::OpCode overlayOp)
 {
-    for(size_t i = 0, n = testCoords.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = testCoords.size(); i < n; ++i) {
         Coordinate& pt = testCoords[i];
         if(! testValid(overlayOp, pt)) {
             invalidLocation = pt;
@@ -180,10 +180,10 @@ OverlayResultValidator::testValid(OverlayOp::OpCode overlayOp,
     location[2] = fplres.getLocation(pt);
 
 #if GEOS_DEBUG
-    cerr << setprecision(10) << "Point " << pt << endl
-         << "Loc0: " << location[0] << endl
-         << "Loc1: " << location[1] << endl
-         << "Locr: " << location[2] << endl;
+    std::cerr << setprecision(10) << "Point " << pt << std::endl
+         << "Loc0: " << location[0] << std::endl
+         << "Loc1: " << location[1] << std::endl
+         << "Locr: " << location[2] << std::endl;
 #endif
 
     /*
@@ -192,8 +192,8 @@ OverlayResultValidator::testValid(OverlayOp::OpCode overlayOp,
      */
     if(find(location.begin(), location.end(), Location::BOUNDARY) != location.end()) {
 #if GEOS_DEBUG
-        cerr << "OverlayResultValidator: testpoint " << pt <<
-             " is on the boundary, blindly returning a positive answer (is valid)" << endl;
+        std::cerr << "OverlayResultValidator: testpoint " << pt <<
+             " is on the boundary, blindly returning a positive answer (is valid)" << std::endl;
 #endif
         return true;
     }
diff --git a/src/operation/overlayng/Edge.cpp b/src/operation/overlayng/Edge.cpp
index a45e5e3..f85b3ba 100644
--- a/src/operation/overlayng/Edge.cpp
+++ b/src/operation/overlayng/Edge.cpp
@@ -90,7 +90,7 @@ Edge::releaseCoordinates()
 
 /*public*/
 const Coordinate&
-Edge::getCoordinate(size_t index)  const
+Edge::getCoordinate(std::size_t index)  const
 {
     return pts->getAt(index);
 }
diff --git a/src/operation/overlayng/EdgeKey.cpp b/src/operation/overlayng/EdgeKey.cpp
index 189355a..d5d13e0 100644
--- a/src/operation/overlayng/EdgeKey.cpp
+++ b/src/operation/overlayng/EdgeKey.cpp
@@ -40,7 +40,7 @@ EdgeKey::initPoints(const Edge* edge)
              edge->getCoordinate(1));
     }
     else {
-        size_t len = edge->size();
+        std::size_t len = edge->size();
         init(edge->getCoordinate(len - 1),
              edge->getCoordinate(len - 2));
     }
diff --git a/src/operation/polygonize/BuildArea.cpp b/src/operation/polygonize/BuildArea.cpp
index 960a9d6..54a2769 100644
--- a/src/operation/polygonize/BuildArea.cpp
+++ b/src/operation/polygonize/BuildArea.cpp
@@ -42,7 +42,7 @@
 #pragma warning(disable:4355)
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -55,9 +55,9 @@ struct Face {
     double envarea = 0.0; // envelope area
     Face* parent = nullptr; /* if this face is an hole of another one, or NULL */
 
-    size_t countParents() const {
+    std::size_t countParents() const {
         const Face* f = this;
-        size_t pcount = 0;
+        std::size_t pcount = 0;
         while ( f->parent ) {
             ++pcount;
             f = f->parent;
@@ -89,11 +89,11 @@ static void findFaceHoles(std::vector<std::unique_ptr<Face>>& faces) {
      * after their shells */
     std::sort(faces.begin(), faces.end(), CompareByEnvarea());
 
-    const size_t nfaces = faces.size();
-    for( size_t i = 0; i < nfaces; ++i ) {
+    const std::size_t nfaces = faces.size();
+    for( std::size_t i = 0; i < nfaces; ++i ) {
         auto& f = faces[i];
-        const size_t nholes = f->poly->getNumInteriorRing();
-        for( size_t h = 0; h < nholes; h++ ) {
+        const std::size_t nholes = f->poly->getNumInteriorRing();
+        for( std::size_t h = 0; h < nholes; h++ ) {
             const auto hole = f->poly->getInteriorRingN(h);
             for( auto j=i+1; j < nfaces; ++j ) {
                 auto& f2 = faces[j];
@@ -138,7 +138,7 @@ static void dumpGeometry(const geom::Geometry* geom)
 #endif
 
 /** Return the area built from the constituent linework of the input geometry. */
-unique_ptr<geom::Geometry> BuildArea::build(const geom::Geometry* geom) {
+std::unique_ptr<geom::Geometry> BuildArea::build(const geom::Geometry* geom) {
     Polygonizer polygonizer;
     polygonizer.add(geom);
     auto polys = polygonizer.getPolygons();
@@ -146,7 +146,7 @@ unique_ptr<geom::Geometry> BuildArea::build(const geom::Geometry* geom) {
     // No geometries in collection, early out
     if( polys.empty() ) {
         // TODO don't create new GeometryFactory here
-        auto emptyGeomCollection = unique_ptr<geom::Geometry>(
+        auto emptyGeomCollection = std::unique_ptr<geom::Geometry>(
             GeometryFactory::create()->createGeometryCollection());
         emptyGeomCollection->setSRID(geom->getSRID());
         return emptyGeomCollection;
diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp
index 7d5869a..8e6d65e 100644
--- a/src/operation/polygonize/EdgeRing.cpp
+++ b/src/operation/polygonize/EdgeRing.cpp
@@ -41,7 +41,7 @@
 //#define DEBUG_ALLOC 1
 //#define GEOS_PARANOIA_LEVEL 2
 
-using namespace std;
+
 using namespace geos::planargraph;
 using namespace geos::algorithm;
 using namespace geos::geom;
@@ -141,7 +141,7 @@ EdgeRing::EdgeRing(const GeometryFactory* newFactory)
     is_hole(false)
 {
 #ifdef DEBUG_ALLOC
-    cerr << "[" << this << "] EdgeRing(factory)" << endl;
+    std::cerr << "[" << this << "] EdgeRing(factory)" << std::endl;
 #endif // DEBUG_ALLOC
 }
 
@@ -248,7 +248,7 @@ EdgeRing::getRingInternal()
         // FIXME: print also ringPts
         std::cerr << "EdgeRing::getRingInternal: "
                   << e.what()
-                  << endl;
+                  << std::endl;
 #endif
         ::geos::ignore_unused_variable_warning(e);
     }
diff --git a/src/operation/polygonize/HoleAssigner.cpp b/src/operation/polygonize/HoleAssigner.cpp
index 85997c9..29cba6c 100644
--- a/src/operation/polygonize/HoleAssigner.cpp
+++ b/src/operation/polygonize/HoleAssigner.cpp
@@ -63,7 +63,7 @@ HoleAssigner::findShells(const geom::Envelope& e) {
 
     // TODO turn AbstractSTRtree::query into a template and remove this
     std::vector<EdgeRing*> shells{shellsVoid.size()};
-    for (size_t i = 0; i < shellsVoid.size(); i++) {
+    for (std::size_t i = 0; i < shellsVoid.size(); i++) {
         shells[i] = static_cast<EdgeRing*>(shellsVoid[i]);
     }
 
diff --git a/src/operation/polygonize/PolygonizeGraph.cpp b/src/operation/polygonize/PolygonizeGraph.cpp
index 84354ba..a3c1190 100644
--- a/src/operation/polygonize/PolygonizeGraph.cpp
+++ b/src/operation/polygonize/PolygonizeGraph.cpp
@@ -33,7 +33,7 @@
 #include <vector>
 #include <set>
 
-//using namespace std;
+//
 using namespace geos::planargraph;
 using namespace geos::geom;
 
diff --git a/src/operation/polygonize/Polygonizer.cpp b/src/operation/polygonize/Polygonizer.cpp
index e146bdc..d7d1501 100644
--- a/src/operation/polygonize/Polygonizer.cpp
+++ b/src/operation/polygonize/Polygonizer.cpp
@@ -39,7 +39,7 @@
 #define GEOS_DEBUG 0
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -82,7 +82,7 @@ Polygonizer::Polygonizer(bool onlyPolygonal):
  * @param geomList a list of {@link Geometry}s with linework to be polygonized
  */
 void
-Polygonizer::add(vector<Geometry*>* geomList)
+Polygonizer::add(std::vector<Geometry*>* geomList)
 {
     for(auto& g : (*geomList)) {
         add(g);
@@ -98,7 +98,7 @@ Polygonizer::add(vector<Geometry*>* geomList)
  * @param geomList a list of {@link Geometry}s with linework to be polygonized
  */
 void
-Polygonizer::add(vector<const Geometry*>* geomList)
+Polygonizer::add(std::vector<const Geometry*>* geomList)
 {
     for(auto& g : (*geomList)) {
         add(g);
@@ -160,7 +160,7 @@ Polygonizer::getPolygons()
 }
 
 /* public */
-const vector<const LineString*>&
+const std::vector<const LineString*>&
 Polygonizer::getDangles()
 {
     polygonize();
@@ -174,7 +174,7 @@ Polygonizer::hasDangles() {
 }
 
 /* public */
-const vector<const LineString*>&
+const std::vector<const LineString*>&
 Polygonizer::getCutEdges()
 {
     polygonize();
@@ -229,23 +229,23 @@ Polygonizer::polygonize()
 
     graph->deleteCutEdges(cutEdges);
 
-    vector<EdgeRing*> edgeRingList;
+    std::vector<EdgeRing*> edgeRingList;
     graph->getEdgeRings(edgeRingList);
 #if GEOS_DEBUG
-    cerr << "Polygonizer::polygonize(): " << edgeRingList.size() << " edgeRings in graph" << endl;
+    std::cerr << "Polygonizer::polygonize(): " << edgeRingList.size() << " edgeRings in graph" << std::endl;
 #endif
-    vector<EdgeRing*> validEdgeRingList;
+    std::vector<EdgeRing*> validEdgeRingList;
     invalidRingLines.clear(); /* what if it was populated already ? we should clean ! */
     findValidRings(edgeRingList, validEdgeRingList, invalidRingLines);
 #if GEOS_DEBUG
-    cerr << "                           " << validEdgeRingList.size() << " valid" << endl;
-    cerr << "                           " << invalidRingLines.size() << " invalid" << endl;
+    std::cerr << "                           " << validEdgeRingList.size() << " valid" << std::endl;
+    std::cerr << "                           " << invalidRingLines.size() << " invalid" << std::endl;
 #endif
 
     findShellsAndHoles(validEdgeRingList);
 #if GEOS_DEBUG
-    cerr << "                           " << holeList.size() << " holes" << endl;
-    cerr << "                           " << shellList.size() << " shells" << endl;
+    std::cerr << "                           " << holeList.size() << " holes" << std::endl;
+    std::cerr << "                           " << shellList.size() << " shells" << std::endl;
 #endif
 
     HoleAssigner::assignHolesToShells(holeList, shellList);
@@ -262,9 +262,9 @@ Polygonizer::polygonize()
 
 /* private */
 void
-Polygonizer::findValidRings(const vector<EdgeRing*>& edgeRingList,
-                            vector<EdgeRing*>& validEdgeRingList,
-                            vector<std::unique_ptr<LineString>>& invalidRingList)
+Polygonizer::findValidRings(const std::vector<EdgeRing*>& edgeRingList,
+                            std::vector<EdgeRing*>& validEdgeRingList,
+                            std::vector<std::unique_ptr<LineString>>& invalidRingList)
 {
     for(const auto& er : edgeRingList) {
         if(er->isValid()) {
@@ -279,7 +279,7 @@ Polygonizer::findValidRings(const vector<EdgeRing*>& edgeRingList,
 
 /* private */
 void
-Polygonizer::findShellsAndHoles(const vector<EdgeRing*>& edgeRingList)
+Polygonizer::findShellsAndHoles(const std::vector<EdgeRing*>& edgeRingList)
 {
     holeList.clear();
     shellList.clear();
@@ -311,7 +311,7 @@ Polygonizer::findDisjointShells() {
 }
 
 void
-Polygonizer::findOuterShells(vector<EdgeRing*> & shells)
+Polygonizer::findOuterShells(std::vector<EdgeRing*> & shells)
 {
     for (EdgeRing* er : shells) {
         auto outerHoleER = er->getOuterHole();
@@ -323,7 +323,7 @@ Polygonizer::findOuterShells(vector<EdgeRing*> & shells)
 }
 
 std::vector<std::unique_ptr<Polygon>>
-Polygonizer::extractPolygons(vector<EdgeRing*> & shells, bool includeAll)
+Polygonizer::extractPolygons(std::vector<EdgeRing*> & shells, bool includeAll)
 {
     std::vector<std::unique_ptr<Polygon>> polys;
     for (EdgeRing* er : shells) {
diff --git a/src/operation/predicate/RectangleContains.cpp b/src/operation/predicate/RectangleContains.cpp
index 4c6d282..99310bd 100644
--- a/src/operation/predicate/RectangleContains.cpp
+++ b/src/operation/predicate/RectangleContains.cpp
@@ -61,7 +61,7 @@ RectangleContains::isContainedInBoundary(const Geometry& geom)
         return isLineStringContainedInBoundary(*l);
     }
 
-    for(size_t i = 0, n = geom.getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = geom.getNumGeometries(); i < n; ++i) {
         const Geometry& comp = *(geom.getGeometryN(i));
         if(!isContainedInBoundary(comp)) {
             return false;
@@ -99,7 +99,7 @@ bool
 RectangleContains::isLineStringContainedInBoundary(const LineString& line)
 {
     const CoordinateSequence& seq = *(line.getCoordinatesRO());
-    for(size_t i = 0, n = seq.size() - 1; i < n; ++i) {
+    for(std::size_t i = 0, n = seq.size() - 1; i < n; ++i) {
         const Coordinate& p0 = seq.getAt(i);
         const Coordinate& p1 = seq.getAt(i + 1);
         if(! isLineSegmentContainedInBoundary(p0, p1)) {
diff --git a/src/operation/predicate/SegmentIntersectionTester.cpp b/src/operation/predicate/SegmentIntersectionTester.cpp
index e2250c7..9171f43 100644
--- a/src/operation/predicate/SegmentIntersectionTester.cpp
+++ b/src/operation/predicate/SegmentIntersectionTester.cpp
@@ -34,7 +34,7 @@ SegmentIntersectionTester::hasIntersectionWithLineStrings(
     const LineString::ConstVect& lines)
 {
     hasIntersectionVar = false;
-    for(size_t i = 0, n = lines.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = lines.size(); i < n; ++i) {
         const LineString* testLine = lines[i];
         hasIntersection(line, *testLine);
         if(hasIntersectionVar) {
diff --git a/src/operation/relate/EdgeEndBuilder.cpp b/src/operation/relate/EdgeEndBuilder.cpp
index 546a72e..5861092 100644
--- a/src/operation/relate/EdgeEndBuilder.cpp
+++ b/src/operation/relate/EdgeEndBuilder.cpp
@@ -127,7 +127,7 @@ void
 EdgeEndBuilder::createEdgeEndForNext(Edge* edge, std::vector<EdgeEnd*>* l,
                                      const EdgeIntersection* eiCurr, const EdgeIntersection* eiNext)
 {
-    size_t iNext = eiCurr->segmentIndex + 1;
+    std::size_t iNext = eiCurr->segmentIndex + 1;
     // if there is no next edge there is nothing to do
     if(iNext >= edge->getNumPoints() && eiNext == nullptr) {
         return;
diff --git a/src/operation/relate/EdgeEndBundle.cpp b/src/operation/relate/EdgeEndBundle.cpp
index 0c163c3..8563640 100644
--- a/src/operation/relate/EdgeEndBundle.cpp
+++ b/src/operation/relate/EdgeEndBundle.cpp
@@ -27,7 +27,7 @@
 
 #include <vector>
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 
@@ -45,7 +45,7 @@ EdgeEndBundle::EdgeEndBundle(EdgeEnd* e):
 
 EdgeEndBundle::~EdgeEndBundle()
 {
-    for(size_t i = 0, n = edgeEnds.size(); i < n; i++) {
+    for(std::size_t i = 0, n = edgeEnds.size(); i < n; i++) {
         delete edgeEnds[i];
     }
 }
@@ -53,7 +53,7 @@ EdgeEndBundle::~EdgeEndBundle()
 //Not needed
 //public Iterator iterator() { return edgeEnds.iterator(); }
 
-const vector<EdgeEnd*>&
+const std::vector<EdgeEnd*>&
 EdgeEndBundle::getEdgeEnds()
 {
     return edgeEnds;
@@ -177,10 +177,10 @@ EdgeEndBundle::updateIM(IntersectionMatrix& im)
     Edge::updateIM(label, im);
 }
 
-string
+std::string
 EdgeEndBundle::print() const
 {
-    string out = "EdgeEndBundle--> Label: " + label.toString() + "\n";
+    std::string out = "EdgeEndBundle--> Label: " + label.toString() + "\n";
     for(auto& e : edgeEnds) {
         out += e->print();
         out += "\n";
diff --git a/src/operation/relate/EdgeEndBundleStar.cpp b/src/operation/relate/EdgeEndBundleStar.cpp
index 1eddb0c..b223502 100644
--- a/src/operation/relate/EdgeEndBundleStar.cpp
+++ b/src/operation/relate/EdgeEndBundleStar.cpp
@@ -20,7 +20,7 @@
 #include <geos/operation/relate/EdgeEndBundleStar.h>
 #include <geos/operation/relate/EdgeEndBundle.h>
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 
diff --git a/src/operation/relate/RelateNodeGraph.cpp b/src/operation/relate/RelateNodeGraph.cpp
index 20b79a6..f979ead 100644
--- a/src/operation/relate/RelateNodeGraph.cpp
+++ b/src/operation/relate/RelateNodeGraph.cpp
@@ -31,7 +31,7 @@
 #include <vector>
 #include <map>
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 
@@ -89,8 +89,8 @@ void
 RelateNodeGraph::computeIntersectionNodes(GeometryGraph* geomGraph,
         int argIndex)
 {
-    vector<Edge*>* edges = geomGraph->getEdges();
-    vector<Edge*>::iterator edgeIt = edges->begin();
+    std::vector<Edge*>* edges = geomGraph->getEdges();
+    std::vector<Edge*>::iterator edgeIt = edges->begin();
     for(; edgeIt < edges->end(); ++edgeIt) {
         Edge* e = *edgeIt;
         Location eLoc = e->getLabel().getLocation(argIndex);
@@ -130,7 +130,7 @@ RelateNodeGraph::copyNodesAndLabels(GeometryGraph* geomGraph, int argIndex)
 }
 
 void
-RelateNodeGraph::insertEdgeEnds(vector<EdgeEnd*>* ee)
+RelateNodeGraph::insertEdgeEnds(std::vector<EdgeEnd*>* ee)
 {
     for(EdgeEnd* e: *ee) {
         nodes->add(e);
diff --git a/src/operation/sharedpaths/SharedPathsOp.cpp b/src/operation/sharedpaths/SharedPathsOp.cpp
index d06121b..d254b19 100644
--- a/src/operation/sharedpaths/SharedPathsOp.cpp
+++ b/src/operation/sharedpaths/SharedPathsOp.cpp
@@ -77,7 +77,7 @@ SharedPathsOp::getSharedPaths(PathList& forwDir, PathList& backDir)
 {
     PathList paths;
     findLinearIntersections(paths);
-    for(size_t i = 0, n = paths.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = paths.size(); i < n; ++i) {
         LineString* path = paths[i];
         if(isSameDirection(*path)) {
             forwDir.push_back(path);
@@ -115,7 +115,7 @@ SharedPathsOp::findLinearIntersections(PathList& to)
     // NOTE: intersection of equal lines yelds splitted lines,
     //       should we sew them back ?
 
-    for(size_t i = 0, n = full->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = full->getNumGeometries(); i < n; ++i) {
         const Geometry* sub = full->getGeometryN(i);
         const LineString* path = dynamic_cast<const LineString*>(sub);
         if(path && ! path->isEmpty()) {
diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index d4a99b8..7e00d73 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -270,7 +270,7 @@ std::unique_ptr<geom::Geometry>
 CascadedPolygonUnion::restrictToPolygons(std::unique_ptr<geom::Geometry> g)
 {
     using namespace geom;
-    using namespace std;
+
 
     if(g->isPolygonal()) {
         return g;
@@ -283,14 +283,14 @@ CascadedPolygonUnion::restrictToPolygons(std::unique_ptr<geom::Geometry> g)
         return std::unique_ptr<Geometry>(polygons[0]->clone());
     }
 
-    typedef vector<Geometry*> GeomVect;
+    typedef std::vector<Geometry*> GeomVect;
 
     Polygon::ConstVect::size_type n = polygons.size();
     GeomVect* newpolys = new GeomVect(n);
     for(Polygon::ConstVect::size_type i = 0; i < n; ++i) {
         (*newpolys)[i] = polygons[i]->clone().release();
     }
-    return unique_ptr<Geometry>(g->getFactory()->createMultiPolygon(newpolys));
+    return std::unique_ptr<Geometry>(g->getFactory()->createMultiPolygon(newpolys));
 }
 
 /************************************************************************/
diff --git a/src/operation/union/CoverageUnion.cpp b/src/operation/union/CoverageUnion.cpp
index 5e10ca4..a9f186b 100644
--- a/src/operation/union/CoverageUnion.cpp
+++ b/src/operation/union/CoverageUnion.cpp
@@ -44,7 +44,7 @@ void CoverageUnion::extractSegments(const Geometry* geom) {
             throw geos::util::IllegalArgumentException("Unhandled geometry type in CoverageUnion.");
         }
 
-        for (size_t i = 0; i < gc->getNumGeometries(); i++) {
+        for (std::size_t i = 0; i < gc->getNumGeometries(); i++) {
             extractSegments(gc->getGeometryN(i));
         }
     }
@@ -54,7 +54,7 @@ void CoverageUnion::extractSegments(const Polygon* p) {
     const LineString* ring = p->getExteriorRing();
 
     extractSegments(ring);
-    for (size_t i = 0; i < p->getNumInteriorRing(); i++) {
+    for (std::size_t i = 0; i < p->getNumInteriorRing(); i++) {
         extractSegments(p->getInteriorRingN(i));
     }
 }
@@ -65,7 +65,7 @@ void CoverageUnion::extractSegments(const LineString* ls) {
     if (coords->isEmpty())
         return;
 
-    for (size_t i = 1; i < coords->size(); i++) {
+    for (std::size_t i = 1; i < coords->size(); i++) {
         LineSegment segment{coords->getAt(i), coords->getAt(i-1)};
         segment.normalize();
 
diff --git a/src/operation/union/OverlapUnion.cpp b/src/operation/union/OverlapUnion.cpp
index 038bd7e..1272e0f 100644
--- a/src/operation/union/OverlapUnion.cpp
+++ b/src/operation/union/OverlapUnion.cpp
@@ -164,7 +164,7 @@ OverlapUnion::isEqual(std::vector<LineSegment>& segs0, std::vector<LineSegment>&
     std::sort(segs0.begin(), segs0.end(), lineSegmentPtrCmp);
     std::sort(segs1.begin(), segs1.end(), lineSegmentPtrCmp);
 
-    size_t sz = segs0.size();
+    std::size_t sz = segs0.size();
     for (std::size_t i = 0; i < sz; i++) {
         if (segs0[i].p0.x != segs1[i].p0.x ||
             segs0[i].p0.y != segs1[i].p0.y ||
diff --git a/src/operation/valid/ConnectedInteriorTester.cpp b/src/operation/valid/ConnectedInteriorTester.cpp
index 99fce79..cb439d9 100644
--- a/src/operation/valid/ConnectedInteriorTester.cpp
+++ b/src/operation/valid/ConnectedInteriorTester.cpp
@@ -57,7 +57,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 using namespace geos::geomgraph;
 using namespace geos::operation::overlay;
@@ -84,8 +84,8 @@ ConnectedInteriorTester::findDifferentPoint(const CoordinateSequence* coord,
         const Coordinate& pt)
 {
     assert(coord);
-    size_t npts = coord->getSize();
-    for(size_t i = 0; i < npts; ++i) {
+    std::size_t npts = coord->getSize();
+    for(std::size_t i = 0; i < npts; ++i) {
         if(!(coord->getAt(i) == pt)) {
             return coord->getAt(i);
         }
@@ -113,7 +113,7 @@ ConnectedInteriorTester::isInteriorsConnected()
     buildEdgeRings(graph.getEdgeEnds(), edgeRings);
 
 #if GEOS_DEBUG
-    cerr << "buildEdgeRings constructed " << edgeRings.size() << " edgeRings." << endl;
+    std::cerr << "buildEdgeRings constructed " << edgeRings.size() << " edgeRings." << std::endl;
 #endif
 
     /*
@@ -126,7 +126,7 @@ ConnectedInteriorTester::isInteriorsConnected()
     visitShellInteriors(geomGraph.getGeometry(), graph);
 
 #if GEOS_DEBUG
-    cerr << "after visitShellInteriors edgeRings are " << edgeRings.size() << " edgeRings." << endl;
+    std::cerr << "after visitShellInteriors edgeRings are " << edgeRings.size() << " edgeRings." << std::endl;
 #endif
 
     /*
@@ -139,18 +139,18 @@ ConnectedInteriorTester::isInteriorsConnected()
     bool res = !hasUnvisitedShellEdge(&edgeRings);
 
 #if GEOS_DEBUG
-    cerr << "releasing " << edgeRings.size() << " edgeRings." << endl;
+    std::cerr << "releasing " << edgeRings.size() << " edgeRings." << std::endl;
 #endif
     // Release memory allocated by buildEdgeRings
-    for(size_t i = 0, n = edgeRings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = edgeRings.size(); i < n; ++i) {
         EdgeRing* er = edgeRings[i];
 #if GEOS_DEBUG
-        cerr << *er << endl;
+        std::cerr << *er << std::endl;
 #endif
         assert(er);
         delete er;
 #if GEOS_DEBUG
-        cerr << "releasing edgeRing at " << er << endl;
+        std::cerr << "releasing edgeRing at " << er << std::endl;
 #endif
     }
     edgeRings.clear();
@@ -159,7 +159,7 @@ ConnectedInteriorTester::isInteriorsConnected()
     // There should be no more references to this object
     // how to check this ? boost::shared_ptr<> comes to mind.
     //
-    for(size_t i = 0, n = maximalEdgeRings.size(); i < n; i++) {
+    for(std::size_t i = 0, n = maximalEdgeRings.size(); i < n; i++) {
         delete maximalEdgeRings[i];
     }
     maximalEdgeRings.clear();
@@ -171,7 +171,7 @@ void
 ConnectedInteriorTester::setInteriorEdgesInResult(PlanarGraph& graph)
 {
     std::vector<EdgeEnd*>* ee = graph.getEdgeEnds();
-    for(size_t i = 0, n = ee->size(); i < n; ++i) {
+    for(std::size_t i = 0, n = ee->size(); i < n; ++i) {
         // Unexpected non DirectedEdge in graphEdgeEnds
         DirectedEdge* de = detail::down_cast<DirectedEdge*>((*ee)[i]);
         if(de->getLabel().getLocation(0, Position::RIGHT) == Location::INTERIOR) {
@@ -186,7 +186,7 @@ ConnectedInteriorTester::buildEdgeRings(std::vector<EdgeEnd*>* dirEdges,
                                         std::vector<EdgeRing*>& minEdgeRings)
 {
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << " got " << dirEdges->size() << " EdgeEnd vector" << endl;
+    std::cerr << __FUNCTION__ << " got " << dirEdges->size() << " EdgeEnd vector" << std::endl;
 #endif
 
     typedef std::vector<EdgeEnd*> EdgeEnds;
@@ -196,7 +196,7 @@ ConnectedInteriorTester::buildEdgeRings(std::vector<EdgeEnd*>* dirEdges,
         DirectedEdge* de = detail::down_cast<DirectedEdge*>((*dirEdges)[i]);
 
 #if GEOS_DEBUG
-        cerr << "DirectedEdge " << i << ": " << de->print() << endl;
+        std::cerr << "DirectedEdge " << i << ": " << de->print() << std::endl;
 #endif
 
         // if this edge has not yet been processed
@@ -230,7 +230,7 @@ ConnectedInteriorTester::visitShellInteriors(const Geometry* g, PlanarGraph& gra
     }
 
     if(const MultiPolygon* mp = dynamic_cast<const MultiPolygon*>(g)) {
-        for(size_t i = 0, n = mp->getNumGeometries(); i < n; i++) {
+        for(std::size_t i = 0, n = mp->getNumGeometries(); i < n; i++) {
             const Polygon* p = mp->getGeometryN(i);
             visitInteriorRing(p->getExteriorRing(), graph);
         }
@@ -290,7 +290,7 @@ ConnectedInteriorTester::hasUnvisitedShellEdge(std::vector<EdgeRing*>* edgeRings
 {
 
 #if GEOS_DEBUG
-    cerr << "hasUnvisitedShellEdge called with " << edgeRings->size() << " edgeRings." << endl;
+    std::cerr << "hasUnvisitedShellEdge called with " << edgeRings->size() << " edgeRings." << std::endl;
 #endif
 
     for(std::vector<EdgeRing*>::iterator
diff --git a/src/operation/valid/ConsistentAreaTester.cpp b/src/operation/valid/ConsistentAreaTester.cpp
index 9ebefb2..a8d65e4 100644
--- a/src/operation/valid/ConsistentAreaTester.cpp
+++ b/src/operation/valid/ConsistentAreaTester.cpp
@@ -33,7 +33,7 @@
 #include <memory> // unique_ptr
 #include <cassert>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geomgraph;
 using namespace geos::geom;
@@ -66,7 +66,7 @@ ConsistentAreaTester::isNodeConsistentArea()
      * To fully check validity, it is necessary to
      * compute ALL intersections, including self-intersections within a single edge.
      */
-    unique_ptr<SegmentIntersector> intersector(geomGraph->computeSelfNodes(&li, true, true));
+    std::unique_ptr<SegmentIntersector> intersector(geomGraph->computeSelfNodes(&li, true, true));
     /*
      * A proper intersection means that the area is not consistent.
      */
diff --git a/src/operation/valid/IndexedNestedRingTester.cpp b/src/operation/valid/IndexedNestedRingTester.cpp
index c1a03cc..f5c1fe6 100644
--- a/src/operation/valid/IndexedNestedRingTester.cpp
+++ b/src/operation/valid/IndexedNestedRingTester.cpp
@@ -42,7 +42,7 @@ IndexedNestedRingTester::isNonNested()
     buildIndex();
 
     std::vector<void*> results;
-    for(size_t i = 0, n = rings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = rings.size(); i < n; ++i) {
         results.clear();
 
         const geom::LinearRing* outerRing = rings[i];
@@ -105,7 +105,7 @@ IndexedNestedRingTester::buildIndex()
     delete index;
 
     index = new index::strtree::STRtree();
-    for(size_t i = 0, n = rings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = rings.size(); i < n; ++i) {
         const geom::LinearRing* ring = rings[i];
         const geom::Envelope* env = ring->getEnvelopeInternal();
         index->insert(env, (void*)ring);
diff --git a/src/operation/valid/IndexedNestedRingTester.h b/src/operation/valid/IndexedNestedRingTester.h
index 3e07e3e..118e305 100644
--- a/src/operation/valid/IndexedNestedRingTester.h
+++ b/src/operation/valid/IndexedNestedRingTester.h
@@ -50,7 +50,7 @@ namespace valid { // geos.operation.valid
 class IndexedNestedRingTester {
 public:
     // @param newGraph : ownership retained by caller
-    IndexedNestedRingTester(geomgraph::GeometryGraph* newGraph, size_t initialCapacity)
+    IndexedNestedRingTester(geomgraph::GeometryGraph* newGraph, std::size_t initialCapacity)
         :
         graph(newGraph),
         index(nullptr),
diff --git a/src/operation/valid/IndexedNestedShellTester.cpp b/src/operation/valid/IndexedNestedShellTester.cpp
index 91c1392..aa36f1a 100644
--- a/src/operation/valid/IndexedNestedShellTester.cpp
+++ b/src/operation/valid/IndexedNestedShellTester.cpp
@@ -35,7 +35,7 @@ public:
         shellLoc(*poly.getExteriorRing())
     {
         auto n = poly.getNumInteriorRing();
-        for (size_t i = 0; i < n; i++) {
+        for (std::size_t i = 0; i < n; i++) {
             ringLoc.emplace_back(*poly.getInteriorRingN(i));
         }
     }
@@ -44,7 +44,7 @@ public:
         return shellLoc;
     }
 
-    Locator& getHoleLocator(size_t holeNum) {
+    Locator& getHoleLocator(std::size_t holeNum) {
         return ringLoc[holeNum];
     }
 
@@ -52,7 +52,7 @@ public:
         return &poly;
     }
 
-    const geom::LinearRing* getInteriorRingN(size_t n) const {
+    const geom::LinearRing* getInteriorRingN(std::size_t n) const {
         return poly.getInteriorRingN(n);
     }
 
@@ -62,7 +62,7 @@ private:
     std::deque<Locator> ringLoc;
 };
 
-IndexedNestedShellTester::IndexedNestedShellTester(const geos::geomgraph::GeometryGraph &g, size_t initialCapacity) :
+IndexedNestedShellTester::IndexedNestedShellTester(const geos::geomgraph::GeometryGraph &g, std::size_t initialCapacity) :
     graph(g),
     nestedPt(nullptr),
     processed(false)
@@ -159,7 +159,7 @@ IndexedNestedShellTester::checkShellNotNested(const geom::LinearRing* shell, Pol
     // Otherwise, the shell is not properly contained in a hole, which is
     // an error.
     const geom::Coordinate* badNestedPt = nullptr;
-    for (size_t i = 0; i < nholes; i++) {
+    for (std::size_t i = 0; i < nholes; i++) {
         const geom::LinearRing* hole = locs.getPolygon()->getInteriorRingN(i);
 
         if (hole->getEnvelopeInternal()->covers(shell->getEnvelopeInternal())) {
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 21a3921..4cfbef7 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -50,7 +50,7 @@
 #include <typeinfo>
 #include <set>
 
-using namespace std;
+
 using namespace geos::algorithm;
 using namespace geos::geomgraph;
 using namespace geos::geom;
@@ -273,9 +273,9 @@ void
 IsValidOp::checkValid(const MultiPolygon* g)
 {
     auto ngeoms = g->getNumGeometries();
-    vector<const Polygon*>polys(ngeoms);
+    std::vector<const Polygon*>polys(ngeoms);
 
-    for(size_t i = 0; i < ngeoms; ++i) {
+    for(std::size_t i = 0; i < ngeoms; ++i) {
         const Polygon* p = g->getGeometryN(i);
 
         checkInvalidCoordinates(p);
@@ -339,7 +339,7 @@ IsValidOp::checkValid(const MultiPolygon* g)
 void
 IsValidOp::checkValid(const GeometryCollection* gc)
 {
-    for(size_t i = 0, ngeoms = gc->getNumGeometries(); i < ngeoms; ++i) {
+    for(std::size_t i = 0, ngeoms = gc->getNumGeometries(); i < ngeoms; ++i) {
         const Geometry* g = gc->getGeometryN(i);
         checkValid(g);
         if(validErr != nullptr) {
@@ -392,7 +392,7 @@ IsValidOp::checkConsistentArea(GeometryGraph* graph)
 void
 IsValidOp::checkNoSelfIntersectingRings(GeometryGraph* graph)
 {
-    vector<Edge*>* edges = graph->getEdges();
+    std::vector<Edge*>* edges = graph->getEdges();
     for(unsigned int i = 0; i < edges->size(); ++i) {
         Edge* e = (*edges)[i];
         checkNoSelfIntersectingRing(e->getEdgeIntersectionList());
@@ -406,7 +406,7 @@ IsValidOp::checkNoSelfIntersectingRings(GeometryGraph* graph)
 void
 IsValidOp::checkNoSelfIntersectingRing(EdgeIntersectionList& eiList)
 {
-    set<const Coordinate*, CoordinateLessThen>nodeSet;
+    std::set<const Coordinate*, CoordinateLessThen>nodeSet;
     bool isFirst = true;
     for(const EdgeIntersection& ei : eiList) {
         if(isFirst) {
@@ -440,7 +440,7 @@ IsValidOp::checkHolesInShell(const Polygon* p, GeometryGraph* graph)
 
     locate::IndexedPointInAreaLocator ipial(*shell);
 
-    for(size_t i = 0; i < nholes; ++i) {
+    for(std::size_t i = 0; i < nholes; ++i) {
         const LinearRing* hole = p->getInteriorRingN(i);
 
         if (hole->isEmpty()) continue;
@@ -472,7 +472,7 @@ IsValidOp::checkHolesNotNested(const Polygon* p, GeometryGraph* graph)
     auto nholes = p->getNumInteriorRing();
 
     IndexedNestedRingTester nestedTester(graph, nholes);
-    for (size_t i = 0; i < nholes; ++i) {
+    for (std::size_t i = 0; i < nholes; ++i) {
         const LinearRing* innerHole = p->getInteriorRingN(i);
 
         //empty holes always pass
@@ -499,7 +499,7 @@ IsValidOp::checkShellsNotNested(const MultiPolygon* mp, GeometryGraph* graph)
 
     IndexedNestedShellTester tester(*graph, ngeoms);
 
-    for (size_t i = 0; i < ngeoms; ++i) {
+    for (std::size_t i = 0; i < ngeoms; ++i) {
         tester.add(*mp->getGeometryN(i));
     }
 
@@ -529,7 +529,7 @@ void
 IsValidOp::checkInvalidCoordinates(const CoordinateSequence* cs)
 {
     auto size = cs->size();
-    for(size_t i = 0; i < size; ++i) {
+    for(std::size_t i = 0; i < size; ++i) {
         if(! isValid(cs->getAt(i))) {
             validErr = new TopologyValidationError(
                 TopologyValidationError::eInvalidCoordinate,
@@ -550,7 +550,7 @@ IsValidOp::checkInvalidCoordinates(const Polygon* poly)
     }
 
     auto nholes = poly->getNumInteriorRing();
-    for(size_t i = 0; i < nholes; ++i) {
+    for(std::size_t i = 0; i < nholes; ++i) {
         checkInvalidCoordinates(
             poly->getInteriorRingN(i)->getCoordinatesRO()
         );
@@ -571,7 +571,7 @@ IsValidOp::checkClosedRings(const Polygon* poly)
     }
 
     auto nholes = poly->getNumInteriorRing();
-    for(size_t i = 0; i < nholes; ++i) {
+    for(std::size_t i = 0; i < nholes; ++i) {
         lr = (const LinearRing*)poly->getInteriorRingN(i);
         checkClosedRing(lr);
         if(validErr) {
diff --git a/src/operation/valid/QuadtreeNestedRingTester.cpp b/src/operation/valid/QuadtreeNestedRingTester.cpp
index 2f8706b..138652f 100644
--- a/src/operation/valid/QuadtreeNestedRingTester.cpp
+++ b/src/operation/valid/QuadtreeNestedRingTester.cpp
@@ -28,7 +28,7 @@
 #include <vector>
 #include <cassert>
 
-using namespace std;
+
 using namespace geos::geomgraph;
 using namespace geos::geom;
 using namespace geos::algorithm;
@@ -70,14 +70,14 @@ bool
 QuadtreeNestedRingTester::isNonNested()
 {
     buildQuadtree();
-    for(size_t i = 0, ni = rings.size(); i < ni; ++i) {
+    for(std::size_t i = 0, ni = rings.size(); i < ni; ++i) {
         const LinearRing* innerRing = rings[i];
         const CoordinateSequence* innerRingPts = innerRing->getCoordinatesRO();
         const Envelope* envi = innerRing->getEnvelopeInternal();
 
-        vector<void*> results;
+        std::vector<void*> results;
         qt->query(envi, results);
-        for(size_t j = 0, nj = results.size(); j < nj; ++j) {
+        for(std::size_t j = 0, nj = results.size(); j < nj; ++j) {
             LinearRing* searchRing = (LinearRing*)results[j];
             const CoordinateSequence* searchRingPts = searchRing->getCoordinatesRO();
 
@@ -117,7 +117,7 @@ void
 QuadtreeNestedRingTester::buildQuadtree()
 {
     qt = new Quadtree();
-    for(size_t i = 0, n = rings.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = rings.size(); i < n; ++i) {
         const LinearRing* ring = rings[i];
         const Envelope* env = ring->getEnvelopeInternal();
 
diff --git a/src/operation/valid/RepeatedPointRemover.cpp b/src/operation/valid/RepeatedPointRemover.cpp
index ef22766..b4aac9a 100644
--- a/src/operation/valid/RepeatedPointRemover.cpp
+++ b/src/operation/valid/RepeatedPointRemover.cpp
@@ -37,7 +37,7 @@ RepeatedPointRemover::removeRepeatedPoints(const geom::CoordinateSequence* seq)
     const Coordinate* prevPt = &(seq->getAt(0));
     pts->push_back(*prevPt) ;
 
-    for (size_t i = 1; i < sz; i++) {
+    for (std::size_t i = 1; i < sz; i++) {
         const Coordinate* nextPt = &(seq->getAt(i));
         if (*nextPt != *prevPt) {
             pts->push_back(*nextPt);
diff --git a/src/operation/valid/RepeatedPointTester.cpp b/src/operation/valid/RepeatedPointTester.cpp
index d9205f1..ec96e90 100644
--- a/src/operation/valid/RepeatedPointTester.cpp
+++ b/src/operation/valid/RepeatedPointTester.cpp
@@ -85,7 +85,7 @@ bool
 RepeatedPointTester::hasRepeatedPoint(const CoordinateSequence* coord)
 {
     auto npts = coord->getSize();
-    for(size_t i = 1; i < npts; ++i) {
+    for(std::size_t i = 1; i < npts; ++i) {
         if(coord->getAt(i - 1) == coord->getAt(i)) {
             repeatedCoord = coord->getAt(i);
             return true;
@@ -101,7 +101,7 @@ RepeatedPointTester::hasRepeatedPoint(const Polygon* p)
         return true;
     }
 
-    for(size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
+    for(std::size_t i = 0, n = p->getNumInteriorRing(); i < n; ++i) {
         if(hasRepeatedPoint(p->getInteriorRingN(i)->getCoordinatesRO())) {
             return true;
         }
@@ -112,7 +112,7 @@ RepeatedPointTester::hasRepeatedPoint(const Polygon* p)
 bool
 RepeatedPointTester::hasRepeatedPoint(const GeometryCollection* gc)
 {
-    for(size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
         const Geometry* g = gc->getGeometryN(i);
         if(hasRepeatedPoint(g)) {
             return true;
@@ -124,7 +124,7 @@ RepeatedPointTester::hasRepeatedPoint(const GeometryCollection* gc)
 bool
 RepeatedPointTester::hasRepeatedPoint(const MultiPolygon* gc)
 {
-    for(size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
         const Polygon* g = gc->getGeometryN(i);
         if(hasRepeatedPoint(g)) {
             return true;
@@ -136,7 +136,7 @@ RepeatedPointTester::hasRepeatedPoint(const MultiPolygon* gc)
 bool
 RepeatedPointTester::hasRepeatedPoint(const MultiLineString* gc)
 {
-    for(size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
+    for(std::size_t i = 0, n = gc->getNumGeometries(); i < n; ++i) {
         const LineString* g = gc->getGeometryN(i);
         if(hasRepeatedPoint(g)) {
             return true;
diff --git a/src/operation/valid/SimpleNestedRingTester.cpp b/src/operation/valid/SimpleNestedRingTester.cpp
index 9d63d21..8abe461 100644
--- a/src/operation/valid/SimpleNestedRingTester.cpp
+++ b/src/operation/valid/SimpleNestedRingTester.cpp
@@ -35,10 +35,10 @@ namespace valid { // geos.operation.valid
 bool
 SimpleNestedRingTester::isNonNested()
 {
-    for(size_t i = 0, ni = rings.size(); i < ni; i++) {
+    for(std::size_t i = 0, ni = rings.size(); i < ni; i++) {
         LinearRing* innerRing = rings[i];
         const CoordinateSequence* innerRingPts = innerRing->getCoordinatesRO();
-        for(size_t j = 0, nj = rings.size(); j < nj; j++) {
+        for(std::size_t j = 0, nj = rings.size(); j < nj; j++) {
             LinearRing* searchRing = rings[j];
             const CoordinateSequence* searchRingPts = searchRing->getCoordinatesRO();
             if(innerRing == searchRing) {
diff --git a/src/operation/valid/SweeplineNestedRingTester.cpp b/src/operation/valid/SweeplineNestedRingTester.cpp
index d7bb59c..7c68ae8 100644
--- a/src/operation/valid/SweeplineNestedRingTester.cpp
+++ b/src/operation/valid/SweeplineNestedRingTester.cpp
@@ -67,7 +67,7 @@ void
 SweeplineNestedRingTester::buildIndex()
 {
     sweepLine = new SweepLineIndex();
-    for(size_t i = 0, n = rings.size(); i < n; i++) {
+    for(std::size_t i = 0, n = rings.size(); i < n; i++) {
         LinearRing* ring = rings[i];
         const Envelope* env = ring->getEnvelopeInternal();
         SweepLineInterval* sweepInt = new SweepLineInterval(env->getMinX(), env->getMaxX(), ring);
diff --git a/src/operation/valid/TopologyValidationError.cpp b/src/operation/valid/TopologyValidationError.cpp
index b1422be..43f4da9 100644
--- a/src/operation/valid/TopologyValidationError.cpp
+++ b/src/operation/valid/TopologyValidationError.cpp
@@ -22,7 +22,7 @@
 
 #include <string>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -71,13 +71,13 @@ TopologyValidationError::getCoordinate()
     return pt;
 }
 
-string
+std::string
 TopologyValidationError::getMessage()
 {
-    return string(errMsg[errorType]);
+    return std::string(errMsg[errorType]);
 }
 
-string
+std::string
 TopologyValidationError::toString()
 {
     return getMessage().append(" at or near point ").append(pt.toString());
diff --git a/src/planargraph/DirectedEdge.cpp b/src/planargraph/DirectedEdge.cpp
index 003cd36..1f3bfdc 100644
--- a/src/planargraph/DirectedEdge.cpp
+++ b/src/planargraph/DirectedEdge.cpp
@@ -22,7 +22,7 @@
 #include <vector>
 #include <typeinfo>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -30,18 +30,18 @@ namespace planargraph {
 
 /*public*/
 void
-DirectedEdge::toEdges(vector<DirectedEdge*>& dirEdges, vector<Edge*>& edges)
+DirectedEdge::toEdges(std::vector<DirectedEdge*>& dirEdges, std::vector<Edge*>& edges)
 {
-    for(size_t i = 0, n = dirEdges.size(); i < n; ++i) {
+    for(std::size_t i = 0, n = dirEdges.size(); i < n; ++i) {
         edges.push_back(dirEdges[i]->parentEdge);
     }
 }
 
 /*public*/
-vector<Edge*>*
-DirectedEdge::toEdges(vector<DirectedEdge*>& dirEdges)
+std::vector<Edge*>*
+DirectedEdge::toEdges(std::vector<DirectedEdge*>& dirEdges)
 {
-    vector<Edge*>* edges = new vector<Edge*>();
+    std::vector<Edge*>* edges = new std::vector<Edge*>();
     toEdges(dirEdges, *edges);
     return edges;
 }
@@ -166,10 +166,10 @@ DirectedEdge::compareDirection(const DirectedEdge* e) const
 }
 
 /*public*/
-string
+std::string
 DirectedEdge::print() const
 {
-    ostringstream s;
+    std::ostringstream s;
     s << *this;
     return s.str();
 }
diff --git a/src/planargraph/DirectedEdgeStar.cpp b/src/planargraph/DirectedEdgeStar.cpp
index 5342bd5..5de7442 100644
--- a/src/planargraph/DirectedEdgeStar.cpp
+++ b/src/planargraph/DirectedEdgeStar.cpp
@@ -19,7 +19,7 @@
 #include <vector>
 #include <algorithm>
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -50,28 +50,28 @@ DirectedEdgeStar::remove(DirectedEdge* de)
     }
 }
 
-vector<DirectedEdge*>::iterator
+std::vector<DirectedEdge*>::iterator
 DirectedEdgeStar::begin()
 {
     sortEdges();
     return outEdges.begin();
 }
 
-vector<DirectedEdge*>::iterator
+std::vector<DirectedEdge*>::iterator
 DirectedEdgeStar::end()
 {
     sortEdges();
     return outEdges.end();
 }
 
-vector<DirectedEdge*>::const_iterator
+std::vector<DirectedEdge*>::const_iterator
 DirectedEdgeStar::begin() const
 {
     sortEdges();
     return outEdges.begin();
 }
 
-vector<DirectedEdge*>::const_iterator
+std::vector<DirectedEdge*>::const_iterator
 DirectedEdgeStar::end() const
 {
     sortEdges();
@@ -95,7 +95,7 @@ DirectedEdgeStar::getCoordinate() const
  * Returns the DirectedEdges, in ascending order by angle with
  * the positive x-axis.
  */
-vector<DirectedEdge*>&
+std::vector<DirectedEdge*>&
 DirectedEdgeStar::getEdges()
 {
     sortEdges();
diff --git a/src/planargraph/Node.cpp b/src/planargraph/Node.cpp
index 26739f3..9a5f8e9 100644
--- a/src/planargraph/Node.cpp
+++ b/src/planargraph/Node.cpp
@@ -19,14 +19,14 @@
 #include <iostream>
 #include <algorithm>
 
-using namespace std;
+
 
 namespace geos {
 namespace planargraph {
 
 /* static public */
 /* UNUSED */
-vector<Edge*>*
+std::vector<Edge*>*
 Node::getEdgesBetween(Node* node0, Node* node1)
 {
     std::vector<Edge*> edges0;
diff --git a/src/planargraph/NodeMap.cpp b/src/planargraph/NodeMap.cpp
index a416527..d889d2b 100644
--- a/src/planargraph/NodeMap.cpp
+++ b/src/planargraph/NodeMap.cpp
@@ -18,7 +18,7 @@
 
 #include <map>
 
-using namespace std;
+
 
 namespace geos {
 namespace planargraph {
@@ -43,7 +43,7 @@ NodeMap::getNodeMap()
 Node*
 NodeMap::add(Node* n)
 {
-    nodeMap.insert(pair<geom::Coordinate, Node*>(n->getCoordinate(), n));
+    nodeMap.insert(std::pair<geom::Coordinate, Node*>(n->getCoordinate(), n));
     return n;
 }
 
@@ -61,7 +61,7 @@ NodeMap::remove(geom::Coordinate& pt)
 
 /* public */
 void
-NodeMap::getNodes(vector<Node*>& values)
+NodeMap::getNodes(std::vector<Node*>& values)
 {
     NodeMap::container::iterator it = nodeMap.begin(), itE = nodeMap.end();
     while(it != itE) {
diff --git a/src/planargraph/PlanarGraph.cpp b/src/planargraph/PlanarGraph.cpp
index 8671d1c..e93dca9 100644
--- a/src/planargraph/PlanarGraph.cpp
+++ b/src/planargraph/PlanarGraph.cpp
@@ -26,7 +26,7 @@
 #include <vector>
 #include <map>
 
-using namespace std;
+
 
 namespace geos {
 namespace planargraph {
@@ -97,7 +97,7 @@ void
 PlanarGraph::remove(Node* node)
 {
     // unhook all directed edges
-    vector<DirectedEdge*>& outEdges = node->getOutEdges()->getEdges();
+    std::vector<DirectedEdge*>& outEdges = node->getOutEdges()->getEdges();
     for(unsigned int i = 0; i < outEdges.size(); ++i) {
         DirectedEdge* de = outEdges[i];
         DirectedEdge* sym = de->getSym();
@@ -128,17 +128,17 @@ PlanarGraph::remove(Node* node)
 }
 
 /*public*/
-vector<Node*>*
-PlanarGraph::findNodesOfDegree(size_t degree)
+std::vector<Node*>*
+PlanarGraph::findNodesOfDegree(std::size_t degree)
 {
-    vector<Node*>* nodesFound = new vector<Node*>();
+    std::vector<Node*>* nodesFound = new std::vector<Node*>();
     findNodesOfDegree(degree, *nodesFound);
     return nodesFound;
 }
 
 /*public*/
 void
-PlanarGraph::findNodesOfDegree(size_t degree, vector<Node*>& nodesFound)
+PlanarGraph::findNodesOfDegree(std::size_t degree, std::vector<Node*>& nodesFound)
 {
     NodeMap::container& nm = nodeMap.getNodeMap();
     for(NodeMap::container::iterator it = nm.begin(), itEnd = nm.end();
diff --git a/src/planargraph/Subgraph.cpp b/src/planargraph/Subgraph.cpp
index 4d418a3..a8f69d5 100644
--- a/src/planargraph/Subgraph.cpp
+++ b/src/planargraph/Subgraph.cpp
@@ -21,15 +21,15 @@
 #include <utility>
 #include <vector>
 
-using namespace std;
+
 
 namespace geos {
 namespace planargraph {
 
-pair<Edge::NonConstSet::iterator, bool>
+std::pair<Edge::NonConstSet::iterator, bool>
 Subgraph::add(Edge* e)
 {
-    pair<Edge::NonConstSet::iterator, bool> p = edges.insert(e);
+    std::pair<Edge::NonConstSet::iterator, bool> p = edges.insert(e);
     if(!p.second) {
         return p;
     }
diff --git a/src/planargraph/algorithm/ConnectedSubgraphFinder.cpp b/src/planargraph/algorithm/ConnectedSubgraphFinder.cpp
index e6d8b3e..190944a 100644
--- a/src/planargraph/algorithm/ConnectedSubgraphFinder.cpp
+++ b/src/planargraph/algorithm/ConnectedSubgraphFinder.cpp
@@ -24,14 +24,14 @@
 #include <vector>
 #include <stack>
 
-using namespace std;
+
 
 namespace geos {
 namespace planargraph {
 namespace algorithm {
 
 void
-ConnectedSubgraphFinder::getConnectedSubgraphs(vector<Subgraph*>& subgraphs)
+ConnectedSubgraphFinder::getConnectedSubgraphs(std::vector<Subgraph*>& subgraphs)
 {
     GraphComponent::setVisitedMap(graph.nodeBegin(),
                                   graph.nodeEnd(), false);
@@ -63,7 +63,7 @@ void
 ConnectedSubgraphFinder::addReachable(Node* startNode,
                                       Subgraph* subgraph)
 {
-    stack<Node*> nodeStack;
+    std::stack<Node*> nodeStack;
     nodeStack.push(startNode);
     while(!nodeStack.empty()) {
         Node* node = nodeStack.top();
@@ -75,7 +75,7 @@ ConnectedSubgraphFinder::addReachable(Node* startNode,
 /*private*/
 void
 ConnectedSubgraphFinder::addEdges(Node* node,
-                                  stack<Node*>& nodeStack, Subgraph* subgraph)
+                                  std::stack<Node*>& nodeStack, Subgraph* subgraph)
 {
     node->setVisited(true);
     DirectedEdgeStar* des = node->getOutEdges();
diff --git a/src/precision/CommonBitsOp.cpp b/src/precision/CommonBitsOp.cpp
index 45d5aa7..febe01e 100644
--- a/src/precision/CommonBitsOp.cpp
+++ b/src/precision/CommonBitsOp.cpp
@@ -30,7 +30,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 
 namespace geos {
@@ -67,8 +67,8 @@ CommonBitsOp::intersection(
     const Geometry* geom0,
     const Geometry* geom1)
 {
-    unique_ptr<Geometry> rgeom0;
-    unique_ptr<Geometry> rgeom1;
+    std::unique_ptr<Geometry> rgeom0;
+    std::unique_ptr<Geometry> rgeom1;
     removeCommonBits(geom0, geom1, rgeom0, rgeom1);
     return computeResultPrecision(rgeom0->intersection(rgeom1.get()));
 }
@@ -79,8 +79,8 @@ CommonBitsOp::Union(
     const Geometry* geom0,
     const Geometry* geom1)
 {
-    unique_ptr<Geometry> rgeom0;
-    unique_ptr<Geometry> rgeom1;
+    std::unique_ptr<Geometry> rgeom0;
+    std::unique_ptr<Geometry> rgeom1;
     removeCommonBits(geom0, geom1, rgeom0, rgeom1);
     return computeResultPrecision(rgeom0->Union(rgeom1.get()));
 }
@@ -91,8 +91,8 @@ CommonBitsOp::difference(
     const Geometry* geom0,
     const Geometry* geom1)
 {
-    unique_ptr<Geometry> rgeom0;
-    unique_ptr<Geometry> rgeom1;
+    std::unique_ptr<Geometry> rgeom0;
+    std::unique_ptr<Geometry> rgeom1;
     removeCommonBits(geom0, geom1, rgeom0, rgeom1);
     return computeResultPrecision(rgeom0->difference(rgeom1.get()));
 }
@@ -103,8 +103,8 @@ CommonBitsOp::symDifference(
     const Geometry* geom0,
     const Geometry* geom1)
 {
-    unique_ptr<Geometry> rgeom0;
-    unique_ptr<Geometry> rgeom1;
+    std::unique_ptr<Geometry> rgeom0;
+    std::unique_ptr<Geometry> rgeom1;
     removeCommonBits(geom0, geom1, rgeom0, rgeom1);
     return computeResultPrecision(rgeom0->symDifference(rgeom1.get()));
 }
@@ -113,7 +113,7 @@ CommonBitsOp::symDifference(
 std::unique_ptr<Geometry>
 CommonBitsOp::buffer(const Geometry* geom0, double distance)
 {
-    unique_ptr<Geometry> rgeom0(removeCommonBits(geom0));
+    std::unique_ptr<Geometry> rgeom0(removeCommonBits(geom0));
     return computeResultPrecision(rgeom0->buffer(distance));
 }
 
@@ -137,7 +137,7 @@ CommonBitsOp::removeCommonBits(const Geometry* geom0)
 
 #if GEOS_DEBUG
     const Coordinate& commonCoord = cbr->getCommonCoordinate();
-    cerr << "CommonBitsRemover bits: " << commonCoord.x << ", " << commonCoord.y << endl;
+    std::cerr << "CommonBitsRemover bits: " << commonCoord.x << ", " << commonCoord.y << std::endl;
 #endif
 
     auto geom = geom0->clone();
@@ -162,7 +162,7 @@ CommonBitsOp::removeCommonBits(
 
 #if GEOS_DEBUG
     const Coordinate& commonCoord = cbr->getCommonCoordinate();
-    cerr << "CommonBitsRemover bits: " << commonCoord.x << ", " << commonCoord.y << endl;
+    std::cerr << "CommonBitsRemover bits: " << commonCoord.x << ", " << commonCoord.y << std::endl;
 #endif
 
     rgeom0 = geom0->clone();
diff --git a/src/precision/MinimumClearance.cpp b/src/precision/MinimumClearance.cpp
index 21d3348..0c06705 100644
--- a/src/precision/MinimumClearance.cpp
+++ b/src/precision/MinimumClearance.cpp
@@ -118,8 +118,8 @@ MinimumClearance::compute()
         double
         vertexDistance(const FacetSequence* fs1, const FacetSequence* fs2)
         {
-            for(size_t i1 = 0; i1 < fs1->size(); i1++) {
-                for(size_t i2 = 0; i2 < fs2->size(); i2++) {
+            for(std::size_t i1 = 0; i1 < fs1->size(); i1++) {
+                for(std::size_t i2 = 0; i2 < fs2->size(); i2++) {
                     const Coordinate* p1 = fs1->getCoordinate(i1);
                     const Coordinate* p2 = fs2->getCoordinate(i2);
                     if(!p1->equals2D(*p2)) {
@@ -141,8 +141,8 @@ MinimumClearance::compute()
         double
         segmentDistance(const FacetSequence* fs1, const FacetSequence* fs2)
         {
-            for(size_t i1 = 0; i1 < fs1->size(); i1++) {
-                for(size_t i2 = 1; i2 < fs2->size(); i2++) {
+            for(std::size_t i1 = 0; i1 < fs1->size(); i1++) {
+                for(std::size_t i2 = 1; i2 < fs2->size(); i2++) {
                     const Coordinate* p = fs1->getCoordinate(i1);
 
                     const Coordinate* seg0 = fs2->getCoordinate(i2 - 1);
diff --git a/src/precision/PrecisionReducerCoordinateOperation.cpp b/src/precision/PrecisionReducerCoordinateOperation.cpp
index ce76bbb..6e9b40a 100644
--- a/src/precision/PrecisionReducerCoordinateOperation.cpp
+++ b/src/precision/PrecisionReducerCoordinateOperation.cpp
@@ -47,7 +47,7 @@ PrecisionReducerCoordinateOperation::edit(const CoordinateSequence* cs,
     auto vc = detail::make_unique<std::vector<Coordinate>>(csSize);
 
     // copy coordinates and reduce
-    for(size_t i = 0; i < csSize; ++i) {
+    for(std::size_t i = 0; i < csSize; ++i) {
         (*vc)[i] = cs->getAt(i);
         targetPM.makePrecise((*vc)[i]);
     }
diff --git a/src/simplify/LineSegmentIndex.cpp b/src/simplify/LineSegmentIndex.cpp
index 2395495..c9028fc 100644
--- a/src/simplify/LineSegmentIndex.cpp
+++ b/src/simplify/LineSegmentIndex.cpp
@@ -36,7 +36,7 @@
 #include <iostream>
 #endif
 
-using namespace std;
+
 using namespace geos::geom;
 using namespace geos::index::quadtree;
 
@@ -54,7 +54,7 @@ private:
 
     const LineSegment* querySeg;
 
-    unique_ptr< vector<LineSegment*> > items;
+    std::unique_ptr< std::vector<LineSegment*> > items;
 
 public:
 
@@ -62,7 +62,7 @@ public:
         :
         ItemVisitor(),
         querySeg(s),
-        items(new vector<LineSegment*>())
+        items(new std::vector<LineSegment*>())
     {}
 
     ~LineSegmentVisitor() override
@@ -74,7 +74,7 @@ public:
         :
         ItemVisitor(),
         querySeg(o.querySeg),
-        items(new vector<LineSegment*>(*(o.items.get())))
+        items(new std::vector<LineSegment*>(*(o.items.get())))
     {
     }
 
@@ -85,7 +85,7 @@ public:
             return *this;
         }
         querySeg = o.querySeg;
-        items.reset(new vector<LineSegment*>(*(o.items.get())));
+        items.reset(new std::vector<LineSegment*>(*(o.items.get())));
         return *this;
     }
 
@@ -99,7 +99,7 @@ public:
         }
     }
 
-    unique_ptr< vector<LineSegment*> >
+    std::unique_ptr< std::vector<LineSegment*> >
     getItems()
     {
         // NOTE: Apparently, this is 'source' method giving up the object resource.
@@ -144,7 +144,7 @@ LineSegmentIndex::remove(const LineSegment* seg)
 }
 
 /*public*/
-unique_ptr< vector<LineSegment*> >
+std::unique_ptr< std::vector<LineSegment*> >
 LineSegmentIndex::query(const LineSegment* querySeg)
 {
     Envelope env(querySeg->p0, querySeg->p1);
@@ -152,7 +152,7 @@ LineSegmentIndex::query(const LineSegment* querySeg)
     LineSegmentVisitor visitor(querySeg);
     index.query(&env, visitor);
 
-    unique_ptr< vector<LineSegment*> > itemsFound = visitor.getItems();
+    std::unique_ptr< std::vector<LineSegment*> > itemsFound = visitor.getItems();
 
     return itemsFound;
 }
diff --git a/src/simplify/TaggedLineSegment.cpp b/src/simplify/TaggedLineSegment.cpp
index fccd44f..00b569c 100644
--- a/src/simplify/TaggedLineSegment.cpp
+++ b/src/simplify/TaggedLineSegment.cpp
@@ -34,7 +34,7 @@ namespace simplify { // geos::simplify
 TaggedLineSegment::TaggedLineSegment(const geom::Coordinate& p_p0,
                                      const geom::Coordinate& p_p1,
                                      const geom::Geometry* nParent,
-                                     size_t nIndex)
+                                     std::size_t nIndex)
     :
     LineSegment(p_p0, p_p1),
     parent(nParent),
diff --git a/src/simplify/TaggedLineString.cpp b/src/simplify/TaggedLineString.cpp
index 680aa4b..167a8ec 100644
--- a/src/simplify/TaggedLineString.cpp
+++ b/src/simplify/TaggedLineString.cpp
@@ -37,7 +37,7 @@
 #endif
 
 using namespace geos::geom;
-using namespace std;
+
 
 namespace geos {
 namespace simplify { // geos::simplify
@@ -56,8 +56,8 @@ TaggedLineString::TaggedLineString(const geom::LineString* nParentLine,
 TaggedLineString::~TaggedLineString()
 {
 #if GEOS_DEBUG
-    cerr << "TaggedLineString[" << this << "] destructor"
-         << endl;
+    std::cerr << "TaggedLineString[" << this << "] destructor"
+         << std::endl;
 #endif
 
     for(std::size_t i = 0, n = segs.size(); i < n; i++) {
@@ -77,8 +77,8 @@ TaggedLineString::init()
     const CoordinateSequence* pts = parentLine->getCoordinatesRO();
 
 #if GEOS_DEBUG
-    cerr << "TaggedLineString[" << this << "] pts.size() " << pts->size()
-         << endl;
+    std::cerr << "TaggedLineString[" << this << "] pts.size() " << pts->size()
+         << std::endl;
 #endif
 
     if(!pts->isEmpty()) {
@@ -97,10 +97,10 @@ TaggedLineString::init()
     }
 
 #if GEOS_DEBUG
-    cerr << "TaggedLineString[" << this << "] segs.size " << segs.size()
-         << endl;
-    cerr << "TaggedLineString[" << this << "] resultSegs.size " << resultSegs.size()
-         << endl;
+    std::cerr << "TaggedLineString[" << this << "] segs.size " << segs.size()
+         << std::endl;
+    std::cerr << "TaggedLineString[" << this << "] resultSegs.size " << resultSegs.size()
+         << std::endl;
 #endif
 }
 
@@ -132,15 +132,15 @@ TaggedLineString::getResultCoordinates() const
 {
 
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << " resultSegs.size: "
-         << resultSegs.size() << endl;
+    std::cerr << __FUNCTION__ << " resultSegs.size: "
+         << resultSegs.size() << std::endl;
 #endif
 
     CoordVectPtr pts = extractCoordinates(resultSegs);
 
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << " extracted Coords.size: "
-         << pts->size() << endl;
+    std::cerr << __FUNCTION__ << " extracted Coords.size: "
+         << pts->size() << std::endl;
 #endif
 
 
@@ -157,7 +157,7 @@ TaggedLineString::extractCoordinates(
     CoordVectPtr pts(new CoordVect());
 
 #if GEOS_DEBUG
-    cerr << __FUNCTION__ << " segs.size: " << segs.size() << endl;
+    std::cerr << __FUNCTION__ << " segs.size: " << segs.size() << std::endl;
 #endif
 
     std::size_t i = 0, size = segs.size();
@@ -199,7 +199,7 @@ TaggedLineString::getSegment(std::size_t i) const
 }
 
 /*public*/
-vector<TaggedLineSegment*>&
+std::vector<TaggedLineSegment*>&
 TaggedLineString::getSegments()
 {
     assert(0);
@@ -207,14 +207,14 @@ TaggedLineString::getSegments()
 }
 
 /*public*/
-const vector<TaggedLineSegment*>&
+const std::vector<TaggedLineSegment*>&
 TaggedLineString::getSegments() const
 {
     return segs;
 }
 
 /*public*/
-unique_ptr<Geometry>
+std::unique_ptr<Geometry>
 TaggedLineString::asLineString() const
 {
     return parentLine->getFactory()->createLineString(
@@ -222,7 +222,7 @@ TaggedLineString::asLineString() const
 }
 
 /*public*/
-unique_ptr<Geometry>
+std::unique_ptr<Geometry>
 TaggedLineString::asLinearRing() const
 {
     return std::unique_ptr<Geometry>(parentLine->getFactory()->createLinearRing(
@@ -231,18 +231,18 @@ TaggedLineString::asLinearRing() const
 
 /*public*/
 void
-TaggedLineString::addToResult(unique_ptr<TaggedLineSegment> seg)
+TaggedLineString::addToResult(std::unique_ptr<TaggedLineSegment> seg)
 {
 #if GEOS_DEBUG
-    cerr << "TaggedLineString[" << this << "] adding "
+    std::cerr << "TaggedLineString[" << this << "] adding "
          << " seg " << seg.get() << " to result"
-         << endl;
+         << std::endl;
 #endif
     resultSegs.push_back(seg.release());
 #if GEOS_DEBUG
-    cerr << "TaggedLineString[" << this << "] adding "
+    std::cerr << "TaggedLineString[" << this << "] adding "
          << " seg " << seg.get() << " to result"
-         << endl;
+         << std::endl;
 #endif
 }
 
diff --git a/src/simplify/TaggedLineStringSimplifier.cpp b/src/simplify/TaggedLineStringSimplifier.cpp
index e3c87e4..36941ae 100644
--- a/src/simplify/TaggedLineStringSimplifier.cpp
+++ b/src/simplify/TaggedLineStringSimplifier.cpp
@@ -23,7 +23,7 @@
 #include <geos/simplify/TaggedLineSegment.h>
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/LineString.h>
-//#include <geos/geom/Geometry.h> // for unique_ptr destructor
+//#include <geos/geom/Geometry.h> // for std::unique_ptr destructor
 //#include <geos/geom/GeometryFactory.h>
 //#include <geos/geom/CoordinateSequenceFactory.h>
 
@@ -105,7 +105,7 @@ TaggedLineStringSimplifier::simplifySection(std::size_t i,
         std::cerr << "single segment, no flattening"
                   << std::endl;
 #endif
-        unique_ptr<TaggedLineSegment> newSeg(new
+        std::unique_ptr<TaggedLineSegment> newSeg(new
                                              TaggedLineSegment(*(line->getSegment(i))));
 
         line->addToResult(std::move(newSeg));
@@ -155,7 +155,7 @@ TaggedLineStringSimplifier::simplifySection(std::size_t i,
 
     if(isValidToSimplify) {
 
-        unique_ptr<TaggedLineSegment> newSeg = flatten(i, j);
+        std::unique_ptr<TaggedLineSegment> newSeg = flatten(i, j);
 
 #if GEOS_DEBUG
         std::cerr << "isValidToSimplify, adding seg "
@@ -175,13 +175,13 @@ TaggedLineStringSimplifier::simplifySection(std::size_t i,
 
 
 /*private*/
-unique_ptr<TaggedLineSegment>
+std::unique_ptr<TaggedLineSegment>
 TaggedLineStringSimplifier::flatten(std::size_t start, std::size_t end)
 {
     // make a new segment for the simplified geometry
     const Coordinate& p0 = linePts->getAt(start);
     const Coordinate& p1 = linePts->getAt(end);
-    unique_ptr<TaggedLineSegment> newSeg(new TaggedLineSegment(p0, p1));
+    std::unique_ptr<TaggedLineSegment> newSeg(new TaggedLineSegment(p0, p1));
     // update the indexes
     remove(line, start, end);
     outputIndex->add(newSeg.get());
@@ -211,7 +211,7 @@ bool
 TaggedLineStringSimplifier::hasBadOutputIntersection(
     const LineSegment& candidateSeg)
 {
-    unique_ptr< vector<LineSegment*> > querySegs =
+    std::unique_ptr< std::vector<LineSegment*> > querySegs =
         outputIndex->query(&candidateSeg);
 
     for(const LineSegment* querySeg : *querySegs) {
@@ -240,7 +240,7 @@ TaggedLineStringSimplifier::hasBadInputIntersection(
     const pair<std::size_t, std::size_t>& sectionIndex,
     const LineSegment& candidateSeg)
 {
-    unique_ptr< vector<LineSegment*> > querySegs =
+    std::unique_ptr< std::vector<LineSegment*> > querySegs =
         inputIndex->query(&candidateSeg);
 
     for(const LineSegment* ls : *querySegs) {
diff --git a/src/simplify/TaggedLinesSimplifier.cpp b/src/simplify/TaggedLinesSimplifier.cpp
index 21a49f2..e37eef2 100644
--- a/src/simplify/TaggedLinesSimplifier.cpp
+++ b/src/simplify/TaggedLinesSimplifier.cpp
@@ -34,7 +34,7 @@
 #endif
 
 using namespace geos::geom;
-using namespace std;
+
 
 namespace geos {
 namespace simplify { // geos::simplify
diff --git a/src/triangulate/DelaunayTriangulationBuilder.cpp b/src/triangulate/DelaunayTriangulationBuilder.cpp
index 8f417d2..19b84cd 100644
--- a/src/triangulate/DelaunayTriangulationBuilder.cpp
+++ b/src/triangulate/DelaunayTriangulationBuilder.cpp
@@ -69,7 +69,7 @@ DelaunayTriangulationBuilder::toVertices(
 {
     IncrementalDelaunayTriangulator::VertexList vertexList(coords.size());
 
-    for(size_t i = 0; i < coords.size(); i++) {
+    for(std::size_t i = 0; i < coords.size(); i++) {
         vertexList[i] = quadedge::Vertex(coords.getAt(i));
     }
     return vertexList;
diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index b3b0911..613e891 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -43,7 +43,7 @@
 
 
 using namespace geos::geom;
-using namespace std;
+
 
 namespace geos {
 namespace triangulate { //geos.triangulate
@@ -140,7 +140,7 @@ QuadEdgeSubdivision::locateFromEdge(const Vertex& v,
 {
     ::geos::ignore_unused_variable_warning(startEdge);
 
-    size_t iter = 0;
+    std::size_t iter = 0;
     auto maxIter = quadEdges.size();
 
     QuadEdge* e = startingEdges[0];
@@ -369,7 +369,7 @@ public:
     visit(QuadEdge* triEdges[3]) override
     {
         auto coordSeq = coordSeqFact.create(4, 0);
-        for(size_t i = 0; i < 3; i++) {
+        for(std::size_t i = 0; i < 3; i++) {
             Vertex v = triEdges[i]->orig();
             coordSeq->setAt(v.getCoordinate(), i);
         }
diff --git a/src/util/Assert.cpp b/src/util/Assert.cpp
index 4fbf2d6..923a7e2 100644
--- a/src/util/Assert.cpp
+++ b/src/util/Assert.cpp
@@ -25,7 +25,7 @@ namespace geos {
 namespace util { // geos.util
 
 void
-Assert::isTrue(bool assertion, const string& message)
+Assert::isTrue(bool assertion, const std::string& message)
 {
     if(!assertion) {
         if(message.empty()) {
@@ -39,7 +39,7 @@ Assert::isTrue(bool assertion, const string& message)
 
 void
 Assert::equals(const Coordinate& expectedValue,
-               const Coordinate& actualValue, const string& message)
+               const Coordinate& actualValue, const std::string& message)
 {
     if(!(actualValue == expectedValue)) {
         throw  AssertionFailedException("Expected " + expectedValue.toString() + " but encountered "
@@ -49,7 +49,7 @@ Assert::equals(const Coordinate& expectedValue,
 
 
 void
-Assert::shouldNeverReachHere(const string& message)
+Assert::shouldNeverReachHere(const std::string& message)
 {
     throw  AssertionFailedException("Should never reach here"
                                     + (!message.empty() ? ": " + message : ""));
diff --git a/src/util/Profiler.cpp b/src/util/Profiler.cpp
index 4b65799..524fd4c 100644
--- a/src/util/Profiler.cpp
+++ b/src/util/Profiler.cpp
@@ -19,12 +19,12 @@
 #include <sstream>
 #include <utility>
 
-using namespace std;
+
 
 namespace geos {
 namespace util { // geos.util
 
-Profile::Profile(string newname) :
+Profile::Profile(std::string newname) :
     name(newname),
     totaltime(timeunit::zero())
 {}
@@ -75,25 +75,25 @@ Profile::getNumTimings() const
 }
 
 void
-Profiler::start(string name)
+Profiler::start(std::string name)
 {
     auto prof = get(name);
     prof->start();
 }
 
 void
-Profiler::stop(string name)
+Profiler::stop(std::string name)
 {
     auto iter = profs.find(name);
     if(iter == profs.end()) {
-        cerr << name << ": no such Profile started";
+        std::cerr << name << ": no such Profile started";
         return;
     }
     iter->second->stop();
 }
 
 Profile*
-Profiler::get(string name)
+Profiler::get(std::string name)
 {
     auto& prof = profs[name];
     if (prof == nullptr) {
@@ -111,8 +111,8 @@ Profiler::instance()
 }
 
 
-ostream&
-operator<< (ostream& os, const Profile& prof)
+std::ostream&
+operator<< (std::ostream& os, const Profile& prof)
 {
     os << " num:" << prof.getNumTimings() << " min:" <<
        prof.getMin() << " max:" << prof.getMax() <<
@@ -121,11 +121,11 @@ operator<< (ostream& os, const Profile& prof)
     return os;
 }
 
-ostream&
-operator<< (ostream& os, const Profiler& prof)
+std::ostream&
+operator<< (std::ostream& os, const Profiler& prof)
 {
     for(const auto& entry : prof.profs) {
-        os << *(entry.second) << endl;
+        os << *(entry.second) << std::endl;
     }
     return os;
 }
diff --git a/tests/unit/algorithm/RobustLineIntersectionTest.cpp b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
index d637139..6172352 100644
--- a/tests/unit/algorithm/RobustLineIntersectionTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
@@ -57,7 +57,7 @@ struct test_robustlineintersection_data {
      */
     void
     checkIntersection(const std::vector<Coordinate>& pt,
-                      size_t expectedIntersectionNum,
+                      std::size_t expectedIntersectionNum,
                       const std::vector<Coordinate>& intPt,
                       double distanceTolerance)
     {
@@ -139,7 +139,7 @@ struct test_robustlineintersection_data {
         std::unique_ptr<CoordinateSequence> cs(g->getCoordinates());
 
         std::vector<Coordinate> intPt;
-        for(size_t i = 0; i < cs->size(); ++i) {
+        for(std::size_t i = 0; i < cs->size(); ++i) {
             intPt.push_back(cs->getAt(i));
         }
 
diff --git a/tests/unit/capi/GEOSDistanceTest.cpp b/tests/unit/capi/GEOSDistanceTest.cpp
index a71b6f0..9b93c7b 100644
--- a/tests/unit/capi/GEOSDistanceTest.cpp
+++ b/tests/unit/capi/GEOSDistanceTest.cpp
@@ -85,13 +85,13 @@ void object::test<1>
 }
 
 GEOSGeometry*
-random_polygon(double x, double y, double r, size_t num_points)
+random_polygon(double x, double y, double r, std::size_t num_points)
 {
     std::vector<double> angle(num_points);
     std::vector<double> radius(num_points);
 
 
-    for(size_t i = 0; i < num_points; i++) {
+    for(std::size_t i = 0; i < num_points; i++) {
         angle[i] = 2 * geos::MATH_PI * std::rand() / RAND_MAX;
         radius[i] = r * std::rand() / RAND_MAX;
     }
diff --git a/tests/unit/capi/GEOSSTRtreeTest.cpp b/tests/unit/capi/GEOSSTRtreeTest.cpp
index c46d39a..8a3253e 100644
--- a/tests/unit/capi/GEOSSTRtreeTest.cpp
+++ b/tests/unit/capi/GEOSSTRtreeTest.cpp
@@ -106,12 +106,12 @@ template<>
 void object::test<2>
 ()
 {
-    size_t ngeoms = 100;
+    std::size_t ngeoms = 100;
     std::vector<GEOSGeometry*> geoms;
     std::vector<GEOSGeometry*> queryPoints;
     GEOSSTRtree* tree = GEOSSTRtree_create(8);
 
-    for(size_t i = 0; i < ngeoms; i++) {
+    for(std::size_t i = 0; i < ngeoms; i++) {
         GEOSCoordSequence* seq = GEOSCoordSeq_create(1, 2);
         GEOSCoordSeq_setX(seq, 0, std::rand());
         GEOSCoordSeq_setY(seq, 0, std::rand());
@@ -119,18 +119,18 @@ void object::test<2>
         GEOSSTRtree_insert(tree, geoms[i], geoms[i]);
     }
 
-    for(size_t i = 0; i < ngeoms; i++) {
+    for(std::size_t i = 0; i < ngeoms; i++) {
         GEOSCoordSequence* seq = GEOSCoordSeq_create(1, 2);
         GEOSCoordSeq_setX(seq, 0, std::rand());
         GEOSCoordSeq_setY(seq, 0, std::rand());
         queryPoints.push_back(GEOSGeom_createPoint(seq));
     }
 
-    for(size_t i = 0; i < ngeoms; i++) {
+    for(std::size_t i = 0; i < ngeoms; i++) {
         const GEOSGeometry* nearest = GEOSSTRtree_nearest(tree, queryPoints[i]);
         const GEOSGeometry* nearestBruteForce = nullptr;
         double nearestBruteForceDistance = std::numeric_limits<double>::max();
-        for(size_t j = 0; j < ngeoms; j++) {
+        for(std::size_t j = 0; j < ngeoms; j++) {
             double distance;
             GEOSDistance(queryPoints[i], geoms[j], &distance);
 
@@ -143,7 +143,7 @@ void object::test<2>
         ensure(nearest == nearestBruteForce || GEOSEquals(nearest, nearestBruteForce));
     }
 
-    for(size_t i = 0; i < ngeoms; i++) {
+    for(std::size_t i = 0; i < ngeoms; i++) {
         GEOSGeom_destroy(geoms[i]);
         GEOSGeom_destroy(queryPoints[i]);
     }
diff --git a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
index a69413c..4e55af2 100644
--- a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
+++ b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
@@ -75,7 +75,7 @@ void object::test<2>
 
         ensure(nullptr != col);
 
-        const size_t size0 = 0;
+        const std::size_t size0 = 0;
         auto sequence = factory->create(col);
 
         ensure(nullptr != sequence);
@@ -106,7 +106,7 @@ void object::test<3>
         col->push_back(Coordinate(1, 2, 3));
         col->push_back(Coordinate(5, 10, 15));
 
-        const size_t size2 = 2;
+        const std::size_t size2 = 2;
         auto sequence = factory->create(col);
 
         ensure(nullptr != sequence);
@@ -132,7 +132,7 @@ void object::test<4>
 
         ensure(nullptr != factory);
 
-        const size_t size1000 = 1000;
+        const std::size_t size1000 = 1000;
         auto sequence = factory->create(size1000, 3);
 
         ensure(nullptr != sequence);
@@ -160,7 +160,7 @@ void object::test<5>
 
         ensure(nullptr != factory);
 
-        const size_t size0 = 0;
+        const std::size_t size0 = 0;
         auto sequence = factory->create();
 
         ensure(nullptr != sequence);
diff --git a/tests/unit/geom/CoordinateArraySequenceTest.cpp b/tests/unit/geom/CoordinateArraySequenceTest.cpp
index 9d6f4eb..8174ba6 100644
--- a/tests/unit/geom/CoordinateArraySequenceTest.cpp
+++ b/tests/unit/geom/CoordinateArraySequenceTest.cpp
@@ -55,7 +55,7 @@ template<>
 void object::test<1>
 ()
 {
-    const size_t size = 0;
+    const std::size_t size = 0;
     geos::geom::CoordinateArraySequence sequence;
 
     ensure(sequence.isEmpty());
@@ -64,7 +64,7 @@ void object::test<1>
 
     ensure_equals(sequence.toString(), std::string("()"));
 
-    const size_t dim = 3;
+    const std::size_t dim = 3;
     ensure_equals(sequence.getDimension(), dim);
 }
 
@@ -74,7 +74,7 @@ template<>
 void object::test<2>
 ()
 {
-    const size_t size = 3;
+    const std::size_t size = 3;
     geos::geom::CoordinateArraySequence sequence(size);
 
     ensure(!sequence.isEmpty());
@@ -85,7 +85,7 @@ void object::test<2>
 
     ensure("Every coodinate in the default sequence should be same.", sequence.hasRepeatedPoints());
 
-    const size_t dim = 2; // default/empty coordinates now 2D.
+    const std::size_t dim = 2; // default/empty coordinates now 2D.
     ensure_equals(sequence.getDimension(), dim);
 }
 
@@ -97,7 +97,7 @@ void object::test<3>
 {
     using geos::geom::Coordinate;
 
-    const size_t size = 3;
+    const std::size_t size = 3;
     const double a = 0;
     const double b = 5.0;
     const double c = 10.0;
@@ -128,7 +128,7 @@ void object::test<4>
     using geos::geom::Coordinate;
 
     // Create empty sequence
-    const size_t sizeEmpty = 0;
+    const std::size_t sizeEmpty = 0;
     geos::geom::CoordinateArraySequence empty_original;
 
     ensure(empty_original.isEmpty());
@@ -143,7 +143,7 @@ void object::test<4>
     ensure_equals(empty_copy.toString(), std::string("()"));
 
     // Create non-empty sequence
-    const size_t sizeNonEmpty = 2;
+    const std::size_t sizeNonEmpty = 2;
     std::vector<Coordinate>* col = new std::vector<Coordinate>();
     col->push_back(Coordinate(1, 2, 3));
     col->push_back(Coordinate(5, 10, 15));
@@ -177,7 +177,7 @@ void object::test<5>
     col->push_back(Coordinate(1, 2));
     col->push_back(Coordinate(5, 10));
 
-    const size_t size = 2;
+    const std::size_t size = 2;
     geos::geom::CoordinateArraySequence sequence(col);
 
     ensure(!sequence.isEmpty());
@@ -202,7 +202,7 @@ void object::test<6>
     col->push_back(Coordinate(1, 2, 3));
     col->push_back(Coordinate(5, 10, 15));
 
-    const size_t size = 2;
+    const std::size_t size = 2;
     geos::geom::CoordinateArraySequence sequence(col);
 
     ensure(!sequence.isEmpty());
@@ -240,7 +240,7 @@ void object::test<7>
     using geos::geom::Coordinate;
 
     // Create empty sequence to fill with coordinates
-    const size_t size = 0;
+    const std::size_t size = 0;
     geos::geom::CoordinateArraySequence sequence;
 
     ensure(sequence.isEmpty());
@@ -249,7 +249,7 @@ void object::test<7>
     // Add coordinates
     Coordinate tmp(1, 2, 3);
     sequence.add(tmp); // insert copy of tmp
-    const size_t sizeOne = 1;
+    const std::size_t sizeOne = 1;
 
     ensure(!sequence.isEmpty());
     ensure_equals(sequence.size(), sizeOne);
@@ -258,7 +258,7 @@ void object::test<7>
     tmp.y = 10;
     tmp.z = 15;
     sequence.add(tmp); // insert copy of tmp
-    const size_t sizeTwo = 2;
+    const std::size_t sizeTwo = 2;
 
     ensure(!sequence.isEmpty());
     ensure_equals(sequence.size(), sizeTwo);
@@ -285,7 +285,7 @@ void object::test<8>
     using geos::geom::Coordinate;
 
     // Create sequence with 2 default coordinates
-    const size_t size = 2;
+    const std::size_t size = 2;
     geos::geom::CoordinateArraySequence sequence(size);
 
     ensure(!sequence.isEmpty());
@@ -324,7 +324,7 @@ void object::test<10>
     using geos::geom::Coordinate;
 
     // Create empty sequence
-    const size_t size = 0;
+    const std::size_t size = 0;
     geos::geom::CoordinateArraySequence sequence;
 
     ensure(sequence.isEmpty());
diff --git a/tests/unit/geom/EnvelopeTest.cpp b/tests/unit/geom/EnvelopeTest.cpp
index 195fb89..1c7b46a 100644
--- a/tests/unit/geom/EnvelopeTest.cpp
+++ b/tests/unit/geom/EnvelopeTest.cpp
@@ -262,7 +262,7 @@ void object::test<10>
     std::vector<Coordinate> c(25);
 
     // std::cout<<std::endl;
-    for (size_t i = 0; i < c.size(); i++) {
+    for (std::size_t i = 0; i < c.size(); i++) {
         c[i].x = static_cast<double>(i % 5);
         c[i].y = static_cast<double>(5 - (i / 5));
         // std::cout<< c[i] << std::endl;
diff --git a/tests/unit/geom/GeometryComponentFilterTest.cpp b/tests/unit/geom/GeometryComponentFilterTest.cpp
index 16eeda9..a42551b 100644
--- a/tests/unit/geom/GeometryComponentFilterTest.cpp
+++ b/tests/unit/geom/GeometryComponentFilterTest.cpp
@@ -40,7 +40,7 @@ group test_geometrycomponentfilter_group("geos::geom::GeometryComponentFilter");
 class NumPointsInFirstNComponents : public geos::geom::GeometryComponentFilter {
 public:
 
-    NumPointsInFirstNComponents(size_t n) : components_remaining(n), num_points(0) {}
+    NumPointsInFirstNComponents(std::size_t n) : components_remaining(n), num_points(0) {}
 
     void
     filter_ro(const geos::geom::Geometry* g) override {
@@ -53,7 +53,7 @@ public:
         filter_ro(g);
     }
 
-    size_t numPoints() {
+    std::size_t numPoints() {
         return num_points;
     }
 
@@ -61,8 +61,8 @@ public:
         return components_remaining == 0;
     }
 private:
-    size_t components_remaining;
-    size_t num_points;
+    std::size_t components_remaining;
+    std::size_t num_points;
 };
 
 // Split components into two categories: Lineal and all other types
diff --git a/tests/unit/geom/LineStringTest.cpp b/tests/unit/geom/LineStringTest.cpp
index d7f0bb8..1d4d214 100644
--- a/tests/unit/geom/LineStringTest.cpp
+++ b/tests/unit/geom/LineStringTest.cpp
@@ -90,7 +90,7 @@ void object::test<2>
     using geos::geom::Coordinate;
 
     // Non-empty sequence of coordinates
-    const size_t size3 = 3;
+    const std::size_t size3 = 3;
 
     CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
     ensure("sequence is null pointer.", pseq != nullptr);
@@ -170,7 +170,7 @@ void object::test<4>
     using geos::geom::Coordinate;
 
     // Non-empty sequence of coordinates
-    const size_t size = 3;
+    const std::size_t size = 3;
 
     CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
     ensure("sequence is null pointer.", pseq != nullptr);
@@ -430,7 +430,7 @@ template<>
 void object::test<22>
 ()
 {
-    const size_t size = 4;
+    const std::size_t size = 4;
     auto geo = reader_.read("LINESTRING (0 0, 5 5, 10 5, 10 10)");
     ensure(geo != nullptr);
 
diff --git a/tests/unit/geom/LinearRingTest.cpp b/tests/unit/geom/LinearRingTest.cpp
index 0d8b61c..031fc97 100644
--- a/tests/unit/geom/LinearRingTest.cpp
+++ b/tests/unit/geom/LinearRingTest.cpp
@@ -43,7 +43,7 @@ struct test_linearring_data {
 
     geos::geom::LinearRing empty_ring_;
     LinearRingPtr ring_;
-    const size_t ring_size_;
+    const std::size_t ring_size_;
 
     test_linearring_data()
         : pm_(1000), factory_(geos::geom::GeometryFactory::create(&pm_, 0))
@@ -86,7 +86,7 @@ void object::test<1>
     using geos::geom::Coordinate;
 
     // Non-empty sequence of coordiantes
-    const size_t size7 = 7;
+    const std::size_t size7 = 7;
     CoordArrayPtr coords = new geos::geom::CoordinateArraySequence();
     ensure("sequence is null pointer.", coords != nullptr);
 
diff --git a/tests/unit/geom/MultiPointTest.cpp b/tests/unit/geom/MultiPointTest.cpp
index b5b0002..3915b14 100644
--- a/tests/unit/geom/MultiPointTest.cpp
+++ b/tests/unit/geom/MultiPointTest.cpp
@@ -31,7 +31,7 @@ struct test_multipoint_data {
 
     MultiPointAutoPtr empty_mp_;
     MultiPointPtr mp_;
-    const size_t mp_size_;
+    const std::size_t mp_size_;
 
     test_multipoint_data()
         :
@@ -70,7 +70,7 @@ template<>
 void object::test<1>
 ()
 {
-    const size_t size0 = 0;
+    const std::size_t size0 = 0;
     MultiPointAutoPtr mp(factory_->createMultiPoint());
 
     ensure(mp->isEmpty());
@@ -87,7 +87,7 @@ template<>
 void object::test<2>
 ()
 {
-    const size_t size0 = 0;
+    const std::size_t size0 = 0;
     MultiPointAutoPtr copy(dynamic_cast<geos::geom::MultiPoint*>(empty_mp_->clone().release()));
     ensure(nullptr != copy.get());
 
@@ -105,7 +105,7 @@ template<>
 void object::test<3>
 ()
 {
-    const size_t size0 = 0;
+    const std::size_t size0 = 0;
     auto geo = reader_.read("MULTIPOINT EMPTY");
     MultiPointPtr mp = dynamic_cast<MultiPointPtr>(geo.get());
 
diff --git a/tests/unit/geom/PointTest.cpp b/tests/unit/geom/PointTest.cpp
index d473cb5..b296eb1 100644
--- a/tests/unit/geom/PointTest.cpp
+++ b/tests/unit/geom/PointTest.cpp
@@ -242,7 +242,7 @@ template<>
 void object::test<15>
 ()
 {
-    ensure_equals(empty_point_->getNumPoints(), (size_t)0);
+    ensure_equals(empty_point_->getNumPoints(), (std::size_t)0);
 }
 
 // Test of getLength() for empty Point
@@ -366,7 +366,7 @@ template<>
 void object::test<28>
 ()
 {
-    ensure_equals(point_->getNumPoints(), (size_t)1);
+    ensure_equals(point_->getNumPoints(), (std::size_t)1);
 }
 
 // Test of getLength() for non-empty Point
diff --git a/tests/unit/geom/PolygonTest.cpp b/tests/unit/geom/PolygonTest.cpp
index 69dc591..9742415 100644
--- a/tests/unit/geom/PolygonTest.cpp
+++ b/tests/unit/geom/PolygonTest.cpp
@@ -40,7 +40,7 @@ struct test_polygon_data {
 
     PolygonAutoPtr empty_poly_;
     PolygonAutoPtr poly_;
-    const size_t poly_size_;
+    const std::size_t poly_size_;
 
     test_polygon_data()
         : pm_(1)
@@ -77,7 +77,7 @@ void object::test<1>
     using geos::geom::Coordinate;
 
     // Create non-empty Coordiantes sequence for Exterior LinearRing
-    const size_t size = 7;
+    const std::size_t size = 7;
     CoordArrayPtr coords = new geos::geom::CoordinateArraySequence();
     ensure("sequence is null pointer.", coords != nullptr);
 
@@ -430,7 +430,7 @@ template<>
 void object::test<30>
 ()
 {
-    const size_t holesNum = 1;
+    const std::size_t holesNum = 1;
 
     auto geo = reader_.read("POLYGON ((0 0, 100 0, 100 100, 0 100, 0 0), (1 1, 1 10, 10 10, 10 1, 1 1) )");
     ensure(geo != nullptr);
@@ -476,7 +476,7 @@ void object::test<32>
     ensure_equals(coords->getSize(), poly_size_);
 
     // Check first and last coordinates
-    const size_t lastPos = poly_size_ - 1;
+    const std::size_t lastPos = poly_size_ - 1;
     ensure_equals(coords->getAt(0), coords->getAt(lastPos));
 
     // Check coordinate	from the middle of ring
diff --git a/tests/unit/io/WKTReaderTest.cpp b/tests/unit/io/WKTReaderTest.cpp
index e725ede..ddc44c1 100644
--- a/tests/unit/io/WKTReaderTest.cpp
+++ b/tests/unit/io/WKTReaderTest.cpp
@@ -182,7 +182,7 @@ void object::test<8>
     wkt.push_back("MULTIPOLYGON(EMPTY(");
     wkt.push_back("GEOMETRYCOLLECTION(");
     wkt.push_back("GEOMETRYCOLLECTION(LINEARRING(");
-    for(size_t i = 0; i < wkt.size(); i++) {
+    for(std::size_t i = 0; i < wkt.size(); i++) {
         try {
             wktreader.read(wkt[i]);
             fail("Didn't get expected exception");
diff --git a/tests/unit/noding/NodedSegmentStringTest.cpp b/tests/unit/noding/NodedSegmentStringTest.cpp
index a86923b..12e4ada 100644
--- a/tests/unit/noding/NodedSegmentStringTest.cpp
+++ b/tests/unit/noding/NodedSegmentStringTest.cpp
@@ -73,7 +73,7 @@ struct test_nodedsegmentstring_data {
         NodedSegmentString nss(line->getCoordinates().release(), 0);
         std::unique_ptr<CoordinateSequence> node = pts->getCoordinates();
 
-        for (size_t i = 0, n=node->size(); i < n; ++i) {
+        for (std::size_t i = 0, n=node->size(); i < n; ++i) {
           nss.addIntersection(node->getAt(i), segmentIndex.at(i));
         }
 
diff --git a/tests/unit/noding/SegmentNodeTest.cpp b/tests/unit/noding/SegmentNodeTest.cpp
index dbde476..f95019b 100644
--- a/tests/unit/noding/SegmentNodeTest.cpp
+++ b/tests/unit/noding/SegmentNodeTest.cpp
@@ -53,7 +53,7 @@ void object::test<1>
     using geos::noding::SegmentNode;
 
     // Create coordinates sequence
-    const size_t coords_size = 2;
+    const std::size_t coords_size = 2;
     auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, coords_size);
 
     ensure(nullptr != cs.get());
@@ -73,7 +73,7 @@ void object::test<1>
 
     // Construct a node on the given NodedSegmentString
     {
-        const size_t segment_index = 0;
+        const std::size_t segment_index = 0;
         SegmentNode node(segment, Coordinate(3, 3), segment_index,
                          segment.getSegmentOctant(segment_index));
 
@@ -102,7 +102,7 @@ void object::test<2>
     using geos::noding::SegmentNode;
 
     // Create coordinates sequence
-    const size_t coords_size = 2;
+    const std::size_t coords_size = 2;
     auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
 
     ensure(nullptr != cs.get());
@@ -122,7 +122,7 @@ void object::test<2>
 
     // Construct an interior node on the given NodedSegmentString
     {
-        const size_t segment_index = 0;
+        const std::size_t segment_index = 0;
         SegmentNode node(segment, Coordinate(0, 0), segment_index,
                          segment.getSegmentOctant(segment_index));
 
@@ -145,7 +145,7 @@ void object::test<3>
     using geos::noding::SegmentNode;
 
     // Create coordinates sequence
-    const size_t coords_size = 2;
+    const std::size_t coords_size = 2;
     auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
 
     ensure(nullptr != cs.get());
@@ -165,7 +165,7 @@ void object::test<3>
 
     // Construct an interior node on the given NodedSegmentString
     {
-        const size_t segment_index = 0;
+        const std::size_t segment_index = 0;
         SegmentNode node(segment, Coordinate(2, 2), segment_index,
                          segment.getSegmentOctant(segment_index));
 
@@ -188,7 +188,7 @@ void object::test<4>
     using geos::noding::SegmentNode;
 
     // Create coordinates sequence
-    const size_t coords_size = 2;
+    const std::size_t coords_size = 2;
     auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
 
     ensure(nullptr != cs.get());
@@ -208,7 +208,7 @@ void object::test<4>
 
     // Construct a node that doesn't even intersect !!
     {
-        const size_t segment_index = 0;
+        const std::size_t segment_index = 0;
         SegmentNode node(segment, Coordinate(1, 2), segment_index,
                          segment.getSegmentOctant(segment_index));
 
diff --git a/tests/unit/operation/distance/IndexedFacetDistanceTest.cpp b/tests/unit/operation/distance/IndexedFacetDistanceTest.cpp
index b2e0a08..6e500f5 100644
--- a/tests/unit/operation/distance/IndexedFacetDistanceTest.cpp
+++ b/tests/unit/operation/distance/IndexedFacetDistanceTest.cpp
@@ -89,11 +89,11 @@ struct test_facetdistanceop_data {
 
 
     std::unique_ptr<geos::geom::LineString>
-    makeSinCircle(size_t nvertices, double radius, double amplitude)
+    makeSinCircle(std::size_t nvertices, double radius, double amplitude)
     {
         geos::geom::CoordinateArraySequence cs;
         std::vector<geos::geom::Coordinate> coords;
-        for (size_t i = 0; i < nvertices; i++) {
+        for (std::size_t i = 0; i < nvertices; i++) {
             geos::geom::Coordinate c;
             double angle = (double)i*360.0/(double)nvertices;
             angle2sincircle(angle, radius, amplitude, &c.x, &c.y);
@@ -318,7 +318,7 @@ void object::test<10>
     for (auto it = m.begin() ; it != m.end(); ++it)
     {
         prof.start(profiles[*it]);
-        for (size_t j = 0; j < pts.size(); j++) {
+        for (std::size_t j = 0; j < pts.size(); j++) {
             double dist_ifd = 0.0, dist_geom = 0.0;
             if (*it == TestIndexedFacetDistance || *it == TestBoth)
                 dist_ifd = ifd.distance(pts[j].get());
diff --git a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
index ce93c63..7cccff2 100644
--- a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
+++ b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
@@ -43,7 +43,7 @@ struct test_unaryuniontest_data {
     void
     delAll(std::vector<Geom*>& geoms)
     {
-        for(size_t i = 0; i < geoms.size(); ++i) {
+        for(std::size_t i = 0; i < geoms.size(); ++i) {
             delete geoms[i];
         }
     }
diff --git a/tests/unit/operation/overlay/validate/OffsetPointGeneratorTest.cpp b/tests/unit/operation/overlay/validate/OffsetPointGeneratorTest.cpp
index 79c1e30..45cbdc4 100644
--- a/tests/unit/operation/overlay/validate/OffsetPointGeneratorTest.cpp
+++ b/tests/unit/operation/overlay/validate/OffsetPointGeneratorTest.cpp
@@ -50,7 +50,7 @@ struct test_offsetpointgenerator_data {
         //
         dist *= 1.0000001;
 
-        for(size_t i = 0, n = coords.size(); i < n; ++i) {
+        for(std::size_t i = 0, n = coords.size(); i < n; ++i) {
             const Coordinate& c = coords[i];
             unique_ptr<Geometry> pg(gf.createPoint(c));
             double rdist =  g->distance(pg.get());
diff --git a/tests/unit/triangulate/VoronoiTest.cpp b/tests/unit/triangulate/VoronoiTest.cpp
index d036697..cdb0474 100644
--- a/tests/unit/triangulate/VoronoiTest.cpp
+++ b/tests/unit/triangulate/VoronoiTest.cpp
@@ -19,7 +19,6 @@
 #include <geos/geom/CoordinateArraySequence.h>
 //#include <stdio.h>
 #include <iostream>
-using namespace std;
 using namespace geos::triangulate;
 using namespace geos::triangulate::quadedge;
 using namespace geos::geom;
@@ -80,9 +79,9 @@ runVoronoi(const char* sitesWkt, const char* expectedWkt, const double tolerance
     bool eq = results->equalsExact(expected.get(), 1e-7);
     if(! eq) {
         writer.setTrim(true);
-        cout << endl;
-        cout << " Expected: " << writer.write(expected.get()) << endl;
-        cout << " Obtained: " << writer.write(results.get()) << endl;
+        std::cout << std::endl;
+        std::cout << " Expected: " << writer.write(expected.get()) << std::endl;
+        std::cout << " Obtained: " << writer.write(results.get()) << std::endl;
     }
     ensure(eq);
 
diff --git a/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp b/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp
index d744203..7c105c2 100644
--- a/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp
+++ b/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp
@@ -151,7 +151,7 @@ template<> template<> void object::test<3>
         std::unique_ptr<CoordinateSequence> cs(
             p->getExteriorRing()->getCoordinates()
         );
-        size_t from = cs->size();
+        std::size_t from = cs->size();
         cs = geos::operation::valid::RepeatedPointRemover::removeRepeatedPoints(cs.get());
         ensure_equals(from, cs->size());
     }
diff --git a/tests/xmltester/Stackwalker.cpp b/tests/xmltester/Stackwalker.cpp
index e376e11..928c8e5 100644
--- a/tests/xmltester/Stackwalker.cpp
+++ b/tests/xmltester/Stackwalker.cpp
@@ -65,7 +65,7 @@ static eAllocCheckOutput g_CallstackOutputType = ACOutput_Simple;
 // #############################################################################################
 #ifdef WITH_IMALLOC_SPY
 //forwards:
-void IMallocHashInsert(void *pData, CONTEXT &Context, size_t nDataSize);
+void IMallocHashInsert(void *pData, CONTEXT &Context, std::size_t nDataSize);
 BOOL IMallocHashRemove(void *pData);
 
 // IMallocSpy-Interface
@@ -262,7 +262,7 @@ static void WriteDateTime(FILE *fFile, BOOL asXMLAttrs = FALSE) {
 
 typedef struct AllocHashEntryType {
   long                       lRequestID;    // RequestID from CRT (if 0, then this entry is empty)
-  size_t                     nDataSize;     // Size of the allocated memory
+  std::size_t                     nDataSize;     // Size of the allocated memory
   char                       cRemovedFlag;  // 0 => memory was not yet released
   struct AllocHashEntryType  *Next;
   // Callstack for EIP
@@ -287,17 +287,17 @@ static ULONG AllocHashCurrentCollisions = 0;
 
 // ##########################################################################################
 #ifdef WITH_IMALLOC_SPY
-// eigene Tabelle für die IMallocs:
+// eigene Tabelle für die IMallocs:
 typedef struct IMallocHashEntryType {
   void                       *pData;    // Key-Word
-  size_t                     nDataSize;     // größe des Datenblocks (optional)
+  std::size_t                     nDataSize;     // größe des Datenblocks (optional)
   char                       cRemovedFlag;  // 0 => nicht wurde noch nicht freigegeben
   struct IMallocHashEntryType  *Next;
-  // Callstack für EIP
+  // Callstack für EIP
   DWORD                      dwEIPOffset;
   DWORD                      dwEIPLen;
   char                       pcEIPAddr[MAX_EIP_LEN_BUF];
-  // Callstack für ESP
+  // Callstack für ESP
   DWORD                      dwESPOffset;
   DWORD                      dwESPLen;
   char                       pcESPAddr[MAX_ESP_LEN_BUF];
@@ -324,7 +324,7 @@ static ULONG IMallocHashFunction(void *pData) {
   ULONG ulTemp;
   DWORD dwPointer = (DWORD) pData;
 
-  // relativ simpler Mechanismus für die Hash-Funktion,
+  // relativ simpler Mechanismus für die Hash-Funktion,
   // mir ist nur nix besseres eingefallen...
   ulTemp = dwPointer % ALLOC_HASH_ENTRIES;
 
@@ -337,7 +337,7 @@ static ULONG IMallocHashFunction(void *pData) {
 //   pData: Key-Word (Pointer to address)
 //   pContext:   Context-Record, for retrieving Callstack (EIP and EBP is only needed)
 //   nDataSize:  How many bytes
-void IMallocHashInsert(void *pData, CONTEXT &Context, size_t nDataSize) {
+void IMallocHashInsert(void *pData, CONTEXT &Context, std::size_t nDataSize) {
   ULONG HashIdx;
   IMallocHashEntryType *pHashEntry;
 
@@ -350,7 +350,7 @@ void IMallocHashInsert(void *pData, CONTEXT &Context, size_t nDataSize) {
   // ermittle den Hash-Wert
   HashIdx = IMallocHashFunction(pData);
 
-  // Eintrag darf nicht größer als die Hash-Tabelle sein
+  // Eintrag darf nicht größer als die Hash-Tabelle sein
   _ASSERTE(HashIdx < ALLOC_HASH_ENTRIES);
 
   pHashEntry = &IMallocHashTable[HashIdx];
@@ -364,9 +364,9 @@ void IMallocHashInsert(void *pData, CONTEXT &Context, size_t nDataSize) {
     if (IMallocHashCurrentCollisions > IMallocHashMaxCollisions)
       IMallocHashMaxCollisions = IMallocHashCurrentCollisions;
 
-    // Eintrag ist schon belegt, verkette die Einträge
-    // wenn dies oft vorkommt, sollte man entweder die Tabelle vergrößern oder eine
-    // andere Hash-Funktion wählen
+    // Eintrag ist schon belegt, verkette die Einträge
+    // wenn dies oft vorkommt, sollte man entweder die Tabelle vergrößern oder eine
+    // andere Hash-Funktion wählen
     while(pHashEntry->Next != NULL) {
       pHashEntry = pHashEntry->Next;
     }
@@ -426,13 +426,13 @@ void IMallocHashInsert(void *pData, CONTEXT &Context, size_t nDataSize) {
 }
 
 // IMallocHashFind
-//   Wird ALLOC_ENTRY_NOT_FOUND zurückgegeben, so wurde der Key nicht
-//   gefunden, ansonsten wird ein Zeiger auf den Hash-Eintrag zurückgegeben
+//   Wird ALLOC_ENTRY_NOT_FOUND zurückgegeben, so wurde der Key nicht
+//   gefunden, ansonsten wird ein Zeiger auf den Hash-Eintrag zurückgegeben
 //   ACHTUNG: In einem preemptiven Tasking-System kann hier nicht
-//            garantiert werden, ob der Zeiger noch gültig ist, wenn er
-//            zurückgegeben wird, da er von einem anderen Thread schon
-//            freigegeben sein könnte.
-//            Die synchronisation muß eine Ebene höher erfolgen
+//            garantiert werden, ob der Zeiger noch gültig ist, wenn er
+//            zurückgegeben wird, da er von einem anderen Thread schon
+//            freigegeben sein könnte.
+//            Die synchronisation muß eine Ebene höher erfolgen
 static IMallocHashEntryType *IMallocHashFind(void *pData) {
   ULONG HashIdx;
   IMallocHashEntryType *pHashEntry;
@@ -440,7 +440,7 @@ static IMallocHashEntryType *IMallocHashFind(void *pData) {
   // ermittle den Hash-Wert
   HashIdx = IMallocHashFunction(pData);
 
-  // Eintrag darf nicht größer als die Hash-Tabelle sein
+  // Eintrag darf nicht größer als die Hash-Tabelle sein
   _ASSERTE(HashIdx < ALLOC_HASH_ENTRIES);
 
   pHashEntry = &IMallocHashTable[HashIdx];
@@ -465,7 +465,7 @@ BOOL IMallocHashRemove(void *pData) {
   // ermittle den Hash-Wert
   HashIdx = IMallocHashFunction(pData);
 
-  // Eintrag darf nicht größer als die Hash-Tabelle sein
+  // Eintrag darf nicht größer als die Hash-Tabelle sein
   _ASSERTE(HashIdx < ALLOC_HASH_ENTRIES);
 
   pHashEntryLast = NULL;
@@ -479,25 +479,25 @@ BOOL IMallocHashRemove(void *pData) {
       if (pHashEntryLast == NULL) {
         // Es ist ein Eintrag direkt in der Tabelle
         if (pHashEntry->Next == NULL) {
-          // Es ist der letze Eintrag lösche also die Tabelle
+          // Es ist der letze Eintrag lösche also die Tabelle
           memset(&IMallocHashTable[HashIdx], 0, sizeof(IMallocHashTable[HashIdx]));
         }
         else {
-          // Es sind noch Einträge verkettet, überschreibe einfach den nicht mehr gebrauchten...
+          // Es sind noch Einträge verkettet, überschreibe einfach den nicht mehr gebrauchten...
           *pHashEntry = *(pHashEntry->Next);
         }
         return TRUE;
       }
       else {
         // ich bin in einem dynamischen Bereich
-        // dies war eine kollisions, zähle also wieder zurück:
+        // dies war eine kollisions, zähle also wieder zurück:
         IMallocHashCurrentCollisions--;
         pHashEntryLast->Next = pHashEntry->Next;
         _free_dbg(pHashEntry, _CRT_BLOCK);
         return TRUE;
       }
 #else
-      // erhöhe nur den Removed counter und behalte das Object im Speicher
+      // erhöhe nur den Removed counter und behalte das Object im Speicher
       pHashEntry->cRemovedFlag++;
       return TRUE;  // erfolgreich
 #endif
@@ -512,7 +512,7 @@ BOOL IMallocHashRemove(void *pData) {
 
 
 
-//   Callback-Funtion for StackWalk für meine CallStack-Ausgabe aus der Hash-Tabelle
+//   Callback-Funtion for StackWalk für meine CallStack-Ausgabe aus der Hash-Tabelle
 #if API_VERSION_NUMBER >= 9
 static BOOL __stdcall ReadProcMemoryFromIMallocHash(HANDLE pData, DWORD lpBaseAddress, PVOID lpBuffer, DWORD nSize, PDWORD lpNumberOfBytesRead) {
 #else
@@ -581,11 +581,11 @@ ULONG IMallocHashOutLeaks(FILE *fFile) {
           c.Eip = pHashEntry->dwEIPOffset;
           c.Ebp = pHashEntry->dwESPOffset;
           ShowStackRM( NULL, c, fFile, &ReadProcMemoryFromIMallocHash, (HANDLE) pHashEntry->pData);
-          // Zähle zusammen wieviel Byte noch nicht freigegeben wurden
+          // Zähle zusammen wieviel Byte noch nicht freigegeben wurden
           if (pHashEntry->nDataSize > 0)
             ulLeaksByte += pHashEntry->nDataSize;
           else
-            ulLeaksByte++;  // Wenn zwar Speicher allokiert wurde, dieser aber 0 Bytes lang war, so reserviere für diesen zumindest 1 Byte
+            ulLeaksByte++;  // Wenn zwar Speicher allokiert wurde, dieser aber 0 Bytes lang war, so reserviere für diesen zumindest 1 Byte
 
           if (g_CallstackOutputType == ACOutput_XML)
             _ftprintf(fFile, _T("</LEAK>\n"));  // terminate the xml-node
@@ -727,7 +727,7 @@ static ULONG AllocHashDeinit(void) {
       }
     }  // while
   }  // for
-  // Lösche die gesamte Hash-Tabelle
+  // Lösche die gesamte Hash-Tabelle
   memset(IMallocHashTable, 0, sizeof(IMallocHashTable));
 #endif
 
@@ -741,7 +741,7 @@ static ULONG AllocHashDeinit(void) {
 // AllocHashFunction
 // The has-function (very simple)
 static inline ULONG AllocHashFunction(long lRequestID) {
-  // I couldn´t find any better and faster
+  // I couldn´t find any better and faster
   return lRequestID % ALLOC_HASH_ENTRIES;
 }  // AllocHashFunction
 
@@ -749,7 +749,7 @@ static inline ULONG AllocHashFunction(long lRequestID) {
 //   lRequestID: Key-Word (RequestID from AllocHook)
 //   pContext:   Context-Record, for retrieving Callstack (EIP and EBP is only needed)
 //   nDataSize:  How many bytes
-static void AllocHashInsert(long lRequestID, CONTEXT &Context, size_t nDataSize) {
+static void AllocHashInsert(long lRequestID, CONTEXT &Context, std::size_t nDataSize) {
   ULONG HashIdx;
   AllocHashEntryType *pHashEntry;
 
@@ -1049,9 +1049,9 @@ typedef struct _CrtMemBlockHeader
          * maintained in the debug heap.
          */
         int                         nBlockUse;
-        size_t                      nDataSize;
+        std::size_t                      nDataSize;
 #else  /* _WIN64 */
-        size_t                      nDataSize;
+        std::size_t                      nDataSize;
         int                         nBlockUse;
 #endif  /* _WIN64 */
         long                        lRequest;
@@ -1091,11 +1091,11 @@ static void DeactivateMallocStackwalker(void) {
 // Special case for VC 5
 #if _MSC_VER <= 1100
 static int MyAllocHook(int nAllocType, void *pvData,
-      size_t nSize, int nBlockUse, long lRequest,
+      std::size_t nSize, int nBlockUse, long lRequest,
       const char * szFileName, int nLine ) {
 #else
 static int MyAllocHook(int nAllocType, void *pvData,
-      size_t nSize, int nBlockUse, long lRequest,
+      std::size_t nSize, int nBlockUse, long lRequest,
       const unsigned char * szFileName, int nLine ) {
 #endif
   static TCHAR *operation[] = { _T(""), _T("ALLOCATIONG"), _T("RE-ALLOCATING"), _T("FREEING") };
@@ -1482,7 +1482,7 @@ static bool GetModuleListPSAPI(ModuleList &modules, DWORD pid, HANDLE hProcess,
   pGMI = (tGMI) GetProcAddress( hPsapi, "GetModuleInformation" );
   if ( pEPM == 0 || pGMFNE == 0 || pGMBN == 0 || pGMI == 0 )
   {
-    // we couldn´t find all functions
+    // we couldn´t find all functions
     FreeLibrary( hPsapi );
     return false;
   }
@@ -1632,7 +1632,7 @@ int InitAllocCheckWN(eAllocCheckOutput eOutput, LPCTSTR pszFileName, ULONG ulSho
 #ifdef WITH_IMALLOC_SPY
   HRESULT hr;
   // erzeuge mein malloc-Spy object
-  LPMALLOCSPY pMallocSpy = new CMallocSpy(); // wird später durch Release freigegeben
+  LPMALLOCSPY pMallocSpy = new CMallocSpy(); // wird später durch Release freigegeben
   if (pMallocSpy != NULL)
   {
     // CoInitilize(); // ??? Ist dies notwendig ?
@@ -1814,7 +1814,7 @@ std::string SimpleXMLEncode(PCSTR szText)
 {
   std::string szRet;
 
-  for (size_t i=0; i<strlen(szText); i++)
+  for (std::size_t i=0; i<strlen(szText); i++)
   {
     switch(szText[i])
     {
@@ -1845,7 +1845,7 @@ std::string SimpleXMLEncode(PCSTR szText)
 // #################################################################################
 // Here the Stackwalk-Part begins.
 //   Some of the code is from an example from a book
-//   But I couldn´t find the reference anymore... sorry...
+//   But I couldn´t find the reference anymore... sorry...
 //   If someone knowns, please let me know...
 // #################################################################################
 // #################################################################################
@@ -2004,7 +2004,7 @@ static void ShowStackRM( HANDLE hThread, CONTEXT& c, FILE *fLogFile, PREAD_PROCE
 // Critical section begin...
   EnterCriticalSection(&g_csFileOpenClose);
 
-  InterlockedIncrement((long*) &g_dwShowCount);  // erhöhe counter
+  InterlockedIncrement((long*) &g_dwShowCount);  // erhöhe counter
 
 
   // NOTE: normally, the exe directory and the current directory should be taken

-----------------------------------------------------------------------

Summary of changes:
 benchmarks/ClassSizes.cpp                          |   3 +-
 benchmarks/algorithm/InteriorPointAreaPerfTest.cpp |  13 +-
 .../algorithm/UnaryUnionSegmentsPerfTest.cpp       |   4 +-
 benchmarks/algorithm/VoronoiPerfTest.cpp           |   4 +-
 benchmarks/capi/GEOSPreparedContainsPerfTest.cpp   |   4 +-
 .../operation/buffer/IteratedBufferStressTest.cpp  |  15 +-
 .../predicate/RectangleIntersectsPerfTest.cpp      |  16 +-
 capi/geos_c.cpp                                    |  18 +-
 capi/geos_ts_c.cpp                                 |  28 +-
 doc/example.cpp                                    | 385 ++++++++++-----------
 .../geos/algorithm/CentralEndpointIntersector.h    |   2 +-
 include/geos/algorithm/LineIntersector.h           |  16 +-
 include/geos/algorithm/MinimumDiameter.h           |   2 +-
 .../algorithm/distance/DiscreteFrechetDistance.h   |   4 +-
 .../geos/algorithm/distance/PointPairDistance.h    |   2 +-
 include/geos/geom/Coordinate.h                     |   2 +-
 include/geos/geom/CoordinateArraySequence.h        |   2 +-
 include/geos/geom/CoordinateSequence.h             |   2 +-
 .../geos/geom/DefaultCoordinateSequenceFactory.h   |   2 +-
 include/geos/geom/Envelope.h                       |   2 +-
 include/geos/geom/FixedSizeCoordinateSequence.h    |  14 +-
 include/geos/geom/Geometry.h                       |   2 +-
 include/geos/geom/GeometryFactory.h                |   2 +-
 include/geos/geom/LineSegment.h                    |   4 +-
 include/geos/geom/LineString.h                     |   2 +-
 include/geos/geom/MultiPoint.h                     |   2 +-
 include/geos/geom/Point.h                          |   2 +-
 include/geos/geom/Polygon.h                        |   4 +-
 include/geos/geomgraph/Edge.h                      |  10 +-
 include/geos/geomgraph/EdgeIntersection.h          |   6 +-
 include/geos/geomgraph/EdgeIntersectionList.h      |   2 +-
 include/geos/geomgraph/TopologyLocation.inl        |  12 +-
 include/geos/geomgraph/index/MonotoneChain.h       |   4 +-
 include/geos/geomgraph/index/MonotoneChainEdge.h   |  14 +-
 include/geos/geomgraph/index/SegmentIntersector.h  |   6 +-
 .../geos/geomgraph/index/SegmentIntersector.inl    |   2 +-
 .../geomgraph/index/SimpleMCSweepLineIntersector.h |   2 +-
 .../geomgraph/index/SimpleSweepLineIntersector.h   |   2 +-
 include/geos/geomgraph/index/SweepLineEvent.h      |   4 +-
 include/geos/geomgraph/index/SweepLineSegment.h    |   4 +-
 include/geos/index/chain/MonotoneChain.h           |  12 +-
 .../geos/index/chain/MonotoneChainSelectAction.h   |   2 +-
 include/geos/index/kdtree/KdTree.h                 |   2 +-
 include/geos/index/quadtree/NodeBase.h             |   4 +-
 include/geos/index/quadtree/Quadtree.h             |   2 +-
 include/geos/index/strtree/AbstractNode.h          |   2 +-
 include/geos/index/strtree/STRtree.h               |   2 +-
 include/geos/index/strtree/SimpleSTRnode.h         |   2 +-
 include/geos/index/sweepline/SweepLineEvent.h      |   6 +-
 include/geos/io/WKBWriter.h                        |   3 +-
 include/geos/linearref/LinearIterator.h            |  14 +-
 include/geos/linearref/LinearLocation.h            |  18 +-
 include/geos/noding/BasicSegmentString.h           |   4 +-
 include/geos/noding/BasicSegmentString.inl         |   4 +-
 include/geos/noding/IntersectionAdder.h            |  12 +-
 include/geos/noding/IntersectionFinderAdder.h      |   4 +-
 include/geos/noding/NodedSegmentString.h           |  12 +-
 include/geos/noding/NodingIntersectionFinder.h     |   8 +-
 include/geos/noding/NodingValidator.h              |   4 +-
 include/geos/noding/OrientedCoordinateArray.h      |   2 +-
 include/geos/noding/SegmentIntersectionDetector.h  |   4 +-
 include/geos/noding/SegmentIntersector.h           |   4 +-
 include/geos/noding/SegmentNode.h                  |   4 +-
 include/geos/noding/SegmentString.h                |   4 +-
 .../geos/noding/snap/SnappingIntersectionAdder.h   |   8 +-
 .../geos/noding/snapround/MCIndexPointSnapper.h    |   2 +-
 .../snapround/SnapRoundingIntersectionAdder.h      |   4 +-
 include/geos/noding/snapround/SnapRoundingNoder.h  |   4 +-
 .../operation/buffer/BufferInputLineSimplifier.h   |   6 +-
 .../geos/operation/buffer/OffsetSegmentString.h    |   4 +-
 include/geos/operation/distance/FacetSequence.h    |  18 +-
 include/geos/operation/distance/GeometryLocation.h |   6 +-
 .../operation/overlay/snap/LineStringSnapper.h     |   2 +-
 include/geos/operation/overlayng/Edge.h            |   2 +-
 .../operation/valid/IndexedNestedShellTester.h     |   2 +-
 include/geos/profiler.h                            |   2 +-
 include/geos/simplify/TaggedLineSegment.h          |   6 +-
 include/geos/util.h                                |   4 +-
 src/algorithm/Area.cpp                             |   8 +-
 src/algorithm/Centroid.cpp                         |  14 +-
 src/algorithm/ConvexHull.cpp                       |  18 +-
 src/algorithm/HCoordinate.cpp                      |  11 +-
 src/algorithm/InteriorPointArea.cpp                |  17 +-
 src/algorithm/InteriorPointLine.cpp                |   2 +-
 src/algorithm/Length.cpp                           |   4 +-
 src/algorithm/LineIntersector.cpp                  | 118 ++++---
 src/algorithm/MinimumBoundingCircle.cpp            |   6 +-
 src/algorithm/Orientation.cpp                      |   2 +-
 src/algorithm/PointLocation.cpp                    |   4 +-
 src/algorithm/PointLocator.cpp                     |   2 +-
 src/algorithm/RobustDeterminant.cpp                |   2 -
 src/algorithm/distance/DiscreteFrechetDistance.cpp |  18 +-
 .../distance/DiscreteHausdorffDistance.cpp         |   4 +-
 src/algorithm/distance/DistanceToPoint.cpp         |   8 +-
 src/algorithm/locate/IndexedPointInAreaLocator.cpp |   4 +-
 src/algorithm/locate/SimplePointInAreaLocator.cpp  |   4 +-
 src/geom/Coordinate.cpp                            |   6 +-
 src/geom/CoordinateArraySequence.cpp               |  24 +-
 src/geom/CoordinateSequence.cpp                    |  26 +-
 src/geom/Dimension.cpp                             |  10 +-
 src/geom/Envelope.cpp                              |  44 ++-
 src/geom/Geometry.cpp                              |  69 ++--
 src/geom/GeometryCollection.cpp                    |  14 +-
 src/geom/GeometryFactory.cpp                       |  60 ++--
 src/geom/IntersectionMatrix.cpp                    |  38 +-
 src/geom/LineString.cpp                            |  21 +-
 src/geom/Location.cpp                              |   2 -
 src/geom/MultiLineString.cpp                       |   2 +-
 src/geom/MultiPoint.cpp                            |   4 +-
 src/geom/MultiPolygon.cpp                          |   4 +-
 src/geom/Point.cpp                                 |  35 +-
 src/geom/Polygon.cpp                               |  20 +-
 src/geom/PrecisionModel.cpp                        |  16 +-
 src/geom/prep/BasicPreparedGeometry.cpp            |   2 +-
 src/geom/prep/PreparedLineStringIntersects.cpp     |   4 +-
 src/geom/prep/PreparedPolygonContainsProperly.cpp  |   2 +-
 src/geom/prep/PreparedPolygonIntersects.cpp        |   2 +-
 src/geom/util/GeometryEditor.cpp                   |   2 +-
 src/geom/util/GeometryTransformer.cpp              |   6 +-
 src/geomgraph/DirectedEdgeStar.cpp                 |   1 -
 src/geomgraph/Edge.cpp                             |  25 +-
 src/geomgraph/EdgeEndStar.cpp                      |   2 -
 src/geomgraph/EdgeIntersectionList.cpp             |   6 +-
 src/geomgraph/EdgeList.cpp                         |   2 +-
 src/geomgraph/EdgeNodingValidator.cpp              |   9 +-
 src/geomgraph/EdgeRing.cpp                         |  14 +-
 src/geomgraph/GeometryGraph.cpp                    |  59 ++--
 src/geomgraph/Node.cpp                             |  21 +-
 src/geomgraph/NodeMap.cpp                          |  23 +-
 src/geomgraph/PlanarGraph.cpp                      |  48 +--
 src/geomgraph/TopologyLocation.cpp                 |   6 +-
 src/geomgraph/index/MonotoneChainEdge.cpp          |  30 +-
 src/geomgraph/index/MonotoneChainIndexer.cpp       |  10 +-
 src/geomgraph/index/SegmentIntersector.cpp         |  16 +-
 src/geomgraph/index/SimpleEdgeSetIntersector.cpp   |  26 +-
 .../index/SimpleMCSweepLineIntersector.cpp         |  14 +-
 src/geomgraph/index/SimpleSweepLineIntersector.cpp |  14 +-
 src/geomgraph/index/SweepLineSegment.cpp           |   2 +-
 src/index/bintree/Bintree.cpp                      |  14 +-
 src/index/bintree/NodeBase.cpp                     |  14 +-
 src/index/chain/MonotoneChain.cpp                  |  20 +-
 src/index/chain/MonotoneChainBuilder.cpp           |   6 +-
 src/index/chain/MonotoneChainOverlapAction.cpp     |   4 +-
 src/index/chain/MonotoneChainSelectAction.cpp      |   2 +-
 .../intervalrtree/SortedPackedIntervalRTree.cpp    |   2 +-
 src/index/kdtree/KdTree.cpp                        |   4 +-
 src/index/quadtree/IntervalSize.cpp                |   4 +-
 src/index/quadtree/Node.cpp                        |   8 +-
 src/index/quadtree/NodeBase.cpp                    |  26 +-
 src/index/quadtree/Quadtree.cpp                    |  24 +-
 src/index/strtree/AbstractSTRtree.cpp              |   6 +-
 src/index/strtree/Interval.cpp                     |   6 +-
 src/index/strtree/SIRtree.cpp                      |   6 +-
 src/index/strtree/STRtree.cpp                      |  24 +-
 src/index/sweepline/SweepLineEvent.cpp             |   2 +-
 src/index/sweepline/SweepLineIndex.cpp             |   6 +-
 src/io/CLocalizer.cpp                              |   2 +-
 src/io/ParseException.cpp                          |  12 +-
 src/io/StringTokenizer.cpp                         |   2 +-
 src/io/WKBReader.cpp                               |  46 +--
 src/io/WKBWriter.cpp                               |  12 +-
 src/io/WKTReader.cpp                               |  54 +--
 src/io/WKTWriter.cpp                               |  38 +-
 src/linearref/ExtractLineByLocation.cpp            |   4 +-
 src/linearref/LengthIndexOfPoint.cpp               |   4 +-
 src/linearref/LengthIndexedLine.cpp                |   4 +-
 src/linearref/LengthLocationMap.cpp                |   2 +-
 src/linearref/LinearGeometryBuilder.cpp            |   2 +-
 src/linearref/LinearIterator.cpp                   |   2 +-
 src/linearref/LinearLocation.cpp                   |  22 +-
 src/linearref/LocationIndexOfLine.cpp              |   2 +-
 src/linearref/LocationIndexOfPoint.cpp             |   8 +-
 src/noding/GeometryNoder.cpp                       |   2 +-
 src/noding/IntersectionAdder.cpp                   |   6 +-
 src/noding/IntersectionFinderAdder.cpp             |   6 +-
 src/noding/MCIndexNoder.cpp                        |  10 +-
 src/noding/MCIndexSegmentSetMutualIntersector.cpp  |   2 +-
 src/noding/NodedSegmentString.cpp                  |  16 +-
 src/noding/NodingIntersectionFinder.cpp            |   6 +-
 src/noding/NodingValidator.cpp                     |  18 +-
 src/noding/Octant.cpp                              |   2 +-
 src/noding/OrientedCoordinateArray.cpp             |  10 +-
 src/noding/ScaledNoder.cpp                         |   6 +-
 src/noding/SegmentIntersectionDetector.cpp         |   4 +-
 src/noding/SegmentNode.cpp                         |  16 +-
 src/noding/SegmentNodeList.cpp                     |  12 +-
 src/noding/SimpleNoder.cpp                         |   4 +-
 src/noding/snap/SnappingIntersectionAdder.cpp      |   8 +-
 src/noding/snap/SnappingNoder.cpp                  |   2 +-
 src/noding/snapround/HotPixelIndex.cpp             |   6 +-
 src/noding/snapround/MCIndexPointSnapper.cpp       |  10 +-
 src/noding/snapround/MCIndexSnapRounder.cpp        |  12 +-
 .../snapround/SnapRoundingIntersectionAdder.cpp    |   8 +-
 src/noding/snapround/SnapRoundingNoder.cpp         |  16 +-
 src/operation/IsSimpleOp.cpp                       |  16 +-
 src/operation/buffer/BufferBuilder.cpp             |  26 +-
 src/operation/buffer/BufferInputLineSimplifier.cpp |  12 +-
 src/operation/buffer/BufferSubgraph.cpp            |  38 +-
 src/operation/buffer/OffsetCurveBuilder.cpp        |  22 +-
 src/operation/buffer/OffsetCurveSetBuilder.cpp     |  10 +-
 src/operation/buffer/OffsetSegmentGenerator.cpp    |   2 +-
 src/operation/buffer/RightmostEdgeFinder.cpp       |  12 +-
 src/operation/buffer/SubgraphDepthLocater.cpp      |  40 +--
 .../distance/ConnectedElementLocationFilter.cpp    |   4 +-
 .../distance/ConnectedElementPointFilter.cpp       |   6 +-
 src/operation/distance/DistanceOp.cpp              |  26 +-
 src/operation/distance/FacetSequence.cpp           |  20 +-
 .../distance/FacetSequenceTreeBuilder.cpp          |   6 +-
 src/operation/distance/GeometryLocation.cpp        |   4 +-
 .../intersection/RectangleIntersection.cpp         |  14 +-
 .../intersection/RectangleIntersectionBuilder.cpp  |   8 +-
 src/operation/linemerge/EdgeString.cpp             |   2 +-
 src/operation/linemerge/LineMergeGraph.cpp         |  16 +-
 src/operation/linemerge/LineMerger.cpp             |  28 +-
 src/operation/linemerge/LineSequencer.cpp          |  12 +-
 src/operation/overlay/EdgeSetNoder.cpp             |   8 +-
 src/operation/overlay/ElevationMatrix.cpp          |  28 +-
 src/operation/overlay/ElevationMatrixCell.cpp      |   6 +-
 src/operation/overlay/LineBuilder.cpp              |  48 +--
 src/operation/overlay/MaximalEdgeRing.cpp          |  12 +-
 src/operation/overlay/OverlayOp.cpp                | 140 ++++----
 src/operation/overlay/PointBuilder.cpp             |   4 +-
 src/operation/overlay/PolygonBuilder.cpp           | 100 +++---
 src/operation/overlay/snap/GeometrySnapper.cpp     |  18 +-
 src/operation/overlay/snap/LineStringSnapper.cpp   |  82 ++---
 .../overlay/snap/SnapIfNeededOverlayOp.cpp         |   6 +-
 src/operation/overlay/snap/SnapOverlayOp.cpp       |   6 +-
 .../overlay/validate/FuzzyPointLocator.cpp         |   4 +-
 .../overlay/validate/OffsetPointGenerator.cpp      |   8 +-
 .../overlay/validate/OverlayResultValidator.cpp    |  44 +--
 src/operation/overlayng/Edge.cpp                   |   2 +-
 src/operation/overlayng/EdgeKey.cpp                |   2 +-
 src/operation/polygonize/BuildArea.cpp             |  18 +-
 src/operation/polygonize/EdgeRing.cpp              |   6 +-
 src/operation/polygonize/HoleAssigner.cpp          |   2 +-
 src/operation/polygonize/PolygonizeGraph.cpp       |   2 +-
 src/operation/polygonize/Polygonizer.cpp           |  36 +-
 src/operation/predicate/RectangleContains.cpp      |   4 +-
 .../predicate/SegmentIntersectionTester.cpp        |   2 +-
 src/operation/relate/EdgeEndBuilder.cpp            |   2 +-
 src/operation/relate/EdgeEndBundle.cpp             |  10 +-
 src/operation/relate/EdgeEndBundleStar.cpp         |   2 +-
 src/operation/relate/RelateNodeGraph.cpp           |   8 +-
 src/operation/sharedpaths/SharedPathsOp.cpp        |   4 +-
 src/operation/union/CascadedPolygonUnion.cpp       |   6 +-
 src/operation/union/CoverageUnion.cpp              |   6 +-
 src/operation/union/OverlapUnion.cpp               |   2 +-
 src/operation/valid/ConnectedInteriorTester.cpp    |  30 +-
 src/operation/valid/ConsistentAreaTester.cpp       |   4 +-
 src/operation/valid/IndexedNestedRingTester.cpp    |   4 +-
 src/operation/valid/IndexedNestedRingTester.h      |   2 +-
 src/operation/valid/IndexedNestedShellTester.cpp   |  10 +-
 src/operation/valid/IsValidOp.cpp                  |  24 +-
 src/operation/valid/QuadtreeNestedRingTester.cpp   |  10 +-
 src/operation/valid/RepeatedPointRemover.cpp       |   2 +-
 src/operation/valid/RepeatedPointTester.cpp        |  10 +-
 src/operation/valid/SimpleNestedRingTester.cpp     |   4 +-
 src/operation/valid/SweeplineNestedRingTester.cpp  |   2 +-
 src/operation/valid/TopologyValidationError.cpp    |   8 +-
 src/planargraph/DirectedEdge.cpp                   |  16 +-
 src/planargraph/DirectedEdgeStar.cpp               |  12 +-
 src/planargraph/Node.cpp                           |   4 +-
 src/planargraph/NodeMap.cpp                        |   6 +-
 src/planargraph/PlanarGraph.cpp                    |  12 +-
 src/planargraph/Subgraph.cpp                       |   6 +-
 .../algorithm/ConnectedSubgraphFinder.cpp          |   8 +-
 src/precision/CommonBitsOp.cpp                     |  24 +-
 src/precision/MinimumClearance.cpp                 |   8 +-
 .../PrecisionReducerCoordinateOperation.cpp        |   2 +-
 src/simplify/LineSegmentIndex.cpp                  |  16 +-
 src/simplify/TaggedLineSegment.cpp                 |   2 +-
 src/simplify/TaggedLineString.cpp                  |  46 +--
 src/simplify/TaggedLineStringSimplifier.cpp        |  14 +-
 src/simplify/TaggedLinesSimplifier.cpp             |   2 +-
 src/triangulate/DelaunayTriangulationBuilder.cpp   |   2 +-
 src/triangulate/quadedge/QuadEdgeSubdivision.cpp   |   6 +-
 src/util/Assert.cpp                                |   6 +-
 src/util/Profiler.cpp                              |  22 +-
 .../unit/algorithm/RobustLineIntersectionTest.cpp  |   4 +-
 tests/unit/capi/GEOSDistanceTest.cpp               |   4 +-
 tests/unit/capi/GEOSSTRtreeTest.cpp                |  12 +-
 .../geom/CoordinateArraySequenceFactoryTest.cpp    |   8 +-
 tests/unit/geom/CoordinateArraySequenceTest.cpp    |  28 +-
 tests/unit/geom/EnvelopeTest.cpp                   |   2 +-
 tests/unit/geom/GeometryComponentFilterTest.cpp    |   8 +-
 tests/unit/geom/LineStringTest.cpp                 |   6 +-
 tests/unit/geom/LinearRingTest.cpp                 |   4 +-
 tests/unit/geom/MultiPointTest.cpp                 |   8 +-
 tests/unit/geom/PointTest.cpp                      |   4 +-
 tests/unit/geom/PolygonTest.cpp                    |   8 +-
 tests/unit/io/WKTReaderTest.cpp                    |   2 +-
 tests/unit/noding/NodedSegmentStringTest.cpp       |   2 +-
 tests/unit/noding/SegmentNodeTest.cpp              |  16 +-
 .../distance/IndexedFacetDistanceTest.cpp          |   6 +-
 tests/unit/operation/geounion/UnaryUnionOpTest.cpp |   2 +-
 .../overlay/validate/OffsetPointGeneratorTest.cpp  |   2 +-
 tests/unit/triangulate/VoronoiTest.cpp             |   7 +-
 .../quadedge/QuadEdgeSubdivisionTest.cpp           |   2 +-
 tests/xmltester/Stackwalker.cpp                    |  78 ++---
 299 files changed, 1918 insertions(+), 1965 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list