@Override public String toString() { String str = "nodes:" + pointList.getSize() + "; " + pointList.toString(); if (instructions != null && !instructions.isEmpty()) str += ", " + instructions.toString(); if (hasErrors()) str += ", " + errors.toString(); return str; }
+ "</metadata>"; StringBuilder gpxOutput = new StringBuilder(header); if (!isEmpty()) { if (withWayPoints) { createWayPointBlock(gpxOutput, instructions.get(0), decimalFormat); // Start
/** * @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; }
InstructionList il = path.calcInstructions(tr); if (!il.isEmpty()) { fullInstructions.addAll(il);
gpxOutput.append("\n<trk><name>").append("GraphHopper MapMatching").append("</name>"); if (instructions != null && !instructions.isEmpty()) { gpxOutput.append("\n<rte>"); Instruction nextInstr = null;
@Override public String toString() { String str = "nodes:" + pointList.getSize() + "; " + pointList.toString(); if (instructions != null && !instructions.isEmpty()) str += ", " + instructions.toString(); if (hasErrors()) str += ", " + errors.toString(); return str; }
@Override public String toString() { String str = "nodes:" + pointList.getSize() + "; " + pointList.toString(); if (instructions != null && !instructions.isEmpty()) str += ", " + instructions.toString(); if (hasErrors()) str += ", " + errors.toString(); return str; }
@Override public String toString() { String str = "nodes:" + pointList.getSize() + "; " + pointList.toString(); if (instructions != null && !instructions.isEmpty()) str += ", " + instructions.toString(); if (hasErrors()) str += ", " + errors.toString(); return str; }
+ "</metadata>"; StringBuilder gpxOutput = new StringBuilder(header); if (!isEmpty()) { if (withWayPoints) { createWayPointBlock(gpxOutput, instructions.get(0), decimalFormat); // Start
+ "</metadata>"; StringBuilder gpxOutput = new StringBuilder(header); if (!isEmpty())
+ "</metadata>"; StringBuilder gpxOutput = new StringBuilder(header); if (!isEmpty()) { if (withWayPoints) { createWayPointBlock(gpxOutput, instructions.get(0)); // Start
/** * @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; }
InstructionList il = path.calcInstructions(tr); if (!il.isEmpty()) { fullInstructions.addAll(il);
InstructionList il = path.calcInstructions(tr); if (!il.isEmpty()) { if (fullPoints.isEmpty()) { PointList pl = il.get(0).getPoints();
if (!il.isEmpty())