| 1234567891011121314151617181920212223242526272829 |
- // index.ts
- import { coordEach } from "@turf/meta";
- function bbox(geojson, options = {}) {
- if (geojson.bbox != null && true !== options.recompute) {
- return geojson.bbox;
- }
- const result = [Infinity, Infinity, -Infinity, -Infinity];
- coordEach(geojson, (coord) => {
- if (result[0] > coord[0]) {
- result[0] = coord[0];
- }
- if (result[1] > coord[1]) {
- result[1] = coord[1];
- }
- if (result[2] < coord[0]) {
- result[2] = coord[0];
- }
- if (result[3] < coord[1]) {
- result[3] = coord[1];
- }
- });
- return result;
- }
- var turf_bbox_default = bbox;
- export {
- bbox,
- turf_bbox_default as default
- };
- //# sourceMappingURL=index.js.map
|