@loaders.gl/tiles 5.0.0-alpha.12 → 5.0.0-alpha.13

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 (716) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +18 -72
  3. package/dist/dist.dev.js +6979 -42928
  4. package/dist/dist.min.js +3 -22
  5. package/dist/image-set.d.ts +1 -1
  6. package/dist/image-set.d.ts.map +1 -1
  7. package/dist/index.cjs +2847 -8781
  8. package/dist/index.cjs.map +3 -4
  9. package/dist/index.d.ts +4 -45
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -27
  12. package/dist/index.js.map +1 -1
  13. package/dist/mlt/bundled.d.ts +3 -0
  14. package/dist/mlt/bundled.d.ts.map +1 -0
  15. package/dist/mlt/bundled.js +5 -0
  16. package/dist/mlt/bundled.js.map +1 -0
  17. package/dist/mlt/index.cjs +3701 -0
  18. package/dist/mlt/index.cjs.map +6 -0
  19. package/dist/mlt/index.d.ts +10 -0
  20. package/dist/mlt/index.d.ts.map +1 -0
  21. package/dist/mlt/index.js +12 -0
  22. package/dist/mlt/index.js.map +1 -0
  23. package/dist/mlt/lib/encode-mlt-geometry.d.ts +6 -0
  24. package/dist/mlt/lib/encode-mlt-geometry.d.ts.map +1 -0
  25. package/dist/mlt/lib/encode-mlt-geometry.js +150 -0
  26. package/dist/mlt/lib/encode-mlt-geometry.js.map +1 -0
  27. package/dist/mlt/lib/encode-mlt-streams.d.ts +13 -0
  28. package/dist/mlt/lib/encode-mlt-streams.d.ts.map +1 -0
  29. package/dist/mlt/lib/encode-mlt-streams.js +57 -0
  30. package/dist/mlt/lib/encode-mlt-streams.js.map +1 -0
  31. package/dist/mlt/lib/encode-mlt.d.ts +6 -0
  32. package/dist/mlt/lib/encode-mlt.d.ts.map +1 -0
  33. package/dist/mlt/lib/encode-mlt.js +174 -0
  34. package/dist/mlt/lib/encode-mlt.js.map +1 -0
  35. package/dist/mlt/lib/parse-mlt.d.ts +11 -0
  36. package/dist/mlt/lib/parse-mlt.d.ts.map +1 -0
  37. package/dist/mlt/lib/parse-mlt.js +675 -0
  38. package/dist/mlt/lib/parse-mlt.js.map +1 -0
  39. package/dist/mlt/mlt-format.d.ts +14 -0
  40. package/dist/mlt/mlt-format.d.ts.map +1 -0
  41. package/dist/mlt/mlt-format.js +17 -0
  42. package/dist/mlt/mlt-format.js.map +1 -0
  43. package/dist/mlt/mlt-loader-with-parser.d.ts +91 -0
  44. package/dist/mlt/mlt-loader-with-parser.d.ts.map +1 -0
  45. package/dist/mlt/mlt-loader-with-parser.js +29 -0
  46. package/dist/mlt/mlt-loader-with-parser.js.map +1 -0
  47. package/dist/mlt/mlt-loader.d.ts +115 -0
  48. package/dist/mlt/mlt-loader.d.ts.map +1 -0
  49. package/dist/mlt/mlt-loader.js +38 -0
  50. package/dist/mlt/mlt-loader.js.map +1 -0
  51. package/dist/mlt/mlt-source-loader.d.ts +82 -0
  52. package/dist/mlt/mlt-source-loader.d.ts.map +1 -0
  53. package/dist/mlt/mlt-source-loader.js +179 -0
  54. package/dist/mlt/mlt-source-loader.js.map +1 -0
  55. package/dist/mlt/mlt-writer.d.ts +45 -0
  56. package/dist/mlt/mlt-writer.d.ts.map +1 -0
  57. package/dist/mlt/mlt-writer.js +21 -0
  58. package/dist/mlt/mlt-writer.js.map +1 -0
  59. package/dist/mlt/unbundled.d.ts +3 -0
  60. package/dist/mlt/unbundled.d.ts.map +1 -0
  61. package/dist/mlt/unbundled.js +5 -0
  62. package/dist/mlt/unbundled.js.map +1 -0
  63. package/dist/mvt/arrow-table-tile-source-loader-types.d.ts +36 -0
  64. package/dist/mvt/arrow-table-tile-source-loader-types.d.ts.map +1 -0
  65. package/dist/mvt/arrow-table-tile-source-loader-types.js +36 -0
  66. package/dist/mvt/arrow-table-tile-source-loader-types.js.map +1 -0
  67. package/dist/mvt/arrow-table-tile-source-loader.cjs +6343 -0
  68. package/dist/mvt/arrow-table-tile-source-loader.cjs.map +6 -0
  69. package/dist/mvt/arrow-table-tile-source-loader.d.ts +69 -0
  70. package/dist/mvt/arrow-table-tile-source-loader.d.ts.map +1 -0
  71. package/dist/mvt/arrow-table-tile-source-loader.js +216 -0
  72. package/dist/mvt/arrow-table-tile-source-loader.js.map +1 -0
  73. package/dist/mvt/arrow-table-tile-source-types.d.ts +21 -0
  74. package/dist/mvt/arrow-table-tile-source-types.d.ts.map +1 -0
  75. package/dist/mvt/arrow-table-tile-source-types.js +6 -0
  76. package/dist/mvt/arrow-table-tile-source-types.js.map +1 -0
  77. package/dist/mvt/bundled.d.ts +6 -0
  78. package/dist/mvt/bundled.d.ts.map +1 -0
  79. package/dist/mvt/bundled.js +7 -0
  80. package/dist/mvt/bundled.js.map +1 -0
  81. package/dist/mvt/dist.dev.js +46689 -0
  82. package/dist/mvt/dist.min.js +94 -0
  83. package/dist/mvt/index.cjs +10095 -0
  84. package/dist/mvt/index.cjs.map +6 -0
  85. package/dist/mvt/index.d.ts +28 -0
  86. package/dist/mvt/index.d.ts.map +1 -0
  87. package/dist/mvt/index.js +27 -0
  88. package/dist/mvt/index.js.map +1 -0
  89. package/dist/mvt/lib/encode-mvt-arrow.d.ts +6 -0
  90. package/dist/mvt/lib/encode-mvt-arrow.d.ts.map +1 -0
  91. package/dist/mvt/lib/encode-mvt-arrow.js +225 -0
  92. package/dist/mvt/lib/encode-mvt-arrow.js.map +1 -0
  93. package/dist/mvt/lib/encode-mvt.d.ts +30 -0
  94. package/dist/mvt/lib/encode-mvt.d.ts.map +1 -0
  95. package/dist/mvt/lib/encode-mvt.js +20 -0
  96. package/dist/mvt/lib/encode-mvt.js.map +1 -0
  97. package/dist/mvt/lib/get-schemas-from-tilejson.d.ts +4 -0
  98. package/dist/mvt/lib/get-schemas-from-tilejson.d.ts.map +1 -0
  99. package/dist/mvt/lib/get-schemas-from-tilejson.js +56 -0
  100. package/dist/mvt/lib/get-schemas-from-tilejson.js.map +1 -0
  101. package/dist/mvt/lib/is-longitude-latitude-crs.d.ts +3 -0
  102. package/dist/mvt/lib/is-longitude-latitude-crs.d.ts.map +1 -0
  103. package/dist/mvt/lib/is-longitude-latitude-crs.js +13 -0
  104. package/dist/mvt/lib/is-longitude-latitude-crs.js.map +1 -0
  105. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts +25 -0
  106. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts.map +1 -0
  107. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js +73 -0
  108. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js.map +1 -0
  109. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts +52 -0
  110. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts.map +1 -0
  111. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js +165 -0
  112. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js.map +1 -0
  113. package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts +116 -0
  114. package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts.map +1 -0
  115. package/dist/mvt/lib/mvt-pbf/mvt-constants.js +127 -0
  116. package/dist/mvt/lib/mvt-pbf/mvt-constants.js.map +1 -0
  117. package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts +17 -0
  118. package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts.map +1 -0
  119. package/dist/mvt/lib/mvt-pbf/mvt-types.js +5 -0
  120. package/dist/mvt/lib/mvt-pbf/mvt-types.js.map +1 -0
  121. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts +77 -0
  122. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts.map +1 -0
  123. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js +235 -0
  124. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js.map +1 -0
  125. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts +25 -0
  126. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts.map +1 -0
  127. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js +263 -0
  128. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js.map +1 -0
  129. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts +4 -0
  130. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts.map +1 -0
  131. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js +134 -0
  132. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js.map +1 -0
  133. package/dist/mvt/lib/mvt-worker-transport.d.ts +15 -0
  134. package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -0
  135. package/dist/mvt/lib/mvt-worker-transport.js +54 -0
  136. package/dist/mvt/lib/mvt-worker-transport.js.map +1 -0
  137. package/dist/mvt/lib/parse-mvt-geojson.d.ts +6 -0
  138. package/dist/mvt/lib/parse-mvt-geojson.d.ts.map +1 -0
  139. package/dist/mvt/lib/parse-mvt-geojson.js +48 -0
  140. package/dist/mvt/lib/parse-mvt-geojson.js.map +1 -0
  141. package/dist/mvt/lib/parse-mvt.d.ts +14 -0
  142. package/dist/mvt/lib/parse-mvt.d.ts.map +1 -0
  143. package/dist/mvt/lib/parse-mvt.js +105 -0
  144. package/dist/mvt/lib/parse-mvt.js.map +1 -0
  145. package/dist/mvt/lib/parse-tilejson.d.ts +74 -0
  146. package/dist/mvt/lib/parse-tilejson.d.ts.map +1 -0
  147. package/dist/mvt/lib/parse-tilejson.js +267 -0
  148. package/dist/mvt/lib/parse-tilejson.js.map +1 -0
  149. package/dist/mvt/lib/resolve-table-tile-parameters.d.ts +4 -0
  150. package/dist/mvt/lib/resolve-table-tile-parameters.d.ts.map +1 -0
  151. package/dist/mvt/lib/resolve-table-tile-parameters.js +16 -0
  152. package/dist/mvt/lib/resolve-table-tile-parameters.js.map +1 -0
  153. package/dist/mvt/lib/types.d.ts +88 -0
  154. package/dist/mvt/lib/types.d.ts.map +1 -0
  155. package/dist/mvt/lib/types.js.map +1 -0
  156. package/dist/mvt/lib/utils/geometry-utils.d.ts +83 -0
  157. package/dist/mvt/lib/utils/geometry-utils.d.ts.map +1 -0
  158. package/dist/mvt/lib/utils/geometry-utils.js +211 -0
  159. package/dist/mvt/lib/utils/geometry-utils.js.map +1 -0
  160. package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts +72 -0
  161. package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts.map +1 -0
  162. package/dist/mvt/lib/vector-tile/vector-tile-feature.js +350 -0
  163. package/dist/mvt/lib/vector-tile/vector-tile-feature.js.map +1 -0
  164. package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts +29 -0
  165. package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts.map +1 -0
  166. package/dist/mvt/lib/vector-tile/vector-tile-layer.js +108 -0
  167. package/dist/mvt/lib/vector-tile/vector-tile-layer.js.map +1 -0
  168. package/dist/mvt/lib/vector-tile/vector-tile.d.ts +9 -0
  169. package/dist/mvt/lib/vector-tile/vector-tile.d.ts.map +1 -0
  170. package/dist/mvt/lib/vector-tile/vector-tile.js +28 -0
  171. package/dist/mvt/lib/vector-tile/vector-tile.js.map +1 -0
  172. package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts +6 -0
  173. package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts.map +1 -0
  174. package/dist/mvt/lib/vector-tiler/arrow-tile.js +84 -0
  175. package/dist/mvt/lib/vector-tiler/arrow-tile.js.map +1 -0
  176. package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts +16 -0
  177. package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts.map +1 -0
  178. package/dist/mvt/lib/vector-tiler/features/clip-features.js +211 -0
  179. package/dist/mvt/lib/vector-tiler/features/clip-features.js.map +1 -0
  180. package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts +18 -0
  181. package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts.map +1 -0
  182. package/dist/mvt/lib/vector-tiler/features/convert-feature.js +161 -0
  183. package/dist/mvt/lib/vector-tiler/features/convert-feature.js.map +1 -0
  184. package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts +30 -0
  185. package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts.map +1 -0
  186. package/dist/mvt/lib/vector-tiler/features/proto-feature.js +53 -0
  187. package/dist/mvt/lib/vector-tiler/features/proto-feature.js.map +1 -0
  188. package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts +10 -0
  189. package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts.map +1 -0
  190. package/dist/mvt/lib/vector-tiler/features/simplify-path.js +67 -0
  191. package/dist/mvt/lib/vector-tiler/features/simplify-path.js.map +1 -0
  192. package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts +17 -0
  193. package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts.map +1 -0
  194. package/dist/mvt/lib/vector-tiler/features/wrap-features.js +95 -0
  195. package/dist/mvt/lib/vector-tiler/features/wrap-features.js.map +1 -0
  196. package/dist/mvt/lib/vector-tiler/proto-tile.d.ts +40 -0
  197. package/dist/mvt/lib/vector-tiler/proto-tile.d.ts.map +1 -0
  198. package/dist/mvt/lib/vector-tiler/proto-tile.js +139 -0
  199. package/dist/mvt/lib/vector-tiler/proto-tile.js.map +1 -0
  200. package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts +12 -0
  201. package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts.map +1 -0
  202. package/dist/mvt/lib/vector-tiler/tile-to-geojson.js +81 -0
  203. package/dist/mvt/lib/vector-tiler/tile-to-geojson.js.map +1 -0
  204. package/dist/mvt/lib/vector-tiler/transform-tile.d.ts +7 -0
  205. package/dist/mvt/lib/vector-tiler/transform-tile.d.ts.map +1 -0
  206. package/dist/mvt/lib/vector-tiler/transform-tile.js +42 -0
  207. package/dist/mvt/lib/vector-tiler/transform-tile.js.map +1 -0
  208. package/dist/mvt/map-style-format.d.ts +13 -0
  209. package/dist/mvt/map-style-format.d.ts.map +1 -0
  210. package/dist/mvt/map-style-format.js +16 -0
  211. package/dist/mvt/map-style-format.js.map +1 -0
  212. package/dist/mvt/map-style-loader-with-parser.d.ts +26 -0
  213. package/dist/mvt/map-style-loader-with-parser.d.ts.map +1 -0
  214. package/dist/mvt/map-style-loader-with-parser.js +38 -0
  215. package/dist/mvt/map-style-loader-with-parser.js.map +1 -0
  216. package/dist/mvt/map-style-loader.d.ts +44 -0
  217. package/dist/mvt/map-style-loader.d.ts.map +1 -0
  218. package/dist/mvt/map-style-loader.js +25 -0
  219. package/dist/mvt/map-style-loader.js.map +1 -0
  220. package/dist/mvt/map-style-schema.d.ts +58 -0
  221. package/dist/mvt/map-style-schema.d.ts.map +1 -0
  222. package/dist/mvt/map-style-schema.js +47 -0
  223. package/dist/mvt/map-style-schema.js.map +1 -0
  224. package/dist/mvt/map-style.d.ts +110 -0
  225. package/dist/mvt/map-style.d.ts.map +1 -0
  226. package/dist/mvt/map-style.js +90 -0
  227. package/dist/mvt/map-style.js.map +1 -0
  228. package/dist/mvt/mvt-format.d.ts +14 -0
  229. package/dist/mvt/mvt-format.d.ts.map +1 -0
  230. package/dist/mvt/mvt-format.js +23 -0
  231. package/dist/mvt/mvt-format.js.map +1 -0
  232. package/dist/mvt/mvt-geojson-loader-types.d.ts +82 -0
  233. package/dist/mvt/mvt-geojson-loader-types.d.ts.map +1 -0
  234. package/dist/mvt/mvt-geojson-loader-types.js +34 -0
  235. package/dist/mvt/mvt-geojson-loader-types.js.map +1 -0
  236. package/dist/mvt/mvt-geojson-loader.cjs +1366 -0
  237. package/dist/mvt/mvt-geojson-loader.cjs.map +6 -0
  238. package/dist/mvt/mvt-geojson-loader.d.ts +32 -0
  239. package/dist/mvt/mvt-geojson-loader.d.ts.map +1 -0
  240. package/dist/mvt/mvt-geojson-loader.js +13 -0
  241. package/dist/mvt/mvt-geojson-loader.js.map +1 -0
  242. package/dist/mvt/mvt-loader-with-parser.d.ts +105 -0
  243. package/dist/mvt/mvt-loader-with-parser.d.ts.map +1 -0
  244. package/dist/mvt/mvt-loader-with-parser.js +21 -0
  245. package/dist/mvt/mvt-loader-with-parser.js.map +1 -0
  246. package/dist/mvt/mvt-loader.d.ts +129 -0
  247. package/dist/mvt/mvt-loader.d.ts.map +1 -0
  248. package/dist/mvt/mvt-loader.js +40 -0
  249. package/dist/mvt/mvt-loader.js.map +1 -0
  250. package/dist/mvt/mvt-source-loader.d.ts +102 -0
  251. package/dist/mvt/mvt-source-loader.d.ts.map +1 -0
  252. package/dist/mvt/mvt-source-loader.js +275 -0
  253. package/dist/mvt/mvt-source-loader.js.map +1 -0
  254. package/dist/mvt/mvt-writer.d.ts +28 -0
  255. package/dist/mvt/mvt-writer.d.ts.map +1 -0
  256. package/dist/mvt/mvt-writer.js +32 -0
  257. package/dist/mvt/mvt-writer.js.map +1 -0
  258. package/dist/mvt/table-tile-source-loader.d.ts +169 -0
  259. package/dist/mvt/table-tile-source-loader.d.ts.map +1 -0
  260. package/dist/mvt/table-tile-source-loader.js +478 -0
  261. package/dist/mvt/table-tile-source-loader.js.map +1 -0
  262. package/dist/mvt/tilejson-format.d.ts +13 -0
  263. package/dist/mvt/tilejson-format.d.ts.map +1 -0
  264. package/dist/mvt/tilejson-format.js +16 -0
  265. package/dist/mvt/tilejson-format.js.map +1 -0
  266. package/dist/mvt/tilejson-loader-with-parser.d.ts +13 -0
  267. package/dist/mvt/tilejson-loader-with-parser.d.ts.map +1 -0
  268. package/dist/mvt/tilejson-loader-with-parser.js +25 -0
  269. package/dist/mvt/tilejson-loader-with-parser.js.map +1 -0
  270. package/dist/mvt/tilejson-loader.d.ts +56 -0
  271. package/dist/mvt/tilejson-loader.d.ts.map +1 -0
  272. package/dist/mvt/tilejson-loader.js +28 -0
  273. package/dist/mvt/tilejson-loader.js.map +1 -0
  274. package/dist/mvt/tilejson-zod-schema.cjs +79 -0
  275. package/dist/mvt/tilejson-zod-schema.cjs.map +6 -0
  276. package/dist/mvt/tilejson-zod-schema.d.ts +218 -0
  277. package/dist/mvt/tilejson-zod-schema.d.ts.map +1 -0
  278. package/dist/mvt/tilejson-zod-schema.js +68 -0
  279. package/dist/mvt/tilejson-zod-schema.js.map +1 -0
  280. package/dist/mvt/tilejson.schema.json +197 -0
  281. package/dist/mvt/unbundled.d.ts +8 -0
  282. package/dist/mvt/unbundled.d.ts.map +1 -0
  283. package/dist/mvt/unbundled.js +8 -0
  284. package/dist/mvt/unbundled.js.map +1 -0
  285. package/dist/mvt/workers/mvt-worker-node.d.ts +2 -0
  286. package/dist/mvt/workers/mvt-worker-node.d.ts.map +1 -0
  287. package/dist/mvt/workers/mvt-worker-node.js +8 -0
  288. package/dist/mvt/workers/mvt-worker-node.js.map +1 -0
  289. package/dist/mvt/workers/mvt-worker.d.ts +2 -0
  290. package/dist/mvt/workers/mvt-worker.d.ts.map +1 -0
  291. package/dist/mvt/workers/mvt-worker.js +7 -0
  292. package/dist/mvt/workers/mvt-worker.js.map +1 -0
  293. package/dist/mvt-worker-node.js +72460 -0
  294. package/dist/mvt-worker-node.js.map +7 -0
  295. package/dist/mvt-worker.js +21239 -0
  296. package/dist/pmtiles/bundled.d.ts +3 -0
  297. package/dist/pmtiles/bundled.d.ts.map +1 -0
  298. package/dist/pmtiles/bundled.js +5 -0
  299. package/dist/pmtiles/bundled.js.map +1 -0
  300. package/dist/pmtiles/dist.dev.js +50530 -0
  301. package/dist/pmtiles/dist.min.js +94 -0
  302. package/dist/pmtiles/geoarrow.cjs +6718 -0
  303. package/dist/pmtiles/geoarrow.cjs.map +6 -0
  304. package/dist/pmtiles/geoarrow.d.ts +30 -0
  305. package/dist/pmtiles/geoarrow.d.ts.map +1 -0
  306. package/dist/pmtiles/geoarrow.js +143 -0
  307. package/dist/pmtiles/geoarrow.js.map +1 -0
  308. package/dist/pmtiles/index.cjs +8011 -0
  309. package/dist/pmtiles/index.cjs.map +6 -0
  310. package/dist/pmtiles/index.d.ts +14 -0
  311. package/dist/pmtiles/index.d.ts.map +1 -0
  312. package/dist/pmtiles/index.js +10 -0
  313. package/dist/pmtiles/index.js.map +1 -0
  314. package/dist/pmtiles/lib/blob-source.d.ts +14 -0
  315. package/dist/pmtiles/lib/blob-source.d.ts.map +1 -0
  316. package/dist/pmtiles/lib/blob-source.js +32 -0
  317. package/dist/pmtiles/lib/blob-source.js.map +1 -0
  318. package/dist/pmtiles/lib/encode-pmtiles.d.ts +8 -0
  319. package/dist/pmtiles/lib/encode-pmtiles.d.ts.map +1 -0
  320. package/dist/pmtiles/lib/encode-pmtiles.js +268 -0
  321. package/dist/pmtiles/lib/encode-pmtiles.js.map +1 -0
  322. package/dist/pmtiles/lib/parse-pmtiles.d.ts +52 -0
  323. package/dist/pmtiles/lib/parse-pmtiles.d.ts.map +1 -0
  324. package/dist/pmtiles/lib/parse-pmtiles.js +95 -0
  325. package/dist/pmtiles/lib/parse-pmtiles.js.map +1 -0
  326. package/dist/pmtiles/lib/range-request-source.d.ts +24 -0
  327. package/dist/pmtiles/lib/range-request-source.d.ts.map +1 -0
  328. package/dist/pmtiles/lib/range-request-source.js +45 -0
  329. package/dist/pmtiles/lib/range-request-source.js.map +1 -0
  330. package/dist/pmtiles/lib/version.d.ts +2 -0
  331. package/dist/pmtiles/lib/version.d.ts.map +1 -0
  332. package/dist/pmtiles/lib/version.js +8 -0
  333. package/dist/pmtiles/lib/version.js.map +1 -0
  334. package/dist/pmtiles/pmtiles-format.d.ts +14 -0
  335. package/dist/pmtiles/pmtiles-format.d.ts.map +1 -0
  336. package/dist/pmtiles/pmtiles-format.js +17 -0
  337. package/dist/pmtiles/pmtiles-format.js.map +1 -0
  338. package/dist/pmtiles/pmtiles-loader-with-parser.d.ts +30 -0
  339. package/dist/pmtiles/pmtiles-loader-with-parser.d.ts.map +1 -0
  340. package/dist/pmtiles/pmtiles-loader-with-parser.js +41 -0
  341. package/dist/pmtiles/pmtiles-loader-with-parser.js.map +1 -0
  342. package/dist/pmtiles/pmtiles-loader.d.ts +41 -0
  343. package/dist/pmtiles/pmtiles-loader.d.ts.map +1 -0
  344. package/dist/pmtiles/pmtiles-loader.js +20 -0
  345. package/dist/pmtiles/pmtiles-loader.js.map +1 -0
  346. package/dist/pmtiles/pmtiles-source-loader.d.ts +85 -0
  347. package/dist/pmtiles/pmtiles-source-loader.d.ts.map +1 -0
  348. package/dist/pmtiles/pmtiles-source-loader.js +239 -0
  349. package/dist/pmtiles/pmtiles-source-loader.js.map +1 -0
  350. package/dist/pmtiles/pmtiles-writer-types.d.ts +39 -0
  351. package/dist/pmtiles/pmtiles-writer-types.d.ts.map +1 -0
  352. package/dist/{point-cloud-tile-source-types.js → pmtiles/pmtiles-writer-types.js} +1 -1
  353. package/dist/pmtiles/pmtiles-writer-types.js.map +1 -0
  354. package/dist/pmtiles/pmtiles-writer.d.ts +22 -0
  355. package/dist/pmtiles/pmtiles-writer.d.ts.map +1 -0
  356. package/dist/pmtiles/pmtiles-writer.js +15 -0
  357. package/dist/pmtiles/pmtiles-writer.js.map +1 -0
  358. package/dist/pmtiles/raster.cjs +1183 -0
  359. package/dist/pmtiles/raster.cjs.map +6 -0
  360. package/dist/pmtiles/raster.d.ts +30 -0
  361. package/dist/pmtiles/raster.d.ts.map +1 -0
  362. package/dist/pmtiles/raster.js +212 -0
  363. package/dist/pmtiles/raster.js.map +1 -0
  364. package/dist/pmtiles/source-info.d.ts +25 -0
  365. package/dist/pmtiles/source-info.d.ts.map +1 -0
  366. package/dist/{types.js → pmtiles/source-info.js} +1 -1
  367. package/dist/pmtiles/source-info.js.map +1 -0
  368. package/dist/pmtiles/unbundled.d.ts +3 -0
  369. package/dist/pmtiles/unbundled.d.ts.map +1 -0
  370. package/dist/pmtiles/unbundled.js +5 -0
  371. package/dist/pmtiles/unbundled.js.map +1 -0
  372. package/dist/raster-set.d.ts +1 -1
  373. package/dist/raster-set.d.ts.map +1 -1
  374. package/dist/raster-set.js +1 -1
  375. package/dist/raster-set.js.map +1 -1
  376. package/dist/tile-matrix.cjs +81 -0
  377. package/dist/tile-matrix.cjs.map +6 -0
  378. package/dist/tile-matrix.d.ts +52 -0
  379. package/dist/tile-matrix.d.ts.map +1 -0
  380. package/dist/tile-matrix.js +75 -0
  381. package/dist/tile-matrix.js.map +1 -0
  382. package/dist/tileset-2d/tile-2d-header.d.ts +2 -2
  383. package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -1
  384. package/dist/tileset-2d/tile-2d-header.js +11 -11
  385. package/dist/tileset-2d/tile-2d-header.js.map +1 -1
  386. package/dist/tileset-2d/tileset-2d.d.ts +19 -10
  387. package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
  388. package/dist/tileset-2d/tileset-2d.js +69 -15
  389. package/dist/tileset-2d/tileset-2d.js.map +1 -1
  390. package/package.json +101 -25
  391. package/src/image-set.ts +1 -1
  392. package/src/index.ts +8 -128
  393. package/src/mlt/bundled.ts +9 -0
  394. package/src/mlt/index.ts +18 -0
  395. package/src/mlt/lib/encode-mlt-geometry.ts +162 -0
  396. package/src/mlt/lib/encode-mlt-streams.ts +66 -0
  397. package/src/mlt/lib/encode-mlt.ts +215 -0
  398. package/src/mlt/lib/parse-mlt.ts +906 -0
  399. package/src/mlt/libs/mlt-decoder.cjs +4552 -0
  400. package/src/mlt/mlt-format.ts +19 -0
  401. package/src/mlt/mlt-loader-with-parser.ts +57 -0
  402. package/src/mlt/mlt-loader.ts +64 -0
  403. package/src/mlt/mlt-source-loader.ts +266 -0
  404. package/src/mlt/mlt-writer.ts +47 -0
  405. package/src/mlt/unbundled.ts +6 -0
  406. package/src/mvt/arrow-table-tile-source-loader-types.ts +55 -0
  407. package/src/mvt/arrow-table-tile-source-loader.ts +307 -0
  408. package/src/mvt/arrow-table-tile-source-types.ts +32 -0
  409. package/src/mvt/bundled.ts +14 -0
  410. package/src/mvt/index.ts +67 -0
  411. package/src/mvt/lib/encode-mvt-arrow.ts +273 -0
  412. package/src/mvt/lib/encode-mvt.ts +46 -0
  413. package/src/mvt/lib/get-schemas-from-tilejson.ts +64 -0
  414. package/src/mvt/lib/is-longitude-latitude-crs.ts +15 -0
  415. package/src/mvt/lib/mapbox-vt-pbf/geojson-to-vt.ts.disabled +76 -0
  416. package/src/mvt/lib/mapbox-vt-pbf/geojson-wrapper.ts +89 -0
  417. package/src/mvt/lib/mapbox-vt-pbf/to-vector-tile.ts +230 -0
  418. package/src/mvt/lib/mvt-pbf/mvt-constants.ts +135 -0
  419. package/src/mvt/lib/mvt-pbf/mvt-types.ts +22 -0
  420. package/src/mvt/lib/mvt-pbf/parse-geometry-from-pbf.ts +285 -0
  421. package/src/mvt/lib/mvt-pbf/parse-mvt-from-pbf.ts +310 -0
  422. package/src/mvt/lib/mvt-pbf/write-mvt-to-pbf.ts +162 -0
  423. package/src/mvt/lib/mvt-worker-transport.ts +74 -0
  424. package/src/mvt/lib/parse-mvt-geojson.ts +65 -0
  425. package/src/mvt/lib/parse-mvt.ts +145 -0
  426. package/src/mvt/lib/parse-tilejson.ts +397 -0
  427. package/src/mvt/lib/resolve-table-tile-parameters.ts +23 -0
  428. package/src/mvt/lib/types.ts +90 -0
  429. package/src/mvt/lib/utils/geometry-utils.ts +238 -0
  430. package/src/mvt/lib/vector-tile/LICENSE.txt +31 -0
  431. package/src/mvt/lib/vector-tile/vector-tile-feature.ts +430 -0
  432. package/src/mvt/lib/vector-tile/vector-tile-layer.ts +130 -0
  433. package/src/mvt/lib/vector-tile/vector-tile.ts +32 -0
  434. package/src/mvt/lib/vector-tiler/LICENSE +19 -0
  435. package/src/mvt/lib/vector-tiler/arrow-tile.ts +93 -0
  436. package/src/mvt/lib/vector-tiler/features/clip-features.ts +250 -0
  437. package/src/mvt/lib/vector-tiler/features/convert-feature.ts +213 -0
  438. package/src/mvt/lib/vector-tiler/features/proto-feature.ts +104 -0
  439. package/src/mvt/lib/vector-tiler/features/simplify-path.ts +84 -0
  440. package/src/mvt/lib/vector-tiler/features/wrap-features.ts +125 -0
  441. package/src/mvt/lib/vector-tiler/proto-tile.ts +217 -0
  442. package/src/mvt/lib/vector-tiler/tile-to-geojson.ts +104 -0
  443. package/src/mvt/lib/vector-tiler/transform-tile.ts +57 -0
  444. package/src/mvt/map-style-format.ts +18 -0
  445. package/src/mvt/map-style-loader-with-parser.ts +62 -0
  446. package/src/mvt/map-style-loader.ts +31 -0
  447. package/src/mvt/map-style-schema.ts +53 -0
  448. package/src/mvt/map-style.ts +218 -0
  449. package/src/mvt/mvt-format.ts +25 -0
  450. package/src/mvt/mvt-geojson-loader-types.ts +60 -0
  451. package/src/mvt/mvt-geojson-loader.ts +20 -0
  452. package/src/mvt/mvt-loader-with-parser.ts +53 -0
  453. package/src/mvt/mvt-loader.ts +73 -0
  454. package/src/mvt/mvt-source-loader.ts +410 -0
  455. package/src/mvt/mvt-writer.ts +35 -0
  456. package/src/mvt/table-tile-source-loader.ts +672 -0
  457. package/src/mvt/tilejson-format.ts +18 -0
  458. package/src/mvt/tilejson-loader-with-parser.ts +38 -0
  459. package/src/mvt/tilejson-loader.ts +42 -0
  460. package/src/mvt/tilejson-zod-schema.ts +199 -0
  461. package/src/mvt/unbundled.ts +13 -0
  462. package/src/mvt/workers/mvt-worker-node.ts +9 -0
  463. package/src/mvt/workers/mvt-worker.ts +8 -0
  464. package/src/pmtiles/bundled.ts +6 -0
  465. package/src/pmtiles/geoarrow.ts +188 -0
  466. package/src/pmtiles/index.ts +27 -0
  467. package/src/pmtiles/lib/blob-source.ts +41 -0
  468. package/src/pmtiles/lib/encode-pmtiles.ts +322 -0
  469. package/src/pmtiles/lib/parse-pmtiles.ts +180 -0
  470. package/src/pmtiles/lib/range-request-source.ts +60 -0
  471. package/src/pmtiles/lib/version.ts +8 -0
  472. package/src/pmtiles/pmtiles-format.ts +19 -0
  473. package/src/pmtiles/pmtiles-loader-with-parser.ts +60 -0
  474. package/src/pmtiles/pmtiles-loader.ts +30 -0
  475. package/src/pmtiles/pmtiles-source-loader.ts +346 -0
  476. package/src/pmtiles/pmtiles-writer-types.ts +45 -0
  477. package/src/pmtiles/pmtiles-writer.ts +26 -0
  478. package/src/pmtiles/raster.ts +289 -0
  479. package/src/pmtiles/source-info.ts +25 -0
  480. package/src/pmtiles/unbundled.ts +6 -0
  481. package/src/raster-set.ts +2 -2
  482. package/src/tile-matrix.ts +138 -0
  483. package/src/tileset-2d/tile-2d-header.ts +14 -13
  484. package/src/tileset-2d/tileset-2d.ts +81 -19
  485. package/dist/constants.d.ts +0 -38
  486. package/dist/constants.d.ts.map +0 -1
  487. package/dist/constants.js +0 -39
  488. package/dist/constants.js.map +0 -1
  489. package/dist/point-cloud/point-cloud-tile.d.ts +0 -47
  490. package/dist/point-cloud/point-cloud-tile.d.ts.map +0 -1
  491. package/dist/point-cloud/point-cloud-tile.js +0 -70
  492. package/dist/point-cloud/point-cloud-tile.js.map +0 -1
  493. package/dist/point-cloud/point-cloud-tileset.d.ts +0 -135
  494. package/dist/point-cloud/point-cloud-tileset.d.ts.map +0 -1
  495. package/dist/point-cloud/point-cloud-tileset.js +0 -549
  496. package/dist/point-cloud/point-cloud-tileset.js.map +0 -1
  497. package/dist/point-cloud/types.d.ts +0 -81
  498. package/dist/point-cloud/types.d.ts.map +0 -1
  499. package/dist/point-cloud/types.js.map +0 -1
  500. package/dist/point-cloud-tile-source-loader-types.d.ts +0 -31
  501. package/dist/point-cloud-tile-source-loader-types.d.ts.map +0 -1
  502. package/dist/point-cloud-tile-source-loader-types.js +0 -34
  503. package/dist/point-cloud-tile-source-loader-types.js.map +0 -1
  504. package/dist/point-cloud-tile-source-loader.cjs +0 -81
  505. package/dist/point-cloud-tile-source-loader.cjs.map +0 -7
  506. package/dist/point-cloud-tile-source-loader.d.ts +0 -27
  507. package/dist/point-cloud-tile-source-loader.d.ts.map +0 -1
  508. package/dist/point-cloud-tile-source-loader.js +0 -17
  509. package/dist/point-cloud-tile-source-loader.js.map +0 -1
  510. package/dist/point-cloud-tile-source-types.d.ts +0 -15
  511. package/dist/point-cloud-tile-source-types.d.ts.map +0 -1
  512. package/dist/point-cloud-tile-source-types.js.map +0 -1
  513. package/dist/point-cloud-tile-source.cjs +0 -105
  514. package/dist/point-cloud-tile-source.cjs.map +0 -7
  515. package/dist/point-cloud-tile-source.d.ts +0 -36
  516. package/dist/point-cloud-tile-source.d.ts.map +0 -1
  517. package/dist/point-cloud-tile-source.js +0 -84
  518. package/dist/point-cloud-tile-source.js.map +0 -1
  519. package/dist/spatial/format-spatial-reference.d.ts +0 -68
  520. package/dist/spatial/format-spatial-reference.d.ts.map +0 -1
  521. package/dist/spatial/format-spatial-reference.js +0 -291
  522. package/dist/spatial/format-spatial-reference.js.map +0 -1
  523. package/dist/spatial/get-spatial-coordinate-frame.d.ts +0 -20
  524. package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +0 -1
  525. package/dist/spatial/get-spatial-coordinate-frame.js +0 -139
  526. package/dist/spatial/get-spatial-coordinate-frame.js.map +0 -1
  527. package/dist/spatial/i3s-elevation.d.ts +0 -20
  528. package/dist/spatial/i3s-elevation.d.ts.map +0 -1
  529. package/dist/spatial/i3s-elevation.js +0 -90
  530. package/dist/spatial/i3s-elevation.js.map +0 -1
  531. package/dist/spatial/i3s-spatial-transformer.d.ts +0 -205
  532. package/dist/spatial/i3s-spatial-transformer.d.ts.map +0 -1
  533. package/dist/spatial/i3s-spatial-transformer.js +0 -731
  534. package/dist/spatial/i3s-spatial-transformer.js.map +0 -1
  535. package/dist/spatial/normalize-crs-identifier.d.ts +0 -15
  536. package/dist/spatial/normalize-crs-identifier.d.ts.map +0 -1
  537. package/dist/spatial/normalize-crs-identifier.js +0 -22
  538. package/dist/spatial/normalize-crs-identifier.js.map +0 -1
  539. package/dist/spatial/spatial-coordinate-transformer.d.ts +0 -54
  540. package/dist/spatial/spatial-coordinate-transformer.d.ts.map +0 -1
  541. package/dist/spatial/spatial-coordinate-transformer.js +0 -311
  542. package/dist/spatial/spatial-coordinate-transformer.js.map +0 -1
  543. package/dist/spatial/spatial-resource-registry.d.ts +0 -47
  544. package/dist/spatial/spatial-resource-registry.d.ts.map +0 -1
  545. package/dist/spatial/spatial-resource-registry.js +0 -76
  546. package/dist/spatial/spatial-resource-registry.js.map +0 -1
  547. package/dist/spatial/spatial-types.d.ts +0 -190
  548. package/dist/spatial/spatial-types.d.ts.map +0 -1
  549. package/dist/spatial/spatial-types.js +0 -192
  550. package/dist/spatial/spatial-types.js.map +0 -1
  551. package/dist/spatial/tiles-3d-spatial-transformer.d.ts +0 -32
  552. package/dist/spatial/tiles-3d-spatial-transformer.d.ts.map +0 -1
  553. package/dist/spatial/tiles-3d-spatial-transformer.js +0 -163
  554. package/dist/spatial/tiles-3d-spatial-transformer.js.map +0 -1
  555. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +0 -60
  556. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +0 -1
  557. package/dist/tileset-3d/common/indexed-archive-tileset-source.js +0 -130
  558. package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +0 -1
  559. package/dist/tileset-3d/common/tile-3d-contracts.d.ts +0 -63
  560. package/dist/tileset-3d/common/tile-3d-contracts.d.ts.map +0 -1
  561. package/dist/tileset-3d/common/tile-3d-contracts.js +0 -51
  562. package/dist/tileset-3d/common/tile-3d-contracts.js.map +0 -1
  563. package/dist/tileset-3d/common/tile-3d.d.ts +0 -410
  564. package/dist/tileset-3d/common/tile-3d.d.ts.map +0 -1
  565. package/dist/tileset-3d/common/tile-3d.js +0 -1056
  566. package/dist/tileset-3d/common/tile-3d.js.map +0 -1
  567. package/dist/tileset-3d/common/tileset-3d.d.ts +0 -369
  568. package/dist/tileset-3d/common/tileset-3d.d.ts.map +0 -1
  569. package/dist/tileset-3d/common/tileset-3d.js +0 -879
  570. package/dist/tileset-3d/common/tileset-3d.js.map +0 -1
  571. package/dist/tileset-3d/common/tileset-cache.d.ts +0 -29
  572. package/dist/tileset-3d/common/tileset-cache.d.ts.map +0 -1
  573. package/dist/tileset-3d/common/tileset-cache.js +0 -82
  574. package/dist/tileset-3d/common/tileset-cache.js.map +0 -1
  575. package/dist/tileset-3d/common/tileset-content-traversal.d.ts +0 -37
  576. package/dist/tileset-3d/common/tileset-content-traversal.d.ts.map +0 -1
  577. package/dist/tileset-3d/common/tileset-content-traversal.js +0 -80
  578. package/dist/tileset-3d/common/tileset-content-traversal.js.map +0 -1
  579. package/dist/tileset-3d/common/tileset-observability.d.ts +0 -60
  580. package/dist/tileset-3d/common/tileset-observability.d.ts.map +0 -1
  581. package/dist/tileset-3d/common/tileset-observability.js +0 -39
  582. package/dist/tileset-3d/common/tileset-observability.js.map +0 -1
  583. package/dist/tileset-3d/common/tileset-source.d.ts +0 -228
  584. package/dist/tileset-3d/common/tileset-source.d.ts.map +0 -1
  585. package/dist/tileset-3d/common/tileset-source.js +0 -17
  586. package/dist/tileset-3d/common/tileset-source.js.map +0 -1
  587. package/dist/tileset-3d/common/tileset-traverser.d.ts +0 -88
  588. package/dist/tileset-3d/common/tileset-traverser.d.ts.map +0 -1
  589. package/dist/tileset-3d/common/tileset-traverser.js +0 -341
  590. package/dist/tileset-3d/common/tileset-traverser.js.map +0 -1
  591. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +0 -182
  592. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +0 -1
  593. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +0 -678
  594. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +0 -1
  595. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +0 -221
  596. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +0 -1
  597. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +0 -770
  598. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +0 -1
  599. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +0 -111
  600. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +0 -1
  601. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +0 -339
  602. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
  603. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts +0 -27
  604. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +0 -1
  605. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js +0 -45
  606. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +0 -1
  607. package/dist/tileset-3d/format-i3s/i3s-source.d.ts +0 -116
  608. package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +0 -1
  609. package/dist/tileset-3d/format-i3s/i3s-source.js +0 -450
  610. package/dist/tileset-3d/format-i3s/i3s-source.js.map +0 -1
  611. package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts +0 -34
  612. package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +0 -1
  613. package/dist/tileset-3d/format-i3s/i3s-tile-manager.js +0 -81
  614. package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +0 -1
  615. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts +0 -25
  616. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +0 -1
  617. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js +0 -84
  618. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +0 -1
  619. package/dist/tileset-3d/helpers/3d-tiles-options.d.ts +0 -5
  620. package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +0 -1
  621. package/dist/tileset-3d/helpers/3d-tiles-options.js +0 -9
  622. package/dist/tileset-3d/helpers/3d-tiles-options.js.map +0 -1
  623. package/dist/tileset-3d/helpers/bounding-volume.d.ts +0 -23
  624. package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +0 -1
  625. package/dist/tileset-3d/helpers/bounding-volume.js +0 -236
  626. package/dist/tileset-3d/helpers/bounding-volume.js.map +0 -1
  627. package/dist/tileset-3d/helpers/frame-state.d.ts +0 -93
  628. package/dist/tileset-3d/helpers/frame-state.d.ts.map +0 -1
  629. package/dist/tileset-3d/helpers/frame-state.js +0 -211
  630. package/dist/tileset-3d/helpers/frame-state.js.map +0 -1
  631. package/dist/tileset-3d/helpers/i3s-lod.d.ts +0 -20
  632. package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +0 -1
  633. package/dist/tileset-3d/helpers/i3s-lod.js +0 -95
  634. package/dist/tileset-3d/helpers/i3s-lod.js.map +0 -1
  635. package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts +0 -17
  636. package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts.map +0 -1
  637. package/dist/tileset-3d/helpers/s2-bounding-volume.js +0 -17
  638. package/dist/tileset-3d/helpers/s2-bounding-volume.js.map +0 -1
  639. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +0 -72
  640. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +0 -1
  641. package/dist/tileset-3d/helpers/tiles-3d-lod.js +0 -257
  642. package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +0 -1
  643. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +0 -134
  644. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +0 -1
  645. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +0 -179
  646. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +0 -1
  647. package/dist/tileset-3d/helpers/transform-utils.d.ts +0 -3
  648. package/dist/tileset-3d/helpers/transform-utils.d.ts.map +0 -1
  649. package/dist/tileset-3d/helpers/transform-utils.js +0 -86
  650. package/dist/tileset-3d/helpers/transform-utils.js.map +0 -1
  651. package/dist/tileset-3d/helpers/zoom.d.ts +0 -46
  652. package/dist/tileset-3d/helpers/zoom.d.ts.map +0 -1
  653. package/dist/tileset-3d/helpers/zoom.js +0 -86
  654. package/dist/tileset-3d/helpers/zoom.js.map +0 -1
  655. package/dist/types.d.ts +0 -48
  656. package/dist/types.d.ts.map +0 -1
  657. package/dist/types.js.map +0 -1
  658. package/dist/utils/doubly-linked-list-node.d.ts +0 -11
  659. package/dist/utils/doubly-linked-list-node.d.ts.map +0 -1
  660. package/dist/utils/doubly-linked-list-node.js +0 -20
  661. package/dist/utils/doubly-linked-list-node.js.map +0 -1
  662. package/dist/utils/doubly-linked-list.d.ts +0 -30
  663. package/dist/utils/doubly-linked-list.d.ts.map +0 -1
  664. package/dist/utils/doubly-linked-list.js +0 -93
  665. package/dist/utils/doubly-linked-list.js.map +0 -1
  666. package/dist/utils/managed-array.d.ts +0 -85
  667. package/dist/utils/managed-array.d.ts.map +0 -1
  668. package/dist/utils/managed-array.js +0 -152
  669. package/dist/utils/managed-array.js.map +0 -1
  670. package/src/constants.ts +0 -59
  671. package/src/point-cloud/point-cloud-tile.ts +0 -80
  672. package/src/point-cloud/point-cloud-tileset.ts +0 -767
  673. package/src/point-cloud/types.ts +0 -99
  674. package/src/point-cloud-tile-source-loader-types.ts +0 -53
  675. package/src/point-cloud-tile-source-loader.ts +0 -32
  676. package/src/point-cloud-tile-source-types.ts +0 -20
  677. package/src/point-cloud-tile-source.ts +0 -112
  678. package/src/spatial/format-spatial-reference.ts +0 -385
  679. package/src/spatial/get-spatial-coordinate-frame.ts +0 -169
  680. package/src/spatial/i3s-elevation.ts +0 -96
  681. package/src/spatial/i3s-spatial-transformer.ts +0 -1021
  682. package/src/spatial/normalize-crs-identifier.ts +0 -26
  683. package/src/spatial/spatial-coordinate-transformer.ts +0 -397
  684. package/src/spatial/spatial-resource-registry.ts +0 -90
  685. package/src/spatial/spatial-types.ts +0 -422
  686. package/src/spatial/tiles-3d-spatial-transformer.ts +0 -194
  687. package/src/tileset-3d/common/indexed-archive-tileset-source.ts +0 -205
  688. package/src/tileset-3d/common/tile-3d-contracts.ts +0 -115
  689. package/src/tileset-3d/common/tile-3d.ts +0 -1310
  690. package/src/tileset-3d/common/tileset-3d.ts +0 -1210
  691. package/src/tileset-3d/common/tileset-cache.ts +0 -111
  692. package/src/tileset-3d/common/tileset-content-traversal.ts +0 -114
  693. package/src/tileset-3d/common/tileset-observability.ts +0 -100
  694. package/src/tileset-3d/common/tileset-source.ts +0 -284
  695. package/src/tileset-3d/common/tileset-traverser.ts +0 -416
  696. package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +0 -1056
  697. package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +0 -1025
  698. package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +0 -391
  699. package/src/tileset-3d/format-i3s/i3s-pending-tiles-register.ts +0 -48
  700. package/src/tileset-3d/format-i3s/i3s-source.ts +0 -557
  701. package/src/tileset-3d/format-i3s/i3s-tile-manager.ts +0 -105
  702. package/src/tileset-3d/format-i3s/i3s-tileset-traverser.ts +0 -102
  703. package/src/tileset-3d/helpers/3d-tiles-options.ts +0 -11
  704. package/src/tileset-3d/helpers/bounding-volume.ts +0 -281
  705. package/src/tileset-3d/helpers/frame-state.ts +0 -322
  706. package/src/tileset-3d/helpers/i3s-lod.ts +0 -109
  707. package/src/tileset-3d/helpers/s2-bounding-volume.ts +0 -32
  708. package/src/tileset-3d/helpers/tiles-3d-lod.ts +0 -370
  709. package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +0 -301
  710. package/src/tileset-3d/helpers/transform-utils.ts +0 -109
  711. package/src/tileset-3d/helpers/zoom.ts +0 -120
  712. package/src/types.ts +0 -54
  713. package/src/utils/doubly-linked-list-node.ts +0 -22
  714. package/src/utils/doubly-linked-list.ts +0 -105
  715. package/src/utils/managed-array.ts +0 -174
  716. /package/dist/{point-cloud → mvt/lib}/types.js +0 -0
@@ -0,0 +1,161 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Forked from https://github.com/mapbox/geojson-vt under compatible ISC license
5
+ import { createProtoFeature } from "./proto-feature.js";
6
+ import { simplifyPath } from "./simplify-path.js";
7
+ /**
8
+ * converts a GeoJSON feature into an intermediate projected JSON vector format
9
+ * with simplification data
10
+ */
11
+ export function convertFeaturesToProtoFeature(data, options) {
12
+ const protoFeatures = [];
13
+ switch (data.type) {
14
+ case 'FeatureCollection':
15
+ let i = 0;
16
+ for (const feature of data.features) {
17
+ const convertedFeatures = convertFeature(feature, options, i++);
18
+ pushConvertedFeatures(protoFeatures, convertedFeatures);
19
+ }
20
+ break;
21
+ case 'Feature':
22
+ {
23
+ const convertedFeatures = convertFeature(data, options);
24
+ pushConvertedFeatures(protoFeatures, convertedFeatures);
25
+ }
26
+ break;
27
+ default: {
28
+ // single geometry or a geometry collection
29
+ const convertedFeatures = convertFeature({ geometry: data }, options);
30
+ pushConvertedFeatures(protoFeatures, convertedFeatures);
31
+ }
32
+ }
33
+ return protoFeatures;
34
+ }
35
+ function pushConvertedFeatures(protoFeatures, convertedFeatures) {
36
+ if (!convertedFeatures) {
37
+ return;
38
+ }
39
+ if (Array.isArray(convertedFeatures)) {
40
+ protoFeatures.push(...convertedFeatures);
41
+ return;
42
+ }
43
+ protoFeatures.push(convertedFeatures);
44
+ }
45
+ /**
46
+ * converts a GeoJSON feature into an intermediate projected JSON vector format
47
+ * with simplification data
48
+ */
49
+ function convertFeature(geojson, options, index) {
50
+ // GeoJSON geometries can be null, but no vector tile will include them.
51
+ if (!geojson.geometry) {
52
+ return;
53
+ }
54
+ const coords = geojson.geometry.coordinates;
55
+ const type = geojson.geometry.type;
56
+ const tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);
57
+ let geometry = [];
58
+ let id = geojson.id;
59
+ if (options.promoteId) {
60
+ id = geojson.properties[options.promoteId];
61
+ }
62
+ else if (options.generateId) {
63
+ id = index || 0;
64
+ }
65
+ switch (type) {
66
+ case 'Point':
67
+ convertPoint(coords, geometry);
68
+ break;
69
+ case 'MultiPoint':
70
+ for (const p of coords) {
71
+ convertPoint(p, geometry);
72
+ }
73
+ break;
74
+ case 'LineString':
75
+ convertLine(coords, geometry, tolerance, false);
76
+ break;
77
+ case 'MultiLineString':
78
+ if (options.lineMetrics) {
79
+ // explode into linestrings to be able to track metrics
80
+ const features = [];
81
+ for (const line of coords) {
82
+ geometry = [];
83
+ convertLine(line, geometry, tolerance, false);
84
+ features.push(createProtoFeature(id, 'LineString', geometry, geojson.properties));
85
+ }
86
+ return features;
87
+ }
88
+ convertLines(coords, geometry, tolerance, false);
89
+ break;
90
+ case 'Polygon':
91
+ convertLines(coords, geometry, tolerance, true);
92
+ break;
93
+ case 'MultiPolygon':
94
+ for (const polygon of coords) {
95
+ const newPolygon = [];
96
+ convertLines(polygon, newPolygon, tolerance, true);
97
+ geometry.push(newPolygon);
98
+ }
99
+ break;
100
+ case 'GeometryCollection': {
101
+ const features = [];
102
+ for (const singleGeometry of geojson.geometry.geometries) {
103
+ const convertedFeatures = convertFeature({
104
+ id,
105
+ geometry: singleGeometry,
106
+ properties: geojson.properties
107
+ }, options, index);
108
+ pushConvertedFeatures(features, convertedFeatures);
109
+ }
110
+ return features;
111
+ }
112
+ default:
113
+ throw new Error('Input data is not a valid GeoJSON object.');
114
+ }
115
+ return createProtoFeature(id, type, geometry, geojson.properties);
116
+ }
117
+ function convertPoint(coords, out) {
118
+ out.push(projectX(coords[0]), projectY(coords[1]), 0);
119
+ }
120
+ function convertLine(ring, out, tolerance, isPolygon) {
121
+ let x0, y0;
122
+ let size = 0;
123
+ for (let j = 0; j < ring.length; j++) {
124
+ const x = projectX(ring[j][0]);
125
+ const y = projectY(ring[j][1]);
126
+ out.push(x, y, 0);
127
+ if (j > 0) {
128
+ if (isPolygon) {
129
+ size += (x0 * y - x * y0) / 2; // area
130
+ }
131
+ else {
132
+ size += Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2)); // length
133
+ }
134
+ }
135
+ x0 = x;
136
+ y0 = y;
137
+ }
138
+ const last = out.length - 3;
139
+ out[2] = 1;
140
+ simplifyPath(out, 0, last, tolerance);
141
+ out[last + 2] = 1;
142
+ out.size = Math.abs(size);
143
+ out.start = 0;
144
+ out.end = out.size;
145
+ }
146
+ function convertLines(rings, out, tolerance, isPolygon) {
147
+ for (let i = 0; i < rings.length; i++) {
148
+ const geom = [];
149
+ convertLine(rings[i], geom, tolerance, isPolygon);
150
+ out.push(geom);
151
+ }
152
+ }
153
+ function projectX(x) {
154
+ return x / 360 + 0.5;
155
+ }
156
+ function projectY(y) {
157
+ const sin = Math.sin((y * Math.PI) / 180);
158
+ const y2 = 0.5 - (0.25 * Math.log((1 + sin) / (1 - sin))) / Math.PI;
159
+ return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;
160
+ }
161
+ //# sourceMappingURL=convert-feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-feature.js","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/convert-feature.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AACpC,gFAAgF;AAQhF,OAAO,EAAC,kBAAkB,EAAC,2BAAwB;AACnD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAa7C;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,IAAiC,EACjC,OAA8B;IAE9B,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,mBAAmB;YACtB,IAAI,CAAC,GAAG,CAAC,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpC,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;gBAChE,qBAAqB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;YAC1D,CAAC;YACD,MAAM;QACR,KAAK,SAAS;YACZ,CAAC;gBACC,MAAM,iBAAiB,GAAG,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACxD,qBAAqB,CAAC,aAAa,EAAE,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AC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAClD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACpE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,30 @@
1
+ export type ProtoFeature = {
2
+ type: 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
3
+ simplifiedType: 1 | 2 | 3;
4
+ geometry: any[];
5
+ id?: string;
6
+ tags?: Record<string, unknown>;
7
+ /** spatial extents */
8
+ minX: number;
9
+ /** spatial extents */
10
+ maxX: number;
11
+ /** spatial extents */
12
+ minY: number;
13
+ /** spatial extents */
14
+ maxY: number;
15
+ };
16
+ export type GeoJSONTileGeometry = GeoJSONTilePointGeometry | GeoJSONTileLineGeometry | GeoJSONTilePolygonGeometry;
17
+ export type GeoJSONTilePointGeometry = {
18
+ simplifiedType: 1;
19
+ geometry: number[];
20
+ };
21
+ export type GeoJSONTileLineGeometry = {
22
+ simplifiedType: 1;
23
+ geometry: number[][];
24
+ };
25
+ export type GeoJSONTilePolygonGeometry = {
26
+ simplifiedType: 1;
27
+ geometry: number[][][];
28
+ };
29
+ export declare function createProtoFeature(id: any, type: 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon', geometry: any[], tags: any): ProtoFeature;
30
+ //# sourceMappingURL=proto-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-feature.d.ts","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/proto-feature.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,iBAAiB,GAAG,SAAS,GAAG,cAAc,CAAC;IAC7F,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC;IAGhB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,wBAAwB,GACxB,uBAAuB,GACvB,0BAA0B,CAAC;AAE/B,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,CAAC,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,EAAE,CAAC,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,cAAc,EAAE,CAAC,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;CACxB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,iBAAiB,GAAG,SAAS,GAAG,cAAc,EAC5F,QAAQ,EAAE,GAAG,EAAE,EACf,IAAI,KAAA,GACH,YAAY,CA6Cd"}
@@ -0,0 +1,53 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Forked from https://github.com/mapbox/geojson-vt under compatible ISC license
5
+ export function createProtoFeature(id, type, geometry, tags) {
6
+ const feature = {
7
+ // eslint-disable-next-line
8
+ id: id == null ? null : id,
9
+ type,
10
+ simplifiedType: undefined, // TODO
11
+ geometry,
12
+ tags,
13
+ minX: Infinity,
14
+ minY: Infinity,
15
+ maxX: -Infinity,
16
+ maxY: -Infinity
17
+ };
18
+ // TODO break out into separate function
19
+ switch (type) {
20
+ case 'Point':
21
+ case 'MultiPoint':
22
+ case 'LineString':
23
+ calcLineBBox(feature, geometry);
24
+ break;
25
+ case 'MultiLineString':
26
+ for (const line of geometry) {
27
+ calcLineBBox(feature, line);
28
+ }
29
+ break;
30
+ case 'Polygon':
31
+ // the outer ring (ie [0]) contains all inner rings
32
+ calcLineBBox(feature, geometry[0]);
33
+ break;
34
+ case 'MultiPolygon':
35
+ for (const polygon of geometry) {
36
+ // the outer ring (ie [0]) contains all inner rings
37
+ calcLineBBox(feature, polygon[0]);
38
+ }
39
+ break;
40
+ default:
41
+ throw new Error(String(type));
42
+ }
43
+ return feature;
44
+ }
45
+ function calcLineBBox(feature, geometry) {
46
+ for (let i = 0; i < geometry.length; i += 3) {
47
+ feature.minX = Math.min(feature.minX, geometry[i]);
48
+ feature.minY = Math.min(feature.minY, geometry[i + 1]);
49
+ feature.maxX = Math.max(feature.maxX, geometry[i]);
50
+ feature.maxY = Math.max(feature.maxY, geometry[i + 1]);
51
+ }
52
+ }
53
+ //# sourceMappingURL=proto-feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-feature.js","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/proto-feature.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AACpC,gFAAgF;AAyChF,MAAM,UAAU,kBAAkB,CAChC,EAAO,EACP,IAA4F,EAC5F,QAAe,EACf,IAAI;IAEJ,MAAM,OAAO,GAAiB;QAC5B,2BAA2B;QAC3B,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAC1B,IAAI;QACJ,cAAc,EAAE,SAAU,EAAE,OAAO;QACnC,QAAQ;QACR,IAAI;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,CAAC,QAAQ;QACf,IAAI,EAAE,CAAC,QAAQ;KAChB,CAAC;IAEF,wCAAwC;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,YAAY,CAAC;QAClB,KAAK,YAAY;YACf,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAChC,MAAM;QAER,KAAK,iBAAiB;YACpB,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC5B,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC9B,CAAC;YACD,MAAM;QAER,KAAK,SAAS;YACZ,mDAAmD;YACnD,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,MAAM;QAER,KAAK,cAAc;YACjB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,mDAAmD;gBACnD,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC;YACD,MAAM;QAER;YACE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,OAAO,EAAE,QAAQ;IACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Calculate simplification data using optimized Douglas-Peucker algorithm
3
+ *
4
+ * @param coords contiguous list of coordinates
5
+ * @param first first coord to simplify
6
+ * @param last last coord to simplify
7
+ * @param sqTolerance tolerance (square distance)
8
+ */
9
+ export declare function simplifyPath(coords: number[], first: number, last: number, sqTolerance: number): void;
10
+ //# sourceMappingURL=simplify-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplify-path.d.ts","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/simplify-path.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,IAAI,CAkCN"}
@@ -0,0 +1,67 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Forked from https://github.com/mapbox/geojson-vt under compatible ISC license
5
+ /**
6
+ * Calculate simplification data using optimized Douglas-Peucker algorithm
7
+ *
8
+ * @param coords contiguous list of coordinates
9
+ * @param first first coord to simplify
10
+ * @param last last coord to simplify
11
+ * @param sqTolerance tolerance (square distance)
12
+ */
13
+ export function simplifyPath(coords, first, last, sqTolerance) {
14
+ let maxSqDist = sqTolerance;
15
+ const mid = (last - first) >> 1;
16
+ let minPosToMid = last - first;
17
+ let index;
18
+ const ax = coords[first];
19
+ const ay = coords[first + 1];
20
+ const bx = coords[last];
21
+ const by = coords[last + 1];
22
+ for (let i = first + 3; i < last; i += 3) {
23
+ const d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);
24
+ if (d > maxSqDist) {
25
+ index = i;
26
+ maxSqDist = d;
27
+ }
28
+ else if (d === maxSqDist) {
29
+ // a workaround to ensure we choose a pivot close to the middle of the list,
30
+ // reducing recursion depth, for certain degenerate inputs
31
+ // https://github.com/mapbox/geojson-vt/issues/104
32
+ const posToMid = Math.abs(i - mid);
33
+ if (posToMid < minPosToMid) {
34
+ index = i;
35
+ minPosToMid = posToMid;
36
+ }
37
+ }
38
+ }
39
+ if (maxSqDist > sqTolerance) {
40
+ if (index - first > 3)
41
+ simplifyPath(coords, first, index, sqTolerance);
42
+ coords[index + 2] = maxSqDist;
43
+ if (last - index > 3)
44
+ simplifyPath(coords, index, last, sqTolerance);
45
+ }
46
+ }
47
+ /** square distance from a point to a segment */
48
+ // eslint-disable-next-line max-params
49
+ function getSqSegDist(px, py, x, y, bx, by) {
50
+ let dx = bx - x;
51
+ let dy = by - y;
52
+ if (dx !== 0 || dy !== 0) {
53
+ const t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);
54
+ if (t > 1) {
55
+ x = bx;
56
+ y = by;
57
+ }
58
+ else if (t > 0) {
59
+ x += dx * t;
60
+ y += dy * t;
61
+ }
62
+ }
63
+ dx = px - x;
64
+ dy = py - y;
65
+ return dx * dx + dy * dy;
66
+ }
67
+ //# sourceMappingURL=simplify-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplify-path.js","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/simplify-path.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AACpC,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAgB,EAChB,KAAa,EACb,IAAY,EACZ,WAAmB;IAEnB,IAAI,SAAS,GAAG,WAAW,CAAC;IAC5B,MAAM,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,WAAW,GAAG,IAAI,GAAG,KAAK,CAAC;IAC/B,IAAI,KAAK,CAAC;IAEV,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAE5B,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEjE,I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CAAC;QAEhE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,CAAC,GAAG,EAAE,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;QACT,CAAC;aAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACZ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IAED,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACZ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAEZ,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ProtoFeature } from "./proto-feature.js";
2
+ /**
3
+ * Options for wrap()
4
+ */
5
+ export type WrapFeaturesOptions = {
6
+ buffer: number /** number of pixels of buffer for the tile */;
7
+ extent: number /** extent of each tile */;
8
+ lineMetrics: boolean;
9
+ };
10
+ /**
11
+ * Wrap across antemeridian, by clipping into two tiles, shifting the overflowing x coordinates
12
+ * @param list of features to be wrapped
13
+ * @param options buffer and extent
14
+ * @returns
15
+ */
16
+ export declare function wrapFeatures(features: ProtoFeature[], options: WrapFeaturesOptions): ProtoFeature[];
17
+ //# sourceMappingURL=wrap-features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap-features.d.ts","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/wrap-features.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAIlD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC,8CAA8C,CAAC;IAC9D,MAAM,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,YAAY,EAAE,EACxB,OAAO,EAAE,mBAAmB,GAC3B,YAAY,EAAE,CAkBhB"}
@@ -0,0 +1,95 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Forked from https://github.com/mapbox/geojson-vt under compatible ISC license
5
+ import { createProtoFeature } from "./proto-feature.js";
6
+ import { clipFeatures } from "./clip-features.js";
7
+ /**
8
+ * Wrap across antemeridian, by clipping into two tiles, shifting the overflowing x coordinates
9
+ * @param list of features to be wrapped
10
+ * @param options buffer and extent
11
+ * @returns
12
+ */
13
+ export function wrapFeatures(features, options) {
14
+ const buffer = options.buffer / options.extent;
15
+ let merged = features;
16
+ const left = clipFeatures(features, 1, -1 - buffer, buffer, 0, -1, 2, options); // left world copy
17
+ const right = clipFeatures(features, 1, 1 - buffer, 2 + buffer, 0, -1, 2, options); // right world copy
18
+ if (left || right) {
19
+ merged = clipFeatures(features, 1, -buffer, 1 + buffer, 0, -1, 2, options) || []; // center world copy
20
+ if (left) {
21
+ merged = shiftFeatureCoords(left, 1).concat(merged); // merge left into center
22
+ }
23
+ if (right) {
24
+ merged = merged.concat(shiftFeatureCoords(right, -1)); // merge right into center
25
+ }
26
+ }
27
+ return merged;
28
+ }
29
+ /**
30
+ * Shift the x coordinates of a list of features
31
+ * @param features list of features to shift x coordinates for
32
+ * @param offset
33
+ * @returns
34
+ */
35
+ function shiftFeatureCoords(features, offset) {
36
+ const newFeatures = [];
37
+ for (let i = 0; i < features.length; i++) {
38
+ const feature = features[i];
39
+ const type = feature.type;
40
+ let newGeometry;
41
+ switch (type) {
42
+ case 'Point':
43
+ case 'MultiPoint':
44
+ case 'LineString':
45
+ newGeometry = shiftCoords(feature.geometry, offset);
46
+ break;
47
+ case 'MultiLineString':
48
+ case 'Polygon':
49
+ newGeometry = [];
50
+ for (const line of feature.geometry) {
51
+ newGeometry.push(shiftCoords(line, offset));
52
+ }
53
+ break;
54
+ case 'MultiPolygon':
55
+ newGeometry = [];
56
+ for (const polygon of feature.geometry) {
57
+ const newPolygon = [];
58
+ for (const line of polygon) {
59
+ // @ts-expect-error TODO
60
+ newPolygon.push(shiftCoords(line, offset));
61
+ }
62
+ newGeometry.push(newPolygon);
63
+ }
64
+ break;
65
+ default:
66
+ throw new Error(String(type));
67
+ }
68
+ newFeatures.push(createProtoFeature(feature.id, type, newGeometry, feature.tags));
69
+ }
70
+ return newFeatures;
71
+ }
72
+ class Points extends Array {
73
+ size;
74
+ start;
75
+ end;
76
+ }
77
+ /**
78
+ * Shift the x coordinate of every point
79
+ * @param points
80
+ * @param offset
81
+ * @returns
82
+ */
83
+ function shiftCoords(points, offset) {
84
+ const newPoints = [];
85
+ newPoints.size = points.size;
86
+ if (points.start !== undefined) {
87
+ newPoints.start = points.start;
88
+ newPoints.end = points.end;
89
+ }
90
+ for (let i = 0; i < points.length; i += 3) {
91
+ newPoints.push(points[i] + offset, points[i + 1], points[i + 2]);
92
+ }
93
+ return newPoints;
94
+ }
95
+ //# sourceMappingURL=wrap-features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap-features.js","sourceRoot":"","sources":["../../../../../src/mvt/lib/vector-tiler/features/wrap-features.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AACpC,gFAAgF;AAGhF,OAAO,EAAC,kBAAkB,EAAC,2BAAwB;AACnD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAW7C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAwB,EACxB,OAA4B;IAE5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/C,IAAI,MAAM,GAAmB,QAAQ,CAAC;IACtC,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,k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AAS,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC/B,SAAS,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAC7B,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { ProtoFeature } from "./features/proto-feature.js";
2
+ export type ProtoTile = {
3
+ /** Processed features */
4
+ protoFeatures: ProtoFeature[];
5
+ /** if we slice further down, no need to keep source geometry */
6
+ sourceFeatures: ProtoFeature[] | null;
7
+ /** Properties */
8
+ tags?: Record<string, string>;
9
+ /** tile x coordinate */
10
+ x: number;
11
+ /** tile y coordinate */
12
+ y: number;
13
+ /** tile z coordinate */
14
+ z: number;
15
+ /** spatial extent */
16
+ minX: number;
17
+ /** spatial extent */
18
+ maxX: number;
19
+ /** spatial extent */
20
+ minY: number;
21
+ /** spatial extent */
22
+ maxY: number;
23
+ /** Whether this tile has been transformed */
24
+ transformed: boolean;
25
+ numPoints: number;
26
+ numSimplified: number;
27
+ /** Number of features in this tile */
28
+ numFeatures: number;
29
+ };
30
+ export type CreateTileOptions = {
31
+ maxZoom?: number;
32
+ tolerance: number;
33
+ extent: number;
34
+ lineMetrics: boolean;
35
+ };
36
+ /**
37
+ * Create a tile from features and tile index
38
+ */
39
+ export declare function createProtoTile(features: ProtoFeature[], z: any, tx: any, ty: any, options: CreateTileOptions): ProtoTile;
40
+ //# sourceMappingURL=proto-tile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-tile.d.ts","sourceRoot":"","sources":["../../../../src/mvt/lib/vector-tiler/proto-tile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,oCAAiC;AAE3D,MAAM,MAAM,SAAS,GAAG;IACtB,yBAAyB;IACzB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,gEAAgE;IAChE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEtC,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,wBAAwB;IACxB,CAAC,EAAE,MAAM,CAAC;IAEV,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,YAAY,EAAE,EACxB,CAAC,KAAA,EACD,EAAE,KAAA,EACF,EAAE,KAAA,EACF,OAAO,EAAE,iBAAiB,GACzB,SAAS,CAqBX"}
@@ -0,0 +1,139 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Forked from https://github.com/mapbox/geojson-vt under compatible ISC license
5
+ /**
6
+ * Create a tile from features and tile index
7
+ */
8
+ export function createProtoTile(features, z, tx, ty, options) {
9
+ const tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);
10
+ const tile = {
11
+ protoFeatures: [],
12
+ sourceFeatures: null,
13
+ numPoints: 0,
14
+ numSimplified: 0,
15
+ numFeatures: features.length,
16
+ x: tx,
17
+ y: ty,
18
+ z,
19
+ transformed: false,
20
+ minX: 2,
21
+ minY: 1,
22
+ maxX: -1,
23
+ maxY: 0
24
+ };
25
+ for (const feature of features) {
26
+ addProtoFeature(tile, feature, tolerance, options);
27
+ }
28
+ return tile;
29
+ }
30
+ // eslint-disable-next-line complexity, max-statements
31
+ function addProtoFeature(tile, feature, tolerance, options) {
32
+ const geometry = feature.geometry;
33
+ const type = feature.type;
34
+ const simplifiedGeometry = [];
35
+ tile.minX = Math.min(tile.minX, feature.minX);
36
+ tile.minY = Math.min(tile.minY, feature.minY);
37
+ tile.maxX = Math.max(tile.maxX, feature.maxX);
38
+ tile.maxY = Math.max(tile.maxY, feature.maxY);
39
+ let simplifiedType;
40
+ switch (type) {
41
+ case 'Point':
42
+ case 'MultiPoint':
43
+ simplifiedType = 1;
44
+ for (let i = 0; i < geometry.length; i += 3) {
45
+ simplifiedGeometry.push(geometry[i], geometry[i + 1]);
46
+ tile.numPoints++;
47
+ tile.numSimplified++;
48
+ }
49
+ break;
50
+ case 'LineString':
51
+ simplifiedType = 2;
52
+ addProtoLine(simplifiedGeometry, geometry, tile, tolerance, false, false);
53
+ break;
54
+ case 'MultiLineString':
55
+ simplifiedType = 2;
56
+ for (let i = 0; i < geometry.length; i++) {
57
+ addProtoLine(simplifiedGeometry, geometry[i], tile, tolerance, false, i === 0);
58
+ }
59
+ break;
60
+ case 'Polygon':
61
+ simplifiedType = 3;
62
+ for (let i = 0; i < geometry.length; i++) {
63
+ addProtoLine(simplifiedGeometry, geometry[i], tile, tolerance, true, i === 0);
64
+ }
65
+ break;
66
+ case 'MultiPolygon':
67
+ simplifiedType = 3;
68
+ for (let k = 0; k < geometry.length; k++) {
69
+ const polygon = geometry[k];
70
+ for (let i = 0; i < polygon.length; i++) {
71
+ addProtoLine(simplifiedGeometry, polygon[i], tile, tolerance, true, i === 0);
72
+ }
73
+ }
74
+ break;
75
+ default:
76
+ throw new Error(`Unknown geometry type: ${type}`);
77
+ }
78
+ if (simplifiedGeometry.length) {
79
+ let tags = feature.tags || null;
80
+ if (type === 'LineString' && options.lineMetrics) {
81
+ tags = {};
82
+ for (const key in feature.tags) {
83
+ tags[key] = feature.tags[key];
84
+ }
85
+ // @ts-expect-error adding fields to arrays
86
+ // eslint-disable-next-line camelcase
87
+ tags.mapbox_clip_start = geometry.start / geometry.size;
88
+ // @ts-expect-error adding fields to arrays
89
+ // eslint-disable-next-line camelcase
90
+ tags.mapbox_clip_end = geometry.end / geometry.size;
91
+ }
92
+ const tileFeature = {
93
+ geometry: simplifiedGeometry,
94
+ simplifiedType,
95
+ // @ts-expect-error
96
+ tags
97
+ };
98
+ if (feature.id !== null) {
99
+ tileFeature.id = feature.id;
100
+ }
101
+ tile.protoFeatures.push(tileFeature);
102
+ }
103
+ }
104
+ // eslint-disable-next-line max-params, max-statements
105
+ function addProtoLine(result, geometry, tile, tolerance, isPolygon, isOuter) {
106
+ const sqTolerance = tolerance * tolerance;
107
+ if (tolerance > 0 && geometry.size < (isPolygon ? sqTolerance : tolerance)) {
108
+ tile.numPoints += geometry.length / 3;
109
+ return;
110
+ }
111
+ const ring = [];
112
+ for (let i = 0; i < geometry.length; i += 3) {
113
+ if (tolerance === 0 || geometry[i + 2] > sqTolerance) {
114
+ tile.numSimplified++;
115
+ ring.push(geometry[i], geometry[i + 1]);
116
+ }
117
+ tile.numPoints++;
118
+ }
119
+ if (isPolygon)
120
+ rewind(ring, isOuter);
121
+ result.push(ring);
122
+ }
123
+ function rewind(ring, clockwise) {
124
+ let area = 0;
125
+ for (let i = 0, j = ring.length - 2; i < ring.length; j = i, i += 2) {
126
+ area += (ring[i] - ring[j]) * (ring[i + 1] + ring[j + 1]);
127
+ }
128
+ if (area > 0 === clockwise) {
129
+ for (let i = 0, len = ring.length; i < len / 2; i += 2) {
130
+ const x = ring[i];
131
+ const y = ring[i + 1];
132
+ ring[i] = ring[len - 2 - i];
133
+ ring[i + 1] = ring[len - 1 - i];
134
+ ring[len - 2 - i] = x;
135
+ ring[len - 1 - i] = y;
136
+ }
137
+ }
138
+ }
139
+ //# sourceMappingURL=proto-tile.js.map