/** * Format a EarthLocation as a lat/lon/(alt) string. * * @param el EarthLocation to format * @return The formatted lat/lon/alt */ public String formatEarthLocationShort(EarthLocation el) { StringBuffer buf = new StringBuffer(); try { LatLonPoint llp = el.getLatLonPoint(); buf.append(formatLatLonShort(llp)); buf.append(" "); buf.append(formatDistance(el.getAltitude().getValue())); } catch (Exception e) { return ""; } return buf.toString(); }
/** * format the earth location * * @param el the earth location * @param includeAlt include the altitude * @param includeLabel include that lat/lon label * @return formatted earth location */ public String formatEarthLocation(EarthLocation el, boolean includeAlt, boolean includeLabel) { StringBuffer buf = new StringBuffer(); try { buf.append(formatLatLonPoint(el.getLatLonPoint(), includeLabel)); } catch (Exception e) { return ""; } if (includeAlt) { if (includeLabel) { buf.append(" Alt: "); } else { buf.append(" "); } try { buf.append(formatDistance(el.getAltitude().getValue())); } catch (Exception e) { buf.append(" "); } } return buf.toString(); }