Skip to content

Data Management

Anita Hapsari edited this page Jul 25, 2017 · 8 revisions

Data Management

Field campaigner is not using database for it's data, instead using file to save data. All of data is saved in three different folder, which are:

  • campaign : it will contains campaign that created in field campaigner website.
  • coverage : it will contains AOI of campaign in geojson format that generated from field campaigner website.
  • surveys : it will contains surveys that used for default setup of type when create/edit campaign. These three folder is needed and make sure these are under same folder.

Deployment Setup

Field campaigner can use any folder for it's data, unless those folders above are presented. But officially, we have repo that can used by others. Here is the repo:

https://github.com/hotosm/field-campaigner-data

For setup, check in here

Campaign File

Campaign is used for save our campaign. The filename is uuid of campaign. It is automatically generated when create campaign, or can create file manually.

Here is the format:

{
    "campaign_creator": "creator of the campaign",
    "campaign_managers":["manager1","manager2"],
    "campaign_status":"start/finish",
    "coverage":{
        "last_uploader":"uploader",
        "last_uploaded":"last date uploaded",
        "geojson":"geojson of coverage."
    },
    "dashboard_settings":"setting of the dashboard based on user's preference",
    "description":"description of the campaign",
    "edited_at":"date of last edited",
    "edited_by":"user who edited the campaign",
    "end_date":"end date of the campaign",
    "geometry":"AOI of campaign in geojson",
    "link_to_omk": "link to omk (true/false)",
    "map_type":"type of map that user may use on details page",
    "name":"name of the campaign",
    "remote_projects":[],
    "selected_functions":{
        "function-1":{
            "function":"FeatureAttributeCompleteness",
            "feature": "amenity=clinic,doctors,hospital", 
            "attributes": {
                "name": [], 
                "amenity": ["clinic", "doctors", "hospital"], 
                "opening_hours": [], 
                "bed_count": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": []
                }, 
            "type": "Health facilities"
        },
        "function-2":{
            "function":"CountFeature",
            "feature": "amenity=clinic,doctors,hospital", 
            "attributes": {
                "name": [], 
                "amenity": ["clinic", "doctors", "hospital"], 
                "opening_hours": [], 
                "bed_count": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": []
               }, 
            "type": "Health facilities"
        },
        "function-3":{
            "function": "MapperEngagement", 
            "feature": "amenity=clinic,doctors,hospital", 
            "attributes": {
                "name": [], 
                "amenity": ["clinic", "doctors", "hospital"], 
                "opening_hours": [], 
                "bed_count": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": [] 
                }, 
            "type": "Health facilities"
        },
        "function-4":{
            "function": "FeatureAttributeCompleteness", 
            "feature": "amenity=college,kindergarten,school,university", 
            "attributes": {
                "name": [], 
                "amenity": ["college", "kindergarten", "school", "university"], 
                "opening_hours": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": [] 
               }, 
            "type": "Educational Facilities"
        },
        "function-5":{
            "function": "CountFeature", 
            "feature": "amenity=college,kindergarten,school,university", 
            "attributes": {
                "name": [], 
                "amenity": ["college", "kindergarten", "school", "university"], 
                "opening_hours": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": []
               }, 
            "type": "Educational Facilities"
        },
        "function-6":{
            "function": "MapperEngagement", 
            "feature": "amenity=college,kindergarten,school,university", 
            "attributes": {
                "name": [], 
                "amenity": ["college", "kindergarten", "school", "university"], 
                "opening_hours": [], 
                "addr:city": [], 
                "addr:street": [], 
                "addr:housenumber": [], 
                "description": []
               }, 
           "type": "Educational Facilities"
        },
        "function-7": {
            "function": "FeatureAttributeCompleteness", 
            "feature": "amenity=bank,banking_agent", 
            "attributes": {
                 "amenity": ["bank", "banking_agent"], 
                 "name": [], 
                 "operator": [], 
                 "opening_hours": [], 
                 "addr:city": [],  
                 "addr:street": [], 
                 "addr:housenumber": [], 
                 "description": []
                }, 
             "type": "Bank"
         }
    },
    "start_date":"start date of the campaign",
    "types": {
        "type-1": {
            "type": "Health facilities", 
            "tags": ["name", "amenity", "opening_hours", "bed_count", "addr:city", 
                    "addr:street", "addr:housenumber", "description"]
           }, 
        "type-2": {
             "type": "Educational Facilities", 
             "tags": ["name", "amenity", "opening_hours", "addr:city", "addr:street", 
                     "addr:housenumber", "description"]
             }, 
         "type-3": {
              "type": "Bank", 
              "tags": ["amenity", "name", "operator", "opening_hours", "addr:city", 
                      "addr:street", "addr:housenumber", "description"]
             }
     },
    "uploader":"uploader",
    "uuid":"should be save with filename",
    "version":3
}

Coverage File

Coverage file is just list of geojson of coverage for campaign. The name of file need to be same with uuid of campaign.

Survey File

Survey file is used for giving user option for default type of campaign that need to be checked. The file is in yaml.