@Override public void finish() { if (prevInRoundabout) { // calc angle between roundabout entrance and finish double orientation = Helper.ANGLE_CALC.calcOrientation(doublePrevLat, doublePrevLon, prevLat, prevLon); orientation = Helper.ANGLE_CALC.alignOrientation(prevOrientation, orientation); double delta = (orientation - prevOrientation); ((RoundaboutInstruction) prevInstruction).setRadian(delta); } Instruction finishInstruction = new FinishInstruction(nodeAccess, prevEdge.getAdjNode()); // This is the heading how the edge ended finishInstruction.setExtraInfo("last_heading", Helper.ANGLE_CALC.calcAzimuth(doublePrevLat, doublePrevLon, prevLat, prevLon)); ways.add(finishInstruction); }
/** * Return the azimuth in degree based on the first tracksegment of this instruction. If this * instruction contains less than 2 points then NaN will be returned or the specified * instruction will be used if that is the finish instruction. */ public double calcAzimuth(Instruction nextI) { double nextLat; double nextLon; if (points.getSize() >= 2) { nextLat = points.getLatitude(1); nextLon = points.getLongitude(1); } else if (nextI != null && points.getSize() == 1) { nextLat = nextI.points.getLatitude(0); nextLon = nextI.points.getLongitude(0); } else { return Double.NaN; } double lat = points.getLatitude(0); double lon = points.getLongitude(0); return AC.calcAzimuth(lat, lon, nextLat, nextLon); }
double startLat = nodeAccess.getLat(baseNode); double startLon = nodeAccess.getLon(baseNode); double heading = Helper.ANGLE_CALC.calcAzimuth(startLat, startLon, latitude, longitude); prevInstruction.setExtraInfo("heading", Helper.round(heading, 2)); ways.add(prevInstruction);
@Override public void finish() { if (prevInRoundabout) { // calc angle between roundabout entrance and finish double orientation = Helper.ANGLE_CALC.calcOrientation(doublePrevLat, doublePrevLon, prevLat, prevLon); orientation = Helper.ANGLE_CALC.alignOrientation(prevOrientation, orientation); double delta = (orientation - prevOrientation); ((RoundaboutInstruction) prevInstruction).setRadian(delta); } Instruction finishInstruction = new FinishInstruction(nodeAccess, prevEdge.getAdjNode()); // This is the heading how the edge ended finishInstruction.setExtraInfo("last_heading", Helper.ANGLE_CALC.calcAzimuth(doublePrevLat, doublePrevLon, prevLat, prevLon)); ways.add(finishInstruction); }
/** * Return the azimuth in degree based on the first tracksegment of this instruction. If this * instruction contains less than 2 points then NaN will be returned or the specified * instruction will be used if that is the finish instruction. */ public double calcAzimuth(Instruction nextI) { double nextLat; double nextLon; if (points.getSize() >= 2) { nextLat = points.getLatitude(1); nextLon = points.getLongitude(1); } else if (nextI != null && points.getSize() == 1) { nextLat = nextI.points.getLatitude(0); nextLon = nextI.points.getLongitude(0); } else { return Double.NaN; } double lat = points.getLatitude(0); double lon = points.getLongitude(0); return AC.calcAzimuth(lat, lon, nextLat, nextLon); }
/** * Return the azimuth in degree based on the first tracksegment of this instruction. If this * instruction contains less than 2 points then NaN will be returned or the specified * instruction will be used if that is the finish instruction. */ public double calcAzimuth(Instruction nextI) { double nextLat; double nextLon; if (points.getSize() >= 2) { nextLat = points.getLatitude(1); nextLon = points.getLongitude(1); } else if (nextI != null && points.getSize() == 1) { nextLat = nextI.points.getLatitude(0); nextLon = nextI.points.getLongitude(0); } else { return Double.NaN; } double lat = points.getLatitude(0); double lon = points.getLongitude(0); return AC.calcAzimuth(lat, lon, nextLat, nextLon); }
/** * Return the azimuth in degree based on the first tracksegment of this instruction. If this * instruction contains less than 2 points then NaN will be returned or the specified * instruction will be used if that is the finish instruction. */ public double calcAzimuth( Instruction nextI ) { double nextLat; double nextLon; if (points.getSize() >= 2) { nextLat = points.getLatitude(1); nextLon = points.getLongitude(1); } else if (nextI != null && points.getSize() == 1) { nextLat = nextI.points.getLatitude(0); nextLon = nextI.points.getLongitude(0); } else { return Double.NaN; } double lat = points.getLatitude(0); double lon = points.getLongitude(0); return AC.calcAzimuth(lat, lon, nextLat, nextLon); }
double startLat = nodeAccess.getLat(baseNode); double startLon = nodeAccess.getLon(baseNode); double heading = Helper.ANGLE_CALC.calcAzimuth(startLat, startLon, latitude, longitude); prevInstruction.setExtraInfo("heading", Helper.round(heading, 2)); ways.add(prevInstruction);