ChizuGeoFeaturetype
One region or country as a GeoJSON feature, in WGS84 [longitude, latitude] degrees: a Polygon or MultiPolygon.
Import it
import type { ChizuGeoFeature } from "@johnmorrisdotca/chizu/world-geo-detail";
Also exported from: @johnmorrisdotca/chizu/divisions-geo
Definition
interface ChizuGeoFeature {
type: "Feature";
properties: ChizuGeoProperties;
geometry: {
type: "Polygon";
coordinates: number[][][];
} | {
type: "MultiPolygon";
coordinates: number[][][][];
};
}
Members
| Name | Type | Description |
|---|---|---|
type | "Feature" | |
properties | ChizuGeoProperties | |
geometry | { type: "Polygon"; coordinates: number[][][]; } | { type: "MultiPolygon"; coordinates: number[][][][]; } |
Examples
import type { ChizuGeoFeature } from "@johnmorrisdotca/chizu/divisions-geo";
const feature: ChizuGeoFeature = {
type: "Feature",
properties: { code: "A", name: "A square" },
geometry: { type: "Polygon", coordinates: [[[0, 0], [1, 0], [1, 1], [0, 0]]] },
};
console.log(feature.geometry.type, feature.geometry.coordinates[0].length);
// Polygon 4Polygon 4What it prints (run when this page was built)