private void collectData(final Route route) {
        float distance = 0.0f;
        Geopoint lastPoint = null;
        entries.clear();
        if (route == null || route.getSegments() == null) {
            return;
        }
        for (RouteSegment segment : route.getSegments()) {
            final ArrayList<Float> elevation = segment.getElevation();
            if (elevation == null) {
                return;
            }
            final Iterator<Float> it = elevation.iterator();
            for (Geopoint point : segment.getPoints()) {
                if (lastPoint != null) {
                    distance += lastPoint.distanceTo(point);
                }
                lastPoint = point;
                final float elev = it.hasNext() ? it.next() : Float.NaN;
                if (!Float.isNaN(elev)) {
                    entries.add(new Entry(distance, elev, point));
                }
            }
        }
    }
collect entries for line chart from route
main/src/main/java/cgeo/geocaching/unifiedmap/layers/ElevationChart.java