... the user friendly GPS tool


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Höhenangaben nicht stimmig?
#6
(09.09.2011, 14:18)Kanitfastan Wrote: Kannst du mir ein Beispiel (Listing...) geben?

So sieht das im Code aus:

Code:
public double getElevationAscend(int startIndex, int endIndex) {
        double result = 0;
        List<P> positions = getPositions();
        BaseNavigationPosition previous = null;
        for (int i = startIndex; i <= endIndex; i++) {
            BaseNavigationPosition next = positions.get(i);
            if (previous != null) {
                Double elevation = previous.calculateElevation(next);
                if (elevation != null && elevation > 0)
                    result += elevation;
            }
            previous = next;
        }
        return result;
    }
--
Christian
Reply


Messages In This Thread
Höhenangaben nicht stimmig? - by Kanitfastan - 09.09.2011, 11:39
RE: Höhenangaben nicht stimmig? - by routeconverter - 09.09.2011, 16:27
RE: Höhenangaben nicht stimmig? - by kumo - 09.09.2011, 15:15

Forum Jump:


Users browsing this thread: 1 Guest(s)