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

jismesh

v1.7.21

Published

JavaScript port of python jismesh package

Downloads

8

Readme

jismesh for js

NPM version NPM monthly downloads NPM total downloads Build Status dependencies Status devDependencies Status

NPM

Utilities for the Japanese regional grid system defined in Japanese Industrial Standards (JIS X 0410 地域メッシュ).

python の jismesh パッケージ を JavaScript に移植したものです。

対応地域メッシュコード

  • 1 次(標準地域メッシュ 80km 四方): 1
  • 40 倍(拡張地域メッシュ 40km 四方): 40000
  • 20 倍(拡張地域メッシュ 20km 四方): 20000
  • 16 倍(拡張地域メッシュ 16km 四方): 16000
  • 2 次(標準地域メッシュ 10km 四方): 2
  • 8 倍(拡張地域メッシュ 8km 四方): 8000
  • 5 倍(拡張地域メッシュ 5km 四方): 5000
  • 4 倍(拡張地域メッシュ 4km 四方): 4000
  • 2.5 倍(拡張地域メッシュ 2.5km 四方): 2500
  • 2 倍(拡張地域メッシュ 2km 四方): 2000
  • 3 次(標準地域メッシュ 1km 四方): 3
  • 4 次(分割地域メッシュ 500m 四方): 4
  • 5 次(分割地域メッシュ 250m 四方): 5
  • 6 次(分割地域メッシュ 125m 四方): 6

インストール

npm install jismesh

または、CDN から読み込む場合

<script src="//cdn.jsdelivr.net/npm/jismesh/dist/jismesh.min.js"></script>

グローバル変数 jismesh が定義されます。

使用例

緯度経度から地域メッシュコードを求める

メッシュコードに変換する世界測地系緯度経度と変換するメッシュコードの次数を指定します。

const jismesh = require("jismesh");

// 緯度経度からメッシュコードを求める。
const meshCode = jismesh.toMeshCode(35.658581, 139.745433, 3);
console.log(meshCode); // => 53393599

地域メッシュコードから次数を求める

メッシュコードからそのメッシュコードの次数を判定します。

const jismesh = require("jismesh");

const meshLevel = jismesh.toMeshLevel("53393599");
console.log(meshLevel); // => 3

地域メッシュコードから緯度経度を求める

求める緯度経度で表される点は、当該メッシュの基準点(南西端)から、 緯度座標上の点の位置(当該メッシュの単位経度の倍数)、経度座標上の点の位置(当該メッシュの単位緯度の倍数) を指定します。

const jismesh = require("jismesh");

// 南西端の緯度経度を求める。
const [latSW, lonSW] = jismesh.toMeshPoint("53393599", 0, 0);
console.log(latSW, lonSW); // => 35.65833333333333 139.7375

// 北東端の緯度経度を求める。
const [latNE, lonNE] = jismesh.toMeshPoint("53393599", 1, 1);
console.log(latNE, lonNE); // => 35.666666666666664 139.75

// 中心点の緯度経度を求める。
const [latC, lonC] = jismesh.toMeshPoint("53393599", 0.5, 0.5);
console.log(latC, lonC); // => 35.6625 139.74375

// 東隣接メッシュの中心点の緯度経度を求める。
const [latEastNeighborC, lonEastNeighborC] = jismesh.toMeshPoint(
  "53393599",
  0.5,
  1.5
);
console.log(latEastNeighborC, lonEastNeighborC); // => 35.6625 139.75625000000002