diff --git a/src/main/java/com/graphhopper/util/DouglasPeucker.java b/src/main/java/com/graphhopper/util/DouglasPeucker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/graphhopper/util/DouglasPeucker.java
+++ b/src/main/java/com/graphhopper/util/DouglasPeucker.java
@@ -27,8 +27,8 @@ public class DouglasPeucker {
     private DistanceCalc calc;
 
     public DouglasPeucker() {
-        // calc = new DistanceCalc();
-        calc = new DistanceCosProjection();
+        calc = new DistanceCalc();
+        // calc = new DistanceCosProjection();
         // 1m
         maxDistance(1);
     }
@@ -49,7 +49,16 @@ public class DouglasPeucker {
      */
     public int simplify(PointList points) {
         int size = points.size();
-        int removed = simplify(points, 0, size - 1);
+        int removed = 0;
+        int delta = 500;
+        int segments = size / delta + 1;
+        int start = 0;
+        for (int i = 0; i < segments; i++) {
+            // start of next is end of last segment, except for the last
+            removed += simplify(points, start, Math.min(size - 1, start + delta));
+            start += delta;
+        }
+
         compressNew(points, removed);
         return removed;
     }
bug when deployed so reploy again with segmenting