InstructionList instructions = new InstructionList(tr); InstructionsFromEdges instructionsFromEdges = new InstructionsFromEdges(path.get(1).edge.edgeIteratorState.getBaseNode(), graph.getGraph(), weighting, weighting.getFlagEncoder(), graph.getNodeAccess(), tr, instructions);
JsonNode instrArr = path.get("instructions"); InstructionList il = new InstructionList(null); int viaCount = 1; for (JsonNode jsonObj : instrArr) {
/** * @return the list of instructions for this path. */ public InstructionList calcInstructions(final Translation tr) { final InstructionList ways = new InstructionList(edgeIds.size() / 4, tr); if (edgeIds.isEmpty()) { if (isFound()) { ways.add(new FinishInstruction(nodeAccess, endNode)); } return ways; } forEveryEdge(new InstructionsFromEdges(getFromNode(), graph, weighting, encoder, nodeAccess, tr, ways)); return ways; }
private InstructionList getInstructions(Translation tr, List<Trip.Leg> legs) { final InstructionList instructions = new InstructionList(tr); for (int i = 0; i < legs.size(); ++i) { Trip.Leg leg = legs.get(i);
@Test public void testCreateGPXCorrectFormattingSmallNumbers() { InstructionList instructions = new InstructionList(usTR); PointList pl = new PointList(); pl.add(0.000001, 0.000001); pl.add(-0.000123, -0.000125); Instruction instruction = new Instruction(0, "do it", null, pl); instructions.add(instruction); instructions.add(new FinishInstruction(0.000852, 0.000852, 0)); String gpxStr = instructions.createGPX("test", 0, true, true, true, true, Constants.VERSION); assertFalse(gpxStr, gpxStr.contains("E-")); assertTrue(gpxStr, gpxStr.contains("0.000001")); assertTrue(gpxStr, gpxStr.contains("-0.000125")); verifyGPX(gpxStr); }
boolean allFound = true; InstructionList fullInstructions = new InstructionList(tr); PointList fullPoints = PointList.EMPTY; List<String> description = new ArrayList<>();
@Test public void testCreateGPXIncludesRoundaboutExitNumber() { InstructionList instructions = new InstructionList(usTR); PointList pl = new PointList(); pl.add(52.555423473315, 13.43890086052345); pl.add(52.555550691982, 13.43946393816465); pl.add(52.555619423589, 13.43886994061328); RoundaboutInstruction instr = new RoundaboutInstruction(Instruction.USE_ROUNDABOUT, "streetname", InstructionAnnotation.EMPTY, pl) .setRadian(2.058006514284998d) .setExitNumber(3) .setExited(); instructions.add(instr); instructions.add(new FinishInstruction(52.555619423589, 13.43886994061328, 0)); String gpxStr = instructions.createGPX("test", 0, true, true, false, false, Constants.VERSION); assertTrue(gpxStr, gpxStr.contains("<gh:exit_number>3</gh:exit_number>")); verifyGPX(gpxStr); }
@Test public void testCreateGPX() { InstructionAnnotation ea = InstructionAnnotation.EMPTY; InstructionList instructions = new InstructionList(usTR); PointList pl = new PointList(); pl.add(49.942576, 11.580384); pl.add(49.941858, 11.582422); instructions.add(new Instruction(Instruction.CONTINUE_ON_STREET, "temp", ea, pl).setDistance(240).setTime(15000)); pl = new PointList(); pl.add(49.941575, 11.583501); instructions.add(new Instruction(Instruction.TURN_LEFT, "temp2", ea, pl).setDistance(25).setTime(4000)); pl = new PointList(); pl.add(49.941389, 11.584311); instructions.add(new Instruction(Instruction.TURN_LEFT, "temp2", ea, pl).setDistance(25).setTime(3000)); instructions.add(new FinishInstruction(49.941029, 11.584514, 0)); List<GPXEntry> result = instructions.createGPXList(); assertEquals(5, result.size()); assertEquals(0, result.get(0).getTime()); assertEquals(10391, result.get(1).getTime()); assertEquals(15000, result.get(2).getTime()); assertEquals(19000, result.get(3).getTime()); assertEquals(22000, result.get(4).getTime()); verifyGPX(instructions.createGPX(Constants.VERSION)); }
/** * @return the list of instructions for this path. */ public InstructionList calcInstructions(final Translation tr) { final InstructionList ways = new InstructionList(edgeIds.size() / 4, tr); if (edgeIds.isEmpty()) { if (isFound()) { ways.add(new FinishInstruction(nodeAccess, endNode)); } return ways; } forEveryEdge(new InstructionsFromEdges(getFromNode(), graph, weighting, encoder, nodeAccess, tr, ways)); return ways; }
il = new InstructionList(null); } else { PathWrapper matchGHRsp = new PathWrapper();
boolean allFound = true; InstructionList fullInstructions = new InstructionList(tr); PointList fullPoints = PointList.EMPTY; List<String> description = new ArrayList<>();
boolean allFound = true; InstructionList fullInstructions = new InstructionList(tr); PointList fullPoints = PointList.EMPTY; List<String> description = new ArrayList<String>();
boolean allFound = true; InstructionList fullInstructions = new InstructionList(tr); PointList fullPoints = PointList.EMPTY; List<String> description = new ArrayList<String>();
final InstructionList ways = new InstructionList(edgeIds.size() / 4, tr); if (edgeIds.isEmpty()) { if (isFound()) {
final InstructionList ways = new InstructionList(edgeIds.size() / 4, tr); if (edgeIds.isEmpty())