@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,165 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
// Forked from https://github.com/mapbox/vt-pbf under MIT License Copyright (c) 2015 Anand Thakker
|
|
5
|
+
import Pbf from 'pbf';
|
|
6
|
+
import { writeMVT } from "../mvt-pbf/write-mvt-to-pbf.js";
|
|
7
|
+
import GeoJSONWrapper from "./geojson-wrapper.js";
|
|
8
|
+
import { copyToArrayBuffer } from '@loaders.gl/core/loader-utils';
|
|
9
|
+
/**
|
|
10
|
+
* Serialize a map of geojson layers
|
|
11
|
+
* loaders.gl addition
|
|
12
|
+
*
|
|
13
|
+
* @param geojson
|
|
14
|
+
* @param [options] - An object specifying the vector-tile specification version and extent that were used to create `layers`.
|
|
15
|
+
* @param [options.extent=4096] - Extent of the vector tile
|
|
16
|
+
* @return uncompressed, pbf-serialized tile data
|
|
17
|
+
*/
|
|
18
|
+
export function fromGeojson(geojson, options) {
|
|
19
|
+
options = options || {};
|
|
20
|
+
geojson = normalizeGeojson(geojson);
|
|
21
|
+
const extent = options.extent || 4096;
|
|
22
|
+
const features = convertFeaturesToVectorTileFeatures(geojson.features, extent, options.tileIndex);
|
|
23
|
+
const layer = new GeoJSONWrapper(features, { ...options, extent });
|
|
24
|
+
// TODO - this is broken
|
|
25
|
+
layer.name = options.layerName || 'geojsonLayer';
|
|
26
|
+
layer.version = options.version || 1;
|
|
27
|
+
layer.extent = options.extent || 4096;
|
|
28
|
+
// @ts-expect-error
|
|
29
|
+
return fromVectorTileJs({ layers: { [layer.name]: layer } });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Serialize a vector-tile-js-created tile to pbf
|
|
33
|
+
*
|
|
34
|
+
* @param tile
|
|
35
|
+
* @return uncompressed, pbf-serialized tile data
|
|
36
|
+
*/
|
|
37
|
+
export function fromVectorTileJs(tile) {
|
|
38
|
+
const pbf = new Pbf();
|
|
39
|
+
writeMVT(tile, pbf);
|
|
40
|
+
const uint8Array = pbf.finish();
|
|
41
|
+
// TODO - make sure no byteOffsets/byteLenghts are used?
|
|
42
|
+
return copyToArrayBuffer(uint8Array.buffer, uint8Array.byteOffset, uint8Array.byteOffset + uint8Array.byteLength);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Serialized a geojson-vt-created tile to pbf.
|
|
46
|
+
*
|
|
47
|
+
* @param vtLayers - An object mapping layer names to geojson-vt-created vector tile objects
|
|
48
|
+
* @param [options] - An object specifying the vector-tile specification version and extent that were used to create `layers`.
|
|
49
|
+
* @param [options.version=1] - Version of vector-tile spec used
|
|
50
|
+
* @param [options.extent=4096] - Extent of the vector tile
|
|
51
|
+
* @return uncompressed, pbf-serialized tile data
|
|
52
|
+
*
|
|
53
|
+
export function fromGeojsonVt(vtLayers, options): ArrayBuffer {
|
|
54
|
+
options = options || {};
|
|
55
|
+
const layers = {};
|
|
56
|
+
for (const key in vtLayers) {
|
|
57
|
+
layers[key] = new GeoJSONWrapper(vtLayers[key].features, options);
|
|
58
|
+
layers[key].name = key;
|
|
59
|
+
layers[key].version = options.version;
|
|
60
|
+
layers[key].extent = options.extent;
|
|
61
|
+
}
|
|
62
|
+
return fromVectorTileJs({layers});
|
|
63
|
+
}
|
|
64
|
+
*/
|
|
65
|
+
export function normalizeGeojson(geojson) {
|
|
66
|
+
if (geojson.type === 'FeatureCollection') {
|
|
67
|
+
return geojson;
|
|
68
|
+
}
|
|
69
|
+
// Array of features
|
|
70
|
+
if (Array.isArray(geojson)) {
|
|
71
|
+
return {
|
|
72
|
+
type: 'FeatureCollection',
|
|
73
|
+
features: geojson
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// A single feature
|
|
77
|
+
if (geojson.type === 'Feature') {
|
|
78
|
+
return {
|
|
79
|
+
type: 'FeatureCollection',
|
|
80
|
+
features: [geojson]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
throw new Error('Invalid GeoJSON object');
|
|
84
|
+
}
|
|
85
|
+
function convertFeaturesToVectorTileFeatures(features, extent, tileIndex) {
|
|
86
|
+
if (features.every(isVectorTileFeature)) {
|
|
87
|
+
return features;
|
|
88
|
+
}
|
|
89
|
+
return features.map(feature => convertFeatureToVectorTile(feature, extent, tileIndex));
|
|
90
|
+
}
|
|
91
|
+
function convertFeatureToVectorTile(feature, extent, tileIndex) {
|
|
92
|
+
const geometry = feature.geometry;
|
|
93
|
+
const type = getVectorTileType(geometry.type);
|
|
94
|
+
return {
|
|
95
|
+
id: typeof feature.id === 'number' ? feature.id : undefined,
|
|
96
|
+
type,
|
|
97
|
+
geometry: projectGeometryToTileSpace(geometry, extent, tileIndex),
|
|
98
|
+
tags: feature.properties || {}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function projectGeometryToTileSpace(geometry, extent, tileIndex) {
|
|
102
|
+
switch (geometry.type) {
|
|
103
|
+
case 'Point':
|
|
104
|
+
return [projectPointToTile(geometry.coordinates, extent, tileIndex)];
|
|
105
|
+
case 'MultiPoint':
|
|
106
|
+
return geometry.coordinates.map(coord => projectPointToTile(coord, extent, tileIndex));
|
|
107
|
+
case 'LineString':
|
|
108
|
+
return [
|
|
109
|
+
geometry.coordinates.map(coord => projectPointToTile(coord, extent, tileIndex))
|
|
110
|
+
];
|
|
111
|
+
case 'MultiLineString':
|
|
112
|
+
return geometry.coordinates.map(line => line.map(coord => projectPointToTile(coord, extent, tileIndex)));
|
|
113
|
+
case 'Polygon':
|
|
114
|
+
return geometry.coordinates.map(ring => ring.map(coord => projectPointToTile(coord, extent, tileIndex)));
|
|
115
|
+
case 'MultiPolygon':
|
|
116
|
+
return geometry.coordinates.flatMap(polygon => polygon.map(ring => ring.map(coord => projectPointToTile(coord, extent, tileIndex))));
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Unsupported geometry type: ${geometry.type}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function projectPointToTile(point, extent, tileIndex) {
|
|
122
|
+
if (isNormalizedPoint(point)) {
|
|
123
|
+
return [Math.round(point[0] * extent), Math.round(point[1] * extent)];
|
|
124
|
+
}
|
|
125
|
+
if (tileIndex && isLngLatPoint(point)) {
|
|
126
|
+
return projectLngLatToTile(point, tileIndex, extent);
|
|
127
|
+
}
|
|
128
|
+
return [Math.round(point[0]), Math.round(point[1])];
|
|
129
|
+
}
|
|
130
|
+
function isNormalizedPoint(point) {
|
|
131
|
+
return Math.abs(point[0]) <= 1 && Math.abs(point[1]) <= 1;
|
|
132
|
+
}
|
|
133
|
+
function isLngLatPoint(point) {
|
|
134
|
+
return Math.abs(point[0]) <= 180 && Math.abs(point[1]) <= 90;
|
|
135
|
+
}
|
|
136
|
+
function projectLngLatToTile(point, tileIndex, extent) {
|
|
137
|
+
const [lng, lat] = point;
|
|
138
|
+
const { x, y, z } = tileIndex;
|
|
139
|
+
const size = extent * Math.pow(2, z);
|
|
140
|
+
const x0 = extent * x;
|
|
141
|
+
const y0 = extent * y;
|
|
142
|
+
const worldX = ((lng + 180) / 360) * size;
|
|
143
|
+
const worldY = ((180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 180 / 2))) * size) /
|
|
144
|
+
360;
|
|
145
|
+
return [Math.round(worldX - x0), Math.round(worldY - y0)];
|
|
146
|
+
}
|
|
147
|
+
function isVectorTileFeature(feature) {
|
|
148
|
+
return typeof feature?.type === 'number' && Array.isArray(feature.geometry);
|
|
149
|
+
}
|
|
150
|
+
function getVectorTileType(type) {
|
|
151
|
+
switch (type) {
|
|
152
|
+
case 'Point':
|
|
153
|
+
case 'MultiPoint':
|
|
154
|
+
return 1;
|
|
155
|
+
case 'LineString':
|
|
156
|
+
case 'MultiLineString':
|
|
157
|
+
return 2;
|
|
158
|
+
case 'Polygon':
|
|
159
|
+
case 'MultiPolygon':
|
|
160
|
+
return 3;
|
|
161
|
+
default:
|
|
162
|
+
throw new Error(`Unknown geometry type: ${type}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=to-vector-tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-vector-tile.js","sourceRoot":"","sources":["../../../../src/mvt/lib/mapbox-vt-pbf/to-vector-tile.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MVT spec constants
|
|
3
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TileInfo {
|
|
6
|
+
/** repeated Layer */
|
|
7
|
+
layers = 3
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* MVT spec constants
|
|
11
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
12
|
+
* @note Layers are described in section 4.1 of the specification
|
|
13
|
+
*/
|
|
14
|
+
export declare enum LayerInfo {
|
|
15
|
+
/**
|
|
16
|
+
* Any compliant implementation must first read the version
|
|
17
|
+
* number encoded in this message and choose the correct
|
|
18
|
+
* implementation for this version number before proceeding to
|
|
19
|
+
* decode other parts of this message.
|
|
20
|
+
* required uint32 [ default = 1 ];
|
|
21
|
+
*/
|
|
22
|
+
version = 15,
|
|
23
|
+
/** PBF: required string */
|
|
24
|
+
name = 1,
|
|
25
|
+
/** The actual features in this tile.
|
|
26
|
+
* PBF: repeated Feature
|
|
27
|
+
*/
|
|
28
|
+
features = 2,
|
|
29
|
+
/**
|
|
30
|
+
* Dictionary encoding for keys
|
|
31
|
+
* PBF: repeated string
|
|
32
|
+
*/
|
|
33
|
+
keys = 3,
|
|
34
|
+
/**
|
|
35
|
+
* Dictionary encoding for values
|
|
36
|
+
* PBF: repeated Value
|
|
37
|
+
*/
|
|
38
|
+
values = 4,
|
|
39
|
+
/**
|
|
40
|
+
* Although this is an "optional" field it is required by the specification.
|
|
41
|
+
* See https://github.com/mapbox/vector-tile-spec/issues/47
|
|
42
|
+
* PBF: optional uint32 [ default = 4096 ];
|
|
43
|
+
*/
|
|
44
|
+
extent = 5
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
48
|
+
* Features are described in section 4.2 of the specification
|
|
49
|
+
*/
|
|
50
|
+
export declare enum FeatureInfo {
|
|
51
|
+
/** optional uint64 [ default = 0 ]; */
|
|
52
|
+
id = 1,
|
|
53
|
+
/**
|
|
54
|
+
* Tags of this feature are encoded as repeated pairs of integers.
|
|
55
|
+
* A detailed description of tags is located in sections 4.2 and 4.4 of the specification
|
|
56
|
+
* repeated uint32 [ packed = true ];
|
|
57
|
+
*/
|
|
58
|
+
tags = 2,
|
|
59
|
+
/**
|
|
60
|
+
* The type of geometry stored in this feature.
|
|
61
|
+
* GeomType [ default = UNKNOWN ];
|
|
62
|
+
*/
|
|
63
|
+
type = 3,
|
|
64
|
+
/**
|
|
65
|
+
* Contains a stream of commands and parameters (vertices).
|
|
66
|
+
* A detailed description on geometry encoding is located in
|
|
67
|
+
* section 4.3 of the specification.
|
|
68
|
+
* repeated uint32 [ packed = true ];
|
|
69
|
+
*/
|
|
70
|
+
geometry = 4
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* GeomType is described in section 4.3.4 of the specification
|
|
74
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
75
|
+
* */
|
|
76
|
+
export declare enum GeometryType {
|
|
77
|
+
UNKNOWN = 0,
|
|
78
|
+
POINT = 1,
|
|
79
|
+
LINESTRING = 2,
|
|
80
|
+
POLYGON = 3
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Variant type encoding
|
|
84
|
+
* The use of values is described in section 4.1 of the specification
|
|
85
|
+
* @note Exactly one of these values must be present in a valid message
|
|
86
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
87
|
+
*/
|
|
88
|
+
export declare enum PropertyType {
|
|
89
|
+
/** string */
|
|
90
|
+
string_value = 1,//
|
|
91
|
+
/** float */
|
|
92
|
+
float_value = 2,
|
|
93
|
+
/** double */
|
|
94
|
+
double_value = 3,
|
|
95
|
+
/** int64 */
|
|
96
|
+
int_value = 4,
|
|
97
|
+
/** uint64 */
|
|
98
|
+
uint_value = 5,
|
|
99
|
+
/** sint64 */
|
|
100
|
+
sint_value = 6,
|
|
101
|
+
/** bool */
|
|
102
|
+
bool_value = 7
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* "Turtle graphics" style geometry commands
|
|
106
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
107
|
+
*/
|
|
108
|
+
export declare enum Command {
|
|
109
|
+
/** 2 Parameters: dX, dY */
|
|
110
|
+
MoveTo = 1,
|
|
111
|
+
/** 2 Parameters dX, dY */
|
|
112
|
+
LineTo = 2,
|
|
113
|
+
/** No parameters */
|
|
114
|
+
ClosePath = 7
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=mvt-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvt-constants.d.ts","sourceRoot":"","sources":["../../../../src/mvt/lib/mvt-pbf/mvt-constants.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,oBAAY,QAAQ;IAClB,qBAAqB;IACrB,MAAM,IAAI;CACX;AAED;;;;GAIG;AACH,oBAAY,SAAS;IACnB;;;;;;OAMG;IACH,OAAO,KAAK;IAEZ,2BAA2B;IAC3B,IAAI,IAAI;IAER;;OAEG;IACH,QAAQ,IAAI;IAEZ;;;OAGG;IACH,IAAI,IAAI;IAER;;;OAGG;IACH,MAAM,IAAI;IAEV;;;;OAIG;IACH,MAAM,IAAI;CAGX;AAED;;;GAGG;AACH,oBAAY,WAAW;IACrB,uCAAuC;IACvC,EAAE,IAAI;IAEN;;;;OAIG;IACH,IAAI,IAAI;IAER;;;OAGG;IACH,IAAI,IAAI;IAER;;;;;OAKG;IACH,QAAQ,IAAI;CACb;AAED;;;KAGK;AACL,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,KAAK,IAAI;IACT,UAAU,IAAI;IACd,OAAO,IAAI;CACZ;AAED;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,aAAa;IACb,YAAY,IAAI,CAAE,EAAE;IACpB,YAAY;IACZ,WAAW,IAAI;IACf,aAAa;IACb,YAAY,IAAI;IAChB,YAAY;IACZ,SAAS,IAAI;IACb,aAAa;IACb,UAAU,IAAI;IACd,aAAa;IACb,UAAU,IAAI;IACd,WAAW;IACX,UAAU,IAAI;CAEf;AAED;;;GAGG;AACH,oBAAY,OAAO;IACjB,2BAA2B;IAC3B,MAAM,IAAI;IACV,0BAA0B;IAC1B,MAAM,IAAI;IACV,oBAAoB;IACpB,SAAS,IAAI;CACd"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* MVT spec constants
|
|
6
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
7
|
+
*/
|
|
8
|
+
export var TileInfo;
|
|
9
|
+
(function (TileInfo) {
|
|
10
|
+
/** repeated Layer */
|
|
11
|
+
TileInfo[TileInfo["layers"] = 3] = "layers";
|
|
12
|
+
})(TileInfo || (TileInfo = {}));
|
|
13
|
+
/**
|
|
14
|
+
* MVT spec constants
|
|
15
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
16
|
+
* @note Layers are described in section 4.1 of the specification
|
|
17
|
+
*/
|
|
18
|
+
export var LayerInfo;
|
|
19
|
+
(function (LayerInfo) {
|
|
20
|
+
/**
|
|
21
|
+
* Any compliant implementation must first read the version
|
|
22
|
+
* number encoded in this message and choose the correct
|
|
23
|
+
* implementation for this version number before proceeding to
|
|
24
|
+
* decode other parts of this message.
|
|
25
|
+
* required uint32 [ default = 1 ];
|
|
26
|
+
*/
|
|
27
|
+
LayerInfo[LayerInfo["version"] = 15] = "version";
|
|
28
|
+
/** PBF: required string */
|
|
29
|
+
LayerInfo[LayerInfo["name"] = 1] = "name";
|
|
30
|
+
/** The actual features in this tile.
|
|
31
|
+
* PBF: repeated Feature
|
|
32
|
+
*/
|
|
33
|
+
LayerInfo[LayerInfo["features"] = 2] = "features";
|
|
34
|
+
/**
|
|
35
|
+
* Dictionary encoding for keys
|
|
36
|
+
* PBF: repeated string
|
|
37
|
+
*/
|
|
38
|
+
LayerInfo[LayerInfo["keys"] = 3] = "keys";
|
|
39
|
+
/**
|
|
40
|
+
* Dictionary encoding for values
|
|
41
|
+
* PBF: repeated Value
|
|
42
|
+
*/
|
|
43
|
+
LayerInfo[LayerInfo["values"] = 4] = "values";
|
|
44
|
+
/**
|
|
45
|
+
* Although this is an "optional" field it is required by the specification.
|
|
46
|
+
* See https://github.com/mapbox/vector-tile-spec/issues/47
|
|
47
|
+
* PBF: optional uint32 [ default = 4096 ];
|
|
48
|
+
*/
|
|
49
|
+
LayerInfo[LayerInfo["extent"] = 5] = "extent";
|
|
50
|
+
// extensions 16 to max;
|
|
51
|
+
})(LayerInfo || (LayerInfo = {}));
|
|
52
|
+
/**
|
|
53
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
54
|
+
* Features are described in section 4.2 of the specification
|
|
55
|
+
*/
|
|
56
|
+
export var FeatureInfo;
|
|
57
|
+
(function (FeatureInfo) {
|
|
58
|
+
/** optional uint64 [ default = 0 ]; */
|
|
59
|
+
FeatureInfo[FeatureInfo["id"] = 1] = "id";
|
|
60
|
+
/**
|
|
61
|
+
* Tags of this feature are encoded as repeated pairs of integers.
|
|
62
|
+
* A detailed description of tags is located in sections 4.2 and 4.4 of the specification
|
|
63
|
+
* repeated uint32 [ packed = true ];
|
|
64
|
+
*/
|
|
65
|
+
FeatureInfo[FeatureInfo["tags"] = 2] = "tags";
|
|
66
|
+
/**
|
|
67
|
+
* The type of geometry stored in this feature.
|
|
68
|
+
* GeomType [ default = UNKNOWN ];
|
|
69
|
+
*/
|
|
70
|
+
FeatureInfo[FeatureInfo["type"] = 3] = "type";
|
|
71
|
+
/**
|
|
72
|
+
* Contains a stream of commands and parameters (vertices).
|
|
73
|
+
* A detailed description on geometry encoding is located in
|
|
74
|
+
* section 4.3 of the specification.
|
|
75
|
+
* repeated uint32 [ packed = true ];
|
|
76
|
+
*/
|
|
77
|
+
FeatureInfo[FeatureInfo["geometry"] = 4] = "geometry";
|
|
78
|
+
})(FeatureInfo || (FeatureInfo = {}));
|
|
79
|
+
/**
|
|
80
|
+
* GeomType is described in section 4.3.4 of the specification
|
|
81
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
82
|
+
* */
|
|
83
|
+
export var GeometryType;
|
|
84
|
+
(function (GeometryType) {
|
|
85
|
+
GeometryType[GeometryType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
86
|
+
GeometryType[GeometryType["POINT"] = 1] = "POINT";
|
|
87
|
+
GeometryType[GeometryType["LINESTRING"] = 2] = "LINESTRING";
|
|
88
|
+
GeometryType[GeometryType["POLYGON"] = 3] = "POLYGON";
|
|
89
|
+
})(GeometryType || (GeometryType = {}));
|
|
90
|
+
/**
|
|
91
|
+
* Variant type encoding
|
|
92
|
+
* The use of values is described in section 4.1 of the specification
|
|
93
|
+
* @note Exactly one of these values must be present in a valid message
|
|
94
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
95
|
+
*/
|
|
96
|
+
export var PropertyType;
|
|
97
|
+
(function (PropertyType) {
|
|
98
|
+
/** string */
|
|
99
|
+
PropertyType[PropertyType["string_value"] = 1] = "string_value";
|
|
100
|
+
/** float */
|
|
101
|
+
PropertyType[PropertyType["float_value"] = 2] = "float_value";
|
|
102
|
+
/** double */
|
|
103
|
+
PropertyType[PropertyType["double_value"] = 3] = "double_value";
|
|
104
|
+
/** int64 */
|
|
105
|
+
PropertyType[PropertyType["int_value"] = 4] = "int_value";
|
|
106
|
+
/** uint64 */
|
|
107
|
+
PropertyType[PropertyType["uint_value"] = 5] = "uint_value";
|
|
108
|
+
/** sint64 */
|
|
109
|
+
PropertyType[PropertyType["sint_value"] = 6] = "sint_value";
|
|
110
|
+
/** bool */
|
|
111
|
+
PropertyType[PropertyType["bool_value"] = 7] = "bool_value";
|
|
112
|
+
// extensions 8 to max;
|
|
113
|
+
})(PropertyType || (PropertyType = {}));
|
|
114
|
+
/**
|
|
115
|
+
* "Turtle graphics" style geometry commands
|
|
116
|
+
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
|
|
117
|
+
*/
|
|
118
|
+
export var Command;
|
|
119
|
+
(function (Command) {
|
|
120
|
+
/** 2 Parameters: dX, dY */
|
|
121
|
+
Command[Command["MoveTo"] = 1] = "MoveTo";
|
|
122
|
+
/** 2 Parameters dX, dY */
|
|
123
|
+
Command[Command["LineTo"] = 2] = "LineTo";
|
|
124
|
+
/** No parameters */
|
|
125
|
+
Command[Command["ClosePath"] = 7] = "ClosePath";
|
|
126
|
+
})(Command || (Command = {}));
|
|
127
|
+
//# sourceMappingURL=mvt-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvt-constants.js","sourceRoot":"","sources":["../../../../src/mvt/lib/mvt-pbf/mvt-constants.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,gCAAgC;AAEhC;;;GAGG;AACH,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qBAAqB;IACrB,2CAAU,CAAA;AACZ,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,SAsCX;AAtCD,WAAY,SAAS;IACnB;;;;;;OAMG;IACH,gDAAY,CAAA;IAEZ,2BAA2B;IAC3B,yCAAQ,CAAA;IAER;;OAEG;IACH,iDAAY,CAAA;IAEZ;;;OAGG;IACH,yCAAQ,CAAA;IAER;;;OAGG;IACH,6CAAU,CAAA;IAEV;;;;OAIG;IACH,6CAAU,CAAA;IAEV,wBAAwB;AAC1B,CAAC,EAtCW,SAAS,KAAT,SAAS,QAsCpB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,WAwBX;AAxBD,WAAY,WAAW;IACrB,uCAAuC;IACvC,yCAAM,CAAA;IAEN;;;;OAIG;IACH,6CAAQ,CAAA;IAER;;;OAGG;IACH,6CAAQ,CAAA;IAER;;;;;OAKG;IACH,qDAAY,CAAA;AACd,CAAC,EAxBW,WAAW,KAAX,WAAW,QAwBtB;AAED;;;KAGK;AACL,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,iDAAS,CAAA;IACT,2DAAc,CAAA;IACd,qDAAW,CAAA;AACb,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAgBX;AAhBD,WAAY,YAAY;IACtB,aAAa;IACb,+DAAgB,CAAA;IAChB,YAAY;IACZ,6DAAe,CAAA;IACf,aAAa;IACb,+DAAgB,CAAA;IAChB,YAAY;IACZ,yDAAa,CAAA;IACb,aAAa;IACb,2DAAc,CAAA;IACd,aAAa;IACb,2DAAc,CAAA;IACd,WAAW;IACX,2DAAc,CAAA;IACd,uBAAuB;AACzB,CAAC,EAhBW,YAAY,KAAZ,YAAY,QAgBvB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,OAOX;AAPD,WAAY,OAAO;IACjB,2BAA2B;IAC3B,yCAAU,CAAA;IACV,0BAA0B;IAC1B,yCAAU,CAAA;IACV,oBAAoB;IACpB,+CAAa,CAAA;AACf,CAAC,EAPW,OAAO,KAAP,OAAO,QAOlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Schema, FlatIndexedGeometry } from '@loaders.gl/core/schema';
|
|
2
|
+
export type MVTTile = {
|
|
3
|
+
layers: Record<string, MVTLayer>;
|
|
4
|
+
};
|
|
5
|
+
export type MVTLayer = {
|
|
6
|
+
version: number;
|
|
7
|
+
name: string;
|
|
8
|
+
extent: number;
|
|
9
|
+
length: number;
|
|
10
|
+
schema: Schema;
|
|
11
|
+
columns: Record<string, (string | number | boolean | null)[]>;
|
|
12
|
+
idColumn: number[];
|
|
13
|
+
boundingBoxColumn: [number, number, number, number][];
|
|
14
|
+
geometryTypeColumn: number[];
|
|
15
|
+
geometryColumn: FlatIndexedGeometry[];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=mvt-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvt-types.d.ts","sourceRoot":"","sources":["../../../../src/mvt/lib/mvt-pbf/mvt-types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACtD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,cAAc,EAAE,mBAAmB,EAAE,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvt-types.js","sourceRoot":"","sources":["../../../../src/mvt/lib/mvt-pbf/mvt-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,gCAAgC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { FlatIndexedGeometry } from '@loaders.gl/core/schema';
|
|
2
|
+
import Protobuf from 'pbf';
|
|
3
|
+
type GeometryCommand = {
|
|
4
|
+
type: 'moveto' | 'lineto' | 'closepath';
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function makeMVTGeometryCommandIterator(pbf: Protobuf): IterableIterator<GeometryCommand>;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a bounding box from the feature geometry at the current position
|
|
11
|
+
* @todo - Reparses the entire PBF geometry - replace with a generic bounding box calculation on parsed data?
|
|
12
|
+
*/
|
|
13
|
+
export declare function readBoundingBoxFromPBF(pbf: Protobuf): [number, number, number, number];
|
|
14
|
+
/**
|
|
15
|
+
* Extract intermediate Flat GeoJSON
|
|
16
|
+
* data format, which maps closely to the binary data buffers.
|
|
17
|
+
* It is similar to GeoJSON, but rather than storing the coordinates
|
|
18
|
+
* in multidimensional arrays, we have a 1D `data` with all the
|
|
19
|
+
* coordinates, and then index into this using the `indices`
|
|
20
|
+
* parameter, e.g.
|
|
21
|
+
*
|
|
22
|
+
* geometry: {
|
|
23
|
+
* type: 'Point', data: [1,2], indices: [0]
|
|
24
|
+
* }
|
|
25
|
+
* geometry: {
|
|
26
|
+
* type: 'LineString', data: [1,2,3,4,...], indices: [0]
|
|
27
|
+
* }
|
|
28
|
+
* geometry: {
|
|
29
|
+
* type: 'Polygon', data: [1,2,3,4,...], indices: [[0, 2]]
|
|
30
|
+
* }
|
|
31
|
+
* Thus the indices member lets us look up the relevant range
|
|
32
|
+
* from the data array.
|
|
33
|
+
* The Multi* versions of the above types share the same data
|
|
34
|
+
* structure, just with multiple elements in the indices array
|
|
35
|
+
*/
|
|
36
|
+
export declare function loadFlatGeometryFromPBF(pbf: Protobuf): FlatIndexedGeometry;
|
|
37
|
+
export {};
|
|
38
|
+
/**
|
|
39
|
+
* Load a GeoJSON style Geometry from the raw PBF
|
|
40
|
+
*
|
|
41
|
+
function readGeoJSONGeometryFromPBF(pbf): number[][][] {
|
|
42
|
+
const lines: number[][][] = [];
|
|
43
|
+
let line: number[][] | undefined;
|
|
44
|
+
|
|
45
|
+
for (const command of makeMVTGeometryCommandIterator(pbf)) {
|
|
46
|
+
switch (command.type) {
|
|
47
|
+
case 'moveto':
|
|
48
|
+
// moveTo
|
|
49
|
+
if (line) lines.push(line);
|
|
50
|
+
line = [];
|
|
51
|
+
if (line) line.push([command.x, command.y]);
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'lineto':
|
|
55
|
+
if (line) line.push([command.x, command.y]);
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 'closepath':
|
|
59
|
+
// Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90
|
|
60
|
+
if (line) {
|
|
61
|
+
line.push(line[0].slice()); // closePolygon
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
// just for eslint
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (line) {
|
|
71
|
+
lines.push(line);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return lines;
|
|
75
|
+
}
|
|
76
|
+
*/
|
|
77
|
+
//# sourceMappingURL=parse-geometry-from-pbf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-geometry-from-pbf.d.ts","sourceRoot":"","sources":["../../../../src/mvt/lib/mvt-pbf/parse-geometry-from-pbf.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAIV,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,QAAQ,MAAM,KAAK,CAAC;AAa3B,KAAK,eAAe,GAAG;IAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAEvF,wBAAiB,8BAA8B,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,eAAe,CAAC,CA0ChG;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAuBtF;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,mBAAmB,CAuC1E;;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCE"}
|