@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
16 lines • 648 B
JavaScript
import { bbox } from "@turf/turf";
import eezPrecalc from "./mr-eez-precalc.json" with { type: "json" };
export const eezColl = eezPrecalc;
export const getBbox = async (name) => {
const eez = eezColl.features.find((c) => c.properties.GEONAME === name);
if (!eez)
throw new Error(`EEZ not found with name ${name}`);
return eez.bbox || bbox(eez);
};
export const getArea = async (name) => {
const eez = eezColl.features.find((c) => c.properties.GEONAME === name);
if (!eez)
throw new Error(`EEZ not found with name ${name}`);
return eez.properties.area_turf || bbox(eez);
};
//# sourceMappingURL=mr-eez.js.map