|
16 | 16 | import java.util.ArrayList; |
17 | 17 | import java.util.Collections; |
18 | 18 | import java.util.List; |
| 19 | +import java.util.Locale; |
19 | 20 | import java.util.regex.Matcher; |
20 | 21 | import java.util.regex.Pattern; |
21 | 22 |
|
@@ -101,12 +102,12 @@ private List<Place> getFromWikidataQuery(LatLng cur, String lang, double radius) |
101 | 102 | throws IOException { |
102 | 103 | List<Place> places = new ArrayList<>(); |
103 | 104 | String query = WIKIDATA_QUERY_TEMPLATE.replace("${RADIUS}", "" + radius) |
104 | | - .replace("${LAT}", "" + String.format("%.3f", cur.latitude)) |
105 | | - .replace("${LONG}", "" + String.format("%.3f", cur.longitude)) |
| 105 | + .replace("${LAT}", "" + String.format(Locale.ROOT, "%.3f", cur.latitude)) |
| 106 | + .replace("${LONG}", "" + String.format(Locale.ROOT, "%.3f", cur.longitude)) |
106 | 107 | .replace("${LANG}", "" + lang); |
107 | 108 | query = URLEncoder.encode(query, "utf-8").replace("+", "%20"); |
108 | 109 | String url = WIKIDATA_QUERY_URL.replace("${QUERY}", query); |
109 | | - Log.d(TAG, url.toString()); |
| 110 | + Log.d(TAG, url); |
110 | 111 | URLConnection conn = new URL(url).openConnection(); |
111 | 112 | conn.setRequestProperty("Accept", "text/tab-separated-values"); |
112 | 113 | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); |
|
0 commit comments