@konfirm/geojson 1.0.0 → 1.0.1

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.
Files changed (127) hide show
  1. package/README.md +7 -7
  2. package/dist/{geojson.d.ts → main.d.mts} +18 -79
  3. package/dist/main.d.ts +137 -15
  4. package/dist/main.global.js +853 -0
  5. package/dist/main.global.js.map +1 -0
  6. package/dist/main.js +824 -0
  7. package/dist/main.js.map +1 -0
  8. package/dist/main.mjs +772 -0
  9. package/dist/main.mjs.map +1 -0
  10. package/package.json +101 -63
  11. package/.editorconfig +0 -16
  12. package/.github/workflows/release.yml +0 -21
  13. package/.github/workflows/tests.yml +0 -56
  14. package/CHANGELOG.md +0 -21
  15. package/dist/Domain/Constants.d.ts +0 -5
  16. package/dist/Domain/GeoJSON/Concept/Altitude.d.ts +0 -3
  17. package/dist/Domain/GeoJSON/Concept/BoundingBox.d.ts +0 -6
  18. package/dist/Domain/GeoJSON/Concept/ExteriorRing.d.ts +0 -4
  19. package/dist/Domain/GeoJSON/Concept/GeoJSONObject.d.ts +0 -11
  20. package/dist/Domain/GeoJSON/Concept/InteriorRing.d.ts +0 -4
  21. package/dist/Domain/GeoJSON/Concept/Latitude.d.ts +0 -3
  22. package/dist/Domain/GeoJSON/Concept/LinearRing.d.ts +0 -4
  23. package/dist/Domain/GeoJSON/Concept/Longitude.d.ts +0 -3
  24. package/dist/Domain/GeoJSON/Concept/Position.d.ts +0 -7
  25. package/dist/Domain/GeoJSON/Feature.d.ts +0 -12
  26. package/dist/Domain/GeoJSON/FeatureCollection.d.ts +0 -8
  27. package/dist/Domain/GeoJSON/GeoJSON.d.ts +0 -7
  28. package/dist/Domain/GeoJSON/Geometry/LineString.d.ts +0 -11
  29. package/dist/Domain/GeoJSON/Geometry/MultiLineString.d.ts +0 -7
  30. package/dist/Domain/GeoJSON/Geometry/MultiPoint.d.ts +0 -8
  31. package/dist/Domain/GeoJSON/Geometry/MultiPolygon.d.ts +0 -7
  32. package/dist/Domain/GeoJSON/Geometry/Point.d.ts +0 -11
  33. package/dist/Domain/GeoJSON/Geometry/Polygon.d.ts +0 -11
  34. package/dist/Domain/GeoJSON/Geometry.d.ts +0 -9
  35. package/dist/Domain/GeoJSON/GeometryCollection.d.ts +0 -8
  36. package/dist/Domain/GeoJSON/GeometryObject.d.ts +0 -12
  37. package/dist/Domain/Guards/Number.d.ts +0 -3
  38. package/dist/Domain/Guards/Tuple.d.ts +0 -3
  39. package/dist/Domain/Iterator/IterablePair.d.ts +0 -32
  40. package/dist/Domain/Iterator/SimpleGeometry.d.ts +0 -90
  41. package/dist/Domain/Utility/Calculate.d.ts +0 -9
  42. package/dist/Domain/Utility/Distance.d.ts +0 -3
  43. package/dist/Domain/Utility/Intersect.d.ts +0 -2
  44. package/dist/Domain/Utility/Segments.d.ts +0 -2
  45. package/dist/Domain/Utility/Winding.d.ts +0 -3
  46. package/dist/geojson.cjs.js +0 -655
  47. package/dist/geojson.cjs.min.js +0 -1
  48. package/dist/geojson.es.js +0 -627
  49. package/dist/geojson.es.min.js +0 -1
  50. package/dist/geojson.js +0 -660
  51. package/dist/geojson.min.js +0 -1
  52. package/rollup.config.mjs +0 -43
  53. package/source/Domain/Constants.ts +0 -5
  54. package/source/Domain/GeoJSON/Concept/Altitude.ts +0 -9
  55. package/source/Domain/GeoJSON/Concept/BoundingBox.ts +0 -31
  56. package/source/Domain/GeoJSON/Concept/ExteriorRing.ts +0 -12
  57. package/source/Domain/GeoJSON/Concept/GeoJSONObject.ts +0 -23
  58. package/source/Domain/GeoJSON/Concept/InteriorRing.ts +0 -12
  59. package/source/Domain/GeoJSON/Concept/Latitude.ts +0 -7
  60. package/source/Domain/GeoJSON/Concept/LinearRing.ts +0 -14
  61. package/source/Domain/GeoJSON/Concept/Longitude.ts +0 -7
  62. package/source/Domain/GeoJSON/Concept/Position.ts +0 -18
  63. package/source/Domain/GeoJSON/Feature.ts +0 -24
  64. package/source/Domain/GeoJSON/FeatureCollection.ts +0 -16
  65. package/source/Domain/GeoJSON/GeoJSON.ts +0 -9
  66. package/source/Domain/GeoJSON/Geometry/LineString.ts +0 -12
  67. package/source/Domain/GeoJSON/Geometry/MultiLineString.ts +0 -9
  68. package/source/Domain/GeoJSON/Geometry/MultiPoint.ts +0 -10
  69. package/source/Domain/GeoJSON/Geometry/MultiPolygon.ts +0 -9
  70. package/source/Domain/GeoJSON/Geometry/Point.ts +0 -12
  71. package/source/Domain/GeoJSON/Geometry/Polygon.ts +0 -20
  72. package/source/Domain/GeoJSON/Geometry.ts +0 -11
  73. package/source/Domain/GeoJSON/GeometryCollection.ts +0 -23
  74. package/source/Domain/GeoJSON/GeometryObject.ts +0 -20
  75. package/source/Domain/Guards/Number.ts +0 -13
  76. package/source/Domain/Guards/Tuple.ts +0 -6
  77. package/source/Domain/Guards/Utility.ts +0 -1
  78. package/source/Domain/Iterator/IterablePair.ts +0 -47
  79. package/source/Domain/Iterator/SimpleGeometry.ts +0 -137
  80. package/source/Domain/Utility/Calculate.ts +0 -143
  81. package/source/Domain/Utility/Distance.ts +0 -56
  82. package/source/Domain/Utility/Intersect.ts +0 -42
  83. package/source/Domain/Utility/Numeric.ts +0 -8
  84. package/source/Domain/Utility/Segments.ts +0 -5
  85. package/source/Domain/Utility/Winding.ts +0 -19
  86. package/source/main.ts +0 -20
  87. package/test/Domain/GeoJSON/Concept/Altitude.ts +0 -58
  88. package/test/Domain/GeoJSON/Concept/BoundingBox.ts +0 -77
  89. package/test/Domain/GeoJSON/Concept/ExteriorRing.ts +0 -65
  90. package/test/Domain/GeoJSON/Concept/GeoJSONObject.ts +0 -56
  91. package/test/Domain/GeoJSON/Concept/InteriorRing.ts +0 -65
  92. package/test/Domain/GeoJSON/Concept/Latitude.ts +0 -56
  93. package/test/Domain/GeoJSON/Concept/LinearRing.ts +0 -63
  94. package/test/Domain/GeoJSON/Concept/Longitude.ts +0 -56
  95. package/test/Domain/GeoJSON/Concept/Position.ts +0 -56
  96. package/test/Domain/GeoJSON/Feature.ts +0 -9
  97. package/test/Domain/GeoJSON/FeatureCollection.ts +0 -9
  98. package/test/Domain/GeoJSON/GeoJSON.ts +0 -21
  99. package/test/Domain/GeoJSON/Geometry/LineString.ts +0 -11
  100. package/test/Domain/GeoJSON/Geometry/MultiLineString.ts +0 -11
  101. package/test/Domain/GeoJSON/Geometry/MultiPoint.ts +0 -11
  102. package/test/Domain/GeoJSON/Geometry/MultiPolygon.ts +0 -11
  103. package/test/Domain/GeoJSON/Geometry/Point.ts +0 -11
  104. package/test/Domain/GeoJSON/Geometry/Polygon.ts +0 -11
  105. package/test/Domain/GeoJSON/Geometry.ts +0 -9
  106. package/test/Domain/GeoJSON/GeometryCollection.ts +0 -9
  107. package/test/Domain/GeoJSON/GeometryObject.ts +0 -4
  108. package/test/Domain/Guards/Number.ts +0 -49
  109. package/test/Domain/Guards/Tuple.ts +0 -27
  110. package/test/Domain/Iterator/IterablePair.ts +0 -203
  111. package/test/Domain/Iterator/SimpleGeometry.ts +0 -195
  112. package/test/Domain/Utility/Calculate.ts +0 -178
  113. package/test/Domain/Utility/Distance.ts +0 -19
  114. package/test/Domain/Utility/Intersect.ts +0 -54
  115. package/test/Domain/Utility/Numeric.ts +0 -30
  116. package/test/Domain/Utility/Winding.ts +0 -52
  117. package/test/README.ts +0 -123
  118. package/test/data/Distance.ts +0 -51
  119. package/test/data/HolySee.ts +0 -74
  120. package/test/data/Intersect.ts +0 -300
  121. package/test/data/Italy.ts +0 -2883
  122. package/test/data/SanMarino.ts +0 -83
  123. package/test/data/Shapes.ts +0 -107
  124. package/test/helper/geometry.ts +0 -76
  125. package/test/helper/malform.ts +0 -82
  126. package/test/main.ts +0 -4
  127. package/tsconfig.json +0 -12
@@ -1,12 +0,0 @@
1
- import { Guard, Validator } from "@konfirm/guard";
2
- import { GeoJSONObject } from "./Concept/GeoJSONObject";
3
- type GeometryBase = GeoJSONObject & {
4
- coordinates: Array<unknown>;
5
- };
6
- export type GeometryObject<T extends GeometryBase> = Omit<GeometryBase, 'coordinates'> & T;
7
- export type MultiGeometryObject<T extends GeometryBase> = GeometryObject<{
8
- type: `Multi${T['type']}`;
9
- coordinates: Array<T['coordinates']>;
10
- }>;
11
- export declare function isGeometryObject<T extends GeometryBase>(type: string, isCoordinates: Validator): Guard<T>;
12
- export {};
@@ -1,3 +0,0 @@
1
- import { Guard } from './Utility';
2
- export declare function isNumberValue<T extends number>(value: any): value is T;
3
- export declare function isNumberBetween<T extends number>(a: number, b?: number): Guard<T>;
@@ -1,3 +0,0 @@
1
- import { Validator } from "@konfirm/guard";
2
- import { Guard } from './Utility';
3
- export declare function isTuple<T extends Array<unknown>>(...rules: Array<Validator>): Guard<T>;
@@ -1,32 +0,0 @@
1
- /**
2
- * Iterator class which traverses all value pairs of two or more Iterable instances
3
- *
4
- * @export
5
- * @class IterablePairIterator
6
- * @template T
7
- */
8
- export declare class IterablePairIterator<T = unknown> {
9
- private readonly iterators;
10
- /**
11
- * Constructs a new instance of IterablePairIterator
12
- *
13
- * @param iterators
14
- */
15
- constructor(...iterators: [Iterable<T>, Iterable<T>, ...Array<Iterable<T>>]);
16
- /**
17
- * Generator yielding all value pairs from the provided iterators
18
- *
19
- * @return {*} {Iterator<[T, T]>}
20
- * @memberof IterablePairIterator
21
- */
22
- [Symbol.iterator](): Iterator<[T, T]>;
23
- /**
24
- * Create unique Iterator<T> combinations to traverse over
25
- *
26
- * @private
27
- * @param {Array<Iterable<T>>} source
28
- * @return {*} {Array<[Iterable<T>, Iterable<T>]>}
29
- * @memberof IterablePairIterator
30
- */
31
- private pairs;
32
- }
@@ -1,90 +0,0 @@
1
- import { LineString, Point, Polygon } from "../../main";
2
- import { GeoJSON } from "../GeoJSON/GeoJSON";
3
- type SimpleGeometry = Point | LineString | Polygon;
4
- /**
5
- * Iterator class to turn any GeoJSON structure into one or more SimpleGeometry (Point | LineString | Polygon) objects
6
- *
7
- * @export
8
- * @class SimpleGeometryIterator
9
- */
10
- export declare class SimpleGeometryIterator {
11
- private readonly inputs;
12
- /**
13
- * Creates an instance of SimpleGeometryIterator
14
- *
15
- * @param {...[GeoJSON, ...Array<GeoJSON>]} inputs
16
- * @memberof SimpleGeometryIterator
17
- */
18
- constructor(...inputs: [GeoJSON, ...Array<GeoJSON>]);
19
- /**
20
- * Generator yielding all SimpleGeometry objects from the provided GeoJSON structure(s)
21
- *
22
- * @return {*} {Iterator<SimpleGeometry>}
23
- * @memberof SimpleGeometryIterator
24
- */
25
- [Symbol.iterator](): Iterator<SimpleGeometry>;
26
- /**
27
- * unwrap any GeoJSON object into one or more SimpleGeometry object
28
- *
29
- * @private
30
- * @param {GeoJSON} geo
31
- * @return {*} {Iterable<SimpleGeometry>}
32
- * @memberof SimpleGeometryIterator
33
- */
34
- private unwrap;
35
- /**
36
- * Generate the geometries in a GeometryCollection
37
- *
38
- * @private
39
- * @param {GeometryCollection} { geometries }
40
- * @return {*} {Iterable<SimpleGeometry>}
41
- * @memberof SimpleGeometryIterator
42
- */
43
- private GeometryCollection;
44
- /**
45
- * Generate the geometries of the Feature object(s) in a FeatureCollection
46
- *
47
- * @private
48
- * @param {FeatureCollection} { features }
49
- * @return {*} {Iterable<SimpleGeometry>}
50
- * @memberof SimpleGeometryIterator
51
- */
52
- private FeatureCollection;
53
- /**
54
- * Generate the geometry of a Feature object
55
- *
56
- * @private
57
- * @param {Feature} { geometry }
58
- * @return {*} {Iterable<SimpleGeometry>}
59
- * @memberof SimpleGeometryIterator
60
- */
61
- private Feature;
62
- /**
63
- * Generate Point objects from a MultiPoint object
64
- *
65
- * @private
66
- * @param {MultiPoint} multi
67
- * @return {*} {Iterable<Point>}
68
- * @memberof SimpleGeometryIterator
69
- */
70
- private MultiPoint;
71
- /**
72
- * Generate LineString objects from a MultiLineString object
73
- *
74
- * @private
75
- * @param {MultiLineString} multi
76
- * @return {*} {Iterable<LineString>}
77
- * @memberof SimpleGeometryIterator
78
- */
79
- private MultiLineString;
80
- /**
81
- * Generate Polygon objects from a MultiPolygon object
82
- *
83
- * @private
84
- * @param {MultiPolygon} multi
85
- * @return {*} {Iterable<Polygon>}
86
- * @memberof SimpleGeometryIterator
87
- */
88
- private MultiPolygon;
89
- }
90
- export {};
@@ -1,9 +0,0 @@
1
- import { Point } from "../GeoJSON/Geometry/Point";
2
- export type PointToPointCalculation = 'cartesian' | 'haversine' | 'vincenty' | ((a: Point['coordinates'], b: Point['coordinates']) => number);
3
- export declare function getClosestPointOnLineByPoint(point: Point['coordinates'], line: [Point['coordinates'], Point['coordinates']]): Point['coordinates'];
4
- export declare function getDistanceOfPointToPoint(a: Point['coordinates'], b: Point['coordinates'], calculation: PointToPointCalculation): number;
5
- export declare function getDistanceOfPointToLine(point: Point['coordinates'], line: [Point['coordinates'], Point['coordinates']], calculation: PointToPointCalculation): number;
6
- export declare function getDistanceOfLineToLine(a: [Point['coordinates'], Point['coordinates']], b: [Point['coordinates'], Point['coordinates']], calculation: PointToPointCalculation): number;
7
- export declare function isLinesCrossing(a: [Point['coordinates'], Point['coordinates']], b: [Point['coordinates'], Point['coordinates']]): boolean;
8
- export declare function isPointOnLine(point: Point['coordinates'], line: [Point['coordinates'], Point['coordinates']], threshold?: number): boolean;
9
- export declare function isPointInRing(p: Point['coordinates'], ring: Array<Point['coordinates']>): boolean;
@@ -1,3 +0,0 @@
1
- import { GeoJSON } from '../GeoJSON/GeoJSON';
2
- import { PointToPointCalculation } from './Calculate';
3
- export declare function distance(a: GeoJSON, b: GeoJSON, calculation?: PointToPointCalculation): number;
@@ -1,2 +0,0 @@
1
- import { GeoJSON } from '../GeoJSON/GeoJSON';
2
- export declare function intersect(a: GeoJSON, b: GeoJSON): boolean;
@@ -1,2 +0,0 @@
1
- import { Point } from '../GeoJSON/Geometry/Point';
2
- export declare function segments(line: Array<Point['coordinates']>): Array<[Point['coordinates'], Point['coordinates']]>;
@@ -1,3 +0,0 @@
1
- import { Position } from "../GeoJSON/Concept/Position";
2
- export declare function isClockwiseWinding<T extends Array<Position>>(value: any): value is T;
3
- export declare function isCounterClockwiseWinding<T extends Array<Position>>(value: any): value is T;