alongTrack関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { alongTrack } from "@johnmorrisdotca/chikyu-earth/place";
定義
function alongTrack(points: readonly { lon: number; lat: number; t: number; }[], options?: PlaceOptions): TrackChange[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
points | readonly { lon: number; lat: number; t: number; }[] | The track, in order. A point with no latitude is skipped. |
options (省略可) | PlaceOptions | undefined | The same city lists as |
戻り値
TrackChange[]
One row for the first sample, then one row each time the country, the nearby country or the sea changes.
例
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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。