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
|
||||
*/
|
||||
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() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyShouldNotExistInOSM() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,4 +109,9 @@ public class DuplicateCommand extends AbstractConflationCommand {
|
|||
public boolean allowUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyShouldNotExistInOSM() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,4 +111,9 @@ public class MergeAddressBuildings extends AbstractConflationCommand {
|
|||
public boolean allowUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyShouldNotExistInOSM() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,4 +131,9 @@ public class MergeBuildingAddress extends AbstractConflationCommand {
|
|||
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.TestError;
|
||||
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.tools.Logging;
|
||||
|
||||
|
@ -44,7 +45,10 @@ public class ConnectingNodeInformationTest extends Test {
|
|||
badTags = new HashMap<>();
|
||||
CreateConnectionsCommand.getConflationCommands().forEach(clazz -> {
|
||||
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
|
||||
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||
Logging.error(e);
|
||||
|
|
Ładowanie…
Reference in New Issue