private OsmTrack compileTrack(final OsmPath path) {
        OsmPathElement element = OsmPathElement.create(path);

        // for final track, cut endnode
        if (guideTrack != null && element.origin != null) {
            element = element.origin;
        }

        final float totalTime = element.getTime();
        final float totalEnergy = element.getEnergy();

        final OsmTrack track = new OsmTrack();
        track.cost = path.cost;
        track.energy = (int) path.getTotalEnergy();

        int distance = 0;

        while (element != null) {
            if (guideTrack != null && element.message == null) {
                element.message = new MessageData();
            }
            final OsmPathElement nextElement = element.origin;
            // ignore double element
            if (nextElement != null && nextElement.positionEquals(element)) {
                element = nextElement;
                continue;
            }

            if (routingContext.inverseRouting) {
                element.setTime(totalTime - element.getTime());
                element.setEnergy(totalEnergy - element.getEnergy());
                track.nodes.add(element);
            } else {
                track.nodes.add(0, element);
            }

            if (nextElement != null) {
                distance += element.calcDistance(nextElement);
            }
            element = nextElement;
        }
        track.distance = distance;
        logInfo("track-length = " + track.distance);
        track.buildMap();

        // for final track..
        if (guideTrack != null) {
            track.copyDetours(guideTrack);
        }
        return track;
    }
find the elevation type for position
to determine the filter value

@param n  the point
@return  the filter value for 1sec / 3sec elevation source
main/src/main/java/cgeo/geocaching/brouter/core/RoutingEngine.java