@math.gl/geospatial 5.0.0-rc.2 → 5.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 (356) hide show
  1. package/README.md +6 -6
  2. package/dist/coordinates.cjs +2523 -0
  3. package/dist/coordinates.cjs.map +6 -0
  4. package/dist/coordinates.d.ts +4 -0
  5. package/dist/coordinates.d.ts.map +1 -1
  6. package/dist/coordinates.js +2 -0
  7. package/dist/coordinates.js.map +1 -1
  8. package/dist/entries/ellipsoid.cjs +1209 -0
  9. package/dist/entries/ellipsoid.cjs.map +6 -0
  10. package/dist/entries/ellipsoid.d.ts +3 -19
  11. package/dist/entries/ellipsoid.d.ts.map +1 -1
  12. package/dist/entries/ellipsoid.js +1 -9
  13. package/dist/entries/ellipsoid.js.map +1 -1
  14. package/dist/expressions.cjs +726 -0
  15. package/dist/expressions.cjs.map +6 -0
  16. package/dist/geodesics.cjs +3195 -0
  17. package/dist/geodesics.cjs.map +6 -0
  18. package/dist/geodesics.d.ts +18 -0
  19. package/dist/geodesics.d.ts.map +1 -0
  20. package/dist/geodesics.js +13 -0
  21. package/dist/geodesics.js.map +1 -0
  22. package/dist/geographic-atlas/sampling.d.ts +1 -1
  23. package/dist/geographic-atlas/sampling.d.ts.map +1 -1
  24. package/dist/geographic-atlas/sampling.js +1 -1
  25. package/dist/geographic-atlas/sampling.js.map +1 -1
  26. package/dist/geographic-cuts.cjs +4160 -0
  27. package/dist/geographic-cuts.cjs.map +6 -0
  28. package/dist/geographic-cuts.d.ts +2 -0
  29. package/dist/geographic-cuts.d.ts.map +1 -1
  30. package/dist/geographic-cuts.js +1 -0
  31. package/dist/geographic-cuts.js.map +1 -1
  32. package/dist/geographic-seams/subdivide-cut.d.ts +1 -1
  33. package/dist/geographic-seams/subdivide-cut.d.ts.map +1 -1
  34. package/dist/geographic-seams/subdivide-cut.js +1 -1
  35. package/dist/geographic-seams/subdivide-cut.js.map +1 -1
  36. package/dist/geographic-seams/types.shared.cjs +32 -0
  37. package/dist/geographic-seams/types.shared.cjs.map +6 -0
  38. package/dist/globe.cjs +4223 -0
  39. package/dist/globe.cjs.map +6 -0
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +2 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/line-simplification.d.ts +7 -0
  45. package/dist/line-simplification.d.ts.map +1 -1
  46. package/dist/line-simplification.js +4 -13
  47. package/dist/line-simplification.js.map +1 -1
  48. package/dist/linear-referencing.d.ts +13 -1
  49. package/dist/linear-referencing.d.ts.map +1 -1
  50. package/dist/linear-referencing.js +29 -9
  51. package/dist/linear-referencing.js.map +1 -1
  52. package/dist/maps/map-transition.shared.cjs +364 -0
  53. package/dist/maps/map-transition.shared.cjs.map +6 -0
  54. package/dist/maps/myriahedral/unfold.d.ts +1 -1
  55. package/dist/maps/myriahedral/unfold.d.ts.map +1 -1
  56. package/dist/maps/myriahedral/unfold.js +1 -1
  57. package/dist/maps/myriahedral/unfold.js.map +1 -1
  58. package/dist/maps/presets.cjs +2 -2
  59. package/dist/maps/presets.cjs.map +2 -2
  60. package/dist/maps/transitions.cjs +3 -342
  61. package/dist/maps/transitions.cjs.map +3 -3
  62. package/dist/maps.cjs +15 -319
  63. package/dist/maps.cjs.map +3 -3
  64. package/dist/measure-referencing.d.ts +16 -0
  65. package/dist/measure-referencing.d.ts.map +1 -0
  66. package/dist/measure-referencing.js +143 -0
  67. package/dist/measure-referencing.js.map +1 -0
  68. package/dist/polygon-simplification.d.ts +6 -0
  69. package/dist/polygon-simplification.d.ts.map +1 -0
  70. package/dist/polygon-simplification.js +141 -0
  71. package/dist/polygon-simplification.js.map +1 -0
  72. package/dist/projection/experimental/core.cjs +63 -1317
  73. package/dist/projection/experimental/core.cjs.map +3 -3
  74. package/dist/projection/experimental/core.d.ts +1 -1
  75. package/dist/projection/experimental/core.d.ts.map +1 -1
  76. package/dist/projection/experimental/crs/projjson.cjs +26 -45
  77. package/dist/projection/experimental/crs/projjson.cjs.map +3 -3
  78. package/dist/projection/experimental/crs/types.shared.cjs +44 -0
  79. package/dist/projection/experimental/crs/types.shared.cjs.map +6 -0
  80. package/dist/projection/experimental/crs/wkt.cjs +36 -52
  81. package/dist/projection/experimental/crs/wkt.cjs.map +3 -3
  82. package/dist/projection/experimental/entries/projections/ob_tran.cjs +9 -23
  83. package/dist/projection/experimental/entries/projections/ob_tran.cjs.map +3 -3
  84. package/dist/projection/experimental/lazy-projections/aea.cjs +1 -1
  85. package/dist/projection/experimental/lazy-projections/aea.js +1 -1
  86. package/dist/projection/experimental/lazy-projections/aeqd.cjs +1 -1
  87. package/dist/projection/experimental/lazy-projections/aeqd.js +1 -1
  88. package/dist/projection/experimental/lazy-projections/bonne.cjs +1 -1
  89. package/dist/projection/experimental/lazy-projections/bonne.js +1 -1
  90. package/dist/projection/experimental/lazy-projections/cass.cjs +1 -1
  91. package/dist/projection/experimental/lazy-projections/cass.js +1 -1
  92. package/dist/projection/experimental/lazy-projections/cea.cjs +1 -1
  93. package/dist/projection/experimental/lazy-projections/cea.js +1 -1
  94. package/dist/projection/experimental/lazy-projections/eck6.cjs +1 -1
  95. package/dist/projection/experimental/lazy-projections/eck6.js +1 -1
  96. package/dist/projection/experimental/lazy-projections/eqc.cjs +1 -1
  97. package/dist/projection/experimental/lazy-projections/eqc.js +1 -1
  98. package/dist/projection/experimental/lazy-projections/eqdc.cjs +1 -1
  99. package/dist/projection/experimental/lazy-projections/eqdc.js +1 -1
  100. package/dist/projection/experimental/lazy-projections/eqearth.cjs +1 -1
  101. package/dist/projection/experimental/lazy-projections/eqearth.js +1 -1
  102. package/dist/projection/experimental/lazy-projections/equi.cjs +1 -1
  103. package/dist/projection/experimental/lazy-projections/equi.js +1 -1
  104. package/dist/projection/experimental/lazy-projections/etmerc.cjs +1 -1
  105. package/dist/projection/experimental/lazy-projections/etmerc.js +1 -1
  106. package/dist/projection/experimental/lazy-projections/geocent.cjs +1 -1
  107. package/dist/projection/experimental/lazy-projections/geocent.js +1 -1
  108. package/dist/projection/experimental/lazy-projections/geos.cjs +1 -1
  109. package/dist/projection/experimental/lazy-projections/geos.js +1 -1
  110. package/dist/projection/experimental/lazy-projections/gnom.cjs +1 -1
  111. package/dist/projection/experimental/lazy-projections/gnom.js +1 -1
  112. package/dist/projection/experimental/lazy-projections/gstmerc.cjs +1 -1
  113. package/dist/projection/experimental/lazy-projections/gstmerc.js +1 -1
  114. package/dist/projection/experimental/lazy-projections/index.cjs +60 -903
  115. package/dist/projection/experimental/lazy-projections/index.cjs.map +3 -3
  116. package/dist/projection/experimental/lazy-projections/krovak.cjs +1 -1
  117. package/dist/projection/experimental/lazy-projections/krovak.js +1 -1
  118. package/dist/projection/experimental/lazy-projections/laea.cjs +1 -1
  119. package/dist/projection/experimental/lazy-projections/laea.js +1 -1
  120. package/dist/projection/experimental/lazy-projections/lcc.cjs +1 -1
  121. package/dist/projection/experimental/lazy-projections/lcc.js +1 -1
  122. package/dist/projection/experimental/lazy-projections/merc.cjs +1 -1
  123. package/dist/projection/experimental/lazy-projections/merc.js +1 -1
  124. package/dist/projection/experimental/lazy-projections/mill.cjs +1 -1
  125. package/dist/projection/experimental/lazy-projections/mill.js +1 -1
  126. package/dist/projection/experimental/lazy-projections/moll.cjs +1 -1
  127. package/dist/projection/experimental/lazy-projections/moll.js +1 -1
  128. package/dist/projection/experimental/lazy-projections/nzmg.cjs +1 -1
  129. package/dist/projection/experimental/lazy-projections/nzmg.js +1 -1
  130. package/dist/projection/experimental/lazy-projections/ob_tran.cjs +1 -1
  131. package/dist/projection/experimental/lazy-projections/ob_tran.js +1 -1
  132. package/dist/projection/experimental/lazy-projections/omerc.cjs +1 -1
  133. package/dist/projection/experimental/lazy-projections/omerc.js +1 -1
  134. package/dist/projection/experimental/lazy-projections/ortho.cjs +1 -1
  135. package/dist/projection/experimental/lazy-projections/ortho.js +1 -1
  136. package/dist/projection/experimental/lazy-projections/poly.cjs +1 -1
  137. package/dist/projection/experimental/lazy-projections/poly.js +1 -1
  138. package/dist/projection/experimental/lazy-projections/qsc.cjs +1 -1
  139. package/dist/projection/experimental/lazy-projections/qsc.js +1 -1
  140. package/dist/projection/experimental/lazy-projections/robin.cjs +1 -1
  141. package/dist/projection/experimental/lazy-projections/robin.js +1 -1
  142. package/dist/projection/experimental/lazy-projections/sinu.cjs +1 -1
  143. package/dist/projection/experimental/lazy-projections/sinu.js +1 -1
  144. package/dist/projection/experimental/lazy-projections/somerc.cjs +1 -1
  145. package/dist/projection/experimental/lazy-projections/somerc.js +1 -1
  146. package/dist/projection/experimental/lazy-projections/stere.cjs +1 -1
  147. package/dist/projection/experimental/lazy-projections/stere.js +1 -1
  148. package/dist/projection/experimental/lazy-projections/sterea.cjs +1 -1
  149. package/dist/projection/experimental/lazy-projections/sterea.js +1 -1
  150. package/dist/projection/experimental/lazy-projections/tmerc.cjs +1 -1
  151. package/dist/projection/experimental/lazy-projections/tmerc.js +1 -1
  152. package/dist/projection/experimental/lazy-projections/tpers.cjs +1 -1
  153. package/dist/projection/experimental/lazy-projections/tpers.js +1 -1
  154. package/dist/projection/experimental/lazy-projections/utm.cjs +1 -1
  155. package/dist/projection/experimental/lazy-projections/utm.js +1 -1
  156. package/dist/projection/experimental/lazy-projections/vandg.cjs +1 -1
  157. package/dist/projection/experimental/lazy-projections/vandg.js +1 -1
  158. package/dist/projection/experimental/projection-engine.shared.cjs +1184 -0
  159. package/dist/projection/experimental/projection-engine.shared.cjs.map +6 -0
  160. package/dist/projection/experimental/typescript-projection.shared.cjs +1703 -0
  161. package/dist/projection/experimental/typescript-projection.shared.cjs.map +6 -0
  162. package/dist/projection/index.cjs +622 -1535
  163. package/dist/projection/index.cjs.map +3 -3
  164. package/dist/projection/pipeline.cjs +44 -58
  165. package/dist/projection/pipeline.cjs.map +3 -3
  166. package/dist/projection/transform-analysis.cjs +20 -936
  167. package/dist/projection/transform-analysis.cjs.map +3 -3
  168. package/dist/spatial-box-clipping.d.ts +9 -0
  169. package/dist/spatial-box-clipping.d.ts.map +1 -0
  170. package/dist/spatial-box-clipping.js +123 -0
  171. package/dist/spatial-box-clipping.js.map +1 -0
  172. package/dist/spatial-dwithin.d.ts +19 -0
  173. package/dist/spatial-dwithin.d.ts.map +1 -0
  174. package/dist/spatial-dwithin.js +107 -0
  175. package/dist/spatial-dwithin.js.map +1 -0
  176. package/dist/spatial-hulls.d.ts +6 -0
  177. package/dist/spatial-hulls.d.ts.map +1 -0
  178. package/dist/spatial-hulls.js +176 -0
  179. package/dist/spatial-hulls.js.map +1 -0
  180. package/dist/spatial-line-intersection-result.d.ts +4 -0
  181. package/dist/spatial-line-intersection-result.d.ts.map +1 -0
  182. package/dist/spatial-line-intersection-result.js +79 -0
  183. package/dist/spatial-line-intersection-result.js.map +1 -0
  184. package/dist/spatial-line-polygon-intersection.d.ts +4 -0
  185. package/dist/spatial-line-polygon-intersection.d.ts.map +1 -0
  186. package/dist/spatial-line-polygon-intersection.js +130 -0
  187. package/dist/spatial-line-polygon-intersection.js.map +1 -0
  188. package/dist/spatial-planar-intersects.d.ts +11 -0
  189. package/dist/spatial-planar-intersects.d.ts.map +1 -1
  190. package/dist/spatial-planar-intersects.js +20 -12
  191. package/dist/spatial-planar-intersects.js.map +1 -1
  192. package/dist/spatial-planar.d.ts +9 -0
  193. package/dist/spatial-planar.d.ts.map +1 -1
  194. package/dist/spatial-planar.js +13 -1
  195. package/dist/spatial-planar.js.map +1 -1
  196. package/dist/spatial-polygon-overlay.d.ts +5 -0
  197. package/dist/spatial-polygon-overlay.d.ts.map +1 -0
  198. package/dist/spatial-polygon-overlay.js +23 -0
  199. package/dist/spatial-polygon-overlay.js.map +1 -0
  200. package/dist/spatial-sql.d.ts +13 -2
  201. package/dist/spatial-sql.d.ts.map +1 -1
  202. package/dist/spatial-sql.js +30 -12
  203. package/dist/spatial-sql.js.map +1 -1
  204. package/dist/spatial-subdivision.d.ts +9 -0
  205. package/dist/spatial-subdivision.d.ts.map +1 -0
  206. package/dist/spatial-subdivision.js +61 -0
  207. package/dist/spatial-subdivision.js.map +1 -0
  208. package/dist/spatial-touches.d.ts +13 -0
  209. package/dist/spatial-touches.d.ts.map +1 -0
  210. package/dist/spatial-touches.js +192 -0
  211. package/dist/spatial-touches.js.map +1 -0
  212. package/dist/st-functions.cjs +2411 -112
  213. package/dist/st-functions.cjs.map +3 -3
  214. package/dist/st-functions.d.ts +67 -2
  215. package/dist/st-functions.d.ts.map +1 -1
  216. package/dist/st-functions.js +195 -12
  217. package/dist/st-functions.js.map +1 -1
  218. package/dist/st-geodesic-functions.d.ts +33 -0
  219. package/dist/st-geodesic-functions.d.ts.map +1 -0
  220. package/dist/st-geodesic-functions.js +84 -0
  221. package/dist/st-geodesic-functions.js.map +1 -0
  222. package/dist/st-hull-functions.cjs +386 -0
  223. package/dist/st-hull-functions.cjs.map +6 -0
  224. package/dist/st-hull-functions.d.ts +17 -0
  225. package/dist/st-hull-functions.d.ts.map +1 -0
  226. package/dist/st-hull-functions.js +14 -0
  227. package/dist/st-hull-functions.js.map +1 -0
  228. package/dist/st-overlay-functions.cjs +621 -0
  229. package/dist/st-overlay-functions.cjs.map +6 -0
  230. package/dist/st-overlay-functions.d.ts +36 -0
  231. package/dist/st-overlay-functions.d.ts.map +1 -0
  232. package/dist/st-overlay-functions.js +183 -0
  233. package/dist/st-overlay-functions.js.map +1 -0
  234. package/dist/st-viewport-functions.cjs +481 -0
  235. package/dist/st-viewport-functions.cjs.map +6 -0
  236. package/dist/st-viewport-functions.d.ts +13 -0
  237. package/dist/st-viewport-functions.d.ts.map +1 -0
  238. package/dist/st-viewport-functions.js +81 -0
  239. package/dist/st-viewport-functions.js.map +1 -0
  240. package/dist/subdivide-geodesic-polyline.d.ts +1 -1
  241. package/dist/subdivide-geodesic-polyline.d.ts.map +1 -1
  242. package/dist/subdivide-geodesic-polyline.js +1 -1
  243. package/dist/subdivide-geodesic-polyline.js.map +1 -1
  244. package/dist/subdivide-globe-mesh.d.ts +1 -1
  245. package/dist/subdivide-globe-mesh.d.ts.map +1 -1
  246. package/dist/subdivide-globe-mesh.js +1 -1
  247. package/dist/subdivide-globe-mesh.js.map +1 -1
  248. package/dist/subdivide-rhumb-polyline.d.ts +1 -1
  249. package/dist/subdivide-rhumb-polyline.d.ts.map +1 -1
  250. package/dist/subdivide-rhumb-polyline.js +1 -1
  251. package/dist/subdivide-rhumb-polyline.js.map +1 -1
  252. package/dist/tasks/index.cjs +808 -2993
  253. package/dist/tasks/index.cjs.map +3 -3
  254. package/dist/terrain/geometry.d.ts +1 -1
  255. package/dist/terrain/geometry.d.ts.map +1 -1
  256. package/dist/terrain/geometry.js +1 -1
  257. package/dist/terrain/geometry.js.map +1 -1
  258. package/dist/terrain/index.cjs +95 -22
  259. package/dist/terrain/index.cjs.map +3 -3
  260. package/dist/terrain/index.d.ts +1 -0
  261. package/dist/terrain/index.d.ts.map +1 -1
  262. package/dist/terrain/index.js +1 -0
  263. package/dist/terrain/index.js.map +1 -1
  264. package/dist/terrain/regional-watersheds.d.ts +44 -0
  265. package/dist/terrain/regional-watersheds.d.ts.map +1 -0
  266. package/dist/terrain/regional-watersheds.js +108 -0
  267. package/dist/terrain/regional-watersheds.js.map +1 -0
  268. package/dist/terrain/tile-cutout-update.d.ts.map +1 -1
  269. package/dist/terrain/tile-cutout-update.js +28 -22
  270. package/dist/terrain/tile-cutout-update.js.map +1 -1
  271. package/dist/tiles.cjs +354 -0
  272. package/dist/tiles.cjs.map +6 -0
  273. package/dist/turf-functions.cjs +16 -9
  274. package/dist/turf-functions.cjs.map +1 -1
  275. package/package.json +154 -117
  276. package/src/coordinates.ts +5 -0
  277. package/src/entries/ellipsoid.ts +7 -32
  278. package/src/geodesics.ts +40 -0
  279. package/src/geographic-atlas/sampling.ts +1 -1
  280. package/src/geographic-cuts.ts +21 -0
  281. package/src/geographic-seams/subdivide-cut.ts +1 -1
  282. package/src/index.ts +2 -0
  283. package/src/line-simplification.ts +4 -16
  284. package/src/linear-referencing.ts +44 -16
  285. package/src/maps/myriahedral/unfold.ts +1 -1
  286. package/src/measure-referencing.ts +165 -0
  287. package/src/polygon-simplification.ts +185 -0
  288. package/src/projection/experimental/core.ts +1 -1
  289. package/src/projection/experimental/lazy-projections/aea.ts +1 -1
  290. package/src/projection/experimental/lazy-projections/aeqd.ts +1 -1
  291. package/src/projection/experimental/lazy-projections/bonne.ts +1 -1
  292. package/src/projection/experimental/lazy-projections/cass.ts +1 -1
  293. package/src/projection/experimental/lazy-projections/cea.ts +1 -1
  294. package/src/projection/experimental/lazy-projections/eck6.ts +1 -1
  295. package/src/projection/experimental/lazy-projections/eqc.ts +1 -1
  296. package/src/projection/experimental/lazy-projections/eqdc.ts +1 -1
  297. package/src/projection/experimental/lazy-projections/eqearth.ts +1 -1
  298. package/src/projection/experimental/lazy-projections/equi.ts +1 -1
  299. package/src/projection/experimental/lazy-projections/etmerc.ts +1 -1
  300. package/src/projection/experimental/lazy-projections/geocent.ts +1 -1
  301. package/src/projection/experimental/lazy-projections/geos.ts +1 -1
  302. package/src/projection/experimental/lazy-projections/gnom.ts +1 -1
  303. package/src/projection/experimental/lazy-projections/gstmerc.ts +1 -1
  304. package/src/projection/experimental/lazy-projections/krovak.ts +1 -1
  305. package/src/projection/experimental/lazy-projections/laea.ts +1 -1
  306. package/src/projection/experimental/lazy-projections/lcc.ts +1 -1
  307. package/src/projection/experimental/lazy-projections/merc.ts +1 -1
  308. package/src/projection/experimental/lazy-projections/mill.ts +1 -1
  309. package/src/projection/experimental/lazy-projections/moll.ts +1 -1
  310. package/src/projection/experimental/lazy-projections/nzmg.ts +1 -1
  311. package/src/projection/experimental/lazy-projections/ob_tran.ts +1 -1
  312. package/src/projection/experimental/lazy-projections/omerc.ts +1 -1
  313. package/src/projection/experimental/lazy-projections/ortho.ts +1 -1
  314. package/src/projection/experimental/lazy-projections/poly.ts +1 -1
  315. package/src/projection/experimental/lazy-projections/qsc.ts +1 -1
  316. package/src/projection/experimental/lazy-projections/robin.ts +1 -1
  317. package/src/projection/experimental/lazy-projections/sinu.ts +1 -1
  318. package/src/projection/experimental/lazy-projections/somerc.ts +1 -1
  319. package/src/projection/experimental/lazy-projections/stere.ts +1 -1
  320. package/src/projection/experimental/lazy-projections/sterea.ts +1 -1
  321. package/src/projection/experimental/lazy-projections/tmerc.ts +1 -1
  322. package/src/projection/experimental/lazy-projections/tpers.ts +1 -1
  323. package/src/projection/experimental/lazy-projections/utm.ts +1 -1
  324. package/src/projection/experimental/lazy-projections/vandg.ts +1 -1
  325. package/src/spatial-box-clipping.ts +140 -0
  326. package/src/spatial-dwithin.ts +135 -0
  327. package/src/spatial-hulls.ts +203 -0
  328. package/src/spatial-line-intersection-result.ts +93 -0
  329. package/src/spatial-line-polygon-intersection.ts +147 -0
  330. package/src/spatial-planar-intersects.ts +21 -15
  331. package/src/spatial-planar.ts +20 -1
  332. package/src/spatial-polygon-overlay.ts +30 -0
  333. package/src/spatial-sql.ts +47 -12
  334. package/src/spatial-subdivision.ts +75 -0
  335. package/src/spatial-touches.ts +218 -0
  336. package/src/st-functions.ts +283 -15
  337. package/src/st-geodesic-functions.ts +121 -0
  338. package/src/st-hull-functions.ts +25 -0
  339. package/src/st-overlay-functions.ts +244 -0
  340. package/src/st-viewport-functions.ts +98 -0
  341. package/src/subdivide-geodesic-polyline.ts +2 -2
  342. package/src/subdivide-globe-mesh.ts +2 -2
  343. package/src/subdivide-rhumb-polyline.ts +2 -2
  344. package/src/terrain/geometry.ts +1 -1
  345. package/src/terrain/index.ts +7 -0
  346. package/src/terrain/regional-watersheds.ts +153 -0
  347. package/src/terrain/tile-cutout-update.ts +32 -26
  348. package/dist/index.cjs +0 -18674
  349. package/dist/index.cjs.map +0 -6
  350. package/dist/turf-expressions.cjs +0 -1997
  351. package/dist/turf-expressions.cjs.map +0 -6
  352. package/dist/turf-expressions.d.ts +0 -3
  353. package/dist/turf-expressions.d.ts.map +0 -1
  354. package/dist/turf-expressions.js +0 -7
  355. package/dist/turf-expressions.js.map +0 -1
  356. package/src/turf-expressions.ts +0 -7
@@ -0,0 +1,16 @@
1
+ import type { WellKnownDimension, WellKnownGeometry } from '@math.gl/core/arrow';
2
+ /** Dimensions with a semantic measure ordinate. */
3
+ type MeasuredDimension = 'xym' | 'xyzm';
4
+ /** Returns the measure dimension or rejects unmeasured linework. */
5
+ export declare function measuredDimension(dimension: WellKnownDimension): MeasuredDimension;
6
+ /** Assigns measures by accumulated XY path length, retaining any Z ordinate. */
7
+ export declare function addMeasure(geometry: WellKnownGeometry, dimension: WellKnownDimension, start: number, end: number): {
8
+ geometry: WellKnownGeometry;
9
+ dimension: MeasuredDimension;
10
+ };
11
+ /** Finds each matching location. Constant-measure segments contribute their midpoint. */
12
+ export declare function locateAlong(geometry: WellKnownGeometry, dimension: MeasuredDimension, measure: number): WellKnownGeometry;
13
+ /** Clips each component in measure space, preserving direction and disjoint visits. */
14
+ export declare function locateBetween(geometry: WellKnownGeometry, dimension: MeasuredDimension, start: number, end: number): WellKnownGeometry;
15
+ export {};
16
+ //# sourceMappingURL=measure-referencing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure-referencing.d.ts","sourceRoot":"","sources":["../src/measure-referencing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAM/E,mDAAmD;AACnD,KAAK,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAAC;AASxC,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,GAAG,iBAAiB,CAGlF;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,kBAAkB,EAC7B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV;IAAC,QAAQ,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAC,CA4B7D;AAgCD,yFAAyF;AACzF,wBAAgB,WAAW,CACzB,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,MAAM,GACd,iBAAiB,CAuBnB;AAQD,uFAAuF;AACvF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,iBAAiB,CA8BnB"}
@@ -0,0 +1,143 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ /** Extracts the paths of a linear geometry without connecting multipart gaps. */
5
+ function pathsOf(geometry) {
6
+ if (geometry.type === 'LineString')
7
+ return [geometry.coordinates];
8
+ if (geometry.type === 'MultiLineString')
9
+ return geometry.coordinates;
10
+ throw new Error('Measured routes require a LineString or MultiLineString');
11
+ }
12
+ /** Returns the measure dimension or rejects unmeasured linework. */
13
+ export function measuredDimension(dimension) {
14
+ if (dimension === 'xym' || dimension === 'xyzm')
15
+ return dimension;
16
+ throw new Error('Input geometry requires a measure (M) ordinate');
17
+ }
18
+ /** Assigns measures by accumulated XY path length, retaining any Z ordinate. */
19
+ export function addMeasure(geometry, dimension, start, end) {
20
+ if (!Number.isFinite(start) || !Number.isFinite(end))
21
+ throw new Error('Expected finite measures');
22
+ const paths = pathsOf(geometry);
23
+ let total = 0;
24
+ const distances = paths.map(path => path.map((point, i) => {
25
+ if (i > 0) {
26
+ const previous = path[i - 1];
27
+ total += Math.hypot(point[0] - previous[0], point[1] - previous[1]);
28
+ }
29
+ return total;
30
+ }));
31
+ if (!Number.isFinite(total))
32
+ throw new Error('Expected finite route length');
33
+ const spatialSize = dimension.includes('z') ? 3 : 2;
34
+ const coordinates = paths.map((path, part) => path.map((point, i) => {
35
+ const fraction = total ? distances[part][i] / total : 0;
36
+ return [...point.slice(0, spatialSize), (1 - fraction) * start + fraction * end];
37
+ }));
38
+ return {
39
+ geometry: geometry.type === 'LineString'
40
+ ? { type: 'LineString', coordinates: coordinates[0] }
41
+ : { type: 'MultiLineString', coordinates },
42
+ dimension: spatialSize === 3 ? 'xyzm' : 'xym'
43
+ };
44
+ }
45
+ /** Tests equality of every ordinate, including dimensions other than XY. */
46
+ function samePosition(a, b) {
47
+ return a.every((value, i) => value === b[i]);
48
+ }
49
+ /** Interpolates XY and optional Z while setting M exactly to the requested value. */
50
+ function atMeasure(a, b, index, measure) {
51
+ const from = a[index];
52
+ const to = b[index];
53
+ if (from !== to) {
54
+ if (measure === from)
55
+ return a;
56
+ if (measure === to)
57
+ return b;
58
+ }
59
+ const span = to - from;
60
+ const fraction = span === 0
61
+ ? 0.5
62
+ : Number.isFinite(span)
63
+ ? (measure - from) / span
64
+ : (measure / 2 - from / 2) / (to / 2 - from / 2);
65
+ return a.map((value, i) => (i === index ? measure : (1 - fraction) * value + fraction * b[i]));
66
+ }
67
+ /** Reads the measure ordinate and rejects invalid measured vertices. */
68
+ function measureAt(position, index) {
69
+ const value = position[index];
70
+ if (!Number.isFinite(value))
71
+ throw new Error('Expected finite route measures');
72
+ return value;
73
+ }
74
+ /** Finds each matching location. Constant-measure segments contribute their midpoint. */
75
+ export function locateAlong(geometry, dimension, measure) {
76
+ if (!Number.isFinite(measure))
77
+ throw new Error('Expected a finite measure');
78
+ const index = dimension.indexOf('m');
79
+ const coordinates = [];
80
+ for (const path of pathsOf(geometry)) {
81
+ let previousEndsAtVertex = false;
82
+ for (let i = 1; i < path.length; i++) {
83
+ const a = path[i - 1];
84
+ const b = path[i];
85
+ const from = measureAt(a, index);
86
+ const to = measureAt(b, index);
87
+ if (measure < Math.min(from, to) || measure > Math.max(from, to)) {
88
+ previousEndsAtVertex = false;
89
+ continue;
90
+ }
91
+ const startsAtVertex = from !== to && measure === from;
92
+ if (!previousEndsAtVertex || !startsAtVertex) {
93
+ coordinates.push(atMeasure(a, b, index, measure));
94
+ }
95
+ previousEndsAtVertex = from !== to && measure === to;
96
+ }
97
+ }
98
+ return { type: 'MultiPoint', coordinates };
99
+ }
100
+ /** Appends a clipped point or line when a contiguous portion is complete. */
101
+ function appendPortion(parts, path) {
102
+ if (path.length === 1)
103
+ parts.push({ type: 'Point', coordinates: path[0] });
104
+ else if (path.length > 1)
105
+ parts.push({ type: 'LineString', coordinates: path });
106
+ }
107
+ /** Clips each component in measure space, preserving direction and disjoint visits. */
108
+ export function locateBetween(geometry, dimension, start, end) {
109
+ if (!Number.isFinite(start) || !Number.isFinite(end))
110
+ throw new Error('Expected finite measures');
111
+ const low = Math.min(start, end);
112
+ const high = Math.max(start, end);
113
+ const index = dimension.indexOf('m');
114
+ const parts = [];
115
+ for (const path of pathsOf(geometry)) {
116
+ let portion = [];
117
+ for (let i = 1; i < path.length; i++) {
118
+ const a = path[i - 1];
119
+ const b = path[i];
120
+ const from = measureAt(a, index);
121
+ const to = measureAt(b, index);
122
+ const begin = Math.max(low, Math.min(from, to));
123
+ const finish = Math.min(high, Math.max(from, to));
124
+ if (begin > finish)
125
+ continue;
126
+ const first = from === to ? a : atMeasure(a, b, index, from <= to ? begin : finish);
127
+ const last = from === to ? b : atMeasure(a, b, index, from <= to ? finish : begin);
128
+ if (!portion.length)
129
+ portion.push(first);
130
+ if (!samePosition(portion[portion.length - 1], last))
131
+ portion.push(last);
132
+ if (to < low || to > high) {
133
+ appendPortion(parts, portion);
134
+ portion = [];
135
+ }
136
+ }
137
+ appendPortion(parts, portion);
138
+ }
139
+ return parts.every(part => part.type === 'LineString')
140
+ ? { type: 'MultiLineString', coordinates: parts.map(part => part.coordinates) }
141
+ : { type: 'GeometryCollection', geometries: parts };
142
+ }
143
+ //# sourceMappingURL=measure-referencing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure-referencing.js","sourceRoot":"","sources":["../src/measure-referencing.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAW5D,iFAAiF;AACjF,SAAS,OAAO,CAAC,QAA2B;IAC1C,IAAI,QAAQ,CAAC,IAAI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K,EAAE,OAAO,CAAC,CAAC;gBAC9B,OAAO,GAAG,EAAE,CAAC;YACf,CAAC;QACH,CAAC;QACD,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC;QACpD,CAAC,CAAC,EAAC,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAC;QAC7E,CAAC,CAAC,EAAC,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,KAAK,EAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { WellKnownGeometry } from '@math.gl/core/arrow';
2
+ /** Simplifies closed rings only when boundary and nesting checks prove topology is preserved. */
3
+ export declare function simplifyPolygonTopology(geometry: Extract<WellKnownGeometry, {
4
+ type: 'Polygon' | 'MultiPolygon';
5
+ }>, tolerance: number): typeof geometry;
6
+ //# sourceMappingURL=polygon-simplification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygon-simplification.d.ts","sourceRoot":"","sources":["../src/polygon-simplification.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AA6J3D,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,EAAE;IAAC,IAAI,EAAE,SAAS,GAAG,cAAc,CAAA;CAAC,CAAC,EACxE,SAAS,EAAE,MAAM,GAChB,OAAO,QAAQ,CAmBjB"}
@@ -0,0 +1,141 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { orient2d } from 'robust-predicates';
5
+ import { simplifyLine } from "./line-simplification.js";
6
+ import { planarBounds } from "./spatial-planar.js";
7
+ import { planarIntersects, segmentsMeet } from "./spatial-planar-intersects.js";
8
+ /** Estimates the active interval count relative to the extent of the sweep. */
9
+ function intervalDensity(items, axis) {
10
+ let minimum = Infinity;
11
+ let maximum = -Infinity;
12
+ let length = 0;
13
+ for (const { bounds } of items) {
14
+ const low = bounds[axis];
15
+ const high = bounds[axis + 2];
16
+ minimum = Math.min(minimum, low);
17
+ maximum = Math.max(maximum, high);
18
+ length += high - low;
19
+ }
20
+ return maximum > minimum ? length / (maximum - minimum) : Infinity;
21
+ }
22
+ /** Visits overlapping bounding boxes along the axis with fewer expected candidates. */
23
+ function anyOverlap(items, reject) {
24
+ const axis = intervalDensity(items, 0) > intervalDensity(items, 1) ? 1 : 0;
25
+ const other = 1 - axis;
26
+ items.sort((a, b) => a.bounds[axis] - b.bounds[axis]);
27
+ for (let i = 0; i < items.length; i++) {
28
+ const a = items[i];
29
+ for (let j = i + 1; j < items.length && items[j].bounds[axis] <= a.bounds[axis + 2]; j++) {
30
+ const b = items[j];
31
+ if (b.bounds[other] <= a.bounds[other + 2] &&
32
+ a.bounds[other] <= b.bounds[other + 2] &&
33
+ reject(a, b))
34
+ return true;
35
+ }
36
+ }
37
+ return false;
38
+ }
39
+ /** Compares two XY positions. */
40
+ function samePoint(a, b) {
41
+ return a[0] === b[0] && a[1] === b[1];
42
+ }
43
+ /** Computes translated signed area for the winding and collapse check. */
44
+ function signedArea(ring) {
45
+ const [x, y] = ring[0];
46
+ let area = 0;
47
+ for (let i = 1; i + 1 < ring.length; i++) {
48
+ const a = ring[i];
49
+ const b = ring[i + 1];
50
+ area += (a[0] - x) * (b[1] - y) - (a[1] - y) * (b[0] - x);
51
+ }
52
+ return area;
53
+ }
54
+ /** Rejects invalid, self-touching, or mutually touching boundaries conservatively. */
55
+ function separatedBoundaries(rings) {
56
+ const edges = [];
57
+ for (const ring of rings) {
58
+ const size = ring.length - 1;
59
+ if (size < 3 || !samePoint(ring[0], ring[size]))
60
+ return false;
61
+ for (let i = 0; i < size; i++) {
62
+ const a = ring[i];
63
+ const b = ring[i + 1];
64
+ const c = ring[(i + 2) % size];
65
+ if (!Number.isFinite(a[0]) || !Number.isFinite(a[1]) || samePoint(a, b))
66
+ return false;
67
+ if (orient2d(a[0], a[1], b[0], b[1], c[0], c[1]) === 0 &&
68
+ (a[0] - b[0]) * (c[0] - b[0]) + (a[1] - b[1]) * (c[1] - b[1]) > 0)
69
+ return false;
70
+ edges.push({
71
+ a,
72
+ b,
73
+ ring,
74
+ index: i,
75
+ bounds: [
76
+ Math.min(a[0], b[0]),
77
+ Math.min(a[1], b[1]),
78
+ Math.max(a[0], b[0]),
79
+ Math.max(a[1], b[1])
80
+ ]
81
+ });
82
+ }
83
+ }
84
+ return !anyOverlap(edges, (a, b) => {
85
+ if (a.ring === b.ring) {
86
+ const gap = Math.abs(a.index - b.index);
87
+ if (gap === 1 || gap === a.ring.length - 2)
88
+ return false;
89
+ }
90
+ return segmentsMeet(a.a, a.b, b.a, b.b);
91
+ });
92
+ }
93
+ /** Checks containment of one ring by another after ruling out boundary contact. */
94
+ function contains(outer, inner) {
95
+ return planarIntersects({ type: 'Polygon', coordinates: [outer] }, { type: 'Point', coordinates: inner[0] });
96
+ }
97
+ /** Checks that all shell, hole, and island containment relationships remain the same. */
98
+ function preservesNesting(before, after) {
99
+ const rings = before.map((original, index) => ({
100
+ original,
101
+ simplified: after[index],
102
+ bounds: planarBounds({ type: 'LineString', coordinates: original })
103
+ }));
104
+ return !anyOverlap(rings, (a, b) => contains(a.original, b.original) !== contains(a.simplified, b.simplified) ||
105
+ contains(b.original, a.original) !== contains(b.simplified, a.simplified));
106
+ }
107
+ /** Keeps the original ring if simplification would collapse it or reverse its winding. */
108
+ function simplifyRing(ring, tolerance) {
109
+ const reduced = simplifyLine(ring, tolerance);
110
+ if (reduced.length < 4 || reduced.length === ring.length)
111
+ return ring;
112
+ const before = signedArea(ring);
113
+ const after = signedArea(reduced);
114
+ return Number.isFinite(before) &&
115
+ Number.isFinite(after) &&
116
+ after &&
117
+ Math.sign(before) === Math.sign(after)
118
+ ? reduced
119
+ : ring;
120
+ }
121
+ /** Simplifies closed rings only when boundary and nesting checks prove topology is preserved. */
122
+ export function simplifyPolygonTopology(geometry, tolerance) {
123
+ if (!Number.isFinite(tolerance) || tolerance < 0)
124
+ throw new Error('Expected a finite nonnegative tolerance');
125
+ if (!tolerance)
126
+ return geometry;
127
+ const polygons = geometry.type === 'Polygon' ? [geometry.coordinates] : geometry.coordinates;
128
+ const before = polygons.flat();
129
+ const reduced = polygons.map(polygon => polygon.map(ring => simplifyRing(ring, tolerance)));
130
+ const after = reduced.flat();
131
+ if (before.every((ring, index) => ring === after[index]))
132
+ return geometry;
133
+ if (!separatedBoundaries(before) ||
134
+ !separatedBoundaries(after) ||
135
+ !preservesNesting(before, after))
136
+ return geometry;
137
+ return geometry.type === 'Polygon'
138
+ ? { type: 'Polygon', coordinates: reduced[0] }
139
+ : { type: 'MultiPolygon', coordinates: reduced };
140
+ }
141
+ //# sourceMappingURL=polygon-simplification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygon-simplification.js","sourceRoot":"","sources":["../src/polygon-simplification.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,iCAA8B;AACnD,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,uCAAoC;AAyB3E,+EAA+E;AAC/E,SAAS,eAAe,CAAC,KAAyB,EAAE,IAAY;IAC9D,IAAI,OAAO,GAAG,QAAQ,CAAC;IACvB,IAAI,OAAO,GAAG,CAAC,QAAQ,CAAC;IACxB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAC,MAAM,EAAC,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,GAAG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