Reference · The realistic Earth's pure parts
BorderFeaturetype
One shape a border set is made of: a GeoJSON feature in longitude and latitude (degrees), a Polygon or MultiPolygon, with an optional code in its properties (a country's code, which says
which regions to ask for). Any other geometry is passed over.
Import it
import type { BorderFeature } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
interface BorderFeature {
properties?: {
code?: string | null;
} | null;
geometry: {
type: string;
coordinates: unknown;
} | null;
}
Members
| Name | Type | Description |
|---|---|---|
properties (optional) | { code?: string | null; } | null | undefined | |
geometry | { type: string; coordinates: unknown; } | null |
Examples
import type { BorderFeature } from "@johnmorrisdotca/chikyu-earth/realistic";
const square: BorderFeature = { properties: { code: "A" }, geometry: { type: "Polygon", coordinates: [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] } };
console.log(square.properties?.code);AWhat it prints (run when this page was built)