- Lightweight (~600KB) packed geojson coordinates of Nepal's district and province boundaries for use with your map.
- Includes all 77 districts with their headquarters as well as all 7 provinces.
- Can be used as a NPM package in your project or you can download the generated geojson files and use them as per your need.
- Since this is a lightweight version of the map, some tradeoff has been made so there isn't minute level accuracy of this map.
npm i nepal-geojson
const nepalGeojson = require('nepal-geojson');
const districtsGeojson = nepalGeojson.districts(); // to get all the geojson for all the districts
// Now use the district level data to plot it in the map
console.log(districtGeojson);
const nepalGeojson = require('nepal-geojson');
const districtsGeojson = nepalGeojson.districts(); // to get all the geojson for all the districts
const provinceOneGeojson = nepalGeojson.province(1); // to get the geojson for all the districts in province 1 similar for other 6 provinces
const kathmanduDistrictGeojson = nepalGeojson.district('KATHMANDU'); // to get the geojson of a single district
// not only does it provide geojson files but also has helper functions to extract necessary details about the districts
const districtsList = nepalGeojson.districtsList(); // to get an array of all the district names
const districtsInfo = nepalGeojson.districtsInfo(); // to get an array of objects of headquarter and province info for all 77 districts
const dhankutaDistrictInfo = nepalGeojson.districtInfo('DHANKUTA'); // to get info about Dhankuta district
const provincesDistrictsInfo = nepalGeojson.provincesWithDistricts(); // returns an array of arrays of provinces each containing info objects of containing districts
const provinceDistrictsInfo = nepalGeojson.provinceWithDistricts(1); // returns array of info objects of districts in province 1
If you want to use it to generate geojson files in the CLI follow the following steps.
npm i -g nepal-geojson
# to build geojson for all the districts
nepal-geojson country
# to build geojson for a particular district
nepal-geojson district Kathmandu
# to get the geojson for all the districts in province 1
nepal-geojson province 1
The built geojson files are stored in geojson folder.
You could also clone the repo and run the following commands to generate the maps.
# to clone the repo
git clone [email protected]:Acesmndr/nepal-geojson.git
cd nepal-geojson
npm install
# to build geojson for all the districts
npm run country
# to build geojson for a particular district
npm run district Kathmandu
# to get the geojson for all the districts in province 1
npm run province 1
If you don't want to use this npm package and just want the geojson file for the entire country or a particular province I've got you covered. I have built those and uploaded them to generated-geojson folder. You can find them here.
Aashish Manandhar [email protected] http://github.com/acesmndr