Fix map gen

This commit is contained in:
Victor Shcherb 2015-07-14 10:50:16 +02:00
parent 6fd3c49d85
commit 7783f9abec

View file

@ -301,7 +301,8 @@ public class MapAlgorithms {
*/
private static int countIntersections(Collection<Node> polyNodes, double latitude, double longitude) {
int intersections = 0;
if (polyNodes.size() == 0) return 0;
if (polyNodes.size() == 0)
return 0;
Node prev = null;
Node first = null;
Node last = null;
@ -321,6 +322,9 @@ public class MapAlgorithms {
}
prev = n;
}
if(first == null || last == null) {
return 0;
}
// special handling, also count first and last, might not be closed, but
// we want this!
if (OsmMapUtils.ray_intersect_lon(first,