npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nepal-geojson

v5.0.0-alpha

Published

Lightweight package for map of Nepal

Downloads

13

Readme

Nepal GeoJSON

npm version Build Status license

  • 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.
  • For GaunPalikas and high resolution version of the map refer to the highres-geojson folder which has been scraped from https://sthaniya.gov.np/ and thus differs slightly from the lightweight version of the map and is a lot heavier since it hasn't been compressed (Work on compression is pending).

Example Usage with Google Maps

Installation

npm i nepal-geojson

Usage

Basic Usage

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);

Advanced Usage

const nepalGeojson = require('nepal-geojson');
const countryGeojson = nepalGeojson.country(); // to get geojson for country without province or district level boundaries
const countryWithProvincesGeojson = nepalGeojson.countryWithProvinces(); // to get geojson for country with province level boundaries
const countryWithDistrictsGeojson = nepalGeojson.countryWithDistricts(); // to get the geojson for country with district level boundaries. It's same as nepalGeojson.districts();
const districtsGeojson = nepalGeojson.districts(); // to get all the geojson for all the districts
const provinceOneGeojson = nepalGeojson.province(1); // to get the geojson for boundary of province 1
const provinceOneGeojson = nepalGeojson.provinceWithDistricts(1); // to get the geojson for province 1 with district boundaries
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.listDistricts(); // 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.listProvincesWithDistricts(); // returns an array of arrays of provinces with province details each containing info objects of containing districts
const provinceDistrictsInfo = nepalGeojson.listProvinceWithDistricts(1); // returns array of info objects of districts in province 1 as well as province information

CLI Usage

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 country without district or province level boundaries
nepal-geojson country
# to build geojson for country with province level boundaries
nepal-geojson country:withProvinces
# to build geojson for country with district level boundaries
nepal-geojson country:withDistricts
# to build geojson for a particular district
nepal-geojson district Kathmandu
# to get the geojson for province 1 boundaries
nepal-geojson province 1
# to get the geojson for province 1 with its districts
nepal-geojson province:withDistricts 1

The built geojson files are stored in geojson folder.

Alternative to CLI Usage

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 country without district or province level boundaries
npm run country
# to build geojson for country with province level boundaries
npm run country:withProvinces
# to build geojson for country with district level boundaries
npm run country:withDistricts
# to build geojson for a particular district
npm run district Kathmandu
# to get the geojson for province 1 boundaries
npm run province 1
# to get the geojson for province 1 with its districts
npm run province:withDistricts 1

Download Static Geojson

If you don't want to use this npm package and just want the geojson file for the entire country or a particular province and associated districts I've got you covered. I have built those and uploaded them to generated-geojson folder. You can find them here.

Author

Aashish Manandhar [email protected] http://github.com/acesmndr

License

  • MIT : http://opensource.org/licenses/MIT

forthebadge forthebadge