public String createGPX(String trackName, long startTimeMillis, String version) { boolean includeElevation = size() > 0 && get(0).getPoints().is3D(); return createGPX(trackName, startTimeMillis, includeElevation, true, true, true, version); }
PointList pointsList = new PointList(); for (Instruction instruction : instructions) { pointsList.add(instruction.getPoints());
public ViaInstruction(Instruction instr) { this(instr.getName(), instr.getAnnotation(), instr.getPoints()); setDistance(instr.getDistance()); setTime(instr.getTime()); this.extraInfo = instr.extraInfo; }
private void updatePointsAndInstruction(EdgeIteratorState edge, PointList pl) { // skip adjNode int len = pl.size() - 1; for (int i = 0; i < len; i++) { prevInstruction.getPoints().add(pl, i); } double newDist = edge.getDistance(); prevInstruction.setDistance(newDist + prevInstruction.getDistance()); prevInstruction.setTime(weighting.calcMillis(edge, false, EdgeIterator.NO_EDGE) + prevInstruction.getTime()); }
/** * @return This method returns a list of gpx entries where the time (in millis) is relative to * the first which is 0. */ public List<GPXEntry> createGPXList() { if (isEmpty()) return Collections.emptyList(); List<GPXEntry> gpxList = new ArrayList<>(); long timeOffset = 0; for (int i = 0; i < size() - 1; i++) { Instruction prevInstr = (i > 0) ? get(i - 1) : null; boolean instrIsFirst = prevInstr == null; Instruction nextInstr = get(i + 1); nextInstr.checkOne(); // current instruction does not contain last point which is equals to first point of next instruction: timeOffset = get(i).fillGPXList(gpxList, timeOffset, prevInstr, nextInstr, instrIsFirst); } Instruction lastI = get(size() - 1); if (lastI.points.size() != 1) throw new IllegalStateException("Last instruction must have exactly one point but was " + lastI.points.size()); double lastLat = lastI.getFirstLat(), lastLon = lastI.getFirstLon(), lastEle = lastI.getPoints().is3D() ? lastI.getFirstEle() : Double.NaN; gpxList.add(new GPXEntry(lastLat, lastLon, lastEle, timeOffset)); return gpxList; }
instructions.add(departureInstruction); } else { pl = instructions.get(instructions.size() - 2).getPoints();
public String createGPX( String trackName, long startTimeMillis ) { boolean includeElevation = getSize() > 0 ? get(0).getPoints().is3D() : false; return createGPX(trackName, startTimeMillis, includeElevation, true, true, true); }
instrJson.putAll(instruction.getExtraInfoJSON()); int tmpIndex = pointsIndex + instruction.getPoints().size();
public String createGPX(String trackName, long startTimeMillis) { boolean includeElevation = getSize() > 0 ? get(0).getPoints().is3D() : false; return createGPX(trackName, startTimeMillis, includeElevation, true, true, true); }
public String createGPX(String trackName, long startTimeMillis, String version) { boolean includeElevation = size() > 0 && get(0).getPoints().is3D(); return createGPX(trackName, startTimeMillis, includeElevation, true, true, true, version); }
public ViaInstruction( Instruction instr ) { this(instr.getName(), instr.getAnnotation(), instr.getPoints()); setDistance(instr.getDistance()); setTime(instr.getTime()); }
public ViaInstruction(Instruction instr) { this(instr.getName(), instr.getAnnotation(), instr.getPoints()); setDistance(instr.getDistance()); setTime(instr.getTime()); this.extraInfo = instr.extraInfo; }
public ViaInstruction(Instruction instr) { this(instr.getName(), instr.getAnnotation(), instr.getPoints()); setDistance(instr.getDistance()); setTime(instr.getTime()); }
private void updatePointsAndInstruction(EdgeIteratorState edge, PointList pl) { // skip adjNode int len = pl.size() - 1; for (int i = 0; i < len; i++) { prevInstruction.getPoints().add(pl, i); } double newDist = edge.getDistance(); prevInstruction.setDistance(newDist + prevInstruction.getDistance()); prevInstruction.setTime(weighting.calcMillis(edge, false, EdgeIterator.NO_EDGE) + prevInstruction.getTime()); } });
private void updatePointsAndInstruction(EdgeIteratorState edge, PointList pl) { // skip adjNode int len = pl.size() - 1; for (int i = 0; i < len; i++) { prevInstruction.getPoints().add(pl, i); } double newDist = edge.getDistance(); prevInstruction.setDistance(newDist + prevInstruction.getDistance()); prevInstruction.setTime(weighting.calcMillis(edge, false, EdgeIterator.NO_EDGE) + prevInstruction.getTime()); }
/** * @return This method returns a list of gpx entries where the time (in millis) is relative to * the first which is 0. */ public List<GPXEntry> createGPXList() { if (isEmpty()) return Collections.emptyList(); List<GPXEntry> gpxList = new ArrayList<>(); long timeOffset = 0; for (int i = 0; i < size() - 1; i++) { Instruction prevInstr = (i > 0) ? get(i - 1) : null; boolean instrIsFirst = prevInstr == null; Instruction nextInstr = get(i + 1); nextInstr.checkOne(); // current instruction does not contain last point which is equals to first point of next instruction: timeOffset = get(i).fillGPXList(gpxList, timeOffset, prevInstr, nextInstr, instrIsFirst); } Instruction lastI = get(size() - 1); if (lastI.points.size() != 1) throw new IllegalStateException("Last instruction must have exactly one point but was " + lastI.points.size()); double lastLat = lastI.getFirstLat(), lastLon = lastI.getFirstLon(), lastEle = lastI.getPoints().is3D() ? lastI.getFirstEle() : Double.NaN; gpxList.add(new GPXEntry(lastLat, lastLon, lastEle, timeOffset)); return gpxList; }
/** * @return This method returns a list of gpx entries where the time (in millis) is relative to * the first which is 0. * <p> */ public List<GPXEntry> createGPXList() { if (isEmpty()) return Collections.emptyList(); List<GPXEntry> gpxList = new ArrayList<GPXEntry>(); long timeOffset = 0; for (int i = 0; i < size() - 1; i++) { Instruction prevInstr = (i > 0) ? get(i - 1) : null; boolean instrIsFirst = prevInstr == null; Instruction nextInstr = get(i + 1); nextInstr.checkOne(); // current instruction does not contain last point which is equals to first point of next instruction: timeOffset = get(i).fillGPXList(gpxList, timeOffset, prevInstr, nextInstr, instrIsFirst); } Instruction lastI = get(size() - 1); if (lastI.points.size() != 1) throw new IllegalStateException("Last instruction must have exactly one point but was " + lastI.points.size()); double lastLat = lastI.getFirstLat(), lastLon = lastI.getFirstLon(), lastEle = lastI.getPoints().is3D() ? lastI.getFirstEle() : Double.NaN; gpxList.add(new GPXEntry(lastLat, lastLon, lastEle, timeOffset)); return gpxList; }
/** * @return This method returns a list of gpx entries where the time (in millis) is relative to * the first which is 0. * <p> */ public List<GPXEntry> createGPXList() { if (isEmpty()) return Collections.emptyList(); List<GPXEntry> gpxList = new ArrayList<GPXEntry>(); long timeOffset = 0; for (int i = 0; i < size() - 1; i++) { Instruction prevInstr = (i > 0) ? get(i - 1) : null; boolean instrIsFirst = prevInstr == null; Instruction nextInstr = get(i + 1); nextInstr.checkOne(); // current instruction does not contain last point which is equals to first point of next instruction: timeOffset = get(i).fillGPXList(gpxList, timeOffset, prevInstr, nextInstr, instrIsFirst); } Instruction lastI = get(size() - 1); if (lastI.points.size() != 1) throw new IllegalStateException("Last instruction must have exactly one point but was " + lastI.points.size()); double lastLat = lastI.getFirstLat(), lastLon = lastI.getFirstLon(), lastEle = lastI.getPoints().is3D() ? lastI.getFirstEle() : Double.NaN; gpxList.add(new GPXEntry(lastLat, lastLon, lastEle, timeOffset)); return gpxList; }
private void updatePointsAndInstruction( EdgeIteratorState edge, PointList pl ) { // skip adjNode int len = pl.size() - 1; for (int i = 0; i < len; i++) { prevInstruction.getPoints().add(pl, i); } double newDist = edge.getDistance(); prevInstruction.setDistance(newDist + prevInstruction.getDistance()); long flags = edge.getFlags(); prevInstruction.setTime(calcMillis(newDist, flags, false) + prevInstruction.getTime()); } });