Index: applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java
===================================================================
--- applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java	(revision 30738)
+++ applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java	(revision 30836)
@@ -234,5 +234,5 @@
                                 EastNorth c2 = Main.getProjection().latlon2eastNorth(curWp.getCoor());
                                 if( !c1.equals(c2) ) {
-                                    EastNorth middle = Geometry.getSegmentAltituteIntersection(c1, c2, en);
+                                    EastNorth middle = getSegmentAltitudeIntersection(c1, c2, en);
                                     if( middle != null && en.distance(middle) < 1 ) {
                                         // found our point, no further search is neccessary
@@ -264,3 +264,34 @@
         return 0;
     }
+
+    /**
+     * Returns the coordinate of intersection of segment p1-p2 and an altitude
+     * to it starting at point p. If the line defined with p1-p2 intersects
+     * its altitude out of p1-p2, null is returned.
+     * @param p1
+     * @param p2
+     * @param point
+     * @return Intersection coordinate or null
+     **/
+     public static EastNorth getSegmentAltitudeIntersection(EastNorth p1, EastNorth p2, EastNorth point) {
+        double ldx = p2.getX() - p1.getX();
+        double ldy = p2.getY() - p1.getY();
+
+        if (ldx == 0 && ldy == 0) //segment zero length
+            return p1;
+
+        double pdx = point.getX() - p1.getX();
+        double pdy = point.getY() - p1.getY();
+
+        double offset = (pdx * ldx + pdy * ldy) / (ldx * ldx + ldy * ldy);
+
+        if (offset < -1e-8 || offset > 1+1e-8) return null;
+        if (offset < 1e-8)
+            return p1;
+        else if (offset > 1-1e-8)
+            return p2;
+        else
+            return new EastNorth(p1.getX() + ldx * offset, p1.getY() + ldy * offset);
+     }
+
 }
