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 place under a point: country, sea, continent and the nearest city

alongTrackfunction

The ordered changes of place along a ground track. Each point is { lon, lat, t }. A change is reported at the sample that entered the new place. near is how a page says the track is approaching a country; the next sample inside it is the country itself.

Import it

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

Definition

function alongTrack(points: readonly { lon: number; lat: number; t: number; }[], options?: PlaceOptions): TrackChange[]

Parameters

NameTypeDescription
pointsreadonly { lon: number; lat: number; t: number; }[]

The track, in order. A point with no latitude is skipped.

options (optional)PlaceOptions | undefined

The same city lists as placeOf. They do not change the country or the sea.

Returns

TrackChange[]

One row for the first sample, then one row each time the country, the nearby country or the sea changes.

Examples

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

const rows = alongTrack([
  { lon: -40, lat: 40, t: 0 },
  { lon: -3.7, lat: 40.4, t: 1 },
  { lon: 2.35, lat: 48.86, t: 2 },
]);
console.log(rows.map((row) => row.entering?.id).join(" "));
atlantic-ocean ES FR

What it prints (run when this page was built)

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