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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jpn-atlas

v1.0.2

Published

便利な日本の国、都道府県、地方公共団体のレベルで堺データをもらい方です。 このデータの元は[国土地理院の地球地図ー2016](http://www.gsi.go.jp/kankyochiri/gm_jpn.html).

Readme

Japan Atlas TopoJSON / 日本アトラスTopoJSON

便利な日本の国、都道府県、地方公共団体のレベルで堺データをもらい方です。 このデータの元は国土地理院の地球地図ー2016.

An easy way to access Japanese geospatial boundary data at the national, prefectural, and municipal levels. The data is taken from the Geospatial Information Authority of Japan's "Global Map Japan" published in 2016.

Usage / 用いること

jpn-atlasはTopoJSONフォーマットで届けられます。SVGとかCanvasなどの座標系のために作られました。このため、ダウンロード、変換、簡略、投影、または掃除しなくて便利に使える。 データは一番簡単なもらう方法がunpkgからです。そろとも、npmから自分でインストールできます。

jpn-atlas is delivered in TopoJSON file format and made for SVG and Canvas coordinate systems (with the 'y' axis being reversed). Because of this, it is convenient to use jpn-atlas to load Japanese geospatial data into a browser application without having to download, convert, simplify, and clean the data yourself, jpn-atlas has already done this for you. The easiest way to get the jpn-atlas data is via unpkg, but you can also install it via npm for yourself. Either of these methods, among others, will allow you to access the boundary data:

Example / 例

unpkgからブラウザのSVGで、d3-geoでデータが表示される:

In-browser SVG via unpkg, displayed using d3-geo:

<!DOCTYPE html>
<svg width="850" height="680" fill="none" stroke="#000" stroke-linejoin="round" stroke-linecap="round"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/topojson-client@3"></script>
<script>

var svg = d3.select("svg");

var path = d3.geoPath();

d3.json("https://unpkg.com/jpn-atlas@1/japan.json", function(error, japan) {
  if (error) throw error;

  svg.append("path")
      .attr("stroke", "#aaa")
      .attr("stroke-width", 0.5)
      .attr("d", path(topojson.mesh(japan, japan.objects.municipalities, function(a, b) { return a !== b && (a.id / 1000 | 0) === (b.id / 1000 | 0); })));

  svg.append("path")
      .attr("stroke-width", 0.5)
      .attr("d", path(topojson.mesh(japan, japan.objects.prefectures, function(a, b) { return a !== b; })));

  svg.append("path")
      .attr("stroke-width", 0.5)
      .attr("d", path(topojson.feature(japan, japan.objects.country)));
});

</script>

unpkgからブラウザのCanvasで、d3-geoでデータが表示される:

In-browser Canvas via unpkg, displayed using d3-geo:

<!DOCTYPE html>
nvas width="850" height="680"></canvas>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/topojson-client@3"></script>
<script>

var context = d3.select("canvas").node().getContext("2d"),
    path = d3.geoPath().context(context);

d3.json("https://unpkg.com/jpn-atlas@1/japan/japan.json", function(error, japan) {
  if (error) throw error;

  context.beginPath();
  path(topojson.mesh(japan));
  context.stroke();
});

</script>

File Reference

# japan/japan.json <>

このファイルは3つのGeometry Collectionが含む TopoJSONのtopologyです。データはd3.geoAzimuthalEqualAreaで投影されて、850x680のビューポートにフィットされて、簡略されています。 データのトポロジーは国土地理院の地球地図ー2016から導かれました。 都道府県の堺は地方公共団体がmergeされたことの結果です。同じように国の堺は都道府県mergeされたことの結果です。

このTopoJSONデータには各都道府県と地方公共団体のidプロパティ全国地方公共団体コードが付いています。例えば、札幌市のコードは01100だから札幌市のfeatureの中でid : 01100のプロパティが付いています。

This file is a TopoJSON topology containing three geometry collections: municipalities, prefectures, and country. The geometry is quantized using topojson-client, projected using d3.geoAzimuthalEqualArea to fit a 850x680 viewport, and simplified. The topology is derived from the Geospatial Information Authority of Japan's Global Map Japan, published in 2016. Prefecture boundaries are computed by merging municipalities, and country boundaries are computed by merging prefectures.

The TopoJSON data assigns each municipality and prefecture an administrative code that can be found under the id property. For instance, the administrative code for Sapporo City is 01100. So the Sapporo feature has an associated id : 01100 object within it. The official source for the administrative codes is only in Japanese. However, Nobu Funaki has a created a handy github repository called list-og-cities-in-japan, which generates this information in English.

# japan.objects.municipalities(地方公共団体)

# japan.objects.prefectures(都道府県)

# japan.objects.country(国)

Contributing / コントリビューション

誰かがコントリビューションに興味があれば、issueを開けて下さい。または、もうあけてあるissueでポーストをしてください。私の日本語はきれいじゃなくて、このReadmeの日本語をわからなかったら新しい訳語を提供してください!

If anyone is interested in contributing go ahead and open an issue or comment on an existing one. Any and all help and ideas are welcome.

Acknowledgment / 礼状

このプロジェクトはus-atlasから全部ぬすまれました。

This whole project is inpsired by / stolen from us-atlas, which produces US county, state, and nation data.