Name: shapefile-ingest
Owner: unicef
Description: null
Created: 2017-04-03 19:47:22.0
Updated: 2017-04-03 19:47:36.0
Pushed: 2017-10-11 17:10:23.0
Homepage: null
Size: 66
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a component of MagicBox
npm install
cp config-sample.js config.js
bash setup.sh
sudo apt-get install postgis
sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
sudo apt-get install gdal-bin
node download_shapefiles_from_gadm.js -s gadm2-8
Zipped shape files will be downloaded to directory in data directory.
clone repo: https://github.com/santiblanko/colombia.geojson
shp2pgsql -s 4326 -D -I santiblanko/mpio.shp col_2_santiblanko | psql all_countries
node import_shapefiles_to_postgres.js -s gadm2-8
node shapefile_to_geojson -s gadm2-8
rm ./data/geojson/gadm2-8/CAN_0.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CAN_0.json data/shapefiles/CAN/CAN_adm0.shp
rm ./data/geojson/gadm2-8/CAN_1.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CAN_1.json data/shapefiles/CAN/CAN_adm1.shp
rm ./data/geojson/gadm2-8/CAN_2.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CAN_2.json data/shapefiles/CAN/CAN_adm2.shp
rm ./data/geojson/gadm2-8/CAN_3.json; ogr2ogr -f GeoJSON -lco COORDINATE_PRECISION=8 data/geojson/gadm2-8/CAN_3.json data/shapefiles/CAN/CAN_adm3.shp
rm ./data/geojson/gadm2-8/CHL_0.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CHL_0.json data/shapefiles/CHL/CHL_adm0.shp
rm ./data/geojson/gadm2-8/CHL_1.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CHL_1.json data/shapefiles/CHL/CHL_adm1.shp
rm ./data/geojson/gadm2-8/CHL_2.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CHL_2.json data/shapefiles/CHL/CHL_adm2.shp
rm ./data/geojson/geojson/gadm2-8/CHL_3.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/CHL_3.json data/shapefiles/CHL/CHL_adm3.shp
rm ./data/geojson/gadm2-8/USA_0.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/USA_0.json data/shapefiles/USA/USA_adm0.shp
rm ./data/geojson/gadm2-8/USA_1.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/USA_1.json data/shapefiles/USA/USA_adm1.shp
rm ./data/geojson/gadm2-8/USA_2.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/USA_2.json data/shapefiles/USA/USA_adm2.shp
rm ./data/geojson/gadm2-8/AUS_2.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/AUS_2.json data/shapefiles/AUS/AUS_adm2.shp
rm ./data/geojson/gadm2-8/THA_3.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/THA_3.json data/shapefiles/THA/THA_adm3.shp
rm ./data/geojson/gadm2-8/VNM_3.json; ogr2ogr -f GeoJSON data/ggeojson/adm2-8/VNM_3.json data/shapefiles/VNM/VNM_adm3.shp
rm ./data/geojson/gadm2-8/PRT_3.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/PRT_3.json data/shapefiles/PRT/PRT_adm3.shp
rm ./data/geojson/gadm2-8/ZAF_4.json; ogr2ogr -f GeoJSON data/geojson/gadm2-8/ZAF_4.json data/shapefiles/ZAF/ZAF_adm4.shp
ogr2ogr -f GeoJSON ./geo./shapefiles/gadm2-8/CHL/CHL_adm0.shp