@trackunit/geo-json-utils
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -380,9 +380,9 @@ 'use strict'; | ||
case "top": | ||
return currentPoint[1] > ((_a = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _a !== void 0 ? _a : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[1] > ((_a = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _a !== void 0 ? _a : -Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "right": | ||
return currentPoint[0] > ((_b = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _b !== void 0 ? _b : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[0] > ((_b = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _b !== void 0 ? _b : -Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "bottom": | ||
return currentPoint[1] < ((_c = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _c !== void 0 ? _c : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[1] < ((_c = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _c !== void 0 ? _c : Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "left": | ||
return currentPoint[0] < ((_d = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _d !== void 0 ? _d : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[0] < ((_d = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _d !== void 0 ? _d : Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
default: { | ||
@@ -474,2 +474,14 @@ throw new Error(`${direction} is not known`); | ||
}; | ||
/** | ||
* @description Creates a TU bounding box from a GeoJSON Bbox. | ||
* @param bbox The GeoJSON Bbox to create a TU bounding box from | ||
* @returns {TuBoundingBox} The TU bounding box created from the GeoJSON Bbox | ||
*/ | ||
const getBoundingBoxFromGeoJsonBbox = (bbox) => { | ||
const [minLon, minLat, maxLon, maxLat] = bbox; | ||
return { | ||
nw: { longitude: minLon, latitude: maxLat }, | ||
se: { longitude: maxLon, latitude: minLat }, | ||
}; | ||
}; | ||
@@ -635,2 +647,3 @@ //! These tools are used to bridge the gap with out poorly typed graphql types | ||
exports.getBboxFromGeoJsonPolygon = getBboxFromGeoJsonPolygon; | ||
exports.getBoundingBoxFromGeoJsonBbox = getBoundingBoxFromGeoJsonBbox; | ||
exports.getBoundingBoxFromGeoJsonPolygon = getBoundingBoxFromGeoJsonPolygon; | ||
@@ -637,0 +650,0 @@ exports.getExtremeGeoJsonPointFromPolygon = getExtremeGeoJsonPointFromPolygon; |
@@ -378,9 +378,9 @@ import { z } from 'zod'; | ||
case "top": | ||
return currentPoint[1] > ((_a = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _a !== void 0 ? _a : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[1] > ((_a = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _a !== void 0 ? _a : -Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "right": | ||
return currentPoint[0] > ((_b = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _b !== void 0 ? _b : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[0] > ((_b = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _b !== void 0 ? _b : -Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "bottom": | ||
return currentPoint[1] < ((_c = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _c !== void 0 ? _c : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[1] < ((_c = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _c !== void 0 ? _c : Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
case "left": | ||
return currentPoint[0] < ((_d = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _d !== void 0 ? _d : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint; | ||
return currentPoint[0] < ((_d = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _d !== void 0 ? _d : Infinity) ? currentPoint : (extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint); | ||
default: { | ||
@@ -472,2 +472,14 @@ throw new Error(`${direction} is not known`); | ||
}; | ||
/** | ||
* @description Creates a TU bounding box from a GeoJSON Bbox. | ||
* @param bbox The GeoJSON Bbox to create a TU bounding box from | ||
* @returns {TuBoundingBox} The TU bounding box created from the GeoJSON Bbox | ||
*/ | ||
const getBoundingBoxFromGeoJsonBbox = (bbox) => { | ||
const [minLon, minLat, maxLon, maxLat] = bbox; | ||
return { | ||
nw: { longitude: minLon, latitude: maxLat }, | ||
se: { longitude: maxLon, latitude: minLat }, | ||
}; | ||
}; | ||
@@ -617,2 +629,2 @@ //! These tools are used to bridge the gap with out poorly typed graphql types | ||
export { EARTH_RADIUS, boundingBoxCrossesMeridian, checkCrossesMeridian, coordinatesToStandardFormat, denormalizeLongitude, geoJsonBboxSchema, geoJsonGeometrySchema, geoJsonLineStringSchema, geoJsonLinearRingSchema, geoJsonMultiLineStringSchema, geoJsonMultiPointSchema, geoJsonMultiPolygonSchema, geoJsonPointSchema, geoJsonPolygonSchema, geoJsonPositionSchema, getBboxFromGeoJsonPolygon, getBoundingBoxFromGeoJsonPolygon, getExtremeGeoJsonPointFromPolygon, getGeoJsonPolygonFromBoundingBox, getGeoJsonPolygonIntersection, getMinMaxLongitudes, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getPointCoordinateFromGeoJsonPoint, getPolygonFromBbox, getPolygonFromPointAndRadius, isFullyContainedInGeoJsonPolygon, isGeoJsonPointInPolygon, isGeoJsonPositionInLinearRing, normalizeLongitudes, tuGeoJsonPointRadiusSchema, tuGeoJsonPolygonNoHolesSchema, tuGeoJsonRectangularBoxPolygonSchema }; | ||
export { EARTH_RADIUS, boundingBoxCrossesMeridian, checkCrossesMeridian, coordinatesToStandardFormat, denormalizeLongitude, geoJsonBboxSchema, geoJsonGeometrySchema, geoJsonLineStringSchema, geoJsonLinearRingSchema, geoJsonMultiLineStringSchema, geoJsonMultiPointSchema, geoJsonMultiPolygonSchema, geoJsonPointSchema, geoJsonPolygonSchema, geoJsonPositionSchema, getBboxFromGeoJsonPolygon, getBoundingBoxFromGeoJsonBbox, getBoundingBoxFromGeoJsonPolygon, getExtremeGeoJsonPointFromPolygon, getGeoJsonPolygonFromBoundingBox, getGeoJsonPolygonIntersection, getMinMaxLongitudes, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getPointCoordinateFromGeoJsonPoint, getPolygonFromBbox, getPolygonFromPointAndRadius, isFullyContainedInGeoJsonPolygon, isGeoJsonPointInPolygon, isGeoJsonPositionInLinearRing, normalizeLongitudes, tuGeoJsonPointRadiusSchema, tuGeoJsonPolygonNoHolesSchema, tuGeoJsonRectangularBoxPolygonSchema }; |
{ | ||
"name": "@trackunit/geo-json-utils", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": "https://github.com/Trackunit/manager", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.txt", |
@@ -84,2 +84,8 @@ import { GeoJsonBbox, GeoJsonLinearRing, GeoJsonMultiPolygon, GeoJsonPoint, GeoJsonPolygon, GeoJsonPosition } from "./GeoJsonSchemas"; | ||
export declare const getGeoJsonPolygonIntersection: (polygon1: GeoJsonPolygon | GeoJsonMultiPolygon, polygon2: GeoJsonPolygon | GeoJsonMultiPolygon) => GeoJsonMultiPolygon | GeoJsonPolygon | null; | ||
/** | ||
* @description Creates a TU bounding box from a GeoJSON Bbox. | ||
* @param bbox The GeoJSON Bbox to create a TU bounding box from | ||
* @returns {TuBoundingBox} The TU bounding box created from the GeoJSON Bbox | ||
*/ | ||
export declare const getBoundingBoxFromGeoJsonBbox: (bbox: GeoJsonBbox) => TuBoundingBox; | ||
export {}; |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
70060
1670
0