kopia lustrzana https://github.com/JOSM/MapWithAI
Fix JOSM-20753 -- fallout from JOSM r17752
Signed-off-by: Taylor Smock <tsmock@fb.com>pull/1/head v1.7.1.5
rodzic
f528c871a3
commit
b2b22a700d
|
@ -64,7 +64,7 @@ public class StreetAddressOrder extends Test {
|
||||||
* @return The primitives that have appropriate addr tags near to the way
|
* @return The primitives that have appropriate addr tags near to the way
|
||||||
*/
|
*/
|
||||||
public static List<IPrimitive> getNearbyAddresses(Way 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()
|
List<Node> addrNodes = way.getDataSet().searchNodes(bbox).parallelStream()
|
||||||
.filter(StreetAddressTest::hasStreetAddressTags).collect(Collectors.toList());
|
.filter(StreetAddressTest::hasStreetAddressTags).collect(Collectors.toList());
|
||||||
List<Way> addrWays = way.getDataSet().searchWays(bbox).parallelStream()
|
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
|
* @return {@code true} if the primitive is the nearest way
|
||||||
*/
|
*/
|
||||||
public static boolean isNearestRoad(Way way, OsmPrimitive prim) {
|
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()
|
List<Pair<Way, Double>> sorted = way.getDataSet().searchWays(primBBox).parallelStream()
|
||||||
.filter(StreetAddressTest::isHighway).map(iway -> StreetAddressTest.distanceToWay(iway, prim))
|
.filter(StreetAddressTest::isHighway).map(iway -> StreetAddressTest.distanceToWay(iway, prim))
|
||||||
.sorted(Comparator.comparing(p -> p.b)).collect(Collectors.toList());
|
.sorted(Comparator.comparing(p -> p.b)).collect(Collectors.toList());
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class StreetAddressTest extends Test {
|
||||||
public static Collection<Way> getSurroundingHighways(OsmPrimitive address) {
|
public static Collection<Way> getSurroundingHighways(OsmPrimitive address) {
|
||||||
Objects.requireNonNull(address.getDataSet(), "Node must be part of a dataset");
|
Objects.requireNonNull(address.getDataSet(), "Node must be part of a dataset");
|
||||||
DataSet ds = address.getDataSet();
|
DataSet ds = address.getDataSet();
|
||||||
BBox addrBox = expandBBox(address.getBBox(), BBOX_EXPANSION);
|
BBox addrBox = expandBBox(new BBox(address.getBBox()), BBOX_EXPANSION);
|
||||||
int expansions = 0;
|
int expansions = 0;
|
||||||
int maxExpansions = Config.getPref().getInt("mapwithai.validator.streetaddresstest.maxexpansions", 20);
|
int maxExpansions = Config.getPref().getInt("mapwithai.validator.streetaddresstest.maxexpansions", 20);
|
||||||
while (ds.searchWays(addrBox).parallelStream().filter(StreetAddressTest::isHighway).count() == 0
|
while (ds.searchWays(addrBox).parallelStream().filter(StreetAddressTest::isHighway).count() == 0
|
||||||
|
|
Ładowanie…
Reference in New Issue