Reference · The realistic Earth's pure parts
shapeBoxesfunction
Each coded shape's box in longitude and latitude: [west, south, east, north], with west greater than east for a shape across the 180th meridian (the shorter way round).
Import it
import { shapeBoxes } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function shapeBoxes(shapes: BorderShapes): Map<string, [number, number, number, number]>
Parameters
| Name | Type | Description |
|---|---|---|
shapes | BorderShapes | The shapes; one with no code is left out. |
Returns
Map<string, [number, number, number, number]>
The box of each code.
Examples
import { shapeBoxes } from "@johnmorrisdotca/chikyu-earth/realistic";
const fiji = { properties: { code: "FJ" }, geometry: { type: "Polygon", coordinates: [[[177, -18], [-179, -18], [-179, -16], [177, -16], [177, -18]]] } };
console.log(shapeBoxes({ features: [fiji] }).get("FJ"));[ 177, -18, -179, -16 ]What it prints (run when this page was built)