Skip to content

Instantly share code, notes, and snippets.

View planemad's full-sized avatar

Arun Ganesh planemad

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"map": {
"title": "Sample title"
},
"version": "v1"
}
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 31 columns, instead of 7. in line 2.
data_id,iso,event_id_cnty,event_id_no_cnty,event_date,year,time_precision,event_type,sub_event_type,actor1,assoc_actor_1,inter1,actor2,assoc_actor_2,inter2,interaction,region,country,admin1,admin2,admin3,location,latitude,longitude,geo_precision,source,source_scale,notes,fatalities,timestamp,iso3
8656762,356,IND102916,102916,"18 November 2021",2021,1,"Explosions/Remote violence","Remote explosive/landmine/IED","Unidentified Armed Group (India)",,3,,,0,30,"South Asia",India,Manipur,"Imphal East",Porompat,Heingang,24.8375,93.9492,2,"Sentinel (India); Assam Tribune; South Asia Terrorism Portal; E-Pao",Other-Subnational,"On 18 November 2021, unidentified assailants exploded an improvised explosive device (IED) in front of a shop, damaging a portion of the steel shutter of the shop at Kairang Muslim Mayai Leikai under Heingang police station (Porompat, Imphal East district, Manipur). No militant group claimed responsibility for the explosion.",0,1637706301,IND
8656857,356,IND102863,102863,"18 November 2021",2021,1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@planemad
planemad / overpass.md
Last active October 10, 2021 03:31
Creating custom OSM based maps using Mapbox

If you have been playing around with the new Mapbox Studio you might be interested to know how to make a custom map with objects of your own interest from OpenStreetMap.

To make the process of creating an updating an OSM based dataset on Mapbox more seamless, I was looking into a command line based workflow that could extract OSM data from Overpass and update a Mapbox hosted dataset in one go.

Requirements

Generate an Overpass Query

  • Use Overpass Turbo to create a query for the data you are interested in extracting. Since i'm interested in bus stops, I first browse the map to Bengaluru, India and then generate a query using the wizard query highway=bus_stop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@planemad
planemad / default.json
Last active January 3, 2021 06:18
publicmap.github.io map config file
{
"title":"Title of the map",
"description":"A description of the map view in a few sentences.",
"attribution":"<a href='#'>JSON Map config</a>",
"worldview":"US",
"center": [73.9064,18.5665],
"rotate": 180,
"styles":[
{
"label":"OpenStreetMap2",
[
{
"ISO": "AFG",
"Rank2020": 122,
"FR_Country": "Afghanistan",
"EN_country": "Afghanistan",
"ES_country": "Afganistàn",
"Score A": "31,83",
"Sco Exa": "61,1589213",
"Score 2020": "37,7",
@planemad
planemad / world-population.json
Last active September 24, 2020 17:59
Population of world countries - Wikidata
[{"qid":"Q148","countryLabel":"People's Republic of China","population":"1409517397"},{"qid":"Q668","countryLabel":"India","population":"1326093247"},{"qid":"Q30","countryLabel":"United States of America","population":"325145963"},{"qid":"Q252","countryLabel":"Indonesia","population":"263991379"},{"qid":"Q843","countryLabel":"Pakistan","population":"216565318"},{"qid":"Q155","countryLabel":"Brazil","population":"210147125"},{"qid":"Q1033","countryLabel":"Nigeria","population":"190886311"},{"qid":"Q902","countryLabel":"Bangladesh","population":"164669751"},{"qid":"Q12557","countryLabel":"Mongol Empire","population":"160000000"},{"qid":"Q96","countryLabel":"Mexico","population":"130526945"},{"qid":"Q17","countryLabel":"Japan","population":"126785797"},{"qid":"Q115","countryLabel":"Ethiopia","population":"104957438"},{"qid":"Q928","countryLabel":"Philippines","population":"104918090"},{"qid":"Q79","countryLabel":"Egypt","population":"94798827"},{"qid":"Q881","countryLabel":"Vietnam","population":"94660000"},{"qi
{"adm0": {"type": "admin","level": 0,"PolyTilesetName": "mapbox.boundaries-adm0-v3","PolyLayerName": "boundaries_admin_0","PointTilesetName": "mapbox.boundaries-admPoints-v3","PointLayerName": "points_admin_0","data": {
"CN":{
"BT":{"feature_id":1642529,"wikidata_id":"Q917","worldview":"CN","unit_code":"BT","name":"Bhutan","names":{"dz":["འབྲུག་ཡུལ་","འབྲུགཡུལ་་"],"en":["Bhutan","Kingdom of Bhutan","bt","🇧🇹","BHU"],"ne":["भुटान"]},"description":"state","source_date":"2016","iso_3166_1_alpha_3":"BTN","iso_3166_1":"BT","z_min":0,"centroid":[90.3571,27.473],"bounds":[88.7683,26.6948,92.124,28.2458],"area_sqkm":43658},
"CN":{"feature_id":3084336,"wikidata_id":"Q148","worldview":"CN","unit_code":"CN","name":"China","names":{"en":["People's Republic of China","China","CN","PR China","PRC","cn","CHN","Communist China","🇨🇳"],"zh":["中华人民共和国","中国","中國","中華人民共和國","共产中国","新中国","中華人民共和國/中华人民共和国","中"]},"description":"state","source_date":"2016","iso_3166_1_alpha_3":"CHN","iso_3166_1":"CN","z_min":0,"centroid":[100.5057,38.