Class CooperativeChallengeOperation

  • Direct Known Subclasses:
    GeometryChangeOperation, TagChangeOperation

    public abstract class CooperativeChallengeOperation
    extends java.lang.Object
    This represents an operation that is embedded in a cooperative challenge. Example: Given a FeatureCollection geojson uploaded to MapRoulette:
    For Tag changes:
     {
       "type": "FeatureCollection",
       "features": [ ... ],            // omitted for readability
       "cooperativeWork": {            // special `cooperativeWork` property
         "meta": {
           "version": 2,               // must be format version `2`
           "type": 1                   // `1` for tag fix type
         },
         "operations": [               // Operations section (see below)
           ...
         ]
       }
     }
     
    For geometry changes:
     {
       "type": "FeatureCollection",
       "features": [ ... ],            // omitted for readability
       "cooperativeWork": {            // special `cooperativeWork` property
         "meta": {
           "version": 2,               // must be format version `2`
           "type": 2                   // `2` for change file type
         },
         "file": {                     // Operations section (see below)
           "type": "xml",              // only xml is supported at this time
           "format": "osc",            // only osc is supported at this time
           "encoding": "base64",       // only base64 is supported at this time
           "content": "..."            // The base64 encoded OSC file
         }
       }
     }
     
    This class is an abstract representation of the json material to be found under "operations". Its subclasses should handle the various ChangeDescriptor types, including GeometryChangeDescriptor, LongElementChangeDescriptor, RelationMemberChangeDescriptor, TagChangeDescriptor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String DATA_KEY  
      protected static java.lang.String ID_KEY  
      protected static java.lang.String OPERATION_KEY  
      protected static java.lang.String OPERATION_TYPE_KEY  
      protected static java.lang.String OPERATIONS_KEY  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CooperativeChallengeOperation​(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)  
    • Constructor Detail

      • CooperativeChallengeOperation

        protected CooperativeChallengeOperation​(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)
    • Method Detail

      • getAppropriateChangeOperation

        public static java.lang.Class<? extends CooperativeChallengeOperation> getAppropriateChangeOperation​(org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescription changeDescription)
        Get the appropriate change operation class
        Parameters:
        changeDescription - The change descriptor
        Returns:
        A class appropriate for the change descriptor
      • getJson

        public com.google.gson.JsonObject getJson()
      • getChangeDescriptorList

        protected java.util.List<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor> getChangeDescriptorList()
      • getIdentifier

        protected java.lang.String getIdentifier()
      • getOperationType

        protected org.openstreetmap.atlas.geography.atlas.change.description.ChangeDescriptorType getOperationType()
      • operationFilter

        protected abstract java.util.function.Predicate<org.openstreetmap.atlas.geography.atlas.change.description.descriptors.ChangeDescriptor> operationFilter()
      • setJson

        protected void setJson​(com.google.gson.JsonObject json)