Don't update prod when JOSM version is unknown.

Also, modify address test to not consider items outside of the download
area, and expand the bbox

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-04-02 11:21:46 -06:00
rodzic cdd6915588
commit 680b1433bc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
3 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -28,7 +28,8 @@ public final class UpdateProd {
* @return {@code true} if an update is needed
*/
public static boolean doProd(int nextMinVersion) {
if (nextMinVersion > Version.getInstance().getVersion()) {
if (nextMinVersion > Version.getInstance().getVersion()
&& Version.getInstance().getVersion() != Version.JOSM_UNKNOWN_VERSION) {
int doUpdate = ConditionalOptionPaneUtil.showOptionDialog(
MapWithAIPlugin.NAME.concat(".ignore_next_version"), MainApplication.getMainFrame(),
tr("Please update JOSM -- {0} {1} is the last {0} version to support JOSM {2}",

Wyświetl plik

@ -31,7 +31,6 @@ import org.openstreetmap.josm.data.StructUtils.StructEntry;
import org.openstreetmap.josm.data.imagery.ImageryInfo;
import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
import org.openstreetmap.josm.data.imagery.Shape;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAIPreferenceEntry;
import org.openstreetmap.josm.spi.preferences.Config;
import org.openstreetmap.josm.tools.CheckParameterUtil;
import org.openstreetmap.josm.tools.ImageProvider;

Wyświetl plik

@ -32,7 +32,7 @@ import org.openstreetmap.josm.tools.Pair;
public class StreetAddressTest extends Test {
/** Standard bbox expansion */
public static final double BBOX_EXPANSION = 0.001;
public static final double BBOX_EXPANSION = 0.002;
private static final String ADDR_STREET = "addr:street";
private final Set<OsmPrimitive> namePrimitiveMap = new HashSet<>();
/**
@ -80,7 +80,7 @@ public class StreetAddressTest extends Test {
}
public void realVisit(OsmPrimitive primitive) {
if (primitive.isUsable() && hasStreetAddressTags(primitive)) {
if (primitive.isUsable() && hasStreetAddressTags(primitive) && !primitive.isOutsideDownloadArea()) {
Collection<Way> surroundingWays = getSurroundingHighways(primitive);
Collection<String> names = getWayNames(surroundingWays);
if (!names.contains(primitive.get(ADDR_STREET))) {
@ -90,9 +90,9 @@ public class StreetAddressTest extends Test {
}
public static Collection<String> getWayNames(Collection<Way> ways) {
return ways.parallelStream().flatMap(w -> w.getInterestingTags().entrySet().parallelStream())
.filter(e -> e.getKey().contains("name") && !e.getKey().contains("tiger")).map(Map.Entry::getValue)
.collect(Collectors.toSet());
return ways.parallelStream().flatMap(w -> w.getInterestingTags().entrySet().parallelStream()).filter(
e -> (e.getKey().contains("name") || e.getKey().contains("ref")) && !e.getKey().contains("tiger"))
.map(Map.Entry::getValue).collect(Collectors.toSet());
}
public static Collection<Way> getSurroundingHighways(OsmPrimitive address) {