Ticket #13361: 13361_v1.patch
| File 13361_v1.patch, 1.9 KB (added by , 10 years ago) |
|---|
-
org/openstreetmap/josm/data/osm/BBox.java
290 290 LatLon.cDdFormatter.format(xmax), 291 291 LatLon.cDdFormatter.format(ymax))); 292 292 } 293 294 /** 295 * @return true if the bbox covers a part of the planets surface 296 * Height and width must be non-negative, but may (both) be 0. 297 */ 298 public boolean isValid() { 299 if (xmin > xmax || ymin > ymax) 300 return false; 301 if (xmin < -180.0 || xmax > 180.0 || ymin < -90.0 || ymax > 90.0) 302 return false; 303 return true; 304 } 293 305 } -
org/openstreetmap/josm/data/osm/Relation.java
455 455 else { 456 456 BBox result = null; 457 457 for (RelationMember rm:members) { 458 BBox box = rm.isRelation() ? rm.getRelation().calculateBBox(visitedRelations) : rm.getMember().getBBox(); 458 BBox box = null; 459 if (rm.isRelation()) 460 box = rm.getRelation().calculateBBox(visitedRelations); 461 else if (rm.isWay()) { 462 box = rm.getWay().getBBox(); 463 if (!box.isValid()) 464 box = null; 465 } else if (rm.isNode()) { 466 Node n = rm.getNode(); 467 if (n.getCoor() != null) 468 box = n.getBBox(); 469 } 459 470 if (box != null) { 460 471 if (result == null) { 461 472 result = box;
