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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jp-local-mesh

v0.1.0

Published

日本の地域メッシュの計算・GeoJSON生成

Readme

jp-local-mesh

日本の地域メッシュの計算・GeoJSON生成

  • インストール方法

    npm install jp-local-mesh
  • 使い方(コンソール)

    $ node ./node_modules/jp-local-mesh/bin/meshGeoJsonMake -h
    Usage: meshGeoJsonMake [options]
    
    Options:
      -w, --workDir <string>         作業フォルダ (default: systemのtempフォルダ/mesh)
      -o, --outDir <string>          出力先フォルダ (default: systemのtempフォルダ/mesh)
      -p, --prefecture <string>      都道府県番号 (default: 番号リストの出力)
      -j, --municipalities <string>  市区町村コード(カンマ区切り) (default: 自治体。番号リストの出力(都道府県指定時))
      -m, --meshWidths <string>      メッシュ幅(カンマ区切り) (default: "1km")
      -h, --help                     display help for command
    対応するメッシュ幅:
    		80km  (一次メッシュ)
    		10km  (二次メッシュ)
    		2km   (2倍地域メッシュ)
    		5km   (5倍地域メッシュ)
    		1km   (三次メッシュ)
    		500m  (2分の1地域メッシュ)
    		250m  (4分の1地域メッシュ)
    		125m  (8分の1地域メッシュ)
    		100m  (10分の1地域メッシュ)
    		50m   (20分の1地域メッシュ)
    Option指定例: 青森県の自治体コード出力
    		meshGeoJsonMake -p 02
    Option指定例: 青森県全県の1・2・3次メッシュ生成
    		meshGeoJsonMake -o ./ -p 02 -j 02 -m 80km,10km,1km

地域メッシュのGeoJSON生成

自治体別の地域メッシュを生成できます

対象メッシュコードの取得先

総務省統計局の市区町村別メッシュ・コード一覧

  • 都道府県別CSV
    • https://www.stat.go.jp/data/mesh/csv/${都道府県番号}.csv
  • 三次メッシュ(1km)

メッシュコード計算

  • メッシュコードの北西端・南東端の緯度経度取得
    import {calc} from "jp-local-mesh";
    const result = calc.("533911");
    console.log("二次メッシュ")
    console.log(`北端緯度${result[0][0]}`);
    console.log(`西端経度${result[0][1]}`);
    console.log(`南端緯度${result[1][0]}`);
    console.log(`東端経度${result[1][1]}`);
    const meshInfo = calc.MESH_INFO.find((info) => info.width === "80km");
    const result = calc.("533911", meshInfo);
    console.log("一次メッシュ換算")
    console.log(`北端緯度${result[0][0]}`);
    console.log(`西端経度${result[0][1]}`);
    console.log(`南端緯度${result[1][0]}`);
    console.log(`東端経度${result[1][1]}`);