Name: download_admin_shapefiles_and_import_geojson_to_elasticsearch
Owner: unicef
Description: MagicBox
Created: 2016-09-13 16:23:26.0
Updated: 2017-08-16 20:24:20.0
Pushed: 2017-04-11 02:59:52.0
Homepage: null
Size: 64
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
node app.js
curl -XDELETE localhost:9200/admins
`curl -XPOST localhost:9200/admins -d '{ “mappings”: {
"admin": {
"properties": {
"geometry": {
"type": "geo_shape"
},
"ISO": {
"type": "string"
},
"admin_level": {
"type": "integer"
},
"admin_id": {
"type": "string"
},
"pub_src": {
"type": "string"
}
}
}
} }' `
rm ./data/gadm2-8/CAN*
ogr2ogr -f GeoJSON data/gadm2-8/CAN_2.geojson data/unzipped/CAN/CAN_adm2.shp
ogr2ogr -f GeoJSON data/gadm2-8/CAN_1.geojson data/unzipped/CAN/CAN_adm1.shp
rm ./data/gadm2-8/AUS_2.geojson
ogr2ogr -f GeoJSON data/gadm2-8/AUS_2.geojson data/unzipped/AUS/AUS_adm2.shp
nohup node import_admins_elasticsearch.js -d gadm2-8> nohup1.out 2>&1&
GADM 0 features: ID_0
GADM 1 features: ID_0, ID_1.
GADM 2, also has ID_0, ID_1, ID_2.
For unique id : country_ISO-ID_0-ID_1-ID_2-admin_name.downcased