
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
JIS 規格で定められている地域メッシュを扱うためのユーティリティです。
JISX0410 の仕様に準拠しており、地域メッシュコード、緯度経度の相互変換がおこなえます。
地域メッシュの区分は下記の通りです。
| レベル | 区画の種類 | 一辺の長さ | コード桁数 | コード例 |
|---|---|---|---|---|
| 80000 | 80倍地域メッシュ (第1次地域区画) | 約80km | 4桁 | 5339 |
| 10000 | 10倍地域メッシュ (第2次地域区画) | 約10km | 6桁 | 533945 |
| 5000 | 5倍地域メッシュ | 約5km | 7桁 | 5339452 |
| 2000 | 2倍地域メッシュ | 約2km | 9桁 (末尾5固定) | 533945465 |
| 1000 | 基準地域メッシュ (第3次地域区画) | 約1km | 8桁 | 53394529 |
| 500 | 2分の1地域メッシュ | 約500m | 9桁 | 533945292 |
| 250 | 4分の1地域メッシュ | 約250m | 10桁 | 5339452922 |
| 125 | 8分の1地域メッシュ | 約125m | 11桁 | 53394529221 |
全国の地域メッシュはこちらから確認できます。
npm install japanmesh
import { japanmesh } from 'japanmesh'
指定した緯度経度(WGS84)から、地域メッシュコードを取得します。
japanmesh.toCode(35.70078, 139.71475, 1000)
=> '53394547'
指定した地域メッシュコードから、緯度経度の境界オブジェクトを取得します。
const bounds = japanmesh.toLatLngBounds('53394547')
bounds.getCenter() // 境界の中央座標
=> { lat: 35.704166666666666, lng: 139.71875 }
bounds.getNorthEast() // 境界の北東座標
=> { lat: 35.70833333333333, lng: 139.725 }
bounds.getNorthWest() // 境界の北西座標
=> { lat: 35.70833333333333, lng: 139.7125 }
bounds.getSouthWest() // 境界の南西座標
=> { lat: 35.699999999999996, lng: 139.7125 }
bounds.getSouthEast() // 境界の南東座標
=> { lat: 35.699999999999996, lng: 139.725 }
bounds.contains({ lat: 35.70416666, lng: 139.71875 }) // 境界内か否か
=> true
指定した地域メッシュコードから、ポリゴンデータ(GeoJSON)を取得します。
japanmesh.toGeoJSON('53394547')
=>
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[139.725, 35.70833333333333],
[139.7125, 35.70833333333333],
[139.7125, 35.699999999999996],
[139.725, 35.699999999999996],
[139.725, 35.70833333333333]
]
]
}
}
指定した地域メッシュコードのレベルを取得します。
japanmesh.getLevel('53394547')
=> 1000
指定した地域メッシュコード内の該当レベルの地域メッシュコードを取得します。
code, level 未指定時は第 1 次地域区画の地域メッシュコードを取得します。
japanmesh.getCodes('53394547', 500)
=> [ '533945471', '533945472', '533945473', '533945474' ]
指定した境界内の該当レベルの地域メッシュコードを取得します。
level 未指定時は第 1 次地域区画の地域メッシュコードを取得します。
import { japanmesh, LatLngBounds } from 'japanmesh'
const bounds = new LatLngBounds(36, 140, 35, 139) // northLat, eastLng, southLat, westLng
japanmesh.getCodesWithinBounds(bounds, 10000)
=> [ '523940', '523941', '523942', '523943', '523944', ... ]
指定した地域メッシュコードが、有効なコードかどうか判定します。
japanmesh.isValidCode('5339')
=> true
japanmesh.isValidCode('9999')
=> false
https://www.stat.go.jp/data/mesh/pdf/gaiyo1.pdf
This project is licensed under the terms of the MIT license.
FAQs
The npm package japanmesh receives a total of 380 weekly downloads. As such, japanmesh popularity was classified as not popular.
We found that japanmesh demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.