@konfirm/geojson 1.0.0 → 1.0.1-beta.0

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,51 +0,0 @@
1
- import { GeoJSON } from '../../source/Domain/GeoJSON/GeoJSON';
2
- import { Polygon } from '../../source/Domain/GeoJSON/Geometry/Polygon';
3
-
4
- const poly: Polygon = {
5
- type: 'Polygon',
6
- coordinates: [
7
- [[0, 0], [0, 7], [2, 7], [2, 5], [4, 5], [4, 7], [7, 7], [7, 5], [9, 5], [9, 7], [11, 7], [11, 0], [0, 0]],
8
- [[2, 2], [5, 2], [5, 4], [2, 4], [2, 2]],
9
- [[7, 2], [9, 2], [9, 4], [7, 4], [7, 2]],
10
- ]
11
- };
12
- export const shapes: Array<{ a: GeoJSON, b: GeoJSON, cartesian: number, haversine: number, vincenty: number }> = [
13
- { a: { type: 'Point', coordinates: [0, 0] }, b: { type: 'Point', coordinates: [1, 0] }, cartesian: 111195.07973436874, haversine: 111195.07973436874, vincenty: 111319.49079322325 },
14
- { a: { type: 'Point', coordinates: [0, 0] }, b: { type: 'Point', coordinates: [1, 1] }, cartesian: 157253.589829502, haversine: 157249.5977681334, vincenty: 156899.56829129544 },
15
-
16
- { a: { type: 'Point', coordinates: [1, 1] }, b: { type: 'LineString', coordinates: [[0, 2], [2, 2]] }, cartesian: 111195.07973436874, haversine: 111195.07973436874, vincenty: 110575.06481449273 },
17
- { a: { type: 'Point', coordinates: [1, 1] }, b: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, cartesian: 0, haversine: 0, vincenty: 0 },
18
- { a: { type: 'Point', coordinates: [3, 3] }, b: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, cartesian: 157253.589829502, haversine: 157177.7682119375, vincenty: 156829.3291160335 },
19
- { a: { type: 'Point', coordinates: [0, 1] }, b: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, cartesian: 78626.794914751, haversine: 78623.30209761004, vincenty: 78448.3205183003 },
20
- { a: { type: 'Point', coordinates: [1, 0] }, b: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, cartesian: 78626.794914751, haversine: 78626.29592703035, vincenty: 78451.24803121673 },
21
-
22
- { a: { type: 'MultiPoint', coordinates: [[9, 9], [1, 0]] }, b: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, cartesian: 78626.794914751, haversine: 78626.29592703035, vincenty: 78451.24803121673 },
23
- { a: { type: 'Point', coordinates: [1, 0] }, b: { type: 'MultiLineString', coordinates: [[[100, 100], [200, 200]], [[0, 0], [2, 2]]] }, cartesian: 78626.794914751, haversine: 78626.29592703035, vincenty: 78451.24803121673 },
24
- { a: { type: 'MultiPoint', coordinates: [[9, 9], [1, 0]] }, b: { type: 'MultiLineString', coordinates: [[[100, 100], [200, 200]], [[0, 0], [2, 2]]] }, cartesian: 78626.794914751, haversine: 78626.29592703035, vincenty: 78451.24803121673 },
25
-
26
- { a: { type: 'Point', coordinates: [2, 2] }, b: { type: 'Polygon', coordinates: [[[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]] }, cartesian: 0, haversine: 0, vincenty: 0 },
27
- { a: { type: 'Point', coordinates: [5, 2] }, b: { type: 'Polygon', coordinates: [[[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]] }, cartesian: 111195.07973436874, haversine: 111127.34097821356, vincenty: 111252.12980016059 },
28
- { a: { type: 'Point', coordinates: [2, 2] }, b: { type: 'Polygon', coordinates: [[[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]] }, cartesian: 111195.07973436874, haversine: 111127.34097821356, vincenty: 110575.06481449273 },
29
-
30
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0]] }, b: { type: 'LineString', coordinates: [[0, 2], [0, 0]] }, cartesian: 0, haversine: 0, vincenty: 0 },
31
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0]] }, b: { type: 'LineString', coordinates: [[1, 2], [1, 0]] }, cartesian: 0, haversine: 0, vincenty: 0 },
32
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0]] }, b: { type: 'LineString', coordinates: [[3, 2], [3, 0]] }, cartesian: 111195.07973436874, haversine: 111195.07973436874, vincenty: 111319.49079322327 },
33
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0]] }, b: { type: 'LineString', coordinates: [[1, 1], [1, 3]] }, cartesian: 111195.07973436874, haversine: 111195.07973436874, vincenty: 110574.38855795695 },
34
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0]] }, b: { type: 'LineString', coordinates: [[1, 1], [3, 3]] }, cartesian: 111195.07973436874, haversine: 111195.07973436874, vincenty: 110574.38855795695 },
35
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 2]] }, b: { type: 'LineString', coordinates: [[2, 0], [0, 2]] }, cartesian: 0, haversine: 0, vincenty: 0 },
36
- { a: { type: 'LineString', coordinates: [[0, 0], [2, 0], [2, 2]] }, b: { type: 'LineString', coordinates: [[0, 2], [0, 0]] }, cartesian: 0, haversine: 0, vincenty: 0 },
37
-
38
- { a: { type: 'LineString', coordinates: [[2, 2], [3, 2]] }, b: { type: 'Polygon', coordinates: [[[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]] }, cartesian: 0, haversine: 0, vincenty: 0 },
39
- { a: { type: 'LineString', coordinates: [[1, 1], [10, 1]] }, b: poly, cartesian: 0, haversine: 0, vincenty: 0 },
40
- { a: { type: 'LineString', coordinates: [[1, 3], [4, 3]] }, b: poly, cartesian: 0, haversine: 0, vincenty: 0 },
41
- { a: { type: 'LineString', coordinates: [[3, 3], [4, 3]] }, b: poly, cartesian: 111195.07973436874, haversine: 111042.6868815999, vincenty: 110576.41652430617 },
42
- { a: { type: 'LineString', coordinates: [[7.5, 3], [8.5, 3]] }, b: poly, cartesian: 55597.53986718437, haversine: 55521.344888509884, vincenty: 55583.97477025055 },
43
- { a: { type: 'LineString', coordinates: [[3, 6], [3, 9]] }, b: poly, cartesian: 111195.07973436874, haversine: 110366.22766612672, vincenty: 110495.20453687456 },
44
-
45
- { a: { type: 'Polygon', coordinates: [[[0, 0], [0, 9], [9, 9], [9, 0], [0, 0]]] }, b: { type: 'Polygon', coordinates: [[[2, 2], [2, 7], [7, 7], [7, 2], [2, 2]]] }, cartesian: 0, haversine: 0, vincenty: 0 },
46
- { a: { type: 'Polygon', coordinates: [[[0, 0], [0, 9], [9, 9], [9, 0], [0, 0]], [[1, 1], [8, 1], [8, 8], [1, 8], [1, 1]]] }, b: { type: 'Polygon', coordinates: [[[2, 2], [2, 7], [7, 7], [7, 2], [2, 2]]] }, cartesian: 111195.07973436874, haversine: 110366.22766612672, vincenty: 110495.20453687456 },
47
-
48
- // // Impossible <-> Possible
49
- { a: { type: 'Impossible', coordinates: [0, 0] } as any, b: { type: 'Point', coordinates: [0, 0] }, cartesian: Infinity, haversine: Infinity, vincenty: Infinity },
50
- { a: { type: 'Point', coordinates: [0, 0] }, b: { type: 'Impossible', coordinates: [0, 0] } as any, cartesian: Infinity, haversine: Infinity, vincenty: Infinity },
51
- ];
@@ -1,74 +0,0 @@
1
- import { Feature, LineString, MultiPoint, Polygon } from "../../source/main";
2
-
3
- export const coordinates: MultiPoint['coordinates'] = [
4
- [12.455663681030273, 41.90628554165478],
5
- [12.457637786865234, 41.90582242096741],
6
- [12.45750904083252, 41.90323527118919],
7
- [12.458131313323975, 41.90296377408531],
8
- [12.458367347717285, 41.902388835231],
9
- [12.458345890045166, 41.90171806669123],
10
- [12.457981109619139, 41.90131879635783],
11
- [12.457423210144043, 41.90115908752542],
12
- [12.456929683685303, 41.90119102932384],
13
- [12.456543445587156, 41.901414621465506],
14
- [12.456221580505371, 41.90165418360565],
15
- [12.454354763031006, 41.90144656313615],
16
- [12.454376220703125, 41.900695929652535],
17
- [12.454547882080078, 41.90034456626665],
18
- [12.454526424407959, 41.90020082614245],
19
- [12.452874183654785, 41.900472334994284],
20
- [12.452852725982666, 41.900296652927864],
21
- [12.451672554016113, 41.900376508472526],
22
- [12.450792789459227, 41.900616074507326],
23
- [12.450792789459227, 41.90082369767715],
24
- [12.448797225952148, 41.900983407348406],
25
- [12.44873285293579, 41.90080772668804],
26
- [12.44802474975586, 41.900663987606414],
27
- [12.44776725769043, 41.90082369767715],
28
- [12.447960376739502, 41.90099937829354],
29
- [12.446715831756592, 41.901765978963454],
30
- [12.446565628051758, 41.90163821282425],
31
- [12.44577169418335, 41.90195762769289],
32
- [12.446587085723877, 41.902356894031726],
33
- [12.446801662445067, 41.902213158437355],
34
- [12.44776725769043, 41.903011685422804],
35
- [12.447617053985596, 41.903107507989986],
36
- [12.448325157165526, 41.90371438090925],
37
- [12.448668479919434, 41.903650499820955],
38
- [12.44901180267334, 41.904672589563994],
39
- [12.448861598968506, 41.904768409638564],
40
- [12.44899034500122, 41.90511974868156],
41
- [12.44922637939453, 41.905199598194436],
42
- [12.449419498443604, 41.90507183892591],
43
- [12.450535297393799, 41.905870330159836],
44
- [12.450342178344727, 41.906014057521375],
45
- [12.450470924377441, 41.90649314638965],
46
- [12.451286315917969, 41.90657299418483],
47
- [12.451479434967041, 41.90636538970964],
48
- [12.453067302703857, 41.906716719964486],
49
- [12.453818321228027, 41.906812536971195],
50
- [12.453839778900146, 41.90698820110995],
51
- [12.455449104309082, 41.90737146664404],
52
- ];
53
- export const multipoint: MultiPoint = {
54
- type: 'MultiPoint',
55
- coordinates,
56
- };
57
- export const linestring: LineString = {
58
- type: 'LineString',
59
- coordinates,
60
- };
61
- export const polygon: Polygon = {
62
- type: 'Polygon',
63
- coordinates: [coordinates.concat([coordinates[0]])]
64
- };
65
- export const feature: Feature = {
66
- type: 'Feature',
67
- properties: {
68
- name: 'Vatican Obelisk',
69
- },
70
- geometry: {
71
- type: 'Point',
72
- coordinates: [12.457240819931028, 41.90221715109714],
73
- },
74
- };
@@ -1,300 +0,0 @@
1
- import * as Italy from './Italy';
2
- import * as HolySee from './HolySee';
3
- import * as SanMarino from './SanMarino';
4
- import { Feature, FeatureCollection, GeoJSON, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from '../../source/main';
5
- import { Geometry } from '../../source/Domain/GeoJSON/Geometry';
6
-
7
- const relative = {
8
- outside1: [
9
- [12.444055080413818, 41.90334706377874],
10
- [12.447037696838379, 41.904784379636986],
11
- [12.449805736541746, 41.90735549729274],
12
- [12.45450496673584, 41.9085372185006]
13
- ],
14
- outside2: [
15
- [12.456951141357422, 41.910597193707545],
16
- [12.456693649291992, 41.90660493327494],
17
- [12.45896816253662, 41.906509115956666],
18
- [12.458603382110596, 41.903139448813754]
19
- ],
20
- partial: [
21
- [12.457487583160399, 41.90226107033812],
22
- [12.458195686340332, 41.90229301158531],
23
- [12.464332580566406, 41.90246868815924]
24
- ],
25
- inside1: [
26
- [12.45425820350647, 41.903925986557695],
27
- [12.454848289489746, 41.90402979284584],
28
- [12.455030679702759, 41.90410964372185],
29
- [12.457063794136047, 41.90400583756355]
30
- ],
31
- inside2: [
32
- [12.454526424407959, 41.90458076185763],
33
- [12.454580068588257, 41.90358661866875]
34
- ]
35
- };
36
-
37
- function center(...points: Array<Array<number>>): Point['coordinates'] {
38
- const s = 1e15;
39
- const c = s * points.length;
40
- const [x, y] = points
41
- .reduce(([x1, y1], [x2, y2]) => [x1 + (x2 * s), y1 + (y2 * s)], [0, 0]);
42
-
43
- return [x / c, y / c];
44
- }
45
-
46
- function geometry<T extends Geometry>(type: T['type'], coordinates: Array<unknown>): T {
47
- return {
48
- type,
49
- coordinates: coordinates.slice() as T['coordinates'],
50
- } as T;
51
- }
52
-
53
- function geometryCollection(...geometries: Array<Geometry | GeometryCollection>): GeometryCollection {
54
- return {
55
- type: 'GeometryCollection',
56
- geometries,
57
- };
58
- }
59
-
60
- function feature(geometry: Geometry): Feature {
61
- return {
62
- type: 'Feature',
63
- properties: null,
64
- geometry,
65
- };
66
- }
67
-
68
- function featureCollection(...features: Array<Feature | Geometry>): FeatureCollection {
69
- return {
70
- type: 'FeatureCollection',
71
- features: features.map((geo) => geo.type === 'Feature' ? geo : feature(geo)),
72
- };
73
- }
74
-
75
- export const shapes: Array<{ a: GeoJSON, b: GeoJSON, intersect: boolean }> = [
76
- // Point <-> Point
77
- { a: geometry<Point>('Point', relative.inside1[0]), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
78
- { a: geometry<Point>('Point', relative.inside1[0]), b: geometry<Point>('Point', relative.inside1[1]), intersect: false },
79
-
80
- // MultiPoint <-> Point
81
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
82
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<Point>('Point', center(relative.inside1[0], relative.inside1[1])), intersect: false },
83
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<Point>('Point', center(relative.inside2[0], relative.inside2[1])), intersect: false },
84
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<Point>('Point', relative.inside2[1]), intersect: false },
85
-
86
- // LineString <-> Point
87
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
88
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<Point>('Point', center(relative.inside1[0], relative.inside1[1])), intersect: true },
89
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<Point>('Point', center(relative.inside2[0], relative.inside2[1])), intersect: false },
90
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<Point>('Point', relative.inside2[1]), intersect: false },
91
-
92
- // MultiLineString <-> Point
93
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1]), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
94
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1]), b: geometry<Point>('Point', center(relative.inside1[0], relative.inside1[1])), intersect: true },
95
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1]), b: geometry<Point>('Point', center(relative.inside2[0], relative.inside2[1])), intersect: false },
96
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1]), b: geometry<Point>('Point', relative.inside2[1]), intersect: false },
97
-
98
- // Polygon <-> Point
99
- { a: HolySee.polygon, b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
100
- { a: HolySee.polygon, b: geometry<Point>('Point', relative.outside1[0]), intersect: false },
101
- { a: SanMarino.polygon, b: geometry<Point>('Point', relative.inside1[0]), intersect: false },
102
- { a: geometry<Polygon>('Polygon', Italy.coordinates[0]), b: geometry<Point>('Point', relative.inside1[0]), intersect: false },
103
- { a: geometry<Polygon>('Polygon', Italy.coordinates[0]), b: geometry<Point>('Point', relative.outside1[0]), intersect: true },
104
-
105
- // MultiPolygon <-> Point
106
- { a: Italy.multipolygon, b: geometry<Point>('Point', relative.inside1[0]), intersect: false },
107
- { a: Italy.multipolygon, b: geometry<Point>('Point', relative.inside2[0]), intersect: false },
108
- { a: Italy.multipolygon, b: geometry<Point>('Point', relative.outside1[0]), intersect: true },
109
- { a: Italy.multipolygon, b: geometry<Point>('Point', relative.outside2[0]), intersect: true },
110
- {
111
- a: geometry<MultiPolygon>('MultiPolygon', [[[[8, 8], [8, 9], [9, 9], [9, 8], [8, 8]]], [[[0, 0], [0, 7], [7, 7], [7, 0], [0, 0]]]]),
112
- b: geometry<Point>('Point', [3, 3]),
113
- intersect: true,
114
- },
115
-
116
- // GeometryCollection <-> Point
117
- { a: geometryCollection(geometry<Point>('Point', relative.inside1[0])), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
118
- { a: geometryCollection(geometry<MultiPoint>('MultiPoint', relative.inside1)), b: geometry<Point>('Point', relative.inside2[1]), intersect: false },
119
-
120
- // Feature <-> Point
121
- { a: feature(Italy.multipolygon), b: geometry<Point>('Point', relative.outside1[0]), intersect: true },
122
- { a: feature(HolySee.polygon), b: geometry<Point>('Point', relative.outside1[0]), intersect: false },
123
-
124
- // FeatureCollection <-> Point
125
- { a: featureCollection(geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1])), b: geometry<Point>('Point', relative.inside1[0]), intersect: true },
126
- { a: featureCollection(geometry<MultiPoint>('MultiPoint', relative.inside1)), b: geometry<Point>('Point', relative.inside2[1]), intersect: false },
127
-
128
-
129
- // MultiPoint <-> MultiPoint
130
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<MultiPoint>('MultiPoint', [relative.inside1[1], relative.inside1[2]]), intersect: true },
131
- { a: geometry<MultiPoint>('MultiPoint', [relative.outside1[0], relative.outside1[1]]), b: geometry<MultiPoint>('MultiPoint', [relative.outside1[1], relative.outside1[2]]), intersect: true },
132
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<MultiPoint>('MultiPoint', [relative.inside1[2], relative.inside1[3]]), intersect: false },
133
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<MultiPoint>('MultiPoint', relative.inside2), intersect: false },
134
-
135
- // MultiPoint <-> LineString
136
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<LineString>('LineString', [relative.inside1[1], relative.inside1[2]]), intersect: true },
137
- { a: geometry<MultiPoint>('MultiPoint', [relative.outside1[0], relative.outside1[1]]), b: geometry<LineString>('LineString', [relative.outside1[1], relative.outside1[2]]), intersect: true },
138
- { a: geometry<MultiPoint>('MultiPoint', [relative.outside1[0], center(relative.outside1[0], relative.outside1[1])]), b: geometry<LineString>('LineString', relative.outside1), intersect: true },
139
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<LineString>('LineString', [relative.inside1[2], relative.inside1[3]]), intersect: false },
140
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<LineString>('LineString', relative.inside2), intersect: false },
141
-
142
- // MultiPoint <-> MultiLineString
143
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<MultiLineString>('MultiLineString', [[relative.inside1[1], relative.inside1[2]], relative.outside1]), intersect: true },
144
- { a: geometry<MultiPoint>('MultiPoint', [relative.outside1[0], relative.outside1[1]]), b: geometry<MultiLineString>('MultiLineString', [[relative.outside1[1], relative.outside1[2]], relative.inside2]), intersect: true },
145
- { a: geometry<MultiPoint>('MultiPoint', [relative.outside1[0], center(relative.outside1[0], relative.outside1[1])]), b: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.outside1]), intersect: true },
146
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: geometry<MultiLineString>('MultiLineString', [relative.inside2, relative.outside1]), intersect: false },
147
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: geometry<MultiLineString>('MultiLineString', [relative.inside2, relative.outside1]), intersect: false },
148
-
149
- // MultiPoint <-> Polygon
150
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: HolySee.polygon, intersect: true },
151
- { a: geometry<MultiPoint>('MultiPoint', relative.partial), b: HolySee.polygon, intersect: true },
152
- { a: geometry<MultiPoint>('MultiPoint', relative.outside1), b: HolySee.polygon, intersect: false },
153
-
154
- // MultiPoint <-> MultiPolygon
155
- { a: geometry<MultiPoint>('MultiPoint', relative.partial), b: Italy.multipolygon, intersect: true },
156
- { a: geometry<MultiPoint>('MultiPoint', relative.outside1), b: Italy.multipolygon, intersect: true },
157
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: Italy.multipolygon, intersect: false },
158
-
159
- // MultiPoint <-> GeometryCollection
160
- { a: geometry<MultiPoint>('MultiPoint', relative.partial), b: geometryCollection(Italy.multipolygon), intersect: true },
161
- { a: geometry<MultiPoint>('MultiPoint', relative.outside1), b: geometryCollection(HolySee.polygon), intersect: false },
162
-
163
- // MultiPoint <-> Feature
164
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: feature(geometry<MultiPoint>('MultiPoint', [relative.inside1[1], relative.inside1[2]])), intersect: true },
165
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: feature(geometry<MultiLineString>('MultiLineString', [relative.inside2, relative.outside1])), intersect: false },
166
-
167
- // MultiPoint <-> FeatureCollection
168
- { a: geometry<MultiPoint>('MultiPoint', [relative.inside1[0], relative.inside1[1]]), b: featureCollection(geometry<MultiPoint>('MultiPoint', [relative.inside1[1], relative.inside1[2]])), intersect: true },
169
- { a: geometry<MultiPoint>('MultiPoint', relative.inside1), b: featureCollection(Italy.multipolygon), intersect: false },
170
-
171
-
172
- // LineString <-> LineString
173
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<LineString>('LineString', relative.inside2), intersect: true },
174
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<LineString>('LineString', relative.outside1), intersect: false },
175
- { a: geometry<LineString>('LineString', relative.inside1), b: geometry<LineString>('LineString', relative.outside2), intersect: false },
176
-
177
- // Polygon <-> LineString
178
- { a: HolySee.polygon, b: geometry<LineString>('LineString', relative.inside2), intersect: true },
179
- { a: HolySee.polygon, b: geometry<LineString>('LineString', relative.partial), intersect: true },
180
- { a: HolySee.polygon, b: geometry<LineString>('LineString', relative.outside2), intersect: false },
181
-
182
- // MultiPolygon <-> LineString
183
- { a: Italy.multipolygon, b: geometry<LineString>('LineString', relative.partial), intersect: true },
184
- { a: Italy.multipolygon, b: geometry<LineString>('LineString', relative.outside2), intersect: true },
185
- { a: Italy.multipolygon, b: geometry<LineString>('LineString', relative.inside2), intersect: false },
186
-
187
- // GeometryCollection <-> LineString
188
- { a: geometryCollection(geometry<LineString>('LineString', relative.inside1)), b: geometry<LineString>('LineString', relative.inside2), intersect: true },
189
- { a: geometryCollection(HolySee.polygon), b: geometry<LineString>('LineString', relative.outside2), intersect: false },
190
-
191
- // Feature <-> LineString
192
- { a: feature(HolySee.polygon), b: geometry<LineString>('LineString', relative.inside2), intersect: true },
193
- { a: feature(geometry<LineString>('LineString', relative.inside1)), b: geometry<LineString>('LineString', relative.outside1), intersect: false },
194
-
195
- // FeatureCollection <-> LineString
196
- { a: featureCollection(HolySee.polygon), b: geometry<LineString>('LineString', relative.partial), intersect: true },
197
- { a: featureCollection(Italy.multipolygon), b: geometry<LineString>('LineString', relative.inside2), intersect: false },
198
-
199
-
200
- // MultiLineString <-> LineString
201
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.inside1]), b: geometry<LineString>('LineString', relative.inside2), intersect: true },
202
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.outside1]), b: geometry<LineString>('LineString', relative.inside2), intersect: false },
203
-
204
- // MultiLineString <-> MultiLineString
205
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.inside2]), b: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1]), intersect: true },
206
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.outside2]), b: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.inside2]), intersect: false },
207
-
208
- // MultiLineString <-> Polygon
209
- { a: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.outside2]), b: HolySee.polygon, intersect: true },
210
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.outside2]), b: HolySee.polygon, intersect: true },
211
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.outside2]), b: HolySee.polygon, intersect: false },
212
-
213
- // MultiLineString <-> MultiPolygon
214
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.outside2]), b: Italy.multipolygon, intersect: true },
215
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside2, relative.partial]), b: Italy.multipolygon, intersect: true },
216
- { a: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.inside2]), b: Italy.multipolygon, intersect: false },
217
-
218
- // MultiLineString <-> GeometryCollection
219
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.inside2]), b: geometryCollection(geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.inside1])), intersect: true },
220
- { a: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.inside2]), b: geometryCollection(Italy.multipolygon), intersect: false },
221
-
222
- // MultiLineString <-> Feature
223
- { a: geometry<MultiLineString>('MultiLineString', [relative.partial, relative.inside1]), b: feature(geometry<LineString>('LineString', relative.inside2)), intersect: true },
224
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.outside2]), b: feature(HolySee.polygon), intersect: false },
225
-
226
- // MultiLineString <-> FeatureCollection
227
- { a: geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.inside2]), b: featureCollection(Italy.multipolygon), intersect: false },
228
- { a: geometry<MultiLineString>('MultiLineString', [relative.outside1, relative.outside2]), b: featureCollection(geometry<MultiLineString>('MultiLineString', [relative.inside1, relative.inside2])), intersect: false },
229
-
230
-
231
- // Polygon <-> Polygon
232
- { a: geometry<Polygon>('Polygon', [Italy.coordinates[0][0]]), b: HolySee.polygon, intersect: true },
233
- { a: geometry<Polygon>('Polygon', [Italy.coordinates[0][0]]), b: SanMarino.polygon, intersect: true },
234
- { a: SanMarino.polygon, b: HolySee.polygon, intersect: false },
235
-
236
- // Polygon <-> MultiPolygon
237
- { a: HolySee.polygon, b: geometry<MultiPolygon>('MultiPolygon', [[Italy.coordinates[0][0]], [Italy.coordinates[1]]]), intersect: true },
238
- { a: SanMarino.polygon, b: geometry<MultiPolygon>('MultiPolygon', [[Italy.coordinates[0][0]], [Italy.coordinates[1]]]), intersect: true },
239
- { a: geometry<Polygon>('Polygon', Italy.coordinates[1]), b: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), intersect: false },
240
-
241
- // Polygon <-> GeometryCollection
242
- { a: geometry<Polygon>('Polygon', [Italy.coordinates[0][0]]), b: geometryCollection(HolySee.polygon), intersect: true },
243
- { a: SanMarino.polygon, b: geometryCollection(HolySee.polygon), intersect: false },
244
-
245
- // Polygon <-> Feature
246
- { a: HolySee.polygon, b: feature(geometry<MultiPolygon>('MultiPolygon', [[Italy.coordinates[0][0]], [Italy.coordinates[1]]])), intersect: true },
247
- { a: geometry<Polygon>('Polygon', Italy.coordinates[1]), b: feature(geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates])), intersect: false },
248
-
249
- // Polygon <-> FeatureCollection
250
- { a: geometry<Polygon>('Polygon', [Italy.coordinates[0][0]]), b: featureCollection(SanMarino.polygon), intersect: true },
251
- { a: SanMarino.polygon, b: featureCollection(HolySee.polygon), intersect: false },
252
-
253
-
254
- // MultiPolygon <-> MultiPolygon
255
- { a: Italy.multipolygon, b: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), intersect: true },
256
- { a: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), b: geometry<MultiPolygon>('MultiPolygon', Italy.coordinates.slice(1)), intersect: false },
257
-
258
- // MultiPolygon <-> GeometryCollection
259
- { a: Italy.multipolygon, b: geometryCollection(geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates])), intersect: true },
260
- { a: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), b: geometryCollection(geometry<MultiPolygon>('MultiPolygon', Italy.coordinates.slice(1))), intersect: false },
261
-
262
- // MultiPolygon <-> Feature
263
- { a: Italy.multipolygon, b: feature(geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates])), intersect: true },
264
- { a: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), b: feature(geometry<MultiPolygon>('MultiPolygon', Italy.coordinates.slice(1))), intersect: false },
265
-
266
- // MultiPolygon <-> FeatureCollection];
267
- { a: Italy.multipolygon, b: featureCollection(geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates])), intersect: true },
268
- { a: geometry<MultiPolygon>('MultiPolygon', [HolySee.polygon.coordinates, SanMarino.polygon.coordinates]), b: featureCollection(geometry<MultiPolygon>('MultiPolygon', Italy.coordinates.slice(1))), intersect: false },
269
-
270
-
271
- // GeometryCollection <-> GeometryCollection
272
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: geometryCollection(geometry<LineString>('LineString', relative.outside1)), intersect: true },
273
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: geometryCollection(geometry<LineString>('LineString', relative.outside2)), intersect: false },
274
-
275
- // GeometryCollection <-> Feature
276
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: feature(geometry<LineString>('LineString', relative.outside1)), intersect: true },
277
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: feature(geometry<LineString>('LineString', relative.outside2)), intersect: false },
278
-
279
- // GeometryCollection <-> FeatureCollection
280
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside1)), intersect: true },
281
- { a: geometryCollection(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside2)), intersect: false },
282
-
283
-
284
- // Feature <-> Feature
285
- { a: feature(geometry<Point>('Point', relative.outside1[1])), b: feature(geometry<LineString>('LineString', relative.outside1)), intersect: true },
286
- { a: feature(geometry<Point>('Point', relative.outside1[1])), b: feature(geometry<LineString>('LineString', relative.outside2)), intersect: false },
287
-
288
- // Feature <-> FeatureCollection
289
- { a: feature(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside1)), intersect: true },
290
- { a: feature(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside2)), intersect: false },
291
-
292
-
293
- // FeatureCollection <-> FeatureCollection
294
- { a: featureCollection(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside1)), intersect: true },
295
- { a: featureCollection(geometry<Point>('Point', relative.outside1[1])), b: featureCollection(geometry<LineString>('LineString', relative.outside2)), intersect: false },
296
-
297
- // Impossible <-> Possible
298
- { a: { type: 'Impossible', coordinates: [0, 0] } as any, b: geometry<Point>('Point', [0, 0]), intersect: false },
299
- { a: geometry<Point>('Point', [0, 0]), b: { type: 'Impossible', coordinates: [0, 0] } as any, intersect: false },
300
- ];