Skip to content

Commit

Permalink
Fix JOSM-20753 -- fallout from JOSM r17752
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Apr 13, 2021
1 parent f528c87 commit b2b22a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void visit(Way way) {
* @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()
Expand All @@ -83,7 +83,7 @@ public static List<IPrimitive> getNearbyAddresses(Way way) {
* @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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static Collection<String> getWayNames(Collection<Way> ways) {
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
Expand Down

0 comments on commit b2b22a7

Please sign in to comment.