Class AtlasChecksGeoJSONDiffSubCommand

  • All Implemented Interfaces:
    org.openstreetmap.atlas.utilities.runtime.FlexibleSubCommand

    public class AtlasChecksGeoJSONDiffSubCommand
    extends JSONFlagDiffSubCommand
    Takes 2 sets of atlas-checks geoJSON flag files and reports the number of additions, subtractions, and changed flags from source to target. Optionally, the reported items can be written to new geoJSON files. Additions and subtractions are based on flag ids. Changes are calculated by differences in the Atlas ids of objects in a flag.
    • Constructor Detail

      • AtlasChecksGeoJSONDiffSubCommand

        public AtlasChecksGeoJSONDiffSubCommand()
    • Method Detail

      • mapFeatures

        protected void mapFeatures​(org.openstreetmap.atlas.streaming.resource.File file,
                                   java.util.HashMap map)
        Description copied from class: JSONFlagDiffSubCommand
        Parses an atlas-checks flag file and maps each flag to its id.
        Overrides:
        mapFeatures in class JSONFlagDiffSubCommand
        Parameters:
        file - File containing the flags
        map - HashMap to store the mapped flags
      • identicalFeatureIds

        protected boolean identicalFeatureIds​(com.google.gson.JsonArray sourceArray,
                                              com.google.gson.JsonArray targetArray)
        Description copied from class: JSONFlagDiffSubCommand
        Helper function for getMissingAndChanged to check for changes in Atlas ids.
        Overrides:
        identicalFeatureIds in class JSONFlagDiffSubCommand
        Parameters:
        sourceArray - feature JsonArray to check from
        targetArray - feature JsonArray to check to
        Returns:
        true if all Atlas ids in source are present in target, and visa versa
      • writeSetToGeoJSON

        protected void writeSetToGeoJSON​(java.util.Set<com.google.gson.JsonObject> flags,
                                         org.openstreetmap.atlas.streaming.resource.File output)
        Description copied from class: JSONFlagDiffSubCommand
        Writes a Set of geoJSON atlas-checks flags to a file.
        Overrides:
        writeSetToGeoJSON in class JSONFlagDiffSubCommand
        Parameters:
        flags - Set of JsonObjects representing geoJSON flags
        output - File to output to