Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Data Provider

Irwan Fathurrahman edited this page May 30, 2017 · 6 revisions

These Data Providers have been implemented so far.

1. Overpass Provider

Here is the module

This data provider access data from Overpass, to query the Overpass API the following parameters are used:

  • Feature : the type of feature to extract e.g. buildings, roads, highway, etc.
  • Polygon : polygon of the area

Example of query :

[out:json];
(node
	["building"]
	(poly:"-7.3597429198273145 112.38464355468751 -7.561269314400291 112.39288330078126 -7.5803277913301415 112.62084960937501 -7.29981189306648 112.59613037109376 -7.3597429198273145 112.38464355468751");
way
	["building"]
	(poly:"-7.3597429198273145 112.38464355468751 -7.561269314400291 112.39288330078126 -7.5803277913301415 112.62084960937501 -7.29981189306648 112.59613037109376 -7.3597429198273145 112.38464355468751");
relation
	["building"]
	(poly:"-7.3597429198273145 112.38464355468751 -7.561269314400291 112.39288330078126 -7.5803277913301415 112.62084960937501 -7.29981189306648 112.59613037109376 -7.3597429198273145 112.38464355468751"););
(._;>;);out body;

The result will be in JSON format and will be used in insight function, visit http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example to know more about Overpass API.

2. Shapefile Provider

Here is the module

Shapefile provider is used for getting shapefile by absolute path, getting its file and converting to geoJSON. This provider is used currently being used by the campaign-coverage insights function.

3. OSMCHA Error Provider

Here is the module

This data provider access data from https://osmcha.mapbox.com/ parameters are used:

  • bbox : bbox of interest of area. We use it based on campaign geometry.
  • page : page for getting data because osmcha using pagination

This provider will use url of osmcha.mapbox.com, getting it's page and scraping data from that. here is the url : https://osmcha.mapbox.com/?bbox=20.429506301879886,-34.03985816485562,20.456285476684574,-34.01510358992117&page=1

here is data that scrapped by this provider. mostly it is still in html tag.

{
    "max_page":"9",
    "previous_page":0,
    "current_page":1,
    "next_page":2,
    "data":[
        {
            "ID":"49085998",
            "Date":"May 29, 2017, 9:41 p.m.",
            "User":"ninjamask",
            "Comment":"Fixing stuff with J...",
            "Count":{
                "success":"14",
                "warning":"55",
                "danger":"156"
            },
            "Reasons":"Suspect_word, Invalid tag modification", 
            "Verified":{
                "status":"False",
                "thumbs_up":"False",
                "verifier":"None"
            }
       },
       {
           "ID":"48232523",
           "Date":"April 28, 2017, 3:50 p.m.",
           "User":"Jahwise",
           "Comment":"Created a bus_stop,...", 
           "Count":{
               "success":"5",
               "warning":"0",
               "danger":"0"
           },
           "Reasons":"New mapper",
           "Verified":{
               "status":"True",
               "thumbs_up":"True",
               "verifier":"karitotp"
           }
       }]
}

Clone this wiki locally