private OsmPath getStartPath(final OsmNode n1, final OsmNode n2, final OsmNodeNamed wp, final OsmNodeNamed endPos, final boolean sameSegmentSearch) {
        try {
            routingContext.setWaypoint(wp, sameSegmentSearch ? endPos : null, false);
            OsmPath bestPath = null;
            OsmLink bestLink = null;
            final OsmLink startLink = new OsmLink(null, n1);
            final OsmPath startPath = routingContext.createPath(startLink);
            startLink.addLinkHolder(startPath, null);
            double minradius = 1e10;
            for (OsmLink link = n1.firstlink; link != null; link = link.getNext(n1)) {
                final OsmNode nextNode = link.getTarget(n1);
                if (nextNode.isHollow()) {
                    continue; // border node?
                }
                if (nextNode.firstlink == null) {
                    continue; // don't care about dead ends
                }
                if (nextNode == n1) {
                    continue; // ?
                }
                if (nextNode != n2) {
                    continue; // just that link
                }

                wp.radius = 1.5;
                final OsmPath testPath = routingContext.createPath(startPath, link, null, guideTrack != null);
                testPath.airdistance = endPos == null ? 0 : nextNode.calcDistance(endPos);
                if (wp.radius < minradius) {
                    bestPath = testPath;
                    minradius = wp.radius;
                    bestLink = link;
                }
            }
            if (bestLink != null) {
                bestLink.addLinkHolder(bestPath, n1);
            }
            bestPath.treedepth = 1;

            return bestPath;
        } finally {
            routingContext.unsetWaypoint();
        }
    }
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