@trackunit/shared-utils 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var zod = require('zod');
4
- var polygonClipping = require('polygon-clipping');
5
3
  var uuid = require('uuid');
6
4
 
7
5
  /**
@@ -415,493 +413,6 @@ searchTerm) => {
415
413
  .every(term => filterableProps(asset).some(value => value.toLowerCase().includes(term.toLowerCase()))));
416
414
  };
417
415
 
418
- // * NOTE: For simplicity these tools are built for 2D coordinate space only!
419
- /**
420
- * A Position is an array of coordinates. [x, y]
421
- * https://tools.ietf.org/html/rfc7946#section-3.1.1
422
- */
423
- const geoJsonPositionSchema = zod.z.tuple([zod.z.number(), zod.z.number()]);
424
- /**
425
- * Point geometry object.
426
- * https://tools.ietf.org/html/rfc7946#section-3.1.2
427
- */
428
- const geoJsonPointSchema = zod.z.strictObject({
429
- type: zod.z.literal("Point"),
430
- coordinates: geoJsonPositionSchema,
431
- });
432
- /**
433
- * MultiPoint geometry object.
434
- * https://tools.ietf.org/html/rfc7946#section-3.1.3
435
- */
436
- const geoJsonMultiPointSchema = zod.z.strictObject({
437
- type: zod.z.literal("MultiPoint"),
438
- coordinates: zod.z.array(geoJsonPositionSchema),
439
- });
440
- /**
441
- * LineString geometry object.
442
- * Minimum length of 2 positions.
443
- * https://tools.ietf.org/html/rfc7946#section-3.1.4
444
- */
445
- const geoJsonLineStringSchema = zod.z.strictObject({
446
- type: zod.z.literal("LineString"),
447
- coordinates: zod.z.array(geoJsonPositionSchema).min(2),
448
- });
449
- /**
450
- * MultiLineString geometry object.
451
- * https://tools.ietf.org/html/rfc7946#section-3.1.5
452
- */
453
- const geoJsonMultiLineStringSchema = zod.z.strictObject({
454
- type: zod.z.literal("MultiLineString"),
455
- coordinates: zod.z.array(zod.z.array(geoJsonPositionSchema)),
456
- });
457
- /**
458
- * Helper type for reuse across polygon schemas.
459
- *
460
- * - A linear ring is a closed LineString with four or more positions.
461
- * - The first and last positions are equivalent, and they MUST contain
462
- identical values; their representation SHOULD also be identical
463
- * - A linear ring is the boundary of a surface or the boundary of a
464
- hole in a surface
465
- * - A linear ring MUST follow the right-hand rule with respect to the
466
- area it bounds, i.e., exterior rings are counterclockwise, and
467
- holes are clockwise
468
- */
469
- const geoJsonLinearRingSchema = zod.z
470
- .array(geoJsonPositionSchema)
471
- .min(4, {
472
- message: "Coordinates array must contain at least 4 positions. 3 to make a non-line shape and 1 to close the shape (duplicate of first)",
473
- })
474
- .superRefine((coords, ctx) => {
475
- const first = coords[0];
476
- const last = coords[coords.length - 1];
477
- // Check if first and last coordinates match
478
- if (JSON.stringify(first) !== JSON.stringify(last)) {
479
- ctx.addIssue({
480
- code: zod.z.ZodIssueCode.custom,
481
- message: "First and last coordinate positions must be identical (to close the linear ring aka polygon).",
482
- });
483
- }
484
- // Check if consecutive points are identical (excluding first and last)
485
- for (let i = 1; i < coords.length - 1; i++) {
486
- if (JSON.stringify(coords[i]) === JSON.stringify(coords[i - 1])) {
487
- ctx.addIssue({
488
- code: zod.z.ZodIssueCode.custom,
489
- message: `Consecutive coordinates at index ${i - 1} and ${i} should not be identical.`,
490
- });
491
- }
492
- }
493
- });
494
- /**
495
- * Polygon geometry object.
496
- * https://tools.ietf.org/html/rfc7946#section-3.1.6
497
- */
498
- const geoJsonPolygonSchema = zod.z.strictObject({
499
- type: zod.z.literal("Polygon"),
500
- coordinates: zod.z.array(geoJsonLinearRingSchema),
501
- });
502
- /**
503
- * MultiPolygon geometry object.
504
- * https://tools.ietf.org/html/rfc7946#section-3.1.7
505
- */
506
- const geoJsonMultiPolygonSchema = zod.z.strictObject({
507
- type: zod.z.literal("MultiPolygon"),
508
- coordinates: zod.z.array(zod.z.array(geoJsonLinearRingSchema)),
509
- });
510
- // The same for Geometry, GeometryCollection, GeoJsonProperties, Feature, FeatureCollection, etc.
511
- const geoJsonGeometrySchema = zod.z.union([
512
- geoJsonPointSchema,
513
- geoJsonMultiPointSchema,
514
- geoJsonLineStringSchema,
515
- geoJsonMultiLineStringSchema,
516
- geoJsonPolygonSchema,
517
- geoJsonMultiPolygonSchema,
518
- ]);
519
- //* -------- Bbox -------- *//
520
- /**
521
- * 2D bounding box of the GeoJSON object.
522
- * The value of the Bbox member is an array of length 4.
523
- *
524
- * [min_lon, min_lat, max_lon, max_lat]
525
- */
526
- const geoJsonBboxSchema = zod.z
527
- .tuple([zod.z.number(), zod.z.number(), zod.z.number(), zod.z.number()])
528
- .refine(([minLng, minLat, maxLng, maxLat]) => maxLng > minLng && maxLat > minLat, {
529
- message: "Invalid bounding box: maxLng should be greater than minLng, and maxLat should be greater than minLat.",
530
- });
531
-
532
- const EARTH_RADIUS = 6378137; // Earth’s mean radius in meters
533
- /**
534
- * @description Creates a polygon (with no holes) from a bounding box.
535
- */
536
- const getPolygonFromBbox = (bbox) => {
537
- const [minLon, minLat, maxLon, maxLat] = bbox;
538
- return {
539
- type: "Polygon",
540
- coordinates: [
541
- [
542
- [minLon, minLat],
543
- [maxLon, minLat],
544
- [maxLon, maxLat],
545
- [minLon, maxLat],
546
- [minLon, minLat],
547
- ],
548
- ],
549
- };
550
- };
551
- /**
552
- * @description Creates a bounding box from a GeoJSON Polygon.
553
- */
554
- const getBboxFromGeoJsonPolygon = (polygon) => {
555
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
556
- if (!polygonParsed.success) {
557
- return null;
558
- }
559
- const points = polygonParsed.data.coordinates[0];
560
- if (!points) {
561
- // Should never happen since the schema checks for it
562
- return null;
563
- }
564
- const latitudes = points.map(point => point[1]);
565
- const longitudes = points.map(point => point[0]);
566
- return [Math.min(...longitudes), Math.min(...latitudes), Math.max(...longitudes), Math.max(...latitudes)];
567
- };
568
- /**
569
- * @description Creates a round polygon from a point and a radius.
570
- */
571
- const getPolygonFromPointAndRadius = (point, radius) => {
572
- const [lon, lat] = point.coordinates;
573
- // Adjust the number of points based on radius (resolution)
574
- const pointsCount = Math.max(32, Math.floor(radius / 100)); // More points for larger radius
575
- const angleStep = (2 * Math.PI) / pointsCount;
576
- const coordinates = [];
577
- for (let i = 0; i <= pointsCount; i++) {
578
- const angle = i * angleStep;
579
- // Calculate offset in latitude and longitude
580
- const deltaLat = (radius / EARTH_RADIUS) * (180 / Math.PI);
581
- const deltaLon = deltaLat / Math.cos((lat * Math.PI) / 180);
582
- // Calculate new coordinates based on angle
583
- const newLat = lat + deltaLat * Math.sin(angle);
584
- const newLon = lon + deltaLon * Math.cos(angle);
585
- coordinates.push([newLon, newLat]);
586
- }
587
- return {
588
- type: "Polygon",
589
- coordinates: [coordinates],
590
- };
591
- };
592
- /**
593
- * @description Creates a TU bounding box from a GeoJson Polygon.
594
- */
595
- const getBoundingBoxFromGeoJsonPolygon = (polygon) => {
596
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
597
- if (!polygonParsed.success) {
598
- return null;
599
- }
600
- const points = polygonParsed.data.coordinates[0];
601
- if (!points) {
602
- // Should never happen since the schema checks for it
603
- return null;
604
- }
605
- const latitudes = points.map(point => point[1]);
606
- const longitudes = points.map(point => point[0]);
607
- return {
608
- nw: {
609
- latitude: Math.max(...latitudes),
610
- longitude: Math.min(...longitudes),
611
- },
612
- se: {
613
- latitude: Math.min(...latitudes),
614
- longitude: Math.max(...longitudes),
615
- },
616
- };
617
- };
618
- /**
619
- * @description Creates a GeoJSON Polygon from a TU bounding box.
620
- */
621
- const getGeoJsonPolygonFromBoundingBox = (boundingBox) => {
622
- const { nw, se } = boundingBox;
623
- return {
624
- type: "Polygon",
625
- coordinates: [
626
- [
627
- [nw.longitude, nw.latitude], // Northwest corner
628
- [se.longitude, nw.latitude], // Northeast corner
629
- [se.longitude, se.latitude], // Southeast corner
630
- [nw.longitude, se.latitude], // Southwest corner
631
- [nw.longitude, nw.latitude], // Close the loop back to Northwest corner
632
- ],
633
- ],
634
- };
635
- };
636
- /**
637
- * @description Creates TU point coordinate from a GeoJSON Point.
638
- */
639
- const getPointCoordinateFromGeoJsonPoint = (point) => {
640
- return { latitude: point.coordinates[1], longitude: point.coordinates[0] };
641
- };
642
- /**
643
- * @description Gets the extreme point of a polygon in a given direction.
644
- * @param {object} params - The parameters object
645
- * @param {GeoJsonPolygon} params.polygon - The polygon to get the extreme point from
646
- * @param {("top" | "right" | "bottom" | "left")} params.direction - The direction to get the extreme point in
647
- * @returns {GeoJsonPoint} The extreme point in the given direction
648
- */
649
- const getExtremeGeoJsonPointFromPolygon = ({ polygon, direction, }) => {
650
- var _a, _b, _c;
651
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
652
- if (!polygonParsed.success) {
653
- return null;
654
- }
655
- const firstPoint = (_a = polygonParsed.data.coordinates[0]) === null || _a === void 0 ? void 0 : _a[0];
656
- if (!firstPoint) {
657
- // Should never happen since the schema checks for it
658
- return null;
659
- }
660
- const extremePosition = (_b = polygonParsed.data.coordinates[0]) === null || _b === void 0 ? void 0 : _b.reduce((extremePoint, currentPoint) => {
661
- var _a, _b, _c, _d;
662
- switch (direction) {
663
- case "top":
664
- 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;
665
- case "right":
666
- 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;
667
- case "bottom":
668
- 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;
669
- case "left":
670
- 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;
671
- default: {
672
- throw new Error(`${direction} is not known`);
673
- }
674
- }
675
- }, (_c = polygonParsed.data.coordinates[0]) === null || _c === void 0 ? void 0 : _c[0]);
676
- return extremePosition
677
- ? {
678
- type: "Point",
679
- coordinates: extremePosition,
680
- }
681
- : null; // Should never happen since the schema checks for it
682
- };
683
- /**
684
- * Checks if a position is inside a linear ring. On edge is considered inside.
685
- */
686
- const isGeoJsonPositionInLinearRing = ({ position, linearRing, }) => {
687
- const linearRingParsed = geoJsonLinearRingSchema.safeParse(linearRing);
688
- if (!linearRingParsed.success) {
689
- return null;
690
- }
691
- let inside = false;
692
- const [x, y] = position;
693
- for (let i = 0, j = linearRingParsed.data.length - 1; i < linearRingParsed.data.length; j = i++) {
694
- const point1 = linearRingParsed.data[i];
695
- const point2 = linearRingParsed.data[j];
696
- if (!point1 || !point2) {
697
- continue;
698
- }
699
- const [xi, yi] = point1;
700
- const [xj, yj] = point2;
701
- const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;
702
- if (intersect) {
703
- inside = !inside;
704
- }
705
- }
706
- return inside;
707
- };
708
- /**
709
- * @description Checks if a point is inside a polygon.
710
- */
711
- const isGeoJsonPointInPolygon = ({ point, polygon, }) => {
712
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
713
- if (!polygonParsed.success) {
714
- return null;
715
- }
716
- return polygonParsed.data.coordinates.some(linearRing => isGeoJsonPositionInLinearRing({ position: point.coordinates, linearRing }));
717
- };
718
- /**
719
- * Checks if polygon1 is fully contained within polygon2
720
- */
721
- const isFullyContainedInGeoJsonPolygon = (polygon1, polygon2) => {
722
- const polygon1Parsed = geoJsonPolygonSchema.safeParse(polygon1);
723
- const polygon2Parsed = geoJsonPolygonSchema.safeParse(polygon2);
724
- // The schema checks more than a TypeScript type can represent
725
- if (!polygon1Parsed.success || !polygon2Parsed.success) {
726
- return null;
727
- }
728
- return polygon1Parsed.data.coordinates.every(linearRing => polygon2Parsed.data.coordinates.some(lr => linearRing.every(position => isGeoJsonPositionInLinearRing({ position, linearRing: lr }))));
729
- };
730
- /**
731
- * @description Gets the intersection between two GeoJSON polygons. If one polygon is fully contained within the other,
732
- * returns the contained polygon. Otherwise returns a MultiPolygon representing the intersection.
733
- * @param polygon1 The first polygon to check intersection
734
- * @param polygon2 The second polygon to check intersection
735
- * @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon (if one contains the other) or MultiPolygon
736
- */
737
- const getGeoJsonPolygonIntersection = (polygon1, polygon2) => {
738
- const polygon1Parsed = geoJsonPolygonSchema.safeParse(polygon1);
739
- const polygon2Parsed = geoJsonPolygonSchema.safeParse(polygon2);
740
- if (!polygon1Parsed.success || !polygon2Parsed.success) {
741
- return null;
742
- }
743
- if (isFullyContainedInGeoJsonPolygon(polygon1, polygon2)) {
744
- return polygon1;
745
- }
746
- if (isFullyContainedInGeoJsonPolygon(polygon2, polygon1)) {
747
- return polygon2;
748
- }
749
- const intersectionResult = polygonClipping.intersection(polygon1.coordinates, polygon2.coordinates);
750
- if (intersectionResult.length === 1 && intersectionResult[0]) {
751
- return {
752
- type: "Polygon",
753
- coordinates: intersectionResult[0],
754
- };
755
- }
756
- return {
757
- type: "MultiPolygon",
758
- coordinates: polygonClipping.intersection(polygon1.coordinates, polygon2.coordinates),
759
- };
760
- };
761
-
762
- //! These tools are used to bridge the gap with out poorly typed graphql types
763
- // Should be ideally be avoided but are needed until we fix the graphql types
764
- const isDoubleNestedCoords = (coords) => Array.isArray(coords) &&
765
- Array.isArray(coords[0]) &&
766
- Array.isArray(coords[0][0]) &&
767
- typeof coords[0][0][0] === "number";
768
- const isSingleCoords = (coords) => typeof coords[0] === "number";
769
- /**
770
- * @description Returns coordinates in consistent format
771
- * @param inconsistentCoordinates Single point, array of points or nested array of points
772
- * @returns {GeoJsonPosition[]} Array of standardized coordinates
773
- */
774
- const coordinatesToStandardFormat = (inconsistentCoordinates) => {
775
- if (!inconsistentCoordinates) {
776
- return [];
777
- }
778
- if (isSingleCoords(inconsistentCoordinates)) {
779
- return [inconsistentCoordinates];
780
- }
781
- if (isDoubleNestedCoords(inconsistentCoordinates)) {
782
- return inconsistentCoordinates[0] || [];
783
- }
784
- if (inconsistentCoordinates[0] && typeof inconsistentCoordinates[0][0] === "number") {
785
- return inconsistentCoordinates;
786
- }
787
- return [];
788
- };
789
- /**
790
- * @description Extracts a point coordinate from a GeoJSON object.
791
- * @param geoObject A GeoJSON object.
792
- * @returns {PointCoordinate} A point coordinate.
793
- */
794
- const getPointCoordinateFromGeoJsonObject = (geoObject) => {
795
- if (!geoObject) {
796
- return undefined;
797
- }
798
- else if ("geometry" in geoObject) {
799
- return getPointCoordinateFromGeoJsonObject(geoObject.geometry);
800
- }
801
- else if ("coordinates" in geoObject &&
802
- Array.isArray(geoObject.coordinates) &&
803
- typeof geoObject.coordinates[0] === "number" &&
804
- typeof geoObject.coordinates[1] === "number") {
805
- const [point] = coordinatesToStandardFormat(geoObject.coordinates);
806
- if (point) {
807
- return { latitude: point[1], longitude: point[0] };
808
- }
809
- else {
810
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
811
- }
812
- }
813
- else {
814
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
815
- }
816
- };
817
- /**
818
- * @description Extracts multiple point coordinates from a GeoJSON object.
819
- * @param geoObject A GeoJSON object.
820
- * @returns {PointCoordinate[]} An array of point coordinates.
821
- * @example getMultipleCoordinatesFromGeoJsonObject({ type: "Point", coordinates: [1, 2] }) // [{ longitude: 1, latitude: 2 }]
822
- */
823
- const getMultipleCoordinatesFromGeoJsonObject = (geoObject) => {
824
- if (!geoObject) {
825
- return undefined;
826
- }
827
- else if ("geometry" in geoObject) {
828
- return getMultipleCoordinatesFromGeoJsonObject(geoObject.geometry);
829
- }
830
- else if ("coordinates" in geoObject) {
831
- return coordinatesToStandardFormat(geoObject.coordinates).map(([longitude, latitude]) => ({ longitude, latitude }));
832
- }
833
- else {
834
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
835
- }
836
- };
837
-
838
- //* -------- Trackunit-invented schemas and types to extend the GeoJson spec -------- *//
839
- /**
840
- * Polygon geometry object that explicitly disallows holes.
841
- *
842
- * Same as geoJsonPolygonSchema but type disallows holes by
843
- * using tuple of one single linear ring instead of an array.
844
- */
845
- const tuGeoJsonPolygonNoHolesSchema = zod.z.strictObject({
846
- //The type is still "Polygon" (not PolygonNoHoles or similar) since it's always
847
- //compliant with Polygon, just not the other way around
848
- type: zod.z.literal("Polygon"),
849
- //uses tuple instead of array to enforce only 1 linear ring aka the polygon itself
850
- coordinates: zod.z.tuple([geoJsonLinearRingSchema]),
851
- });
852
- /**
853
- * Point radius object.
854
- * For when you wish to define an area by a point and a radius.
855
- *
856
- * radius is in meters
857
- */
858
- const tuGeoJsonPointRadiusSchema = zod.z.strictObject({
859
- type: zod.z.literal("PointRadius"),
860
- coordinates: geoJsonPositionSchema,
861
- radius: zod.z.number().positive(), // in meters
862
- });
863
- /**
864
- * A Polygon with exactly 5 points and 4 horizontal/vertical sides that form a normal rectangular box.
865
- */
866
- const tuGeoJsonRectangularBoxPolygonSchema = zod.z
867
- .strictObject({
868
- type: zod.z.literal("Polygon"),
869
- coordinates: zod.z.array(geoJsonLinearRingSchema),
870
- })
871
- .superRefine((data, ctx) => {
872
- const coordinates = data.coordinates[0];
873
- // Validate polygon has exactly 5 points
874
- if ((coordinates === null || coordinates === void 0 ? void 0 : coordinates.length) !== 5) {
875
- ctx.addIssue({
876
- code: zod.z.ZodIssueCode.custom,
877
- message: "Polygon must have exactly 5 coordinates to form a closed box.",
878
- });
879
- return;
880
- }
881
- // Check each side is either horizontal or vertical
882
- for (let i = 0; i < 4; i++) {
883
- const point1 = coordinates[i];
884
- const point2 = coordinates[i + 1];
885
- if (point1 === undefined || point2 === undefined) {
886
- ctx.addIssue({
887
- code: zod.z.ZodIssueCode.custom,
888
- message: "Each coordinate must be a defined point.",
889
- });
890
- return;
891
- }
892
- const [x1, y1] = point1;
893
- const [x2, y2] = point2;
894
- // Ensure each line segment is either horizontal or vertical
895
- if (x1 !== x2 && y1 !== y2) {
896
- ctx.addIssue({
897
- code: zod.z.ZodIssueCode.custom,
898
- message: "Polygon sides must be horizontal or vertical to form a box shape.",
899
- });
900
- return;
901
- }
902
- }
903
- });
904
-
905
416
  /**
906
417
  * Group an array of items by a key.
907
418
  *
@@ -1549,7 +1060,6 @@ const uuidv4 = () => {
1549
1060
  const uuidv5 = (name, namespace) => uuid.v5(name, namespace);
1550
1061
 
1551
1062
  exports.DateTimeFormat = DateTimeFormat;
1552
- exports.EARTH_RADIUS = EARTH_RADIUS;
1553
1063
  exports.align = align;
1554
1064
  exports.alphabeticallySort = alphabeticallySort;
1555
1065
  exports.arrayLengthCompare = arrayLengthCompare;
@@ -1559,7 +1069,6 @@ exports.capitalize = capitalize;
1559
1069
  exports.convertBlobToBase64 = convertBlobToBase64;
1560
1070
  exports.convertMetersToYards = convertMetersToYards;
1561
1071
  exports.convertYardsToMeters = convertYardsToMeters;
1562
- exports.coordinatesToStandardFormat = coordinatesToStandardFormat;
1563
1072
  exports.dateCompare = dateCompare;
1564
1073
  exports.deleteUndefinedKeys = deleteUndefinedKeys;
1565
1074
  exports.difference = difference;
@@ -1572,30 +1081,10 @@ exports.filterByMultiple = filterByMultiple;
1572
1081
  exports.formatAddress = formatAddress;
1573
1082
  exports.formatCoordinates = formatCoordinates;
1574
1083
  exports.fuzzySearch = fuzzySearch;
1575
- exports.geoJsonBboxSchema = geoJsonBboxSchema;
1576
- exports.geoJsonGeometrySchema = geoJsonGeometrySchema;
1577
- exports.geoJsonLineStringSchema = geoJsonLineStringSchema;
1578
- exports.geoJsonLinearRingSchema = geoJsonLinearRingSchema;
1579
- exports.geoJsonMultiLineStringSchema = geoJsonMultiLineStringSchema;
1580
- exports.geoJsonMultiPointSchema = geoJsonMultiPointSchema;
1581
- exports.geoJsonMultiPolygonSchema = geoJsonMultiPolygonSchema;
1582
- exports.geoJsonPointSchema = geoJsonPointSchema;
1583
- exports.geoJsonPolygonSchema = geoJsonPolygonSchema;
1584
- exports.geoJsonPositionSchema = geoJsonPositionSchema;
1585
- exports.getBboxFromGeoJsonPolygon = getBboxFromGeoJsonPolygon;
1586
- exports.getBoundingBoxFromGeoJsonPolygon = getBoundingBoxFromGeoJsonPolygon;
1587
1084
  exports.getDifferenceBetweenDates = getDifferenceBetweenDates;
1588
1085
  exports.getEndOfDay = getEndOfDay;
1589
- exports.getExtremeGeoJsonPointFromPolygon = getExtremeGeoJsonPointFromPolygon;
1590
1086
  exports.getFirstLevelObjectPropertyDifferences = getFirstLevelObjectPropertyDifferences;
1591
- exports.getGeoJsonPolygonFromBoundingBox = getGeoJsonPolygonFromBoundingBox;
1592
- exports.getGeoJsonPolygonIntersection = getGeoJsonPolygonIntersection;
1593
1087
  exports.getISOStringFromDate = getISOStringFromDate;
1594
- exports.getMultipleCoordinatesFromGeoJsonObject = getMultipleCoordinatesFromGeoJsonObject;
1595
- exports.getPointCoordinateFromGeoJsonObject = getPointCoordinateFromGeoJsonObject;
1596
- exports.getPointCoordinateFromGeoJsonPoint = getPointCoordinateFromGeoJsonPoint;
1597
- exports.getPolygonFromBbox = getPolygonFromBbox;
1598
- exports.getPolygonFromPointAndRadius = getPolygonFromPointAndRadius;
1599
1088
  exports.getResizedDimensions = getResizedDimensions;
1600
1089
  exports.getStartOfDay = getStartOfDay;
1601
1090
  exports.groupBy = groupBy;
@@ -1603,9 +1092,6 @@ exports.groupTinyDataToOthers = groupTinyDataToOthers;
1603
1092
  exports.hourIntervals = hourIntervals;
1604
1093
  exports.intersection = intersection;
1605
1094
  exports.isArrayEqual = isArrayEqual;
1606
- exports.isFullyContainedInGeoJsonPolygon = isFullyContainedInGeoJsonPolygon;
1607
- exports.isGeoJsonPointInPolygon = isGeoJsonPointInPolygon;
1608
- exports.isGeoJsonPositionInLinearRing = isGeoJsonPositionInLinearRing;
1609
1095
  exports.isSorted = isSorted;
1610
1096
  exports.isUUID = isUUID;
1611
1097
  exports.isValidImage = isValidImage;
@@ -1633,9 +1119,6 @@ exports.toUUID = toUUID;
1633
1119
  exports.trimIds = trimIds;
1634
1120
  exports.trimPath = trimPath;
1635
1121
  exports.truthy = truthy;
1636
- exports.tuGeoJsonPointRadiusSchema = tuGeoJsonPointRadiusSchema;
1637
- exports.tuGeoJsonPolygonNoHolesSchema = tuGeoJsonPolygonNoHolesSchema;
1638
- exports.tuGeoJsonRectangularBoxPolygonSchema = tuGeoJsonRectangularBoxPolygonSchema;
1639
1122
  exports.unionArraysByKey = unionArraysByKey;
1640
1123
  exports.uuidv3 = uuidv3;
1641
1124
  exports.uuidv4 = uuidv4;