Changeset 12161 in josm for trunk/src/org/openstreetmap/josm/data/osm/BBox.java
- Timestamp:
- 2017-05-15T15:43:30+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r11452 r12161 7 7 8 8 import org.openstreetmap.josm.data.Bounds; 9 import org.openstreetmap.josm.data.coor.ILatLon; 9 10 import org.openstreetmap.josm.data.coor.LatLon; 10 11 import org.openstreetmap.josm.data.coor.QuadTiling; … … 85 86 */ 86 87 public BBox(Way w) { 87 w.getNodes().forEach( n -> add(n.getCoor()));88 w.getNodes().forEach(this::add); 88 89 } 89 90 … … 93 94 */ 94 95 public BBox(Node n) { 95 if (n.isLatLonKnown()) { 96 add(n.getCoor()); 97 } 96 this((ILatLon) n); 97 } 98 99 /** 100 * Create BBox for a given latlon. An invalid BBox is returned if the coordinates are not known. 101 * @param ll The lat lon position 102 */ 103 public BBox(ILatLon ll) { 104 add(ll); 105 } 106 107 /** 108 * Add a point to an existing BBox. Extends this bbox if necessary so that this.bounds(c) will return true 109 * if c is a valid LatLon instance. 110 * Kept for binary compatibility 111 * @param c a LatLon point 112 */ 113 public final void add(LatLon c) { 114 add((ILatLon) c); 98 115 } 99 116 … … 103 120 * @param c a LatLon point 104 121 */ 105 public final void add(LatLon c) { 106 if (c != null && c.isValid()) { 107 add(c.lon(), c.lat()); 108 } 122 public final void add(ILatLon c) { 123 add(c.lon(), c.lat()); 109 124 } 110 125
Note:
See TracChangeset
for help on using the changeset viewer.