This commit is contained in:
PavelRatushny 2017-09-08 12:27:53 +03:00
parent 53992a2585
commit 8f1ba86a14

View file

@ -581,7 +581,7 @@ public class GeoPointParserUtil {
url = "http://www.openstreetmap.org/search?query=" + URLEncoder.encode(qstr);
System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(qstr));
assertGeoPoint(actual, new GeoParsedPoint(qstr.replace(',',' ')));
// http://maps.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204
qstr = "760 West Genesee Street Syracuse NY 13204";
@ -956,20 +956,16 @@ public class GeoPointParserUtil {
} else if (queryMap != null) {
String queryStr = queryMap.get("query");
if (queryStr != null) {
String[] vls = null;
if (queryStr.contains(",")) {
vls = queryStr.split("/|,");
} else if (queryStr.contains(" ")) {
vls = queryStr.split(" ");
}
if (vls != null && vls.length == 2) {
queryStr = queryStr.replace("+", " ").replace(",", " ");
String[] vls = queryStr.split(" ");
if (vls.length == 2) {
lat = parseSilentDouble(vls[0]);
lon = parseSilentDouble(vls[1]);
if (lat == 0 || lon == 0) {
return new GeoParsedPoint(queryStr.replace("+", " ").replace("/|,", " "));
return new GeoParsedPoint(queryStr);
}
} else {
return new GeoParsedPoint(queryStr.replace("+", " ").replace("/|,", " "));
return new GeoParsedPoint(queryStr);
}
}
}