private OsmTrack mergeTrack(final OsmPathElement match, final OsmTrack oldTrack) {
        logInfo("**************** merging match=" + match.cost + " with oldTrack=" + oldTrack.cost);
        OsmPathElement element = match;
        final OsmTrack track = new OsmTrack();
        track.cost = oldTrack.cost;

        while (element != null) {
            track.addNode(element);
            element = element.origin;
        }
        long lastId = 0;
        final long id1 = match.getIdFromPos();
        final long id0 = match.origin == null ? 0 : match.origin.getIdFromPos();
        boolean appending = false;
        for (OsmPathElement n : oldTrack.nodes) {
            if (appending) {
                track.nodes.add(n);
            }

            final long id = n.getIdFromPos();
            if (id == id1 && lastId == id0) {
                appending = true;
            }
            lastId = id;
        }


        track.buildMap();
        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