Fix JOSM-20753 -- fallout from JOSM r17752

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head v1.7.1.5
Taylor Smock 2021-04-13 08:01:45 -06:00
rodzic f528c871a3
commit b2b22a700d
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -64,7 +64,7 @@ public class StreetAddressOrder extends Test {
* @return The primitives that have appropriate addr tags near to the way
*/
public static List<IPrimitive> getNearbyAddresses(Way way) {
BBox bbox = StreetAddressTest.expandBBox(way.getBBox(), StreetAddressTest.BBOX_EXPANSION);
BBox bbox = StreetAddressTest.expandBBox(new BBox(way.getBBox()), StreetAddressTest.BBOX_EXPANSION);
List<Node> addrNodes = way.getDataSet().searchNodes(bbox).parallelStream()
.filter(StreetAddressTest::hasStreetAddressTags).collect(Collectors.toList());
List<Way> addrWays = way.getDataSet().searchWays(bbox).parallelStream()
@ -83,7 +83,7 @@ public class StreetAddressOrder extends Test {
* @return {@code true} if the primitive is the nearest way
*/
public static boolean isNearestRoad(Way way, OsmPrimitive prim) {
BBox primBBox = StreetAddressTest.expandBBox(prim.getBBox(), StreetAddressTest.BBOX_EXPANSION);
BBox primBBox = StreetAddressTest.expandBBox(new BBox(prim.getBBox()), StreetAddressTest.BBOX_EXPANSION);
List<Pair<Way, Double>> sorted = way.getDataSet().searchWays(primBBox).parallelStream()
.filter(StreetAddressTest::isHighway).map(iway -> StreetAddressTest.distanceToWay(iway, prim))
.sorted(Comparator.comparing(p -> p.b)).collect(Collectors.toList());

Wyświetl plik

@ -101,7 +101,7 @@ public class StreetAddressTest extends Test {
public static Collection<Way> getSurroundingHighways(OsmPrimitive address) {
Objects.requireNonNull(address.getDataSet(), "Node must be part of a dataset");
DataSet ds = address.getDataSet();
BBox addrBox = expandBBox(address.getBBox(), BBOX_EXPANSION);
BBox addrBox = expandBBox(new BBox(address.getBBox()), BBOX_EXPANSION);
int expansions = 0;
int maxExpansions = Config.getPref().getInt("mapwithai.validator.streetaddresstest.maxexpansions", 20);
while (ds.searchWays(addrBox).parallelStream().filter(StreetAddressTest::isHighway).count() == 0