@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.
- package/LICENSE +1 -1
- package/README.md +18 -72
- package/dist/dist.dev.js +6979 -42928
- package/dist/dist.min.js +3 -22
- package/dist/image-set.d.ts +1 -1
- package/dist/image-set.d.ts.map +1 -1
- package/dist/index.cjs +2847 -8781
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +4 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -27
- package/dist/index.js.map +1 -1
- package/dist/mlt/bundled.d.ts +3 -0
- package/dist/mlt/bundled.d.ts.map +1 -0
- package/dist/mlt/bundled.js +5 -0
- package/dist/mlt/bundled.js.map +1 -0
- package/dist/mlt/index.cjs +3701 -0
- package/dist/mlt/index.cjs.map +6 -0
- package/dist/mlt/index.d.ts +10 -0
- package/dist/mlt/index.d.ts.map +1 -0
- package/dist/mlt/index.js +12 -0
- package/dist/mlt/index.js.map +1 -0
- package/dist/mlt/lib/encode-mlt-geometry.d.ts +6 -0
- package/dist/mlt/lib/encode-mlt-geometry.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt-geometry.js +150 -0
- package/dist/mlt/lib/encode-mlt-geometry.js.map +1 -0
- package/dist/mlt/lib/encode-mlt-streams.d.ts +13 -0
- package/dist/mlt/lib/encode-mlt-streams.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt-streams.js +57 -0
- package/dist/mlt/lib/encode-mlt-streams.js.map +1 -0
- package/dist/mlt/lib/encode-mlt.d.ts +6 -0
- package/dist/mlt/lib/encode-mlt.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt.js +174 -0
- package/dist/mlt/lib/encode-mlt.js.map +1 -0
- package/dist/mlt/lib/parse-mlt.d.ts +11 -0
- package/dist/mlt/lib/parse-mlt.d.ts.map +1 -0
- package/dist/mlt/lib/parse-mlt.js +675 -0
- package/dist/mlt/lib/parse-mlt.js.map +1 -0
- package/dist/mlt/mlt-format.d.ts +14 -0
- package/dist/mlt/mlt-format.d.ts.map +1 -0
- package/dist/mlt/mlt-format.js +17 -0
- package/dist/mlt/mlt-format.js.map +1 -0
- package/dist/mlt/mlt-loader-with-parser.d.ts +91 -0
- package/dist/mlt/mlt-loader-with-parser.d.ts.map +1 -0
- package/dist/mlt/mlt-loader-with-parser.js +29 -0
- package/dist/mlt/mlt-loader-with-parser.js.map +1 -0
- package/dist/mlt/mlt-loader.d.ts +115 -0
- package/dist/mlt/mlt-loader.d.ts.map +1 -0
- package/dist/mlt/mlt-loader.js +38 -0
- package/dist/mlt/mlt-loader.js.map +1 -0
- package/dist/mlt/mlt-source-loader.d.ts +82 -0
- package/dist/mlt/mlt-source-loader.d.ts.map +1 -0
- package/dist/mlt/mlt-source-loader.js +179 -0
- package/dist/mlt/mlt-source-loader.js.map +1 -0
- package/dist/mlt/mlt-writer.d.ts +45 -0
- package/dist/mlt/mlt-writer.d.ts.map +1 -0
- package/dist/mlt/mlt-writer.js +21 -0
- package/dist/mlt/mlt-writer.js.map +1 -0
- package/dist/mlt/unbundled.d.ts +3 -0
- package/dist/mlt/unbundled.d.ts.map +1 -0
- package/dist/mlt/unbundled.js +5 -0
- package/dist/mlt/unbundled.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.d.ts +36 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.js +36 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader.cjs +6343 -0
- package/dist/mvt/arrow-table-tile-source-loader.cjs.map +6 -0
- package/dist/mvt/arrow-table-tile-source-loader.d.ts +69 -0
- package/dist/mvt/arrow-table-tile-source-loader.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader.js +216 -0
- package/dist/mvt/arrow-table-tile-source-loader.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-types.d.ts +21 -0
- package/dist/mvt/arrow-table-tile-source-types.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-types.js +6 -0
- package/dist/mvt/arrow-table-tile-source-types.js.map +1 -0
- package/dist/mvt/bundled.d.ts +6 -0
- package/dist/mvt/bundled.d.ts.map +1 -0
- package/dist/mvt/bundled.js +7 -0
- package/dist/mvt/bundled.js.map +1 -0
- package/dist/mvt/dist.dev.js +46689 -0
- package/dist/mvt/dist.min.js +94 -0
- package/dist/mvt/index.cjs +10095 -0
- package/dist/mvt/index.cjs.map +6 -0
- package/dist/mvt/index.d.ts +28 -0
- package/dist/mvt/index.d.ts.map +1 -0
- package/dist/mvt/index.js +27 -0
- package/dist/mvt/index.js.map +1 -0
- package/dist/mvt/lib/encode-mvt-arrow.d.ts +6 -0
- package/dist/mvt/lib/encode-mvt-arrow.d.ts.map +1 -0
- package/dist/mvt/lib/encode-mvt-arrow.js +225 -0
- package/dist/mvt/lib/encode-mvt-arrow.js.map +1 -0
- package/dist/mvt/lib/encode-mvt.d.ts +30 -0
- package/dist/mvt/lib/encode-mvt.d.ts.map +1 -0
- package/dist/mvt/lib/encode-mvt.js +20 -0
- package/dist/mvt/lib/encode-mvt.js.map +1 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.d.ts +4 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.d.ts.map +1 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.js +56 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.js.map +1 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.d.ts +3 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.d.ts.map +1 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.js +13 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.js.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts +25 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js +73 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts +52 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js +165 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts +116 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.js +127 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts +17 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.js +5 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts +77 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js +235 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts +25 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js +263 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts +4 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js +134 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-worker-transport.d.ts +15 -0
- package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-worker-transport.js +54 -0
- package/dist/mvt/lib/mvt-worker-transport.js.map +1 -0
- package/dist/mvt/lib/parse-mvt-geojson.d.ts +6 -0
- package/dist/mvt/lib/parse-mvt-geojson.d.ts.map +1 -0
- package/dist/mvt/lib/parse-mvt-geojson.js +48 -0
- package/dist/mvt/lib/parse-mvt-geojson.js.map +1 -0
- package/dist/mvt/lib/parse-mvt.d.ts +14 -0
- package/dist/mvt/lib/parse-mvt.d.ts.map +1 -0
- package/dist/mvt/lib/parse-mvt.js +105 -0
- package/dist/mvt/lib/parse-mvt.js.map +1 -0
- package/dist/mvt/lib/parse-tilejson.d.ts +74 -0
- package/dist/mvt/lib/parse-tilejson.d.ts.map +1 -0
- package/dist/mvt/lib/parse-tilejson.js +267 -0
- package/dist/mvt/lib/parse-tilejson.js.map +1 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.d.ts +4 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.d.ts.map +1 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.js +16 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.js.map +1 -0
- package/dist/mvt/lib/types.d.ts +88 -0
- package/dist/mvt/lib/types.d.ts.map +1 -0
- package/dist/mvt/lib/types.js.map +1 -0
- package/dist/mvt/lib/utils/geometry-utils.d.ts +83 -0
- package/dist/mvt/lib/utils/geometry-utils.d.ts.map +1 -0
- package/dist/mvt/lib/utils/geometry-utils.js +211 -0
- package/dist/mvt/lib/utils/geometry-utils.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts +72 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.js +350 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts +29 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.js +108 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile.d.ts +9 -0
- package/dist/mvt/lib/vector-tile/vector-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile.js +28 -0
- package/dist/mvt/lib/vector-tile/vector-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts +6 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.js +84 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts +16 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.js +211 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts +18 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.js +161 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts +30 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.js +53 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts +10 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.js +67 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts +17 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.js +95 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.d.ts +40 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.js +139 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts +12 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.js +81 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.d.ts +7 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.js +42 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.js.map +1 -0
- package/dist/mvt/map-style-format.d.ts +13 -0
- package/dist/mvt/map-style-format.d.ts.map +1 -0
- package/dist/mvt/map-style-format.js +16 -0
- package/dist/mvt/map-style-format.js.map +1 -0
- package/dist/mvt/map-style-loader-with-parser.d.ts +26 -0
- package/dist/mvt/map-style-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/map-style-loader-with-parser.js +38 -0
- package/dist/mvt/map-style-loader-with-parser.js.map +1 -0
- package/dist/mvt/map-style-loader.d.ts +44 -0
- package/dist/mvt/map-style-loader.d.ts.map +1 -0
- package/dist/mvt/map-style-loader.js +25 -0
- package/dist/mvt/map-style-loader.js.map +1 -0
- package/dist/mvt/map-style-schema.d.ts +58 -0
- package/dist/mvt/map-style-schema.d.ts.map +1 -0
- package/dist/mvt/map-style-schema.js +47 -0
- package/dist/mvt/map-style-schema.js.map +1 -0
- package/dist/mvt/map-style.d.ts +110 -0
- package/dist/mvt/map-style.d.ts.map +1 -0
- package/dist/mvt/map-style.js +90 -0
- package/dist/mvt/map-style.js.map +1 -0
- package/dist/mvt/mvt-format.d.ts +14 -0
- package/dist/mvt/mvt-format.d.ts.map +1 -0
- package/dist/mvt/mvt-format.js +23 -0
- package/dist/mvt/mvt-format.js.map +1 -0
- package/dist/mvt/mvt-geojson-loader-types.d.ts +82 -0
- package/dist/mvt/mvt-geojson-loader-types.d.ts.map +1 -0
- package/dist/mvt/mvt-geojson-loader-types.js +34 -0
- package/dist/mvt/mvt-geojson-loader-types.js.map +1 -0
- package/dist/mvt/mvt-geojson-loader.cjs +1366 -0
- package/dist/mvt/mvt-geojson-loader.cjs.map +6 -0
- package/dist/mvt/mvt-geojson-loader.d.ts +32 -0
- package/dist/mvt/mvt-geojson-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-geojson-loader.js +13 -0
- package/dist/mvt/mvt-geojson-loader.js.map +1 -0
- package/dist/mvt/mvt-loader-with-parser.d.ts +105 -0
- package/dist/mvt/mvt-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/mvt-loader-with-parser.js +21 -0
- package/dist/mvt/mvt-loader-with-parser.js.map +1 -0
- package/dist/mvt/mvt-loader.d.ts +129 -0
- package/dist/mvt/mvt-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-loader.js +40 -0
- package/dist/mvt/mvt-loader.js.map +1 -0
- package/dist/mvt/mvt-source-loader.d.ts +102 -0
- package/dist/mvt/mvt-source-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-source-loader.js +275 -0
- package/dist/mvt/mvt-source-loader.js.map +1 -0
- package/dist/mvt/mvt-writer.d.ts +28 -0
- package/dist/mvt/mvt-writer.d.ts.map +1 -0
- package/dist/mvt/mvt-writer.js +32 -0
- package/dist/mvt/mvt-writer.js.map +1 -0
- package/dist/mvt/table-tile-source-loader.d.ts +169 -0
- package/dist/mvt/table-tile-source-loader.d.ts.map +1 -0
- package/dist/mvt/table-tile-source-loader.js +478 -0
- package/dist/mvt/table-tile-source-loader.js.map +1 -0
- package/dist/mvt/tilejson-format.d.ts +13 -0
- package/dist/mvt/tilejson-format.d.ts.map +1 -0
- package/dist/mvt/tilejson-format.js +16 -0
- package/dist/mvt/tilejson-format.js.map +1 -0
- package/dist/mvt/tilejson-loader-with-parser.d.ts +13 -0
- package/dist/mvt/tilejson-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/tilejson-loader-with-parser.js +25 -0
- package/dist/mvt/tilejson-loader-with-parser.js.map +1 -0
- package/dist/mvt/tilejson-loader.d.ts +56 -0
- package/dist/mvt/tilejson-loader.d.ts.map +1 -0
- package/dist/mvt/tilejson-loader.js +28 -0
- package/dist/mvt/tilejson-loader.js.map +1 -0
- package/dist/mvt/tilejson-zod-schema.cjs +79 -0
- package/dist/mvt/tilejson-zod-schema.cjs.map +6 -0
- package/dist/mvt/tilejson-zod-schema.d.ts +218 -0
- package/dist/mvt/tilejson-zod-schema.d.ts.map +1 -0
- package/dist/mvt/tilejson-zod-schema.js +68 -0
- package/dist/mvt/tilejson-zod-schema.js.map +1 -0
- package/dist/mvt/tilejson.schema.json +197 -0
- package/dist/mvt/unbundled.d.ts +8 -0
- package/dist/mvt/unbundled.d.ts.map +1 -0
- package/dist/mvt/unbundled.js +8 -0
- package/dist/mvt/unbundled.js.map +1 -0
- package/dist/mvt/workers/mvt-worker-node.d.ts +2 -0
- package/dist/mvt/workers/mvt-worker-node.d.ts.map +1 -0
- package/dist/mvt/workers/mvt-worker-node.js +8 -0
- package/dist/mvt/workers/mvt-worker-node.js.map +1 -0
- package/dist/mvt/workers/mvt-worker.d.ts +2 -0
- package/dist/mvt/workers/mvt-worker.d.ts.map +1 -0
- package/dist/mvt/workers/mvt-worker.js +7 -0
- package/dist/mvt/workers/mvt-worker.js.map +1 -0
- package/dist/mvt-worker-node.js +72460 -0
- package/dist/mvt-worker-node.js.map +7 -0
- package/dist/mvt-worker.js +21239 -0
- package/dist/pmtiles/bundled.d.ts +3 -0
- package/dist/pmtiles/bundled.d.ts.map +1 -0
- package/dist/pmtiles/bundled.js +5 -0
- package/dist/pmtiles/bundled.js.map +1 -0
- package/dist/pmtiles/dist.dev.js +50530 -0
- package/dist/pmtiles/dist.min.js +94 -0
- package/dist/pmtiles/geoarrow.cjs +6718 -0
- package/dist/pmtiles/geoarrow.cjs.map +6 -0
- package/dist/pmtiles/geoarrow.d.ts +30 -0
- package/dist/pmtiles/geoarrow.d.ts.map +1 -0
- package/dist/pmtiles/geoarrow.js +143 -0
- package/dist/pmtiles/geoarrow.js.map +1 -0
- package/dist/pmtiles/index.cjs +8011 -0
- package/dist/pmtiles/index.cjs.map +6 -0
- package/dist/pmtiles/index.d.ts +14 -0
- package/dist/pmtiles/index.d.ts.map +1 -0
- package/dist/pmtiles/index.js +10 -0
- package/dist/pmtiles/index.js.map +1 -0
- package/dist/pmtiles/lib/blob-source.d.ts +14 -0
- package/dist/pmtiles/lib/blob-source.d.ts.map +1 -0
- package/dist/pmtiles/lib/blob-source.js +32 -0
- package/dist/pmtiles/lib/blob-source.js.map +1 -0
- package/dist/pmtiles/lib/encode-pmtiles.d.ts +8 -0
- package/dist/pmtiles/lib/encode-pmtiles.d.ts.map +1 -0
- package/dist/pmtiles/lib/encode-pmtiles.js +268 -0
- package/dist/pmtiles/lib/encode-pmtiles.js.map +1 -0
- package/dist/pmtiles/lib/parse-pmtiles.d.ts +52 -0
- package/dist/pmtiles/lib/parse-pmtiles.d.ts.map +1 -0
- package/dist/pmtiles/lib/parse-pmtiles.js +95 -0
- package/dist/pmtiles/lib/parse-pmtiles.js.map +1 -0
- package/dist/pmtiles/lib/range-request-source.d.ts +24 -0
- package/dist/pmtiles/lib/range-request-source.d.ts.map +1 -0
- package/dist/pmtiles/lib/range-request-source.js +45 -0
- package/dist/pmtiles/lib/range-request-source.js.map +1 -0
- package/dist/pmtiles/lib/version.d.ts +2 -0
- package/dist/pmtiles/lib/version.d.ts.map +1 -0
- package/dist/pmtiles/lib/version.js +8 -0
- package/dist/pmtiles/lib/version.js.map +1 -0
- package/dist/pmtiles/pmtiles-format.d.ts +14 -0
- package/dist/pmtiles/pmtiles-format.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-format.js +17 -0
- package/dist/pmtiles/pmtiles-format.js.map +1 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.d.ts +30 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.js +41 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.js.map +1 -0
- package/dist/pmtiles/pmtiles-loader.d.ts +41 -0
- package/dist/pmtiles/pmtiles-loader.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-loader.js +20 -0
- package/dist/pmtiles/pmtiles-loader.js.map +1 -0
- package/dist/pmtiles/pmtiles-source-loader.d.ts +85 -0
- package/dist/pmtiles/pmtiles-source-loader.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-source-loader.js +239 -0
- package/dist/pmtiles/pmtiles-source-loader.js.map +1 -0
- package/dist/pmtiles/pmtiles-writer-types.d.ts +39 -0
- package/dist/pmtiles/pmtiles-writer-types.d.ts.map +1 -0
- package/dist/{point-cloud-tile-source-types.js → pmtiles/pmtiles-writer-types.js} +1 -1
- package/dist/pmtiles/pmtiles-writer-types.js.map +1 -0
- package/dist/pmtiles/pmtiles-writer.d.ts +22 -0
- package/dist/pmtiles/pmtiles-writer.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-writer.js +15 -0
- package/dist/pmtiles/pmtiles-writer.js.map +1 -0
- package/dist/pmtiles/raster.cjs +1183 -0
- package/dist/pmtiles/raster.cjs.map +6 -0
- package/dist/pmtiles/raster.d.ts +30 -0
- package/dist/pmtiles/raster.d.ts.map +1 -0
- package/dist/pmtiles/raster.js +212 -0
- package/dist/pmtiles/raster.js.map +1 -0
- package/dist/pmtiles/source-info.d.ts +25 -0
- package/dist/pmtiles/source-info.d.ts.map +1 -0
- package/dist/{types.js → pmtiles/source-info.js} +1 -1
- package/dist/pmtiles/source-info.js.map +1 -0
- package/dist/pmtiles/unbundled.d.ts +3 -0
- package/dist/pmtiles/unbundled.d.ts.map +1 -0
- package/dist/pmtiles/unbundled.js +5 -0
- package/dist/pmtiles/unbundled.js.map +1 -0
- package/dist/raster-set.d.ts +1 -1
- package/dist/raster-set.d.ts.map +1 -1
- package/dist/raster-set.js +1 -1
- package/dist/raster-set.js.map +1 -1
- package/dist/tile-matrix.cjs +81 -0
- package/dist/tile-matrix.cjs.map +6 -0
- package/dist/tile-matrix.d.ts +52 -0
- package/dist/tile-matrix.d.ts.map +1 -0
- package/dist/tile-matrix.js +75 -0
- package/dist/tile-matrix.js.map +1 -0
- package/dist/tileset-2d/tile-2d-header.d.ts +2 -2
- package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -1
- package/dist/tileset-2d/tile-2d-header.js +11 -11
- package/dist/tileset-2d/tile-2d-header.js.map +1 -1
- package/dist/tileset-2d/tileset-2d.d.ts +19 -10
- package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
- package/dist/tileset-2d/tileset-2d.js +69 -15
- package/dist/tileset-2d/tileset-2d.js.map +1 -1
- package/package.json +101 -25
- package/src/image-set.ts +1 -1
- package/src/index.ts +8 -128
- package/src/mlt/bundled.ts +9 -0
- package/src/mlt/index.ts +18 -0
- package/src/mlt/lib/encode-mlt-geometry.ts +162 -0
- package/src/mlt/lib/encode-mlt-streams.ts +66 -0
- package/src/mlt/lib/encode-mlt.ts +215 -0
- package/src/mlt/lib/parse-mlt.ts +906 -0
- package/src/mlt/libs/mlt-decoder.cjs +4552 -0
- package/src/mlt/mlt-format.ts +19 -0
- package/src/mlt/mlt-loader-with-parser.ts +57 -0
- package/src/mlt/mlt-loader.ts +64 -0
- package/src/mlt/mlt-source-loader.ts +266 -0
- package/src/mlt/mlt-writer.ts +47 -0
- package/src/mlt/unbundled.ts +6 -0
- package/src/mvt/arrow-table-tile-source-loader-types.ts +55 -0
- package/src/mvt/arrow-table-tile-source-loader.ts +307 -0
- package/src/mvt/arrow-table-tile-source-types.ts +32 -0
- package/src/mvt/bundled.ts +14 -0
- package/src/mvt/index.ts +67 -0
- package/src/mvt/lib/encode-mvt-arrow.ts +273 -0
- package/src/mvt/lib/encode-mvt.ts +46 -0
- package/src/mvt/lib/get-schemas-from-tilejson.ts +64 -0
- package/src/mvt/lib/is-longitude-latitude-crs.ts +15 -0
- package/src/mvt/lib/mapbox-vt-pbf/geojson-to-vt.ts.disabled +76 -0
- package/src/mvt/lib/mapbox-vt-pbf/geojson-wrapper.ts +89 -0
- package/src/mvt/lib/mapbox-vt-pbf/to-vector-tile.ts +230 -0
- package/src/mvt/lib/mvt-pbf/mvt-constants.ts +135 -0
- package/src/mvt/lib/mvt-pbf/mvt-types.ts +22 -0
- package/src/mvt/lib/mvt-pbf/parse-geometry-from-pbf.ts +285 -0
- package/src/mvt/lib/mvt-pbf/parse-mvt-from-pbf.ts +310 -0
- package/src/mvt/lib/mvt-pbf/write-mvt-to-pbf.ts +162 -0
- package/src/mvt/lib/mvt-worker-transport.ts +74 -0
- package/src/mvt/lib/parse-mvt-geojson.ts +65 -0
- package/src/mvt/lib/parse-mvt.ts +145 -0
- package/src/mvt/lib/parse-tilejson.ts +397 -0
- package/src/mvt/lib/resolve-table-tile-parameters.ts +23 -0
- package/src/mvt/lib/types.ts +90 -0
- package/src/mvt/lib/utils/geometry-utils.ts +238 -0
- package/src/mvt/lib/vector-tile/LICENSE.txt +31 -0
- package/src/mvt/lib/vector-tile/vector-tile-feature.ts +430 -0
- package/src/mvt/lib/vector-tile/vector-tile-layer.ts +130 -0
- package/src/mvt/lib/vector-tile/vector-tile.ts +32 -0
- package/src/mvt/lib/vector-tiler/LICENSE +19 -0
- package/src/mvt/lib/vector-tiler/arrow-tile.ts +93 -0
- package/src/mvt/lib/vector-tiler/features/clip-features.ts +250 -0
- package/src/mvt/lib/vector-tiler/features/convert-feature.ts +213 -0
- package/src/mvt/lib/vector-tiler/features/proto-feature.ts +104 -0
- package/src/mvt/lib/vector-tiler/features/simplify-path.ts +84 -0
- package/src/mvt/lib/vector-tiler/features/wrap-features.ts +125 -0
- package/src/mvt/lib/vector-tiler/proto-tile.ts +217 -0
- package/src/mvt/lib/vector-tiler/tile-to-geojson.ts +104 -0
- package/src/mvt/lib/vector-tiler/transform-tile.ts +57 -0
- package/src/mvt/map-style-format.ts +18 -0
- package/src/mvt/map-style-loader-with-parser.ts +62 -0
- package/src/mvt/map-style-loader.ts +31 -0
- package/src/mvt/map-style-schema.ts +53 -0
- package/src/mvt/map-style.ts +218 -0
- package/src/mvt/mvt-format.ts +25 -0
- package/src/mvt/mvt-geojson-loader-types.ts +60 -0
- package/src/mvt/mvt-geojson-loader.ts +20 -0
- package/src/mvt/mvt-loader-with-parser.ts +53 -0
- package/src/mvt/mvt-loader.ts +73 -0
- package/src/mvt/mvt-source-loader.ts +410 -0
- package/src/mvt/mvt-writer.ts +35 -0
- package/src/mvt/table-tile-source-loader.ts +672 -0
- package/src/mvt/tilejson-format.ts +18 -0
- package/src/mvt/tilejson-loader-with-parser.ts +38 -0
- package/src/mvt/tilejson-loader.ts +42 -0
- package/src/mvt/tilejson-zod-schema.ts +199 -0
- package/src/mvt/unbundled.ts +13 -0
- package/src/mvt/workers/mvt-worker-node.ts +9 -0
- package/src/mvt/workers/mvt-worker.ts +8 -0
- package/src/pmtiles/bundled.ts +6 -0
- package/src/pmtiles/geoarrow.ts +188 -0
- package/src/pmtiles/index.ts +27 -0
- package/src/pmtiles/lib/blob-source.ts +41 -0
- package/src/pmtiles/lib/encode-pmtiles.ts +322 -0
- package/src/pmtiles/lib/parse-pmtiles.ts +180 -0
- package/src/pmtiles/lib/range-request-source.ts +60 -0
- package/src/pmtiles/lib/version.ts +8 -0
- package/src/pmtiles/pmtiles-format.ts +19 -0
- package/src/pmtiles/pmtiles-loader-with-parser.ts +60 -0
- package/src/pmtiles/pmtiles-loader.ts +30 -0
- package/src/pmtiles/pmtiles-source-loader.ts +346 -0
- package/src/pmtiles/pmtiles-writer-types.ts +45 -0
- package/src/pmtiles/pmtiles-writer.ts +26 -0
- package/src/pmtiles/raster.ts +289 -0
- package/src/pmtiles/source-info.ts +25 -0
- package/src/pmtiles/unbundled.ts +6 -0
- package/src/raster-set.ts +2 -2
- package/src/tile-matrix.ts +138 -0
- package/src/tileset-2d/tile-2d-header.ts +14 -13
- package/src/tileset-2d/tileset-2d.ts +81 -19
- package/dist/constants.d.ts +0 -38
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -39
- package/dist/constants.js.map +0 -1
- package/dist/point-cloud/point-cloud-tile.d.ts +0 -47
- package/dist/point-cloud/point-cloud-tile.d.ts.map +0 -1
- package/dist/point-cloud/point-cloud-tile.js +0 -70
- package/dist/point-cloud/point-cloud-tile.js.map +0 -1
- package/dist/point-cloud/point-cloud-tileset.d.ts +0 -135
- package/dist/point-cloud/point-cloud-tileset.d.ts.map +0 -1
- package/dist/point-cloud/point-cloud-tileset.js +0 -549
- package/dist/point-cloud/point-cloud-tileset.js.map +0 -1
- package/dist/point-cloud/types.d.ts +0 -81
- package/dist/point-cloud/types.d.ts.map +0 -1
- package/dist/point-cloud/types.js.map +0 -1
- package/dist/point-cloud-tile-source-loader-types.d.ts +0 -31
- package/dist/point-cloud-tile-source-loader-types.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-loader-types.js +0 -34
- package/dist/point-cloud-tile-source-loader-types.js.map +0 -1
- package/dist/point-cloud-tile-source-loader.cjs +0 -81
- package/dist/point-cloud-tile-source-loader.cjs.map +0 -7
- package/dist/point-cloud-tile-source-loader.d.ts +0 -27
- package/dist/point-cloud-tile-source-loader.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-loader.js +0 -17
- package/dist/point-cloud-tile-source-loader.js.map +0 -1
- package/dist/point-cloud-tile-source-types.d.ts +0 -15
- package/dist/point-cloud-tile-source-types.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-types.js.map +0 -1
- package/dist/point-cloud-tile-source.cjs +0 -105
- package/dist/point-cloud-tile-source.cjs.map +0 -7
- package/dist/point-cloud-tile-source.d.ts +0 -36
- package/dist/point-cloud-tile-source.d.ts.map +0 -1
- package/dist/point-cloud-tile-source.js +0 -84
- package/dist/point-cloud-tile-source.js.map +0 -1
- package/dist/spatial/format-spatial-reference.d.ts +0 -68
- package/dist/spatial/format-spatial-reference.d.ts.map +0 -1
- package/dist/spatial/format-spatial-reference.js +0 -291
- package/dist/spatial/format-spatial-reference.js.map +0 -1
- package/dist/spatial/get-spatial-coordinate-frame.d.ts +0 -20
- package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +0 -1
- package/dist/spatial/get-spatial-coordinate-frame.js +0 -139
- package/dist/spatial/get-spatial-coordinate-frame.js.map +0 -1
- package/dist/spatial/i3s-elevation.d.ts +0 -20
- package/dist/spatial/i3s-elevation.d.ts.map +0 -1
- package/dist/spatial/i3s-elevation.js +0 -90
- package/dist/spatial/i3s-elevation.js.map +0 -1
- package/dist/spatial/i3s-spatial-transformer.d.ts +0 -205
- package/dist/spatial/i3s-spatial-transformer.d.ts.map +0 -1
- package/dist/spatial/i3s-spatial-transformer.js +0 -731
- package/dist/spatial/i3s-spatial-transformer.js.map +0 -1
- package/dist/spatial/normalize-crs-identifier.d.ts +0 -15
- package/dist/spatial/normalize-crs-identifier.d.ts.map +0 -1
- package/dist/spatial/normalize-crs-identifier.js +0 -22
- package/dist/spatial/normalize-crs-identifier.js.map +0 -1
- package/dist/spatial/spatial-coordinate-transformer.d.ts +0 -54
- package/dist/spatial/spatial-coordinate-transformer.d.ts.map +0 -1
- package/dist/spatial/spatial-coordinate-transformer.js +0 -311
- package/dist/spatial/spatial-coordinate-transformer.js.map +0 -1
- package/dist/spatial/spatial-resource-registry.d.ts +0 -47
- package/dist/spatial/spatial-resource-registry.d.ts.map +0 -1
- package/dist/spatial/spatial-resource-registry.js +0 -76
- package/dist/spatial/spatial-resource-registry.js.map +0 -1
- package/dist/spatial/spatial-types.d.ts +0 -190
- package/dist/spatial/spatial-types.d.ts.map +0 -1
- package/dist/spatial/spatial-types.js +0 -192
- package/dist/spatial/spatial-types.js.map +0 -1
- package/dist/spatial/tiles-3d-spatial-transformer.d.ts +0 -32
- package/dist/spatial/tiles-3d-spatial-transformer.d.ts.map +0 -1
- package/dist/spatial/tiles-3d-spatial-transformer.js +0 -163
- package/dist/spatial/tiles-3d-spatial-transformer.js.map +0 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +0 -60
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +0 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.js +0 -130
- package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +0 -1
- package/dist/tileset-3d/common/tile-3d-contracts.d.ts +0 -63
- package/dist/tileset-3d/common/tile-3d-contracts.d.ts.map +0 -1
- package/dist/tileset-3d/common/tile-3d-contracts.js +0 -51
- package/dist/tileset-3d/common/tile-3d-contracts.js.map +0 -1
- package/dist/tileset-3d/common/tile-3d.d.ts +0 -410
- package/dist/tileset-3d/common/tile-3d.d.ts.map +0 -1
- package/dist/tileset-3d/common/tile-3d.js +0 -1056
- package/dist/tileset-3d/common/tile-3d.js.map +0 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +0 -369
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-3d.js +0 -879
- package/dist/tileset-3d/common/tileset-3d.js.map +0 -1
- package/dist/tileset-3d/common/tileset-cache.d.ts +0 -29
- package/dist/tileset-3d/common/tileset-cache.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-cache.js +0 -82
- package/dist/tileset-3d/common/tileset-cache.js.map +0 -1
- package/dist/tileset-3d/common/tileset-content-traversal.d.ts +0 -37
- package/dist/tileset-3d/common/tileset-content-traversal.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-content-traversal.js +0 -80
- package/dist/tileset-3d/common/tileset-content-traversal.js.map +0 -1
- package/dist/tileset-3d/common/tileset-observability.d.ts +0 -60
- package/dist/tileset-3d/common/tileset-observability.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-observability.js +0 -39
- package/dist/tileset-3d/common/tileset-observability.js.map +0 -1
- package/dist/tileset-3d/common/tileset-source.d.ts +0 -228
- package/dist/tileset-3d/common/tileset-source.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-source.js +0 -17
- package/dist/tileset-3d/common/tileset-source.js.map +0 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts +0 -88
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-traverser.js +0 -341
- package/dist/tileset-3d/common/tileset-traverser.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +0 -182
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +0 -678
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +0 -221
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +0 -770
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +0 -111
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +0 -339
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts +0 -27
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js +0 -45
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts +0 -116
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-source.js +0 -450
- package/dist/tileset-3d/format-i3s/i3s-source.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts +0 -34
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js +0 -81
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts +0 -25
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js +0 -84
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +0 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.d.ts +0 -5
- package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.js +0 -9
- package/dist/tileset-3d/helpers/3d-tiles-options.js.map +0 -1
- package/dist/tileset-3d/helpers/bounding-volume.d.ts +0 -23
- package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/bounding-volume.js +0 -236
- package/dist/tileset-3d/helpers/bounding-volume.js.map +0 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts +0 -93
- package/dist/tileset-3d/helpers/frame-state.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/frame-state.js +0 -211
- package/dist/tileset-3d/helpers/frame-state.js.map +0 -1
- package/dist/tileset-3d/helpers/i3s-lod.d.ts +0 -20
- package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/i3s-lod.js +0 -95
- package/dist/tileset-3d/helpers/i3s-lod.js.map +0 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts +0 -17
- package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.js +0 -17
- package/dist/tileset-3d/helpers/s2-bounding-volume.js.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +0 -72
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.js +0 -257
- package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +0 -134
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +0 -179
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +0 -1
- package/dist/tileset-3d/helpers/transform-utils.d.ts +0 -3
- package/dist/tileset-3d/helpers/transform-utils.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/transform-utils.js +0 -86
- package/dist/tileset-3d/helpers/transform-utils.js.map +0 -1
- package/dist/tileset-3d/helpers/zoom.d.ts +0 -46
- package/dist/tileset-3d/helpers/zoom.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/zoom.js +0 -86
- package/dist/tileset-3d/helpers/zoom.js.map +0 -1
- package/dist/types.d.ts +0 -48
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/doubly-linked-list-node.d.ts +0 -11
- package/dist/utils/doubly-linked-list-node.d.ts.map +0 -1
- package/dist/utils/doubly-linked-list-node.js +0 -20
- package/dist/utils/doubly-linked-list-node.js.map +0 -1
- package/dist/utils/doubly-linked-list.d.ts +0 -30
- package/dist/utils/doubly-linked-list.d.ts.map +0 -1
- package/dist/utils/doubly-linked-list.js +0 -93
- package/dist/utils/doubly-linked-list.js.map +0 -1
- package/dist/utils/managed-array.d.ts +0 -85
- package/dist/utils/managed-array.d.ts.map +0 -1
- package/dist/utils/managed-array.js +0 -152
- package/dist/utils/managed-array.js.map +0 -1
- package/src/constants.ts +0 -59
- package/src/point-cloud/point-cloud-tile.ts +0 -80
- package/src/point-cloud/point-cloud-tileset.ts +0 -767
- package/src/point-cloud/types.ts +0 -99
- package/src/point-cloud-tile-source-loader-types.ts +0 -53
- package/src/point-cloud-tile-source-loader.ts +0 -32
- package/src/point-cloud-tile-source-types.ts +0 -20
- package/src/point-cloud-tile-source.ts +0 -112
- package/src/spatial/format-spatial-reference.ts +0 -385
- package/src/spatial/get-spatial-coordinate-frame.ts +0 -169
- package/src/spatial/i3s-elevation.ts +0 -96
- package/src/spatial/i3s-spatial-transformer.ts +0 -1021
- package/src/spatial/normalize-crs-identifier.ts +0 -26
- package/src/spatial/spatial-coordinate-transformer.ts +0 -397
- package/src/spatial/spatial-resource-registry.ts +0 -90
- package/src/spatial/spatial-types.ts +0 -422
- package/src/spatial/tiles-3d-spatial-transformer.ts +0 -194
- package/src/tileset-3d/common/indexed-archive-tileset-source.ts +0 -205
- package/src/tileset-3d/common/tile-3d-contracts.ts +0 -115
- package/src/tileset-3d/common/tile-3d.ts +0 -1310
- package/src/tileset-3d/common/tileset-3d.ts +0 -1210
- package/src/tileset-3d/common/tileset-cache.ts +0 -111
- package/src/tileset-3d/common/tileset-content-traversal.ts +0 -114
- package/src/tileset-3d/common/tileset-observability.ts +0 -100
- package/src/tileset-3d/common/tileset-source.ts +0 -284
- package/src/tileset-3d/common/tileset-traverser.ts +0 -416
- package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +0 -1056
- package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +0 -1025
- package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +0 -391
- package/src/tileset-3d/format-i3s/i3s-pending-tiles-register.ts +0 -48
- package/src/tileset-3d/format-i3s/i3s-source.ts +0 -557
- package/src/tileset-3d/format-i3s/i3s-tile-manager.ts +0 -105
- package/src/tileset-3d/format-i3s/i3s-tileset-traverser.ts +0 -102
- package/src/tileset-3d/helpers/3d-tiles-options.ts +0 -11
- package/src/tileset-3d/helpers/bounding-volume.ts +0 -281
- package/src/tileset-3d/helpers/frame-state.ts +0 -322
- package/src/tileset-3d/helpers/i3s-lod.ts +0 -109
- package/src/tileset-3d/helpers/s2-bounding-volume.ts +0 -32
- package/src/tileset-3d/helpers/tiles-3d-lod.ts +0 -370
- package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +0 -301
- package/src/tileset-3d/helpers/transform-utils.ts +0 -109
- package/src/tileset-3d/helpers/zoom.ts +0 -120
- package/src/types.ts +0 -54
- package/src/utils/doubly-linked-list-node.ts +0 -22
- package/src/utils/doubly-linked-list.ts +0 -105
- package/src/utils/managed-array.ts +0 -174
- /package/dist/{point-cloud → mvt/lib}/types.js +0 -0
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT AND ISC
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
// Based on https://github.com/mapbox/geojson-vt under compatible ISC license
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
SourceLoader,
|
|
8
|
+
CoreAPI,
|
|
9
|
+
DataSourceOptions,
|
|
10
|
+
VectorTileSource,
|
|
11
|
+
TileSourceMetadata,
|
|
12
|
+
GetTileDataParameters,
|
|
13
|
+
GetTileParameters
|
|
14
|
+
} from '@loaders.gl/core/loader-utils';
|
|
15
|
+
import {
|
|
16
|
+
DataSource,
|
|
17
|
+
getRequiredOptions,
|
|
18
|
+
getSourceLoaderOptions,
|
|
19
|
+
log
|
|
20
|
+
} from '@loaders.gl/core/loader-utils';
|
|
21
|
+
import type {
|
|
22
|
+
Schema,
|
|
23
|
+
GeoJSONTable,
|
|
24
|
+
Feature,
|
|
25
|
+
BinaryFeatureCollection,
|
|
26
|
+
ArrowTable
|
|
27
|
+
} from '@loaders.gl/core/schema';
|
|
28
|
+
import type {GeoArrowEncodingPreference} from '@loaders.gl/core/schema';
|
|
29
|
+
import {convertFeaturesToWKBArrowTable} from '@loaders.gl/arrow-geometry/feature-collection-to-arrow';
|
|
30
|
+
import {deduceTableSchema} from '@loaders.gl/core/schema-utils';
|
|
31
|
+
import {Stats, Stat} from 'probe.gl/stats';
|
|
32
|
+
|
|
33
|
+
import {resolveTableTileParameters} from './lib/resolve-table-tile-parameters';
|
|
34
|
+
import type {ProtoFeature} from './lib/vector-tiler/features/proto-feature';
|
|
35
|
+
import type {ProtoTile} from './lib/vector-tiler/proto-tile';
|
|
36
|
+
import {createProtoTile} from './lib/vector-tiler/proto-tile';
|
|
37
|
+
import {transformTile} from './lib/vector-tiler/transform-tile'; // coordinate transformation
|
|
38
|
+
import {convertTileToGeoJSON} from './lib/vector-tiler/tile-to-geojson'; // tile clipping and wrapping
|
|
39
|
+
import {convertFeaturesToProtoFeature} from './lib/vector-tiler/features/convert-feature';
|
|
40
|
+
import {clipFeatures} from './lib/vector-tiler/features/clip-features'; // stripe clipping algorithm
|
|
41
|
+
import {wrapFeatures} from './lib/vector-tiler/features/wrap-features'; // date line processing
|
|
42
|
+
|
|
43
|
+
/** Options to configure tiling */
|
|
44
|
+
export type TableTileSourceLoaderOptions = DataSourceOptions & {
|
|
45
|
+
/** Preferred encoding for Arrow geometry output. */
|
|
46
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
47
|
+
table?: {
|
|
48
|
+
coordinates?: 'local' | 'wgs84' | 'EPSG:4326';
|
|
49
|
+
/** max zoom to preserve detail on */
|
|
50
|
+
maxZoom?: number;
|
|
51
|
+
/** max zoom in the tile index */
|
|
52
|
+
indexMaxZoom?: number;
|
|
53
|
+
/** max number of points per tile in the tile index */
|
|
54
|
+
maxPointsPerTile?: number;
|
|
55
|
+
/** simplification tolerance (higher means simpler) */
|
|
56
|
+
tolerance?: number;
|
|
57
|
+
/** tile extent */
|
|
58
|
+
extent?: number;
|
|
59
|
+
/** tile buffer on each side */
|
|
60
|
+
buffer?: number;
|
|
61
|
+
/** name of a feature property to be promoted to feature.id */
|
|
62
|
+
promoteId?: string;
|
|
63
|
+
/** whether to generate feature ids. Cannot be used with promoteId */
|
|
64
|
+
generateId?: boolean;
|
|
65
|
+
/** logging level (0, 1 or 2) */
|
|
66
|
+
debug?: number;
|
|
67
|
+
/** whether to calculate line metrics */
|
|
68
|
+
lineMetrics?: boolean;
|
|
69
|
+
/** Shape of returned vector tile data. */
|
|
70
|
+
shape?: 'geojson-table' | 'arrow-table';
|
|
71
|
+
/** Preferred encoding for Arrow geometry output. */
|
|
72
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** Options to configure tiling */
|
|
77
|
+
export const TableTileSourceLoader = {
|
|
78
|
+
dataType: null as unknown as TableVectorTileSource,
|
|
79
|
+
batchType: null as never,
|
|
80
|
+
name: 'TableTiler',
|
|
81
|
+
id: 'table-tiler',
|
|
82
|
+
module: 'tiles',
|
|
83
|
+
version: '0.0.0',
|
|
84
|
+
extensions: ['mvt'],
|
|
85
|
+
mimeTypes: ['application/octet-stream'],
|
|
86
|
+
type: 'table',
|
|
87
|
+
fromUrl: true,
|
|
88
|
+
fromBlob: true,
|
|
89
|
+
|
|
90
|
+
options: {
|
|
91
|
+
table: {
|
|
92
|
+
coordinates: 'local',
|
|
93
|
+
promoteId: undefined!,
|
|
94
|
+
maxZoom: 14,
|
|
95
|
+
indexMaxZoom: 5,
|
|
96
|
+
maxPointsPerTile: 10000,
|
|
97
|
+
tolerance: 3,
|
|
98
|
+
extent: 4096,
|
|
99
|
+
buffer: 64,
|
|
100
|
+
generateId: undefined,
|
|
101
|
+
shape: 'geojson-table'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
defaultOptions: {
|
|
106
|
+
table: {
|
|
107
|
+
coordinates: 'local',
|
|
108
|
+
promoteId: undefined!,
|
|
109
|
+
maxZoom: 14,
|
|
110
|
+
indexMaxZoom: 5,
|
|
111
|
+
maxPointsPerTile: 10000,
|
|
112
|
+
tolerance: 3,
|
|
113
|
+
extent: 4096,
|
|
114
|
+
buffer: 64,
|
|
115
|
+
generateId: undefined,
|
|
116
|
+
shape: 'geojson-table'
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
testURL: (url: string): boolean => url.endsWith('.geojson'),
|
|
121
|
+
createDataSource(
|
|
122
|
+
url: string | Blob | GeoJSONTable | Promise<GeoJSONTable>,
|
|
123
|
+
options: TableTileSourceLoaderOptions,
|
|
124
|
+
coreApi?: CoreAPI
|
|
125
|
+
): TableVectorTileSource {
|
|
126
|
+
const tablePromise = isLoadableTableInput(url) ? url : loadTable(url, options, coreApi);
|
|
127
|
+
return new TableVectorTileSource(tablePromise, options);
|
|
128
|
+
}
|
|
129
|
+
} as const satisfies SourceLoader<TableVectorTileSource>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Dynamically vector tiles a table (the table needs a geometry column)
|
|
133
|
+
* - Tiles are generated when requested.
|
|
134
|
+
* - Each tile contains a tables of clipped features.
|
|
135
|
+
*
|
|
136
|
+
* @note - Currently only accepts `GeoJSONTable` tables
|
|
137
|
+
* @note - Currently only outputs `GeoJSONTable`
|
|
138
|
+
* @note - (can be initialized with a promise that resolves to GeoJSONTable).
|
|
139
|
+
*
|
|
140
|
+
* @todo - metadata should scan all rows to determine schema
|
|
141
|
+
* @todo - metadata scan all rows to determine tilestats (field values[] etc).
|
|
142
|
+
* @todo - handle binary input tables
|
|
143
|
+
* @todo - generate binary output tables
|
|
144
|
+
* @todo - how does TileSourceLayer specify coordinates / decided which layer to render with
|
|
145
|
+
*/
|
|
146
|
+
export class TableVectorTileSource
|
|
147
|
+
extends DataSource<GeoJSONTable | Promise<GeoJSONTable>, TableTileSourceLoaderOptions>
|
|
148
|
+
implements VectorTileSource
|
|
149
|
+
{
|
|
150
|
+
/** Global stats for all DynamicVectorTileSources */
|
|
151
|
+
static stats = new Stats({
|
|
152
|
+
id: 'table-tile-source-loader-all',
|
|
153
|
+
stats: [new Stat('count', 'tiles'), new Stat('count', 'features')]
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
/** Stats for this TableVectorTileSource */
|
|
157
|
+
stats = new Stats({
|
|
158
|
+
id: 'table-tile-source-loader',
|
|
159
|
+
stats: [new Stat('tiles', 'count'), new Stat('features', 'count')]
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
/** MIME type of the tiles emitted by this tile source */
|
|
163
|
+
readonly mimeType = 'application/vnd.mapbox-vector-tile';
|
|
164
|
+
/** Whether emitted tile geometries use tile-local coordinates. */
|
|
165
|
+
readonly localCoordinates: boolean;
|
|
166
|
+
readonly tableOptions: Required<Required<TableTileSourceLoaderOptions>['table']>;
|
|
167
|
+
|
|
168
|
+
/* Schema of the data */
|
|
169
|
+
schema: Schema | null = null;
|
|
170
|
+
|
|
171
|
+
/** Map of generated tiles, indexed by stringified tile coordinates */
|
|
172
|
+
tiles: Record<string, ProtoTile> = {};
|
|
173
|
+
/** Array of tile coordinates */
|
|
174
|
+
tileCoords: {x: number; y: number; z: number}[] = [];
|
|
175
|
+
|
|
176
|
+
/** Input data has loaded, initial top-level tiling is done, sync methods can now be called */
|
|
177
|
+
ready: Promise<void>;
|
|
178
|
+
/** Metadata for the tile source (generated TileJSON/tilestats */
|
|
179
|
+
metadata: Promise<unknown>;
|
|
180
|
+
|
|
181
|
+
constructor(table: GeoJSONTable | Promise<GeoJSONTable>, options: TableTileSourceLoaderOptions) {
|
|
182
|
+
super(table, options, TableTileSourceLoader.defaultOptions);
|
|
183
|
+
this.tableOptions = getRequiredOptions(this.options).table;
|
|
184
|
+
this.localCoordinates = this.tableOptions.coordinates === 'local';
|
|
185
|
+
this.getTileData = this.getTileData.bind(this);
|
|
186
|
+
this.ready = this.initializeTilesAsync(table);
|
|
187
|
+
this.metadata = this.getMetadata();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async initializeTilesAsync(tablePromise: GeoJSONTable | Promise<GeoJSONTable>): Promise<void> {
|
|
191
|
+
const table = await tablePromise;
|
|
192
|
+
this.schema = table.features.length > 0 ? deduceTableSchema(table) : {fields: [], metadata: {}};
|
|
193
|
+
this.createRootTiles(table);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async getMetadata(): Promise<TileSourceMetadata & {schema: Schema | null}> {
|
|
197
|
+
await this.ready;
|
|
198
|
+
return {schema: this.schema, minZoom: 0, maxZoom: this.tableOptions.maxZoom};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async getSchema(): Promise<Schema> {
|
|
202
|
+
await this.ready;
|
|
203
|
+
return this.schema!;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Get a tile at the specified index
|
|
208
|
+
* @param tileIndex z, x, y of tile
|
|
209
|
+
* @returns
|
|
210
|
+
*/
|
|
211
|
+
async getVectorTile(tileIndex: GetTileParameters): Promise<GeoJSONTable | ArrowTable | null> {
|
|
212
|
+
await this.ready;
|
|
213
|
+
const table = this.getTileSync(tileIndex);
|
|
214
|
+
log.info(2, 'getVectorTile', tileIndex, table)();
|
|
215
|
+
return this.tableOptions.shape === 'arrow-table' && table
|
|
216
|
+
? convertFeaturesToWKBArrowTable(table.features, {
|
|
217
|
+
encodingPreference:
|
|
218
|
+
(this.options as TableTileSourceLoaderOptions).geoarrow?.encodingPreference ||
|
|
219
|
+
this.tableOptions.geoarrow?.encodingPreference
|
|
220
|
+
})
|
|
221
|
+
: table;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
async getTile(tileIndex: GetTileParameters): Promise<GeoJSONTable | null> {
|
|
225
|
+
await this.ready;
|
|
226
|
+
return this.getTileSync(tileIndex);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async getTileData(
|
|
230
|
+
tileParams: GetTileDataParameters
|
|
231
|
+
): Promise<Feature[] | BinaryFeatureCollection> {
|
|
232
|
+
await this.ready;
|
|
233
|
+
const tile = this.getTileSync({
|
|
234
|
+
...tileParams.index,
|
|
235
|
+
tileMatrix: tileParams.tileMatrix,
|
|
236
|
+
signal: tileParams.signal
|
|
237
|
+
});
|
|
238
|
+
return tile?.features || [];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Implementation
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Synchronously request a tile
|
|
245
|
+
* @note Application must await `source.ready` before calling sync methods.
|
|
246
|
+
*/
|
|
247
|
+
getTileSync(tileIndex: GetTileParameters): GeoJSONTable | null {
|
|
248
|
+
tileIndex = resolveTableTileParameters(tileIndex, this.tableOptions.maxZoom);
|
|
249
|
+
const protoTile = this.getProtoTile(tileIndex);
|
|
250
|
+
if (!protoTile) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return convertTileToGeoJSON(protoTile, {
|
|
255
|
+
coordinates: this.tableOptions.coordinates,
|
|
256
|
+
tileIndex,
|
|
257
|
+
extent: this.tableOptions.extent
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Create the initial tiles
|
|
263
|
+
* @note the tiles stores all the features together with additional data
|
|
264
|
+
*/
|
|
265
|
+
createRootTiles(table: GeoJSONTable): void {
|
|
266
|
+
if (this.tableOptions.maxZoom < 0 || this.tableOptions.maxZoom > 24) {
|
|
267
|
+
throw new Error('maxZoom should be in the 0-24 range');
|
|
268
|
+
}
|
|
269
|
+
if (this.tableOptions.promoteId && this.tableOptions.generateId) {
|
|
270
|
+
throw new Error('promoteId and generateId cannot be used together.');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
log.log(1, 'TableVectorTileSource creating root tiles', this.tableOptions)();
|
|
274
|
+
|
|
275
|
+
// projects and adds simplification info
|
|
276
|
+
log.time(1, 'preprocess table')();
|
|
277
|
+
let features = convertFeaturesToProtoFeature(table, this.tableOptions);
|
|
278
|
+
log.timeEnd(1, 'preprocess table')();
|
|
279
|
+
|
|
280
|
+
// wraps features (ie extreme west and extreme east)
|
|
281
|
+
log.time(1, 'generate tiles')();
|
|
282
|
+
|
|
283
|
+
features = wrapFeatures(features, this.tableOptions);
|
|
284
|
+
|
|
285
|
+
// start slicing from the top tile down
|
|
286
|
+
if (features.length === 0) {
|
|
287
|
+
log.log(1, 'TableVectorTileSource: no features generated')();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
this.splitTile(features, 0, 0, 0);
|
|
292
|
+
|
|
293
|
+
const rootTile = this.tiles[0];
|
|
294
|
+
log.log(1, `root tile features: ${rootTile.numFeatures}, points: ${rootTile.numPoints}`)();
|
|
295
|
+
|
|
296
|
+
log.timeEnd(1, 'generate tiles')();
|
|
297
|
+
log.log(
|
|
298
|
+
1,
|
|
299
|
+
`TableVectorTileSource: tiles generated: ${this.stats.get('total').count}`,
|
|
300
|
+
this.stats
|
|
301
|
+
)();
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return geojsonvt-style "half formed" vector tile
|
|
306
|
+
* @note Application must await `source.ready` before calling sync methods.
|
|
307
|
+
*/
|
|
308
|
+
// eslint-disable-next-line complexity, max-statements
|
|
309
|
+
getProtoTile(tileIndex: {z: number; x: number; y: number}): ProtoTile | null {
|
|
310
|
+
const {z, y} = tileIndex;
|
|
311
|
+
let {x} = tileIndex;
|
|
312
|
+
// z = +z;
|
|
313
|
+
// x = +x;
|
|
314
|
+
// y = +y;
|
|
315
|
+
|
|
316
|
+
const {extent} = this.tableOptions;
|
|
317
|
+
|
|
318
|
+
if (z < 0 || z > 24) {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const z2 = 1 << z;
|
|
323
|
+
x = (x + z2) & (z2 - 1); // wrapFeatures tile x coordinate
|
|
324
|
+
|
|
325
|
+
const id = toID(z, x, y);
|
|
326
|
+
if (this.tiles[id]) {
|
|
327
|
+
return transformTile(this.tiles[id], extent);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
log.log(log, 'drilling down to z%d-%d-%d', z, x, y)();
|
|
331
|
+
|
|
332
|
+
let z0 = z;
|
|
333
|
+
let x0 = x;
|
|
334
|
+
let y0 = y;
|
|
335
|
+
let parent;
|
|
336
|
+
|
|
337
|
+
while (!parent && z0 > 0) {
|
|
338
|
+
z0--;
|
|
339
|
+
x0 = x0 >> 1;
|
|
340
|
+
y0 = y0 >> 1;
|
|
341
|
+
parent = this.tiles[toID(z0, x0, y0)];
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (!parent || !parent.sourceFeatures) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// if we found a parent tile containing the original geometry, we can drill down from it
|
|
349
|
+
log.log(1, 'found parent tile z%d-%d-%d', z0, x0, y0)();
|
|
350
|
+
log.time(1, 'drilling down')();
|
|
351
|
+
|
|
352
|
+
this.splitTile(parent.sourceFeatures, z0, x0, y0, z, x, y);
|
|
353
|
+
|
|
354
|
+
log.timeEnd(1, 'drilling down')();
|
|
355
|
+
|
|
356
|
+
return this.tiles[id] ? transformTile(this.tiles[id], extent) : null;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* splits features from a parent tile to sub-tiles.
|
|
361
|
+
* @param z, x, and y are the coordinates of the parent tile
|
|
362
|
+
* @param cz, cx, and cy are the coordinates of the target tile
|
|
363
|
+
*
|
|
364
|
+
* If no target tile is specified, splitting stops when we reach the maximum
|
|
365
|
+
* zoom or the number of points is low as specified in the options.
|
|
366
|
+
*/
|
|
367
|
+
// eslint-disable-next-line max-params, max-statements, complexity
|
|
368
|
+
splitTile(
|
|
369
|
+
features: ProtoFeature[],
|
|
370
|
+
z: number,
|
|
371
|
+
x: number,
|
|
372
|
+
y: number,
|
|
373
|
+
cz?: number,
|
|
374
|
+
cx?: number,
|
|
375
|
+
cy?: number
|
|
376
|
+
): void {
|
|
377
|
+
const stack: any[] = [features, z, x, y];
|
|
378
|
+
|
|
379
|
+
// avoid recursion by using a processing queue
|
|
380
|
+
while (stack.length) {
|
|
381
|
+
y = stack.pop();
|
|
382
|
+
x = stack.pop();
|
|
383
|
+
z = stack.pop();
|
|
384
|
+
features = stack.pop();
|
|
385
|
+
|
|
386
|
+
const z2 = 1 << z;
|
|
387
|
+
const id = toID(z, x, y);
|
|
388
|
+
let tile = this.tiles[id];
|
|
389
|
+
|
|
390
|
+
if (!tile) {
|
|
391
|
+
log.time(2, 'tile creation')();
|
|
392
|
+
|
|
393
|
+
tile = this.tiles[id] = createProtoTile(features, z, x, y, this.tableOptions);
|
|
394
|
+
this.tileCoords.push({z, x, y});
|
|
395
|
+
|
|
396
|
+
const key = `z${z}`;
|
|
397
|
+
let stat = this.stats.get(key, 'count');
|
|
398
|
+
stat.incrementCount();
|
|
399
|
+
|
|
400
|
+
stat = this.stats.get('total');
|
|
401
|
+
stat.incrementCount();
|
|
402
|
+
|
|
403
|
+
stat = TableVectorTileSource.stats.get(key, 'count');
|
|
404
|
+
stat.incrementCount();
|
|
405
|
+
|
|
406
|
+
stat = TableVectorTileSource.stats.get('total');
|
|
407
|
+
stat.incrementCount();
|
|
408
|
+
|
|
409
|
+
log.log(
|
|
410
|
+
2,
|
|
411
|
+
'tile z%d-%d-%d (features: %d, points: %d, simplified: %d)',
|
|
412
|
+
z,
|
|
413
|
+
x,
|
|
414
|
+
y,
|
|
415
|
+
tile.numFeatures,
|
|
416
|
+
tile.numPoints,
|
|
417
|
+
tile.numSimplified
|
|
418
|
+
)();
|
|
419
|
+
log.timeEnd(2, 'tile creation')();
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// save reference to original geometry in tile so that we can drill down later if we stop now
|
|
423
|
+
tile.sourceFeatures = features;
|
|
424
|
+
|
|
425
|
+
/* eslint-disable no-continue */
|
|
426
|
+
|
|
427
|
+
// if it's the first-pass tiling
|
|
428
|
+
if (cz === undefined) {
|
|
429
|
+
// stop tiling if we reached max zoom, or if the tile is too simple
|
|
430
|
+
if (
|
|
431
|
+
z === this.tableOptions.indexMaxZoom ||
|
|
432
|
+
tile.numPoints <= this.tableOptions.maxPointsPerTile
|
|
433
|
+
) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
// if a drilldown to a specific tile
|
|
437
|
+
} else if (z === this.tableOptions.maxZoom || z === cz) {
|
|
438
|
+
// stop tiling if we reached base zoom or our target tile zoom
|
|
439
|
+
continue;
|
|
440
|
+
} else if (cz !== undefined) {
|
|
441
|
+
// stop tiling if it's not an ancestor of the target tile
|
|
442
|
+
const zoomSteps = cz - z;
|
|
443
|
+
// @ts-expect-error TODO fix the types of cx cy
|
|
444
|
+
if (x !== cx >> zoomSteps || y !== cy >> zoomSteps) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// if we slice further down, no need to keep source geometry
|
|
450
|
+
tile.sourceFeatures = null;
|
|
451
|
+
|
|
452
|
+
if (features.length === 0) continue;
|
|
453
|
+
|
|
454
|
+
log.time(2, 'clipping tile')();
|
|
455
|
+
|
|
456
|
+
// values we'll use for clipping
|
|
457
|
+
const k1 = (0.5 * this.tableOptions.buffer) / this.tableOptions.extent;
|
|
458
|
+
const k2 = 0.5 - k1;
|
|
459
|
+
const k3 = 0.5 + k1;
|
|
460
|
+
const k4 = 1 + k1;
|
|
461
|
+
|
|
462
|
+
let tl: ProtoFeature[] | null = null;
|
|
463
|
+
let bl: ProtoFeature[] | null = null;
|
|
464
|
+
let tr: ProtoFeature[] | null = null;
|
|
465
|
+
let br: ProtoFeature[] | null = null;
|
|
466
|
+
|
|
467
|
+
let left = clipFeatures(
|
|
468
|
+
features,
|
|
469
|
+
z2,
|
|
470
|
+
x - k1,
|
|
471
|
+
x + k3,
|
|
472
|
+
0,
|
|
473
|
+
tile.minX,
|
|
474
|
+
tile.maxX,
|
|
475
|
+
this.tableOptions
|
|
476
|
+
);
|
|
477
|
+
let right = clipFeatures(
|
|
478
|
+
features,
|
|
479
|
+
z2,
|
|
480
|
+
x + k2,
|
|
481
|
+
x + k4,
|
|
482
|
+
0,
|
|
483
|
+
tile.minX,
|
|
484
|
+
tile.maxX,
|
|
485
|
+
this.tableOptions
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
// @ts-expect-error - unclear why this is needed?
|
|
489
|
+
features = null;
|
|
490
|
+
|
|
491
|
+
if (left) {
|
|
492
|
+
tl = clipFeatures(left, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, this.tableOptions);
|
|
493
|
+
bl = clipFeatures(left, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, this.tableOptions);
|
|
494
|
+
left = null;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (right) {
|
|
498
|
+
tr = clipFeatures(right, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, this.tableOptions);
|
|
499
|
+
br = clipFeatures(right, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, this.tableOptions);
|
|
500
|
+
right = null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
log.timeEnd(2, 'clipping tile')();
|
|
504
|
+
|
|
505
|
+
stack.push(tl || [], z + 1, x * 2, y * 2);
|
|
506
|
+
stack.push(bl || [], z + 1, x * 2, y * 2 + 1);
|
|
507
|
+
stack.push(tr || [], z + 1, x * 2 + 1, y * 2);
|
|
508
|
+
stack.push(br || [], z + 1, x * 2 + 1, y * 2 + 1);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function toID(z, x, y): number {
|
|
514
|
+
return ((1 << z) * y + x) * 32 + z;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** Detects whether the supplied input is already a resolved table payload. */
|
|
518
|
+
function isLoadableTableInput(
|
|
519
|
+
data: string | Blob | GeoJSONTable | Promise<GeoJSONTable>
|
|
520
|
+
): data is GeoJSONTable | Promise<GeoJSONTable> {
|
|
521
|
+
return typeof data !== 'string' && !(data instanceof Blob);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** Loads a GeoJSON table from URL/blob input through the injected core API. */
|
|
525
|
+
async function loadTable(
|
|
526
|
+
url: string | Blob,
|
|
527
|
+
options: TableTileSourceLoaderOptions,
|
|
528
|
+
coreApi?: CoreAPI
|
|
529
|
+
): Promise<GeoJSONTable> {
|
|
530
|
+
const loaders = options?.core?.loaders;
|
|
531
|
+
if (!coreApi?.load) {
|
|
532
|
+
throw new Error(
|
|
533
|
+
'TableTileSourceLoader requires an injected CoreAPI to load tables from URL or Blob inputs.'
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if (!loaders?.length) {
|
|
538
|
+
throw new Error(
|
|
539
|
+
'TableTileSourceLoader requires `options.core.loaders` when creating a source from URL or Blob inputs.'
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
const loadOptions = {
|
|
544
|
+
...getSourceLoaderOptions(options),
|
|
545
|
+
// This source's tiler consumes object-row GeoJSON features internally.
|
|
546
|
+
geojson: {
|
|
547
|
+
...(options.geojson as Record<string, unknown> | undefined),
|
|
548
|
+
shape: 'geojson-table'
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
const table = await coreApi.load(url, loaders.length === 1 ? loaders[0] : loaders, loadOptions);
|
|
552
|
+
if (!isGeoJSONTable(table)) {
|
|
553
|
+
throw new Error(
|
|
554
|
+
'TableTileSourceLoader requires the configured parser loaders to return a GeoJSONTable.'
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return table;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/** Checks whether a parser result matches the GeoJSONTable runtime shape. */
|
|
562
|
+
function isGeoJSONTable(table: unknown): table is GeoJSONTable {
|
|
563
|
+
return Boolean(
|
|
564
|
+
table &&
|
|
565
|
+
typeof table === 'object' &&
|
|
566
|
+
'shape' in table &&
|
|
567
|
+
(table as GeoJSONTable).shape === 'geojson-table' &&
|
|
568
|
+
'features' in table &&
|
|
569
|
+
Array.isArray((table as GeoJSONTable).features)
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/*
|
|
574
|
+
|
|
575
|
+
// eslint-disable-next-line max-statements, complexity
|
|
576
|
+
function convertToGeoJSONTable(
|
|
577
|
+
vtTile: ProtoTile,
|
|
578
|
+
options: {
|
|
579
|
+
coordinates: 'local' | 'wgs84' | 'EPSG:4326';
|
|
580
|
+
tileIndex: {x: number; y: number; z: number};
|
|
581
|
+
extent: number;
|
|
582
|
+
}
|
|
583
|
+
): GeoJSONTable | null {
|
|
584
|
+
const features: Feature[] = [];
|
|
585
|
+
for (const rawFeature of vtTile.features) {
|
|
586
|
+
if (!rawFeature || !rawFeature.geometry) {
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
let type:
|
|
591
|
+
| 'Point'
|
|
592
|
+
| 'MultiPoint'
|
|
593
|
+
| 'LineString'
|
|
594
|
+
| 'MultiLineString'
|
|
595
|
+
| 'Polygon'
|
|
596
|
+
| 'MultiPolygon';
|
|
597
|
+
|
|
598
|
+
let coordinates: any;
|
|
599
|
+
|
|
600
|
+
// raw geometry
|
|
601
|
+
switch (rawFeature.type) {
|
|
602
|
+
case 1:
|
|
603
|
+
if (rawFeature.geometry.length === 1) {
|
|
604
|
+
type = 'Point';
|
|
605
|
+
coordinates = rawFeature.geometry[0];
|
|
606
|
+
} else {
|
|
607
|
+
type = 'MultiPoint';
|
|
608
|
+
coordinates = rawFeature.geometry;
|
|
609
|
+
}
|
|
610
|
+
break;
|
|
611
|
+
case 2:
|
|
612
|
+
if (rawFeature.geometry.length === 1) {
|
|
613
|
+
type = 'LineString';
|
|
614
|
+
coordinates = rawFeature.geometry[0];
|
|
615
|
+
} else {
|
|
616
|
+
type = 'MultiLineString';
|
|
617
|
+
coordinates = rawFeature.geometry;
|
|
618
|
+
}
|
|
619
|
+
break;
|
|
620
|
+
case 3:
|
|
621
|
+
if (rawFeature.geometry.length > 1) {
|
|
622
|
+
type = 'MultiPolygon';
|
|
623
|
+
coordinates = [rawFeature.geometry];
|
|
624
|
+
} else {
|
|
625
|
+
type = 'Polygon';
|
|
626
|
+
coordinates = rawFeature.geometry;
|
|
627
|
+
}
|
|
628
|
+
break;
|
|
629
|
+
default:
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
switch (options.coordinates) {
|
|
634
|
+
case 'EPSG:4326':
|
|
635
|
+
case 'wgs84':
|
|
636
|
+
projectToLngLat(coordinates, options.tileIndex, options.extent);
|
|
637
|
+
break;
|
|
638
|
+
|
|
639
|
+
case 'local':
|
|
640
|
+
convertToLocalCoordinates(coordinates, options.extent);
|
|
641
|
+
break;
|
|
642
|
+
|
|
643
|
+
default:
|
|
644
|
+
throw new Error(`Unsupported CRS ${options.coordinates}`);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const feature: Feature = {
|
|
648
|
+
type: 'Feature',
|
|
649
|
+
geometry: {
|
|
650
|
+
type,
|
|
651
|
+
coordinates
|
|
652
|
+
},
|
|
653
|
+
properties: rawFeature.tags || {},
|
|
654
|
+
id: rawFeature.id
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
features.push(feature);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (features.length === 0) {
|
|
661
|
+
return null;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const table: GeoJSONTable = {
|
|
665
|
+
shape: 'geojson-table',
|
|
666
|
+
type: 'FeatureCollection',
|
|
667
|
+
features
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
return table;
|
|
671
|
+
}
|
|
672
|
+
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Format} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
|
|
7
|
+
/** TileJSON metadata format. */
|
|
8
|
+
export const TileJSONFormat = {
|
|
9
|
+
name: 'TileJSON',
|
|
10
|
+
id: 'tilejson',
|
|
11
|
+
module: 'tiles',
|
|
12
|
+
encoding: 'json',
|
|
13
|
+
format: 'tilejson',
|
|
14
|
+
extensions: ['json'],
|
|
15
|
+
mimeTypes: ['application/json'],
|
|
16
|
+
category: 'metadata',
|
|
17
|
+
text: true
|
|
18
|
+
} as const satisfies Format;
|