Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The globe as an SVG string

COUNTRIESconstant

Every country the globe draws, as GeoJSON in longitude and latitude (177 features, Antarctica included), each with its English name, its Japanese name and its two-letter code.

Import it

import { COUNTRIES } from "@johnmorrisdotca/chikyu-earth";

Definition

const COUNTRIES: FeatureCollection<Geometry, CountryProps> = {
    type: "FeatureCollection",
    features: WORLD_GEO.features.map((feature) => ({
        type: "Feature",
        geometry: feature.geometry as Geometry,
        properties: {
            name: feature.properties.name,
            ja: feature.properties.nameJa || null,
            alpha2: feature.properties.code.length === 2 ? feature.properties.code : null,
        },
    })),
}

Members

NameTypeDescription
type"FeatureCollection"

Specifies the type of GeoJSON object.

featuresFeature<Geometry, CountryProps>[]
bbox (optional)BBox | undefined

Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5

Examples

import { COUNTRIES } from "@johnmorrisdotca/chikyu-earth";

const japan = COUNTRIES.features.find((feature) => feature.properties.alpha2 === "JP");
console.log(japan?.properties.name, japan?.properties.ja, COUNTRIES.features.length);
Japan 日本 177

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.11.0.