kopia lustrzana https://github.com/JOSM/MapWithAI
Don't throw warning if the conflation key should be in OSM
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
d05eca89d8
commit
a2bde9603d
|
@ -138,4 +138,10 @@ public abstract class AbstractConflationCommand extends Command {
|
||||||
* undo/redo lists
|
* undo/redo lists
|
||||||
*/
|
*/
|
||||||
public abstract boolean allowUndo();
|
public abstract boolean allowUndo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if the key should not exist in OpenStreetMap
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public abstract boolean keyShouldNotExistInOSM();
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,4 +99,9 @@ public class ConnectedCommand extends AbstractConflationCommand {
|
||||||
public boolean allowUndo() {
|
public boolean allowUndo() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyShouldNotExistInOSM() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,4 +109,9 @@ public class DuplicateCommand extends AbstractConflationCommand {
|
||||||
public boolean allowUndo() {
|
public boolean allowUndo() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyShouldNotExistInOSM() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,4 +111,9 @@ public class MergeAddressBuildings extends AbstractConflationCommand {
|
||||||
public boolean allowUndo() {
|
public boolean allowUndo() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyShouldNotExistInOSM() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,4 +131,9 @@ public class MergeBuildingAddress extends AbstractConflationCommand {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyShouldNotExistInOSM() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.openstreetmap.josm.data.validation.Severity;
|
||||||
import org.openstreetmap.josm.data.validation.Test;
|
import org.openstreetmap.josm.data.validation.Test;
|
||||||
import org.openstreetmap.josm.data.validation.TestError;
|
import org.openstreetmap.josm.data.validation.TestError;
|
||||||
import org.openstreetmap.josm.gui.progress.ProgressMonitor;
|
import org.openstreetmap.josm.gui.progress.ProgressMonitor;
|
||||||
|
import org.openstreetmap.josm.plugins.mapwithai.backend.commands.conflation.AbstractConflationCommand;
|
||||||
import org.openstreetmap.josm.plugins.mapwithai.commands.CreateConnectionsCommand;
|
import org.openstreetmap.josm.plugins.mapwithai.commands.CreateConnectionsCommand;
|
||||||
import org.openstreetmap.josm.tools.Logging;
|
import org.openstreetmap.josm.tools.Logging;
|
||||||
|
|
||||||
|
@ -44,7 +45,10 @@ public class ConnectingNodeInformationTest extends Test {
|
||||||
badTags = new HashMap<>();
|
badTags = new HashMap<>();
|
||||||
CreateConnectionsCommand.getConflationCommands().forEach(clazz -> {
|
CreateConnectionsCommand.getConflationCommands().forEach(clazz -> {
|
||||||
try {
|
try {
|
||||||
badTags.put(clazz.getConstructor(DataSet.class).newInstance(new DataSet()).getKey(), null);
|
AbstractConflationCommand command = clazz.getConstructor(DataSet.class).newInstance(new DataSet());
|
||||||
|
if (command.keyShouldNotExistInOSM()) {
|
||||||
|
badTags.put(command.getKey(), null);
|
||||||
|
}
|
||||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||||
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||||
Logging.error(e);
|
Logging.error(e);
|
||||||
|
|
Ładowanie…
Reference in New Issue