@math.gl/geospatial 5.0.0-beta.11 → 5.0.0-beta.12

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 (276) hide show
  1. package/README.md +3 -3
  2. package/dist/index.cjs +725 -229
  3. package/dist/index.cjs.map +3 -3
  4. package/dist/index.d.ts +5 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +4 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/projection/experimental/core.cjs.map +1 -1
  9. package/dist/projection/experimental/crs/spatial-reference.d.ts.map +1 -1
  10. package/dist/projection/experimental/crs/spatial-reference.js.map +1 -1
  11. package/dist/projection/experimental/crs/types.d.ts.map +1 -1
  12. package/dist/projection/experimental/lazy-projections/aea.cjs +4 -1
  13. package/dist/projection/experimental/lazy-projections/aea.cjs.map +1 -1
  14. package/dist/projection/experimental/lazy-projections/aea.d.ts.map +1 -1
  15. package/dist/projection/experimental/lazy-projections/aea.js +4 -1
  16. package/dist/projection/experimental/lazy-projections/aea.js.map +1 -1
  17. package/dist/projection/experimental/lazy-projections/bonne.cjs +4 -1
  18. package/dist/projection/experimental/lazy-projections/bonne.cjs.map +1 -1
  19. package/dist/projection/experimental/lazy-projections/bonne.d.ts.map +1 -1
  20. package/dist/projection/experimental/lazy-projections/bonne.js +4 -1
  21. package/dist/projection/experimental/lazy-projections/bonne.js.map +1 -1
  22. package/dist/projection/experimental/lazy-projections/cass.cjs +4 -1
  23. package/dist/projection/experimental/lazy-projections/cass.cjs.map +1 -1
  24. package/dist/projection/experimental/lazy-projections/cass.d.ts.map +1 -1
  25. package/dist/projection/experimental/lazy-projections/cass.js +4 -1
  26. package/dist/projection/experimental/lazy-projections/cass.js.map +1 -1
  27. package/dist/projection/experimental/lazy-projections/eck6.cjs +4 -1
  28. package/dist/projection/experimental/lazy-projections/eck6.cjs.map +1 -1
  29. package/dist/projection/experimental/lazy-projections/eck6.d.ts.map +1 -1
  30. package/dist/projection/experimental/lazy-projections/eck6.js +4 -1
  31. package/dist/projection/experimental/lazy-projections/eck6.js.map +1 -1
  32. package/dist/projection/experimental/lazy-projections/eqdc.cjs +4 -1
  33. package/dist/projection/experimental/lazy-projections/eqdc.cjs.map +1 -1
  34. package/dist/projection/experimental/lazy-projections/eqdc.d.ts.map +1 -1
  35. package/dist/projection/experimental/lazy-projections/eqdc.js +4 -1
  36. package/dist/projection/experimental/lazy-projections/eqdc.js.map +1 -1
  37. package/dist/projection/experimental/lazy-projections/eqearth.cjs +4 -1
  38. package/dist/projection/experimental/lazy-projections/eqearth.cjs.map +1 -1
  39. package/dist/projection/experimental/lazy-projections/eqearth.d.ts.map +1 -1
  40. package/dist/projection/experimental/lazy-projections/eqearth.js +4 -1
  41. package/dist/projection/experimental/lazy-projections/eqearth.js.map +1 -1
  42. package/dist/projection/experimental/lazy-projections/equi.cjs +4 -1
  43. package/dist/projection/experimental/lazy-projections/equi.cjs.map +1 -1
  44. package/dist/projection/experimental/lazy-projections/equi.d.ts.map +1 -1
  45. package/dist/projection/experimental/lazy-projections/equi.js +4 -1
  46. package/dist/projection/experimental/lazy-projections/equi.js.map +1 -1
  47. package/dist/projection/experimental/lazy-projections/geocent.cjs +4 -1
  48. package/dist/projection/experimental/lazy-projections/geocent.cjs.map +1 -1
  49. package/dist/projection/experimental/lazy-projections/geocent.d.ts.map +1 -1
  50. package/dist/projection/experimental/lazy-projections/geocent.js +4 -1
  51. package/dist/projection/experimental/lazy-projections/geocent.js.map +1 -1
  52. package/dist/projection/experimental/lazy-projections/geos.cjs +4 -1
  53. package/dist/projection/experimental/lazy-projections/geos.cjs.map +1 -1
  54. package/dist/projection/experimental/lazy-projections/geos.d.ts.map +1 -1
  55. package/dist/projection/experimental/lazy-projections/geos.js +4 -1
  56. package/dist/projection/experimental/lazy-projections/geos.js.map +1 -1
  57. package/dist/projection/experimental/lazy-projections/gnom.cjs +4 -1
  58. package/dist/projection/experimental/lazy-projections/gnom.cjs.map +1 -1
  59. package/dist/projection/experimental/lazy-projections/gnom.d.ts.map +1 -1
  60. package/dist/projection/experimental/lazy-projections/gnom.js +4 -1
  61. package/dist/projection/experimental/lazy-projections/gnom.js.map +1 -1
  62. package/dist/projection/experimental/lazy-projections/index.cjs +92 -23
  63. package/dist/projection/experimental/lazy-projections/index.cjs.map +1 -1
  64. package/dist/projection/experimental/lazy-projections/krovak.cjs +4 -1
  65. package/dist/projection/experimental/lazy-projections/krovak.cjs.map +1 -1
  66. package/dist/projection/experimental/lazy-projections/krovak.d.ts.map +1 -1
  67. package/dist/projection/experimental/lazy-projections/krovak.js +4 -1
  68. package/dist/projection/experimental/lazy-projections/krovak.js.map +1 -1
  69. package/dist/projection/experimental/lazy-projections/merc.cjs +4 -1
  70. package/dist/projection/experimental/lazy-projections/merc.cjs.map +1 -1
  71. package/dist/projection/experimental/lazy-projections/merc.d.ts.map +1 -1
  72. package/dist/projection/experimental/lazy-projections/merc.js +4 -1
  73. package/dist/projection/experimental/lazy-projections/merc.js.map +1 -1
  74. package/dist/projection/experimental/lazy-projections/mill.cjs +4 -1
  75. package/dist/projection/experimental/lazy-projections/mill.cjs.map +1 -1
  76. package/dist/projection/experimental/lazy-projections/mill.d.ts.map +1 -1
  77. package/dist/projection/experimental/lazy-projections/mill.js +4 -1
  78. package/dist/projection/experimental/lazy-projections/mill.js.map +1 -1
  79. package/dist/projection/experimental/lazy-projections/moll.cjs +4 -1
  80. package/dist/projection/experimental/lazy-projections/moll.cjs.map +1 -1
  81. package/dist/projection/experimental/lazy-projections/moll.d.ts.map +1 -1
  82. package/dist/projection/experimental/lazy-projections/moll.js +4 -1
  83. package/dist/projection/experimental/lazy-projections/moll.js.map +1 -1
  84. package/dist/projection/experimental/lazy-projections/nzmg.cjs +4 -1
  85. package/dist/projection/experimental/lazy-projections/nzmg.cjs.map +1 -1
  86. package/dist/projection/experimental/lazy-projections/nzmg.d.ts.map +1 -1
  87. package/dist/projection/experimental/lazy-projections/nzmg.js +4 -1
  88. package/dist/projection/experimental/lazy-projections/nzmg.js.map +1 -1
  89. package/dist/projection/experimental/lazy-projections/omerc.cjs +4 -1
  90. package/dist/projection/experimental/lazy-projections/omerc.cjs.map +1 -1
  91. package/dist/projection/experimental/lazy-projections/omerc.d.ts.map +1 -1
  92. package/dist/projection/experimental/lazy-projections/omerc.js +4 -1
  93. package/dist/projection/experimental/lazy-projections/omerc.js.map +1 -1
  94. package/dist/projection/experimental/lazy-projections/ortho.cjs +4 -1
  95. package/dist/projection/experimental/lazy-projections/ortho.cjs.map +1 -1
  96. package/dist/projection/experimental/lazy-projections/ortho.d.ts.map +1 -1
  97. package/dist/projection/experimental/lazy-projections/ortho.js +4 -1
  98. package/dist/projection/experimental/lazy-projections/ortho.js.map +1 -1
  99. package/dist/projection/experimental/lazy-projections/poly.cjs +4 -1
  100. package/dist/projection/experimental/lazy-projections/poly.cjs.map +1 -1
  101. package/dist/projection/experimental/lazy-projections/poly.d.ts.map +1 -1
  102. package/dist/projection/experimental/lazy-projections/poly.js +4 -1
  103. package/dist/projection/experimental/lazy-projections/poly.js.map +1 -1
  104. package/dist/projection/experimental/lazy-projections/robin.cjs +4 -1
  105. package/dist/projection/experimental/lazy-projections/robin.cjs.map +1 -1
  106. package/dist/projection/experimental/lazy-projections/robin.d.ts.map +1 -1
  107. package/dist/projection/experimental/lazy-projections/robin.js +4 -1
  108. package/dist/projection/experimental/lazy-projections/robin.js.map +1 -1
  109. package/dist/projection/experimental/lazy-projections/sinu.cjs +4 -1
  110. package/dist/projection/experimental/lazy-projections/sinu.cjs.map +1 -1
  111. package/dist/projection/experimental/lazy-projections/sinu.d.ts.map +1 -1
  112. package/dist/projection/experimental/lazy-projections/sinu.js +4 -1
  113. package/dist/projection/experimental/lazy-projections/sinu.js.map +1 -1
  114. package/dist/projection/experimental/lazy-projections/stere.cjs +4 -1
  115. package/dist/projection/experimental/lazy-projections/stere.cjs.map +1 -1
  116. package/dist/projection/experimental/lazy-projections/stere.d.ts.map +1 -1
  117. package/dist/projection/experimental/lazy-projections/stere.js +4 -1
  118. package/dist/projection/experimental/lazy-projections/stere.js.map +1 -1
  119. package/dist/projection/experimental/lazy-projections/tpers.cjs +4 -1
  120. package/dist/projection/experimental/lazy-projections/tpers.cjs.map +1 -1
  121. package/dist/projection/experimental/lazy-projections/tpers.d.ts.map +1 -1
  122. package/dist/projection/experimental/lazy-projections/tpers.js +4 -1
  123. package/dist/projection/experimental/lazy-projections/tpers.js.map +1 -1
  124. package/dist/projection/experimental/lazy-projections/vandg.cjs +4 -1
  125. package/dist/projection/experimental/lazy-projections/vandg.cjs.map +1 -1
  126. package/dist/projection/experimental/lazy-projections/vandg.d.ts.map +1 -1
  127. package/dist/projection/experimental/lazy-projections/vandg.js +4 -1
  128. package/dist/projection/experimental/lazy-projections/vandg.js.map +1 -1
  129. package/dist/projection/index.cjs.map +1 -1
  130. package/dist/projection/index.d.ts.map +1 -1
  131. package/dist/projection/index.js.map +1 -1
  132. package/dist/projection/lib/projection.js.map +1 -1
  133. package/dist/projection/pipeline.cjs.map +1 -1
  134. package/dist/projection/transform-analysis.cjs.map +1 -1
  135. package/dist/tasks/index.cjs.map +1 -1
  136. package/dist/terrain/cutout-polygons.d.ts +21 -0
  137. package/dist/terrain/cutout-polygons.d.ts.map +1 -0
  138. package/dist/terrain/cutout-polygons.js +172 -0
  139. package/dist/terrain/cutout-polygons.js.map +1 -0
  140. package/dist/terrain/cutout-region.d.ts +34 -0
  141. package/dist/terrain/cutout-region.d.ts.map +1 -0
  142. package/dist/terrain/cutout-region.js +33 -0
  143. package/dist/terrain/cutout-region.js.map +1 -0
  144. package/dist/terrain/geographic-cutout.d.ts +38 -0
  145. package/dist/terrain/geographic-cutout.d.ts.map +1 -0
  146. package/dist/terrain/geographic-cutout.js +120 -0
  147. package/dist/terrain/geographic-cutout.js.map +1 -0
  148. package/dist/terrain/index.cjs +532 -36
  149. package/dist/terrain/index.cjs.map +3 -3
  150. package/dist/terrain/index.d.ts +5 -0
  151. package/dist/terrain/index.d.ts.map +1 -1
  152. package/dist/terrain/index.js +4 -0
  153. package/dist/terrain/index.js.map +1 -1
  154. package/dist/terrain/mesh-cutout.d.ts +10 -5
  155. package/dist/terrain/mesh-cutout.d.ts.map +1 -1
  156. package/dist/terrain/mesh-cutout.js +62 -20
  157. package/dist/terrain/mesh-cutout.js.map +1 -1
  158. package/dist/terrain/tile-cutout-update.d.ts +73 -0
  159. package/dist/terrain/tile-cutout-update.d.ts.map +1 -0
  160. package/dist/terrain/tile-cutout-update.js +181 -0
  161. package/dist/terrain/tile-cutout-update.js.map +1 -0
  162. package/dist/terrain/tile-cutout.d.ts +33 -0
  163. package/dist/terrain/tile-cutout.d.ts.map +1 -0
  164. package/dist/terrain/tile-cutout.js +93 -0
  165. package/dist/terrain/tile-cutout.js.map +1 -0
  166. package/dist/turf/expressions.cjs +4 -4
  167. package/dist/turf/expressions.cjs.map +2 -2
  168. package/dist/turf/expressions.d.ts +1 -1
  169. package/dist/turf/expressions.d.ts.map +1 -1
  170. package/dist/turf/expressions.js +2 -2
  171. package/dist/turf/expressions.js.map +1 -1
  172. package/dist/turf.cjs +25 -25
  173. package/dist/turf.cjs.map +2 -2
  174. package/dist/turf.d.ts +1 -1
  175. package/dist/turf.d.ts.map +1 -1
  176. package/dist/turf.js +2 -2
  177. package/dist/turf.js.map +1 -1
  178. package/dist/web-mercator/assert.d.ts +2 -0
  179. package/dist/web-mercator/assert.d.ts.map +1 -0
  180. package/dist/web-mercator/assert.js +12 -0
  181. package/dist/web-mercator/assert.js.map +1 -0
  182. package/dist/web-mercator/fit-bounds.d.ts +52 -0
  183. package/dist/web-mercator/fit-bounds.d.ts.map +1 -0
  184. package/dist/web-mercator/fit-bounds.js +70 -0
  185. package/dist/web-mercator/fit-bounds.js.map +1 -0
  186. package/dist/web-mercator/fly-to-viewport.d.ts +19 -0
  187. package/dist/web-mercator/fly-to-viewport.d.ts.map +1 -0
  188. package/dist/web-mercator/fly-to-viewport.js +94 -0
  189. package/dist/web-mercator/fly-to-viewport.js.map +1 -0
  190. package/dist/web-mercator/get-bounds.d.ts +3 -0
  191. package/dist/web-mercator/get-bounds.d.ts.map +1 -0
  192. package/dist/web-mercator/get-bounds.js +56 -0
  193. package/dist/web-mercator/get-bounds.js.map +1 -0
  194. package/dist/web-mercator/index.cjs +705 -0
  195. package/dist/web-mercator/index.cjs.map +6 -0
  196. package/dist/web-mercator/index.d.ts +14 -0
  197. package/dist/web-mercator/index.d.ts.map +1 -0
  198. package/dist/web-mercator/index.js +14 -0
  199. package/dist/web-mercator/index.js.map +1 -0
  200. package/dist/web-mercator/math-utils.d.ts +7 -0
  201. package/dist/web-mercator/math-utils.d.ts.map +1 -0
  202. package/dist/web-mercator/math-utils.js +30 -0
  203. package/dist/web-mercator/math-utils.js.map +1 -0
  204. package/dist/web-mercator/mercator-meters.d.ts +29 -0
  205. package/dist/web-mercator/mercator-meters.d.ts.map +1 -0
  206. package/dist/web-mercator/mercator-meters.js +61 -0
  207. package/dist/web-mercator/mercator-meters.js.map +1 -0
  208. package/dist/web-mercator/normalize-viewport-props.d.ts +16 -0
  209. package/dist/web-mercator/normalize-viewport-props.d.ts.map +1 -0
  210. package/dist/web-mercator/normalize-viewport-props.js +45 -0
  211. package/dist/web-mercator/normalize-viewport-props.js.map +1 -0
  212. package/dist/web-mercator/web-mercator-utils.d.ts +192 -0
  213. package/dist/web-mercator/web-mercator-utils.d.ts.map +1 -0
  214. package/dist/web-mercator/web-mercator-utils.js +321 -0
  215. package/dist/web-mercator/web-mercator-utils.js.map +1 -0
  216. package/dist/web-mercator/web-mercator-viewport.d.ts +177 -0
  217. package/dist/web-mercator/web-mercator-viewport.d.ts.map +1 -0
  218. package/dist/web-mercator/web-mercator-viewport.js +276 -0
  219. package/dist/web-mercator/web-mercator-viewport.js.map +1 -0
  220. package/dist/web-mercator.d.ts +1 -1
  221. package/dist/web-mercator.d.ts.map +1 -1
  222. package/dist/web-mercator.js +1 -1
  223. package/dist/web-mercator.js.map +1 -1
  224. package/package.json +19 -458
  225. package/src/index.ts +36 -5
  226. package/src/projection/experimental/crs/spatial-reference.ts +1 -6
  227. package/src/projection/experimental/crs/types.ts +1 -1
  228. package/src/projection/experimental/crs/wkt.ts +1 -1
  229. package/src/projection/experimental/crs-descriptor.ts +1 -1
  230. package/src/projection/experimental/lazy-projections/aea.ts +4 -1
  231. package/src/projection/experimental/lazy-projections/bonne.ts +4 -1
  232. package/src/projection/experimental/lazy-projections/cass.ts +4 -1
  233. package/src/projection/experimental/lazy-projections/eck6.ts +4 -1
  234. package/src/projection/experimental/lazy-projections/eqdc.ts +4 -1
  235. package/src/projection/experimental/lazy-projections/eqearth.ts +4 -1
  236. package/src/projection/experimental/lazy-projections/equi.ts +4 -1
  237. package/src/projection/experimental/lazy-projections/geocent.ts +4 -1
  238. package/src/projection/experimental/lazy-projections/geos.ts +4 -1
  239. package/src/projection/experimental/lazy-projections/gnom.ts +4 -1
  240. package/src/projection/experimental/lazy-projections/krovak.ts +4 -1
  241. package/src/projection/experimental/lazy-projections/merc.ts +4 -1
  242. package/src/projection/experimental/lazy-projections/mill.ts +4 -1
  243. package/src/projection/experimental/lazy-projections/moll.ts +4 -1
  244. package/src/projection/experimental/lazy-projections/nzmg.ts +4 -1
  245. package/src/projection/experimental/lazy-projections/omerc.ts +4 -1
  246. package/src/projection/experimental/lazy-projections/ortho.ts +4 -1
  247. package/src/projection/experimental/lazy-projections/poly.ts +4 -1
  248. package/src/projection/experimental/lazy-projections/robin.ts +4 -1
  249. package/src/projection/experimental/lazy-projections/sinu.ts +4 -1
  250. package/src/projection/experimental/lazy-projections/stere.ts +4 -1
  251. package/src/projection/experimental/lazy-projections/tpers.ts +4 -1
  252. package/src/projection/experimental/lazy-projections/vandg.ts +4 -1
  253. package/src/projection/index.ts +1 -1
  254. package/src/projection/lib/projection.ts +1 -1
  255. package/src/terrain/cutout-polygons.ts +202 -0
  256. package/src/terrain/cutout-region.ts +54 -0
  257. package/src/terrain/geographic-cutout.ts +154 -0
  258. package/src/terrain/index.ts +24 -0
  259. package/src/terrain/mesh-cutout.ts +85 -23
  260. package/src/terrain/tile-cutout-update.ts +293 -0
  261. package/src/terrain/tile-cutout.ts +123 -0
  262. package/src/turf/expressions.ts +2 -2
  263. package/src/turf.ts +3 -7
  264. package/src/web-mercator/assert.ts +11 -0
  265. package/src/web-mercator/fit-bounds.ts +132 -0
  266. package/src/web-mercator/fly-to-viewport.ts +157 -0
  267. package/src/web-mercator/get-bounds.ts +62 -0
  268. package/src/web-mercator/index.ts +49 -0
  269. package/src/web-mercator/math-utils.ts +35 -0
  270. package/src/web-mercator/mercator-meters.ts +83 -0
  271. package/src/web-mercator/normalize-viewport-props.ts +58 -0
  272. package/src/web-mercator/web-mercator-utils.ts +468 -0
  273. package/src/web-mercator/web-mercator-viewport.ts +406 -0
  274. package/src/web-mercator.ts +1 -1
  275. package/dist/projection/experimental/index.cjs +0 -11707
  276. package/dist/projection/experimental/index.cjs.map +0 -6
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import type {CRSMetadata, CRSUnit} from '../../crs/index';
5
+ import type {CRSMetadata, CRSUnit} from '../../crs';
6
6
  import type {CRSResolver} from '../../crs/resolver';
7
7
  import {normalizeCRS} from './crs/normalize';
8
8
  import {createRenderingScale} from './crs-rendering-scale';
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyAlbersEqualArea: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'aea', aliases: ['Albers_Conic_Equal_Area', 'Albers_Equal_Area', 'Albers']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/aea')).albersEqualArea
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/aea');
11
+ return projectionModule.albersEqualArea;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyBonne: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'bonne', aliases: ['Bonne (Werner lat_1=90)']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/bonne')).bonne
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/bonne');
11
+ return projectionModule.bonne;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyCassiniSoldner: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'cass', aliases: ['Cassini', 'Cassini_Soldner']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/cass')).cassiniSoldner
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/cass');
11
+ return projectionModule.cassiniSoldner;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyEckertVI: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'eck6', aliases: ['Eckert_VI']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/eck6')).eckertVI
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/eck6');
11
+ return projectionModule.eckertVI;
12
+ }
10
13
  );
@@ -7,5 +7,8 @@ import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyEquidistantConic: ProjectionDescriptor =
8
8
  /* @__PURE__ */ createProjectionDescriptor(
9
9
  {name: 'eqdc', aliases: ['Equidistant_Conic']},
10
- async () => (await import('@math.gl/geospatial/projection/projections/eqdc')).equidistantConic
10
+ async () => {
11
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/eqdc');
12
+ return projectionModule.equidistantConic;
13
+ }
11
14
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyEqualEarth: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'eqearth', aliases: ['Equal Earth', 'Equal_Earth']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/eqearth')).equalEarth
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/eqearth');
11
+ return projectionModule.equalEarth;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyEquirectangular: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'equi', aliases: []},
9
- async () => (await import('@math.gl/geospatial/projection/projections/equi')).equirectangular
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/equi');
11
+ return projectionModule.equirectangular;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyGeocentric: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'geocent', aliases: ['Geocentric', 'geocentric', 'Geocent']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/geocent')).geocentric
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/geocent');
11
+ return projectionModule.geocentric;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyGeostationary: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'geos', aliases: ['Geostationary Satellite View', 'Geostationary_Satellite']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/geos')).geostationary
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/geos');
11
+ return projectionModule.geostationary;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyGnomonic: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'gnom', aliases: []},
9
- async () => (await import('@math.gl/geospatial/projection/projections/gnom')).gnomonic
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/gnom');
11
+ return projectionModule.gnomonic;
12
+ }
10
13
  );
@@ -14,5 +14,8 @@ export const lazyKrovak: ProjectionDescriptor = /* @__PURE__ */ createProjection
14
14
  'Krovak Modified (North Orientated)'
15
15
  ]
16
16
  },
17
- async () => (await import('@math.gl/geospatial/projection/projections/krovak')).krovak
17
+ async () => {
18
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/krovak');
19
+ return projectionModule.krovak;
20
+ }
18
21
  );
@@ -15,5 +15,8 @@ export const lazyMercator: ProjectionDescriptor = /* @__PURE__ */ createProjecti
15
15
  'Mercator_Variant_A'
16
16
  ]
17
17
  },
18
- async () => (await import('@math.gl/geospatial/projection/projections/merc')).mercator
18
+ async () => {
19
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/merc');
20
+ return projectionModule.mercator;
21
+ }
19
22
  );
@@ -7,5 +7,8 @@ import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyMillerCylindrical: ProjectionDescriptor =
8
8
  /* @__PURE__ */ createProjectionDescriptor(
9
9
  {name: 'mill', aliases: ['Miller_Cylindrical']},
10
- async () => (await import('@math.gl/geospatial/projection/projections/mill')).millerCylindrical
10
+ async () => {
11
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/mill');
12
+ return projectionModule.millerCylindrical;
13
+ }
11
14
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyMollweide: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'moll', aliases: ['Mollweide']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/moll')).mollweide
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/moll');
11
+ return projectionModule.mollweide;
12
+ }
10
13
  );
@@ -7,5 +7,8 @@ import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyNewZealandMapGrid: ProjectionDescriptor =
8
8
  /* @__PURE__ */ createProjectionDescriptor(
9
9
  {name: 'nzmg', aliases: ['New_Zealand_Map_Grid']},
10
- async () => (await import('@math.gl/geospatial/projection/projections/nzmg')).newZealandMapGrid
10
+ async () => {
11
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/nzmg');
12
+ return projectionModule.newZealandMapGrid;
13
+ }
11
14
  );
@@ -18,5 +18,8 @@ export const lazyObliqueMercator: ProjectionDescriptor = /* @__PURE__ */ createP
18
18
  'Oblique_Mercator'
19
19
  ]
20
20
  },
21
- async () => (await import('@math.gl/geospatial/projection/projections/omerc')).obliqueMercator
21
+ async () => {
22
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/omerc');
23
+ return projectionModule.obliqueMercator;
24
+ }
22
25
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyOrthographic: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'ortho', aliases: []},
9
- async () => (await import('@math.gl/geospatial/projection/projections/ortho')).orthographic
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/ortho');
11
+ return projectionModule.orthographic;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyPolyconic: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'poly', aliases: ['Polyconic', 'American_Polyconic']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/poly')).polyconic
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/poly');
11
+ return projectionModule.polyconic;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyRobinson: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'robin', aliases: ['Robinson']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/robin')).robinson
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/robin');
11
+ return projectionModule.robinson;
12
+ }
10
13
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazySinusoidal: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'sinu', aliases: ['Sinusoidal']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/sinu')).sinusoidal
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/sinu');
11
+ return projectionModule.sinusoidal;
12
+ }
10
13
  );
@@ -14,5 +14,8 @@ export const lazyStereographic: ProjectionDescriptor = /* @__PURE__ */ createPro
14
14
  'Polar_Stereographic'
15
15
  ]
16
16
  },
17
- async () => (await import('@math.gl/geospatial/projection/projections/stere')).stereographic
17
+ async () => {
18
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/stere');
19
+ return projectionModule.stereographic;
20
+ }
18
21
  );
@@ -7,5 +7,8 @@ import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyTiltedPerspective: ProjectionDescriptor =
8
8
  /* @__PURE__ */ createProjectionDescriptor(
9
9
  {name: 'tpers', aliases: ['Tilted_Perspective']},
10
- async () => (await import('@math.gl/geospatial/projection/projections/tpers')).tiltedPerspective
10
+ async () => {
11
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/tpers');
12
+ return projectionModule.tiltedPerspective;
13
+ }
11
14
  );
@@ -6,5 +6,8 @@ import {createProjectionDescriptor} from '../projection-descriptor';
6
6
  import type {ProjectionDescriptor} from '../projection-descriptor';
7
7
  export const lazyVanDerGrinten: ProjectionDescriptor = /* @__PURE__ */ createProjectionDescriptor(
8
8
  {name: 'vandg', aliases: ['Van_der_Grinten_I', 'VanDerGrinten', 'Van_der_Grinten']},
9
- async () => (await import('@math.gl/geospatial/projection/projections/vandg')).vanDerGrinten
9
+ async () => {
10
+ const projectionModule = await import('@math.gl/geospatial/projection/projections/vandg');
11
+ return projectionModule.vanDerGrinten;
12
+ }
10
13
  );
@@ -2,5 +2,5 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- export * from './experimental/index';
5
+ export * from './experimental';
6
6
  export {FullProjectionEngine, projectionEngine} from './lib/projection';
@@ -46,7 +46,7 @@ import {
46
46
  obliqueTransformation,
47
47
  wktCRSParser,
48
48
  projJSONCRSParser
49
- } from '../experimental/index';
49
+ } from '../experimental';
50
50
  import {CORE_PARAMETERS} from '../experimental/crs/normalize';
51
51
  import type {ProjectionPlugin} from '../experimental/types';
52
52
 
@@ -0,0 +1,202 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {
6
+ createTerrainCutoutPlan,
7
+ type CutoutPoint,
8
+ type TerrainCutoutPolygon,
9
+ type TerrainCutoutPolygonSet
10
+ } from './cutout-region';
11
+
12
+ /** Limits for validating and preparing a reusable polygon arrangement. */
13
+ export type TerrainCutoutPolygonOptions = {
14
+ /** Maximum total ring edges. Default 2048. */
15
+ maxEdges?: number;
16
+ /** Maximum validation, containment and line-comparison operations. Default 4000000. */
17
+ maxWork?: number;
18
+ };
19
+ /** Prepare concave polygons, holes and disjoint regions for all terrain cut APIs.
20
+ * Copies inputs. Ring winding is unrestricted. Rings must be simple and finite,
21
+ * with no repeated closing point. Holes are strictly contained and disjoint;
22
+ * separate polygon domains must not overlap or touch. Islands inside another
23
+ * polygon's hole are allowed. Polygon IDs are zero-based input array indices.
24
+ *
25
+ * The immutable descriptor contains CPU functions: reuse it for cache hits,
26
+ * and prepare a new descriptor inside each worker instead of transferring it.
27
+ * Supporting-line arrangements can grow quadratically; split-time budgets
28
+ * remain necessary in addition to these preparation limits.
29
+ */
30
+ export function prepareTerrainCutoutPolygons(
31
+ polygons: readonly TerrainCutoutPolygon[],
32
+ {maxEdges = 2048, maxWork = 4000000}: TerrainCutoutPolygonOptions = {}
33
+ ): TerrainCutoutPolygonSet {
34
+ if (![maxEdges, maxWork].every(n => Number.isSafeInteger(n) && n >= 0) || !polygons.length)
35
+ throw new RangeError('Invalid terrain cutout polygon limits or empty set');
36
+ let work = 0,
37
+ edgeCount = 0;
38
+ /** Bound preprocessing before expensive pair comparisons. */
39
+ const charge = (amount: number) => {
40
+ work += amount;
41
+ if (work > maxWork) throw new RangeError('Terrain cutout polygon work budget exceeded');
42
+ };
43
+ if (polygons.length > Math.floor(maxEdges / 3))
44
+ throw new RangeError('Terrain cutout polygon edge budget exceeded');
45
+ const regions = polygons.map(p => {
46
+ if (1 + (p.holes?.length ?? 0) > Math.floor((maxEdges - edgeCount) / 3))
47
+ throw new RangeError('Terrain cutout polygon edge budget exceeded');
48
+ return [p.outer, ...(p.holes ?? [])].map(ring => {
49
+ edgeCount += ring.length;
50
+ if (edgeCount > maxEdges) throw new RangeError('Terrain cutout polygon edge budget exceeded');
51
+ charge(ring.length);
52
+ if (ring.length < 3 || ring.some(p => p.length !== 2 || !p.every(Number.isFinite)))
53
+ throw new RangeError('Invalid terrain cutout polygon ring');
54
+ return ring.map(p => Object.freeze([p[0], p[1]] as const));
55
+ });
56
+ });
57
+ const rings = regions.flat();
58
+ for (const ring of rings) {
59
+ let area = 0;
60
+ for (let i = 0; i < ring.length; i++) {
61
+ charge(1);
62
+ const a = ring[i],
63
+ b = ring[(i + 1) % ring.length],
64
+ c = ring[(i + 2) % ring.length];
65
+ if (equal(a, b)) throw new RangeError('Duplicate terrain cutout ring vertex');
66
+ area += orient(ring[0], a, b);
67
+ if (
68
+ orient(a, b, c) === 0 &&
69
+ (a[0] - b[0]) * (c[0] - b[0]) + (a[1] - b[1]) * (c[1] - b[1]) >= 0
70
+ )
71
+ throw new RangeError('Backtracking terrain cutout ring edge');
72
+ for (let j = i + 1; j < ring.length; j++) {
73
+ if (j === i + 1 || (i === 0 && j === ring.length - 1)) continue;
74
+ charge(1);
75
+ if (intersects(a, b, ring[j], ring[(j + 1) % ring.length]))
76
+ throw new RangeError('Self-intersecting terrain cutout ring');
77
+ }
78
+ }
79
+ if (!Number.isFinite(area) || area === 0)
80
+ throw new RangeError('Degenerate terrain cutout ring');
81
+ }
82
+ for (let i = 0; i < rings.length; i++)
83
+ for (let j = i + 1; j < rings.length; j++) {
84
+ const a = rings[i],
85
+ b = rings[j];
86
+ for (let x = 0; x < a.length; x++)
87
+ for (let y = 0; y < b.length; y++) {
88
+ charge(1);
89
+ if (intersects(a[x], a[(x + 1) % a.length], b[y], b[(y + 1) % b.length]))
90
+ throw new RangeError('Terrain cutout rings must not touch or intersect');
91
+ }
92
+ }
93
+ for (const region of regions)
94
+ for (let i = 1; i < region.length; i++) {
95
+ if (contains(region[0], region[i][0], charge) !== 1)
96
+ throw new RangeError('Terrain cutout hole must be strictly inside its outer ring');
97
+ for (let j = 1; j < i; j++)
98
+ if (
99
+ contains(region[j], region[i][0], charge) === 1 ||
100
+ contains(region[i], region[j][0], charge) === 1
101
+ )
102
+ throw new RangeError('Nested terrain cutout holes are not supported');
103
+ }
104
+ /** Test the interior of a polygon, excluding every hole. */
105
+ function inRegion(
106
+ region: readonly (readonly CutoutPoint[])[],
107
+ point: CutoutPoint,
108
+ budget: (n: number) => void
109
+ ) {
110
+ const outer = contains(region[0], point, budget);
111
+ if (outer !== 1) return outer;
112
+ for (let i = 1; i < region.length; i++) {
113
+ const hole = contains(region[i], point, budget);
114
+ if (hole === 0) return 0;
115
+ if (hole === 1) return -1;
116
+ }
117
+ return 1;
118
+ }
119
+ for (let i = 0; i < regions.length; i++)
120
+ for (let j = i + 1; j < regions.length; j++) {
121
+ if (
122
+ inRegion(regions[i], regions[j][0][0], charge) === 1 ||
123
+ inRegion(regions[j], regions[i][0][0], charge) === 1
124
+ )
125
+ throw new RangeError('Overlapping terrain cutout polygon domains');
126
+ }
127
+ const lines: (readonly [CutoutPoint, CutoutPoint])[] = [];
128
+ for (const ring of rings)
129
+ for (let i = 0; i < ring.length; i++) {
130
+ const a = ring[i],
131
+ b = ring[(i + 1) % ring.length];
132
+ // Avoid splitting twice by the same supporting line (including collinear vertices).
133
+ if (
134
+ lines.some(([u, v]) => {
135
+ charge(1);
136
+ return orient(u, v, a) === 0 && orient(u, v, b) === 0;
137
+ })
138
+ )
139
+ continue;
140
+ lines.push(a[0] < b[0] || (a[0] === b[0] && a[1] < b[1]) ? [a, b] : [b, a]);
141
+ }
142
+ return createTerrainCutoutPlan({
143
+ lines: Object.freeze(lines.map(line => Object.freeze(line))),
144
+ classify(point, budget) {
145
+ for (let i = 0; i < regions.length; i++) {
146
+ const result = inRegion(regions[i], point, budget);
147
+ if (result === 0) throw new RangeError('Unrepresentable terrain cutout fragment interior');
148
+ if (result === 1) return i;
149
+ }
150
+ return -1;
151
+ }
152
+ });
153
+ }
154
+
155
+ /** Exact coordinate equality for duplicate endpoints. */
156
+ function equal(a: CutoutPoint, b: CutoutPoint) {
157
+ return a[0] === b[0] && a[1] === b[1];
158
+ }
159
+ /** Signed twice-area with explicit overflow rejection. */
160
+ function orient(a: CutoutPoint, b: CutoutPoint, c: CutoutPoint) {
161
+ const value = (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
162
+ if (!Number.isFinite(value)) throw new RangeError('Terrain cutout polygon coordinate overflow');
163
+ return value;
164
+ }
165
+ /** Inclusive segment membership after collinearity has been established. */
166
+ function onSegment(a: CutoutPoint, b: CutoutPoint, p: CutoutPoint) {
167
+ return (
168
+ p[0] >= Math.min(a[0], b[0]) &&
169
+ p[0] <= Math.max(a[0], b[0]) &&
170
+ p[1] >= Math.min(a[1], b[1]) &&
171
+ p[1] <= Math.max(a[1], b[1])
172
+ );
173
+ }
174
+ /** Detect crossings, overlapping edges and mere touches during ring validation. */
175
+ function intersects(a: CutoutPoint, b: CutoutPoint, c: CutoutPoint, d: CutoutPoint) {
176
+ const abC = orient(a, b, c),
177
+ abD = orient(a, b, d),
178
+ cdA = orient(c, d, a),
179
+ cdB = orient(c, d, b);
180
+ return (
181
+ (abC === 0 && onSegment(a, b, c)) ||
182
+ (abD === 0 && onSegment(a, b, d)) ||
183
+ (cdA === 0 && onSegment(c, d, a)) ||
184
+ (cdB === 0 && onSegment(c, d, b)) ||
185
+ (((abC > 0 && abD < 0) || (abC < 0 && abD > 0)) &&
186
+ ((cdA > 0 && cdB < 0) || (cdA < 0 && cdB > 0)))
187
+ );
188
+ }
189
+ /** Winding classification: interior 1, exterior -1, boundary 0. */
190
+ function contains(ring: readonly CutoutPoint[], p: CutoutPoint, charge: (n: number) => void) {
191
+ let winding = 0;
192
+ for (let i = 0; i < ring.length; i++) {
193
+ charge(1);
194
+ const a = ring[i],
195
+ b = ring[(i + 1) % ring.length],
196
+ cross = orient(a, b, p);
197
+ if (cross === 0 && onSegment(a, b, p)) return 0;
198
+ if (a[1] <= p[1] && b[1] > p[1] && cross > 0) winding++;
199
+ if (a[1] > p[1] && b[1] <= p[1] && cross < 0) winding--;
200
+ }
201
+ return winding === 0 ? -1 : 1;
202
+ }
@@ -0,0 +1,54 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ /** A finite local XY coordinate. */
6
+ export type CutoutPoint = readonly [number, number];
7
+ /** One simple outer ring with strictly contained, disjoint hole rings. */
8
+ export type TerrainCutoutPolygon = {
9
+ /** Either winding; omit the repeated closing point. */
10
+ outer: readonly CutoutPoint[];
11
+ /** Either winding; holes must not touch or intersect any other ring. */
12
+ holes?: readonly (readonly CutoutPoint[])[];
13
+ };
14
+ /** Internal prepared partition contract, shared without importing polygon algorithms. */
15
+ export type TerrainCutoutPlan = {
16
+ /** Supporting lines shared by every independently clipped tile. */
17
+ lines: readonly (readonly [CutoutPoint, CutoutPoint])[];
18
+ /** Return polygon index or -1 for the remainder; charge classification work. */
19
+ classify: (point: CutoutPoint, charge: (amount: number) => void) => number;
20
+ };
21
+ /** Versioned brand shared by ESM/CJS and both public entry-point bundles. */
22
+ const PLAN = Symbol.for('@math.gl/geospatial/terrain-cutout-polygons/v1');
23
+ /** Immutable prepared polygon set; create with prepareTerrainCutoutPolygons. */
24
+ export type TerrainCutoutPolygonSet = {readonly [PLAN]: TerrainCutoutPlan};
25
+ /** A strictly convex ring or an opt-in prepared concave/multi-polygon cut. */
26
+ export type TerrainCutoutRegion = readonly CutoutPoint[] | TerrainCutoutPolygonSet;
27
+
28
+ /** @internal Brand a validated plan without exposing its mutable preparation state. */
29
+ export function createTerrainCutoutPlan(plan: TerrainCutoutPlan): TerrainCutoutPolygonSet {
30
+ return Object.freeze({[PLAN]: Object.freeze(plan)});
31
+ }
32
+ /** @internal Read only genuine prepared inputs; arrays use the convex fast path. */
33
+ export function getTerrainCutoutPlan(region: TerrainCutoutRegion): TerrainCutoutPlan | undefined {
34
+ if (Array.isArray(region)) return undefined;
35
+ const plan = (region as TerrainCutoutPolygonSet | undefined)?.[PLAN];
36
+ if (!plan) throw new RangeError('Invalid prepared terrain cutout polygons');
37
+ return plan;
38
+ }
39
+ /** @internal Snapshot raw rings; immutable descriptors retain their identity. */
40
+ export function copyTerrainCutoutRegion(region: TerrainCutoutRegion): TerrainCutoutRegion {
41
+ return getTerrainCutoutPlan(region)
42
+ ? region
43
+ : (region as readonly CutoutPoint[]).map(p => [p[0], p[1]] as const);
44
+ }
45
+ /** @internal Prepared shapes compare by identity; raw rings compare by value. */
46
+ export function sameTerrainCutoutRegion(a: TerrainCutoutRegion, b: TerrainCutoutRegion): boolean {
47
+ if (getTerrainCutoutPlan(a) || getTerrainCutoutPlan(b)) return a === b;
48
+ const aa = a as readonly CutoutPoint[],
49
+ bb = b as readonly CutoutPoint[];
50
+ return (
51
+ aa.length === bb.length &&
52
+ aa.every((p, i) => bb[i].length === 2 && p[0] === bb[i][0] && p[1] === bb[i][1])
53
+ );
54
+ }