Ticket #9024: bboxplugins.diff
File bboxplugins.diff, 12.1 KB (added by , 11 years ago) |
---|
-
buildings_tools/src/buildings_tools/Building.java
205 205 private Node findNode(EastNorth en) { 206 206 DataSet ds = Main.main.getCurrentDataSet(); 207 207 LatLon l = eastNorth2latlon(en); 208 List<Node> nodes = ds.searchNodes(new BBox(l.lon() - 0.0000001, l.lat() - 0.0000001, 209 l.lon() + 0.0000001, l.lat() + 0.0000001)); 208 List<Node> nodes = ds.searchNodes(l.toBBox(0.0000001)); 210 209 Node bestnode = null; 211 210 double mindist = 0.0003; 212 211 for (Node n : nodes) { -
gpxfilter/src/gpxfilter/GpxGrabber.java
26 26 private int page; 27 27 28 28 public GpxGrabber(Bounds downloadArea) { 29 this.lat1 = downloadArea.getMin ().lat();30 this.lon1 = downloadArea.getMin ().lon();31 this.lat2 = downloadArea.getMax ().lat();32 this.lon2 = downloadArea.getMax ().lon();29 this.lat1 = downloadArea.getMinLat(); 30 this.lon1 = downloadArea.getMinLon(); 31 this.lat2 = downloadArea.getMaxLat(); 32 this.lon2 = downloadArea.getMaxLon(); 33 33 34 34 page = 0; 35 35 } -
imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java
262 262 protected static final String getBounds(OsmPrimitive p, boolean closeTag) { 263 263 BBox bbox = p.getBBox(); 264 264 String result = " <bounds "; 265 result += "min-lat='"+df.format(bbox.getBottomRight ().lat())+"' ";266 result += "min-lon='"+df.format(bbox.getTopLeft ().lon())+"' ";267 result += "max-lat='"+df.format(bbox.getTopLeft ().lat())+"' ";268 result += "max-lon='"+df.format(bbox.getBottomRight ().lon())+"'";265 result += "min-lat='"+df.format(bbox.getBottomRightLat())+"' "; 266 result += "min-lon='"+df.format(bbox.getTopLeftLon())+"' "; 267 result += "max-lat='"+df.format(bbox.getTopLeftLat())+"' "; 268 result += "max-lon='"+df.format(bbox.getBottomRightLon())+"'"; 269 269 result += closeTag ? " />" : ">\n"; 270 270 return result; 271 271 } … … 323 323 } 324 324 325 325 return latMap.size() == 2 && lonMap.size() == 2 326 && latMap.containsKey(bBox.getBottomRight ().lat()) && latMap.containsKey(bBox.getTopLeft().lat())327 && lonMap.containsKey(bBox.getBottomRight ().lon()) && lonMap.containsKey(bBox.getTopLeft().lon());326 && latMap.containsKey(bBox.getBottomRightLat()) && latMap.containsKey(bBox.getTopLeftLat()) 327 && lonMap.containsKey(bBox.getBottomRightLon()) && lonMap.containsKey(bBox.getTopLeftLon()); 328 328 } 329 329 return false; 330 330 } -
imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java
24 24 import org.openstreetmap.josm.data.imagery.Shape; 25 25 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds; 26 26 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 27 import org.openstreetmap.josm.data.osm.BBox;28 27 import org.openstreetmap.josm.data.osm.DataSet; 29 28 import org.openstreetmap.josm.data.osm.Node; 30 29 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 76 75 } 77 76 78 77 private static Node getNode(LatLon latlon, DataSet dataSet) { 79 List<Node> nodes = dataSet.searchNodes( new BBox(latlon, latlon));78 List<Node> nodes = dataSet.searchNodes(latlon.toBBox()); 80 79 if (!nodes.isEmpty()) { 81 80 return nodes.get(0); 82 81 } else { -
mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
520 520 MapView mapView = Main.map.mapView; 521 521 Bounds bounds = new Bounds(mapView.getLatLon(0, mapView.getHeight()), 522 522 mapView.getLatLon(mapView.getWidth(), 0)); 523 return new BoundingBox(bounds.getMin ().lon(), bounds.getMin().lat(),524 bounds.getMax ().lon(), bounds.getMax().lat());523 return new BoundingBox(bounds.getMinLon(), bounds.getMinLat(), 524 bounds.getMaxLon(), bounds.getMaxLat()); 525 525 } 526 526 527 527 /** -
opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java
265 265 266 266 public final Collection<String> getOsmXapiRequests(Bounds bounds) { 267 267 return getOsmXapiRequests( 268 LatLon.roundToOsmPrecisionStrict(bounds.getMin ().lon())+","+269 LatLon.roundToOsmPrecisionStrict(bounds.getMin ().lat())+","+270 LatLon.roundToOsmPrecisionStrict(bounds.getMax ().lon())+","+271 LatLon.roundToOsmPrecisionStrict(bounds.getMax ().lat()));268 LatLon.roundToOsmPrecisionStrict(bounds.getMinLon())+","+ 269 LatLon.roundToOsmPrecisionStrict(bounds.getMinLat())+","+ 270 LatLon.roundToOsmPrecisionStrict(bounds.getMaxLon())+","+ 271 LatLon.roundToOsmPrecisionStrict(bounds.getMaxLat())); 272 272 } 273 273 274 274 protected Collection<String> getOsmXapiRequests(String bbox) {return null;} 275 275 276 276 public final String getOverpassApiRequest(Bounds bounds) { 277 277 return getOverpassApiRequest( 278 "w=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMin ().lon())+"\" "+279 "s=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMin ().lat())+"\" "+280 "e=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMax ().lon())+"\" "+281 "n=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMax ().lat())+"\"");278 "w=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMinLon())+"\" "+ 279 "s=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMinLat())+"\" "+ 280 "e=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMaxLon())+"\" "+ 281 "n=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMaxLat())+"\""); 282 282 } 283 283 284 284 -
openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java
56 56 57 57 // add query params to the uri 58 58 StringBuilder sb = new StringBuilder(uri) 59 .append("?b=").append(bounds.getMin ().lat())60 .append("&t=").append(bounds.getMax ().lat())61 .append("&l=").append(bounds.getMin ().lon())62 .append("&r=").append(bounds.getMax ().lon());59 .append("?b=").append(bounds.getMinLat()) 60 .append("&t=").append(bounds.getMaxLat()) 61 .append("&l=").append(bounds.getMinLon()) 62 .append("&r=").append(bounds.getMaxLon()); 63 63 uri = sb.toString(); 64 64 65 65 // download the data -
osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
192 192 193 193 private void writeGenerated(Bounds b) throws IOException { 194 194 String bounds_tag = "<bounds " + 195 "minlat=\"" + b.getMin ().lat() + "\" " +196 "maxlat=\"" + b.getMax ().lat() + "\" " +197 "minlon=\"" + b.getMin ().lon() + "\" " +198 "maxlon=\"" + b.getMax ().lon() + "\" " + "/>";195 "minlat=\"" + b.getMinLat() + "\" " + 196 "maxlat=\"" + b.getMaxLat() + "\" " + 197 "minlon=\"" + b.getMinLon() + "\" " + 198 "maxlon=\"" + b.getMaxLon() + "\" " + "/>"; 199 199 200 200 BufferedReader reader = new BufferedReader( 201 201 new FileReader( getPluginDir() + File.separator + "osm-map-features.xml") ); -
tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java
44 44 System.out.println("-------"); 45 45 System.out.println("Node: " + n); 46 46 LatLon ll = n.getCoor(); 47 BBox bbox = new BBox( 48 ll.getX() - MIN_DISTANCE, 49 ll.getY() - MIN_DISTANCE, 50 ll.getX() + MIN_DISTANCE, 51 ll.getY() + MIN_DISTANCE); 47 BBox bbox = ll.toBBox(MIN_DISTANCE); 52 48 53 49 // bude se node slucovat s jinym? 54 50 double minDistanceSq = MIN_DISTANCE; … … 124 120 throws IllegalStateException, IndexOutOfBoundsException { 125 121 126 122 LatLon ll = node.getCoor(); 127 BBox bbox = new BBox( 128 ll.getX() - MIN_DISTANCE_TW, 129 ll.getY() - MIN_DISTANCE_TW, 130 ll.getX() + MIN_DISTANCE_TW, 131 ll.getY() + MIN_DISTANCE_TW); 123 BBox bbox = ll.toBBox(MIN_DISTANCE_TW); 132 124 133 125 // node nebyl slouceny s jinym 134 126 // hledani pripadne blizke usecky, kam bod pridat -
walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java
255 255 if (!key.valid) continue; 256 256 if (tile == null) { 257 257 // check if tile is in range 258 Bounds tileBounds = new Bounds( new LatLon(tileYToLat(y+1), tileXToLon(x)),259 new LatLon(tileYToLat(y), tileXToLon(x+1)));258 Bounds tileBounds = new Bounds(tileYToLat(y+1), tileXToLon(x), 259 tileYToLat(y), tileXToLon(x+1)); 260 260 if (!tileBounds.asRect().intersects(printBounds.asRect())) continue; 261 261 tile = new WalkingPapersTile(x, y, currentZoomLevel, this); 262 262 tileStorage.put(key, tile); -
waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java
265 265 */ 266 266 private Node findDuplicateNode(Node referenceNode) { 267 267 DataSet ds = Main.main.getCurrentDataSet(); 268 List<Node> candidates = ds.searchNodes(new B Box(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005)));268 List<Node> candidates = ds.searchNodes(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005).toBBox()); 269 269 for (Node candidate: candidates) { 270 270 if (!candidate.equals(referenceNode) 271 271 && !candidate.isIncomplete()