public boolean isOnPolyline(final long px, final long py) {
        final int iLast = points.size() - 1;
        Point p1 = points.get(0);
        for (int i = 1; i <= iLast; i++) {
            final Point p2 = points.get(i);
            if (isOnLine(px, py, p1.x, p1.y, p2.x, p2.y)) {
                return true;
            }
            p1 = p2;
        }
        return false;
    }
tests whether a segment defined by lon and lat of two points does either
intersect the polygon or any of the endpoints (or both) are enclosed by
the polygon. For this test the winding-number algorithm is
being used. That means a point being within an overlapping region of the
polygon is also taken as being 'inside' the polygon.

@param lon0 longitude of start point
@param lat0 latitude of start point
@param lon1 longitude of end point
@param lat1 latitude of start point
@return true if segment or any of it's points are 'inside' of polygon
main/src/main/java/cgeo/geocaching/brouter/core/OsmNogoPolygon.java