Exemplo n.º 1
0
  /**
   * format the latlon point
   *
   * @param llp the llp
   * @param includeLabel include the label
   * @return formatted point
   */
  public String formatLatLonPoint(LatLonPoint llp, boolean includeLabel) {

    StringBuffer buf = new StringBuffer();
    if (includeLabel) {
      buf.append("Lat: ");
    }
    try {
      buf.append(formatLatLon(Math.min(Math.max(llp.getLatitude().getValue(), -90), 90)));
    } catch (Exception e) {
      buf.append(" ");
    }
    if (includeLabel) {
      buf.append(" Lon: ");
    } else {
      buf.append("/");
    }
    try {
      buf.append(formatLatLon(Misc.normalizeLongitude(llp.getLongitude().getValue())));
    } catch (Exception e) {
      buf.append(" ");
    }
    return buf.toString();
  }