if (sign == Instruction.CONTINUE_ON_STREET) { if (jsonObj.has("heading")) { instr.setExtraInfo("heading", jsonObj.get("heading").asDouble());
@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); }
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); prevName = name;
@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); }
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); prevName = name;