Class AtlasChecksLogDiffSubCommand
- java.lang.Object
-
- org.openstreetmap.atlas.checks.commands.JSONFlagDiffSubCommand
-
- org.openstreetmap.atlas.checks.commands.AtlasChecksLogDiffSubCommand
-
- All Implemented Interfaces:
org.openstreetmap.atlas.utilities.runtime.FlexibleSubCommand
public class AtlasChecksLogDiffSubCommand extends JSONFlagDiffSubCommand
Takes 2 sets of atlas-checks log files and reports the number of additions, subtractions, and changed flags from source to target. Optionally, the reported items can be written to new log files. Additions and subtractions are based on flag ids. Changes are calculated by differences in the Atlas ids of objects in a flag.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.atlas.checks.commands.JSONFlagDiffSubCommand
JSONFlagDiffSubCommand.DiffReturn, JSONFlagDiffSubCommand.JSONFlagDiff
-
-
Constructor Summary
Constructors Constructor Description AtlasChecksLogDiffSubCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JSONFlagDiffSubCommand.JSONFlagDiffgetDiff(java.util.HashMap source, java.util.HashMap target, JSONFlagDiffSubCommand.DiffReturn returnType)Takes twoHashMaps containing atlas-checks flags mapped by id.protected intgetSourceSize()A getter for the number of flags inJSONFlagDiffSubCommand.sourceprotected booleanidenticalFeatureIds(com.google.gson.JsonArray sourceArray, com.google.gson.JsonArray targetArray)Helper function forgetMissingAndChangedto check for changes in Atlas ids.protected voidmapFeatures(org.openstreetmap.atlas.streaming.resource.File file, java.util.HashMap map)Parses an atlas-checks flag file and maps each flag to its id.-
Methods inherited from class org.openstreetmap.atlas.checks.commands.JSONFlagDiffSubCommand
execute, getDescription, getGson, getName, getSource, getTarget, switches, usage, writeSetToGeoJSON
-
-
-
-
Method Detail
-
mapFeatures
protected void mapFeatures(org.openstreetmap.atlas.streaming.resource.File file, java.util.HashMap map)Description copied from class:JSONFlagDiffSubCommandParses an atlas-checks flag file and maps each flag to its id.- Overrides:
mapFeaturesin classJSONFlagDiffSubCommand- Parameters:
file-Filecontaining the flagsmap-HashMapto store the mapped flags
-
getDiff
protected JSONFlagDiffSubCommand.JSONFlagDiff getDiff(java.util.HashMap source, java.util.HashMap target, JSONFlagDiffSubCommand.DiffReturn returnType)
Description copied from class:JSONFlagDiffSubCommandTakes twoHashMaps containing atlas-checks flags mapped by id. Finds missing elements in the target based on keys. Optionally computes changes in the AtlasObject ids found in each flag.- Overrides:
getDiffin classJSONFlagDiffSubCommand- Parameters:
source-HashMapof the flags to compare fromtarget-HashMapof the flags to compare toreturnType-JSONFlagDiffSubCommand.DiffReturn; If this isCHANGEDthechangedattribute of the returnedJSONFlagDiffSubCommand.JSONFlagDiffwill be populated.- Returns:
- an
JSONFlagDiffSubCommand.JSONFlagDiff
-
identicalFeatureIds
protected boolean identicalFeatureIds(com.google.gson.JsonArray sourceArray, com.google.gson.JsonArray targetArray)Description copied from class:JSONFlagDiffSubCommandHelper function forgetMissingAndChangedto check for changes in Atlas ids.- Overrides:
identicalFeatureIdsin classJSONFlagDiffSubCommand- Parameters:
sourceArray-featureJsonArrayto check fromtargetArray-featureJsonArrayto check to- Returns:
- true if all Atlas ids in
sourceare present intarget, and visa versa
-
getSourceSize
protected int getSourceSize()
Description copied from class:JSONFlagDiffSubCommandA getter for the number of flags inJSONFlagDiffSubCommand.source- Overrides:
getSourceSizein classJSONFlagDiffSubCommand- Returns:
int
-
-