本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · 行政区画の情報

SubdivisionFacts型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The facts about one subdivision, from the /subdivision-facts entry: null where Wikidata has none, or gives two.

インポート

import type { SubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";

定義

interface SubdivisionFacts {
    code: string;
    capital: {
        en: string;
        ja: string | null;
        reading?: string;
    } | null;
    capitalPoint: LatLon | null;
    population: number | null;
    populationYear: number | null;
    areaKm2: number | null;
    areaYear: number | null;
    point: LatLon | null;
}

メンバー

名前型説明
codestring

ISO 3166-2, "JP-13"

capital{ en: string; ja: string | null; reading?: string; } | null

The seat of its government; reading in hiragana

capitalPointLatLon | null

The capital's coordinates

populationnumber | null

People, from Wikidata

populationYearnumber | null

The year the population is for, where Wikidata says

areaKm2number | null

Area in square kilometres, from Wikidata

areaYearnumber | null

The year the area is for, where Wikidata says

pointLatLon | null

Wikidata's coordinate location for the subdivision

例

import type { SubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";
import { loadSubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";

const value: SubdivisionFacts = (await loadSubdivisionFacts("JP"))![0];
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[
  'code',
  'capital',
  'capitalPoint',
  'population',
  'populationYear',
  'areaKm2'
]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.4.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。