/** * Return the direction like 'NE' based on the first tracksegment of the instruction. If * Instruction does not contain enough coordinate points, an empty string will be returned. */ String calcDirection(Instruction nextI) { double azimuth = calcAzimuth(nextI); if (Double.isNaN(azimuth)) return ""; return AC.azimuth2compassPoint(azimuth); }
public void createRteptBlock(StringBuilder output, Instruction instruction, Instruction nextI, DecimalFormat decimalFormat) { output.append("\n<rtept lat=\"").append(decimalFormat.format(instruction.getFirstLat())). append("\" lon=\"").append(decimalFormat.format(instruction.getFirstLon())).append("\">"); if (!instruction.getName().isEmpty()) output.append("<desc>").append(simpleXMLEscape(instruction.getTurnDescription(tr))).append("</desc>"); output.append("<extensions>"); output.append("<gh:distance>").append(Helper.round(instruction.getDistance(), 1)).append("</gh:distance>"); output.append("<gh:time>").append(instruction.getTime()).append("</gh:time>"); String direction = instruction.calcDirection(nextI); if (!direction.isEmpty()) output.append("<gh:direction>").append(direction).append("</gh:direction>"); double azimuth = instruction.calcAzimuth(nextI); if (!Double.isNaN(azimuth)) output.append("<gh:azimuth>").append(Helper.round2(azimuth)).append("</gh:azimuth>"); if (instruction instanceof RoundaboutInstruction) { RoundaboutInstruction ri = (RoundaboutInstruction) instruction; output.append("<gh:exit_number>").append(ri.getExitNumber()).append("</gh:exit_number>"); } output.append("<gh:sign>").append(instruction.getSign()).append("</gh:sign>"); output.append("</extensions>"); output.append("</rtept>"); }
/** * Return the direction like 'NE' based on the first tracksegment of the instruction. If * Instruction does not contain enough coordinate points, an empty string will be returned. */ String calcDirection( Instruction nextI ) { double azimuth = calcAzimuth(nextI); if (Double.isNaN(azimuth)) return ""; return AC.azimuth2compassPoint(azimuth); }
/** * Return the direction like 'NE' based on the first tracksegment of the instruction. If * Instruction does not contain enough coordinate points, an empty string will be returned. */ String calcDirection(Instruction nextI) { double azimuth = calcAzimuth(nextI); if (Double.isNaN(azimuth)) return ""; return AC.azimuth2compassPoint(azimuth); }
/** * Return the direction like 'NE' based on the first tracksegment of the instruction. If * Instruction does not contain enough coordinate points, an empty string will be returned. */ String calcDirection(Instruction nextI) { double azimuth = calcAzimuth(nextI); if (Double.isNaN(azimuth)) return ""; return AC.azimuth2compassPoint(azimuth); }
public void createRteptBlock(StringBuilder output, Instruction instruction, Instruction nextI) { output.append("\n<rtept lat=\"").append(Helper.round6(instruction.getFirstLat())). append("\" lon=\"").append(Helper.round6(instruction.getFirstLon())).append("\">"); if (!instruction.getName().isEmpty()) output.append("<desc>").append(simpleXMLEscape(instruction.getTurnDescription(tr))).append("</desc>"); output.append("<extensions>"); output.append("<gh:distance>").append(Helper.round(instruction.getDistance(), 1)).append("</gh:distance>"); output.append("<gh:time>").append(instruction.getTime()).append("</gh:time>"); String direction = instruction.calcDirection(nextI); if (!direction.isEmpty()) output.append("<gh:direction>").append(direction).append("</gh:direction>"); double azimuth = instruction.calcAzimuth(nextI); if (!Double.isNaN(azimuth)) output.append("<gh:azimuth>").append(Helper.round2(azimuth)).append("</gh:azimuth>"); output.append("<gh:sign>").append(instruction.getSign()).append("</gh:sign>"); output.append("</extensions>"); output.append("</rtept>"); }
public void createRteptBlock( StringBuilder output, Instruction instruction, Instruction nextI ) { output.append("\n<rtept lat=\"").append(Helper.round6(instruction.getFirstLat())). append("\" lon=\"").append(Helper.round6(instruction.getFirstLon())).append("\">"); if (!instruction.getName().isEmpty()) output.append("<desc>").append(simpleXMLEscape(instruction.getTurnDescription(tr))).append("</desc>"); output.append("<extensions>"); output.append("<gh:distance>").append(Helper.round(instruction.getDistance(), 1)).append("</gh:distance>"); output.append("<gh:time>").append(instruction.getTime()).append("</gh:time>"); String direction = instruction.calcDirection(nextI); if (!direction.isEmpty()) output.append("<gh:direction>").append(direction).append("</gh:direction>"); double azimuth = instruction.calcAzimuth(nextI); if (!Double.isNaN(azimuth)) output.append("<gh:azimuth>").append(Helper.round2(azimuth)).append("</gh:azimuth>"); output.append("<gh:sign>").append(instruction.getSign()).append("</gh:sign>"); output.append("</extensions>"); output.append("</rtept>"); }
public void createRteptBlock(StringBuilder output, Instruction instruction, Instruction nextI, DecimalFormat decimalFormat) { output.append("\n<rtept lat=\"").append(decimalFormat.format(instruction.getFirstLat())). append("\" lon=\"").append(decimalFormat.format(instruction.getFirstLon())).append("\">"); if (!instruction.getName().isEmpty()) output.append("<desc>").append(simpleXMLEscape(instruction.getTurnDescription(tr))).append("</desc>"); output.append("<extensions>"); output.append("<gh:distance>").append(Helper.round(instruction.getDistance(), 1)).append("</gh:distance>"); output.append("<gh:time>").append(instruction.getTime()).append("</gh:time>"); String direction = instruction.calcDirection(nextI); if (!direction.isEmpty()) output.append("<gh:direction>").append(direction).append("</gh:direction>"); double azimuth = instruction.calcAzimuth(nextI); if (!Double.isNaN(azimuth)) output.append("<gh:azimuth>").append(Helper.round2(azimuth)).append("</gh:azimuth>"); if (instruction instanceof RoundaboutInstruction) { RoundaboutInstruction ri = (RoundaboutInstruction) instruction; output.append("<gh:exit_number>").append(ri.getExitNumber()).append("</gh:exit_number>"); } output.append("<gh:sign>").append(instruction.getSign()).append("</gh:sign>"); output.append("</extensions>"); output.append("</rtept>"); }