示例#1
0
 private String getAddressReverseGeocodeURL(GeoPoint gp) {
   //  -
   // http://nominatim.openstreetmap.org/reverse?format=xml&addressdetails=1&zoom=18&lat=46.17330&lon=21.29370
   StringBuffer sb = new StringBuffer();
   RTProperties rtp = this.getProperties();
   String url = rtp.getString(PROP_reverseURL, null);
   if (!StringTools.isBlank(url)) {
     sb.append(url);
   } else {
     String host = rtp.getString(PROP_hostName, HOST_PRIMARY);
     sb.append("http://");
     sb.append(host);
     if (host.indexOf("mapquest") >= 0) {
       sb.append("/nominatim/v1/reverse?");
     } else {
       sb.append("/reverse?");
     }
   }
   sb.append("format=xml&");
   sb.append("limit=1&");
   // sb.append("osm_type=W&");
   sb.append("addressdetails=").append(rtp.getString(PROP_addressdetails, "1")).append("&"); // 0,1
   sb.append("zoom=").append(rtp.getString(PROP_zoom, "18")).append("&"); // 0..18
   sb.append("email=").append(this.getEmail()).append("&"); // required, per usage policy
   sb.append("lat=").append(gp.getLatitudeString(GeoPoint.SFORMAT_DEC_5, null)).append("&");
   sb.append("lon=").append(gp.getLongitudeString(GeoPoint.SFORMAT_DEC_5, null));
   return sb.toString();
 }
示例#2
0
 private String getEmail() {
   RTProperties rtp = this.getProperties();
   String email = rtp.getString(PROP_email, null);
   if (StringTools.isBlank(email)) {
     email = SendMail.getUserFromEmailAddress();
   }
   return email;
 }