Changeset 33626 in osm for applications/editors/josm/plugins/wikipedia/src
- Timestamp:
- 2017-09-18T06:27:29+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia/src/org/wikipedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikosmDownloadSource.java
r33624 r33626 221 221 * is not restricted to bbox. 222 222 */ 223 if (!settings.getDownloadBounds().isPresent() && query.contains("{{bbox}}")) { 223 if (!settings.getDownloadBounds().isPresent() && ( 224 query.contains("{{boxParams}}") || 225 query.contains("{{center}}") 226 )) { 224 227 JOptionPane.showMessageDialog( 225 228 this.getParent(), -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/io/WikosmDownloadReader.java
r33624 r33626 88 88 protected String getRequestForBbox(double lon1, double lat1, double lon2, double lat2) { 89 89 final String query = this.wikosmQuery 90 .replace("{{boxParams}}", b box(lon1, lat1, lon2, lat2))90 .replace("{{boxParams}}", boxParams(lon1, lat1, lon2, lat2)) 91 91 .replace("{{center}}", center(lon1, lat1, lon2, lat2)); 92 92 return DATA_PREFIX + Utils.encodeUrl(query); 93 93 } 94 94 95 p rivatestatic String bbox(double lon1, double lat1, double lon2, double lat2) {96 return "\nbd:serviceParam wikibase:cornerWest " + point(lon1, lat1) + "." + 95 public static String boxParams(double lon1, double lat1, double lon2, double lat2) { 96 return "\nbd:serviceParam wikibase:cornerWest " + point(lon1, lat1) + ".\n" + 97 97 "bd:serviceParam wikibase:cornerEast " + point(lon2, lat2) + ".\n"; 98 98 } 99 99 100 p rivatestatic String center(double lon1, double lat1, double lon2, double lat2) {100 public static String center(double lon1, double lat1, double lon2, double lat2) { 101 101 LatLon c = new BBox(lon1, lat1, lon2, lat2).getCenter(); 102 102 return point(c.lon(), c.lat()); 103 103 } 104 104 105 p rivatestatic String point(double lon, double lat) {106 return " Point(\"" + lon + " " + lat + "\")^^geo:wktLiteral";105 public static String point(double lon, double lat) { 106 return "\"Point(" + lon + " " + lat + ")\"^^geo:wktLiteral"; 107 107 } 108 108 … … 266 266 267 267 // add bounds if necessary (note that Wikosm API does not return bounds in the response XML) 268 if (ds != null && ds.getDataSources().isEmpty() && wikosmQuery.contains("{{b box}}")) {268 if (ds != null && ds.getDataSources().isEmpty() && wikosmQuery.contains("{{boxParams}}")) { 269 269 if (crosses180th) { 270 270 Bounds bounds = new Bounds(lat1, lon1, lat2, 180.0);
Note:
See TracChangeset
for help on using the changeset viewer.