@loaders.gl/geospatial 0.0.0-stage → 5.0.0-alpha.14
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 +52 -0
- package/README.md +8 -2
- package/dist/dbf-worker.js +17099 -0
- package/dist/dbf.d.ts +2 -0
- package/dist/dbf.d.ts.map +1 -0
- package/dist/dbf.js +5 -0
- package/dist/dbf.js.map +1 -0
- package/dist/flatgeobuf/bundled.d.ts +3 -0
- package/dist/flatgeobuf/bundled.d.ts.map +1 -0
- package/dist/flatgeobuf/bundled.js +5 -0
- package/dist/flatgeobuf/bundled.js.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-format.d.ts +12 -0
- package/dist/flatgeobuf/flatgeobuf-format.d.ts.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-format.js +15 -0
- package/dist/flatgeobuf/flatgeobuf-format.js.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-loader-types.d.ts +104 -0
- package/dist/flatgeobuf/flatgeobuf-loader-types.d.ts.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-loader-types.js +36 -0
- package/dist/flatgeobuf/flatgeobuf-loader-types.js.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-loader.d.ts +59 -0
- package/dist/flatgeobuf/flatgeobuf-loader.d.ts.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-loader.js +38 -0
- package/dist/flatgeobuf/flatgeobuf-loader.js.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-source-loader.d.ts +105 -0
- package/dist/flatgeobuf/flatgeobuf-source-loader.d.ts.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-source-loader.js +240 -0
- package/dist/flatgeobuf/flatgeobuf-source-loader.js.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-table-query-capabilities.d.ts +4 -0
- package/dist/flatgeobuf/flatgeobuf-table-query-capabilities.d.ts.map +1 -0
- package/dist/flatgeobuf/flatgeobuf-table-query-capabilities.js +12 -0
- package/dist/flatgeobuf/flatgeobuf-table-query-capabilities.js.map +1 -0
- package/dist/flatgeobuf/index.cjs +5543 -0
- package/dist/flatgeobuf/index.cjs.map +6 -0
- package/dist/flatgeobuf/index.d.ts +9 -0
- package/dist/flatgeobuf/index.d.ts.map +1 -0
- package/dist/flatgeobuf/index.js +11 -0
- package/dist/flatgeobuf/index.js.map +1 -0
- package/dist/flatgeobuf/lib/flatgeobuf-reader.d.ts +97 -0
- package/dist/flatgeobuf/lib/flatgeobuf-reader.d.ts.map +1 -0
- package/dist/flatgeobuf/lib/flatgeobuf-reader.js +577 -0
- package/dist/flatgeobuf/lib/flatgeobuf-reader.js.map +1 -0
- package/dist/flatgeobuf/lib/flatgeobuf-worker-transport.d.ts +8 -0
- package/dist/flatgeobuf/lib/flatgeobuf-worker-transport.d.ts.map +1 -0
- package/dist/flatgeobuf/lib/flatgeobuf-worker-transport.js +44 -0
- package/dist/flatgeobuf/lib/flatgeobuf-worker-transport.js.map +1 -0
- package/dist/flatgeobuf/lib/parse-flatgeobuf.d.ts +36 -0
- package/dist/flatgeobuf/lib/parse-flatgeobuf.d.ts.map +1 -0
- package/dist/flatgeobuf/lib/parse-flatgeobuf.js +269 -0
- package/dist/flatgeobuf/lib/parse-flatgeobuf.js.map +1 -0
- package/dist/flatgeobuf/unbundled.d.ts +3 -0
- package/dist/flatgeobuf/unbundled.d.ts.map +1 -0
- package/dist/flatgeobuf/unbundled.js +5 -0
- package/dist/flatgeobuf/unbundled.js.map +1 -0
- package/dist/flatgeobuf-worker.js +32891 -0
- package/dist/flatgeobuf.d.ts +2 -0
- package/dist/flatgeobuf.d.ts.map +1 -0
- package/dist/flatgeobuf.js +5 -0
- package/dist/flatgeobuf.js.map +1 -0
- package/dist/geopackage/bundled.d.ts +3 -0
- package/dist/geopackage/bundled.d.ts.map +1 -0
- package/dist/geopackage/bundled.js +5 -0
- package/dist/geopackage/bundled.js.map +1 -0
- package/dist/geopackage/geopackage-format.d.ts +11 -0
- package/dist/geopackage/geopackage-format.d.ts.map +1 -0
- package/dist/geopackage/geopackage-format.js +14 -0
- package/dist/geopackage/geopackage-format.js.map +1 -0
- package/dist/geopackage/geopackage-loader-options.d.ts +5 -0
- package/dist/geopackage/geopackage-loader-options.d.ts.map +1 -0
- package/dist/geopackage/geopackage-loader-options.js +12 -0
- package/dist/geopackage/geopackage-loader-options.js.map +1 -0
- package/dist/geopackage/geopackage-loader-types.d.ts +72 -0
- package/dist/geopackage/geopackage-loader-types.d.ts.map +1 -0
- package/dist/geopackage/geopackage-loader-types.js +30 -0
- package/dist/geopackage/geopackage-loader-types.js.map +1 -0
- package/dist/geopackage/geopackage-loader.d.ts +26 -0
- package/dist/geopackage/geopackage-loader.d.ts.map +1 -0
- package/dist/geopackage/geopackage-loader.js +12 -0
- package/dist/geopackage/geopackage-loader.js.map +1 -0
- package/dist/geopackage/geopackage-source-loader.d.ts +99 -0
- package/dist/geopackage/geopackage-source-loader.d.ts.map +1 -0
- package/dist/geopackage/geopackage-source-loader.js +258 -0
- package/dist/geopackage/geopackage-source-loader.js.map +1 -0
- package/dist/geopackage/index.cjs +4433 -0
- package/dist/geopackage/index.cjs.map +6 -0
- package/dist/geopackage/index.d.ts +7 -0
- package/dist/geopackage/index.d.ts.map +1 -0
- package/dist/geopackage/index.js +7 -0
- package/dist/geopackage/index.js.map +1 -0
- package/dist/geopackage/lib/geopackage-tile-metadata.d.ts +22 -0
- package/dist/geopackage/lib/geopackage-tile-metadata.d.ts.map +1 -0
- package/dist/geopackage/lib/geopackage-tile-metadata.js +105 -0
- package/dist/geopackage/lib/geopackage-tile-metadata.js.map +1 -0
- package/dist/geopackage/lib/parse-geopackage.d.ts +39 -0
- package/dist/geopackage/lib/parse-geopackage.d.ts.map +1 -0
- package/dist/geopackage/lib/parse-geopackage.js +485 -0
- package/dist/geopackage/lib/parse-geopackage.js.map +1 -0
- package/dist/geopackage/lib/types.d.ts +216 -0
- package/dist/geopackage/lib/types.d.ts.map +1 -0
- package/dist/geopackage/lib/types.js +5 -0
- package/dist/geopackage/lib/types.js.map +1 -0
- package/dist/geopackage/unbundled.d.ts +3 -0
- package/dist/geopackage/unbundled.d.ts.map +1 -0
- package/dist/geopackage/unbundled.js +5 -0
- package/dist/geopackage/unbundled.js.map +1 -0
- package/dist/geopackage.d.ts +2 -0
- package/dist/geopackage.d.ts.map +1 -0
- package/dist/geopackage.js +5 -0
- package/dist/geopackage.js.map +1 -0
- package/dist/gpx.d.ts +2 -0
- package/dist/gpx.d.ts.map +1 -0
- package/dist/gpx.js +5 -0
- package/dist/gpx.js.map +1 -0
- package/dist/index.cjs +15191 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/kml/bundled.d.ts +13 -0
- package/dist/kml/bundled.d.ts.map +1 -0
- package/dist/kml/bundled.js +10 -0
- package/dist/kml/bundled.js.map +1 -0
- package/dist/kml/gpx-loader-types.d.ts +61 -0
- package/dist/kml/gpx-loader-types.d.ts.map +1 -0
- package/dist/kml/gpx-loader-types.js +25 -0
- package/dist/kml/gpx-loader-types.js.map +1 -0
- package/dist/kml/gpx-loader.d.ts +56 -0
- package/dist/kml/gpx-loader.d.ts.map +1 -0
- package/dist/kml/gpx-loader.js +62 -0
- package/dist/kml/gpx-loader.js.map +1 -0
- package/dist/kml/index.cjs +11435 -0
- package/dist/kml/index.cjs.map +6 -0
- package/dist/kml/index.d.ts +18 -0
- package/dist/kml/index.d.ts.map +1 -0
- package/dist/kml/index.js +13 -0
- package/dist/kml/index.js.map +1 -0
- package/dist/kml/kml-format.d.ts +50 -0
- package/dist/kml/kml-format.d.ts.map +1 -0
- package/dist/kml/kml-format.js +62 -0
- package/dist/kml/kml-format.js.map +1 -0
- package/dist/kml/kml-loader-types.d.ts +61 -0
- package/dist/kml/kml-loader-types.d.ts.map +1 -0
- package/dist/kml/kml-loader-types.js +25 -0
- package/dist/kml/kml-loader-types.js.map +1 -0
- package/dist/kml/kml-loader.d.ts +56 -0
- package/dist/kml/kml-loader.d.ts.map +1 -0
- package/dist/kml/kml-loader.js +60 -0
- package/dist/kml/kml-loader.js.map +1 -0
- package/dist/kml/kml-parser.d.ts +98 -0
- package/dist/kml/kml-parser.d.ts.map +1 -0
- package/dist/kml/kml-parser.js +461 -0
- package/dist/kml/kml-parser.js.map +1 -0
- package/dist/kml/kml-writer.d.ts +64 -0
- package/dist/kml/kml-writer.d.ts.map +1 -0
- package/dist/kml/kml-writer.js +202 -0
- package/dist/kml/kml-writer.js.map +1 -0
- package/dist/kml/kmz-archive.d.ts +19 -0
- package/dist/kml/kmz-archive.d.ts.map +1 -0
- package/dist/kml/kmz-archive.js +72 -0
- package/dist/kml/kmz-archive.js.map +1 -0
- package/dist/kml/kmz-loader-types.d.ts +58 -0
- package/dist/kml/kmz-loader-types.d.ts.map +1 -0
- package/dist/kml/kmz-loader-types.js +24 -0
- package/dist/kml/kmz-loader-types.js.map +1 -0
- package/dist/kml/kmz-loader.d.ts +29 -0
- package/dist/kml/kmz-loader.d.ts.map +1 -0
- package/dist/kml/kmz-loader.js +41 -0
- package/dist/kml/kmz-loader.js.map +1 -0
- package/dist/kml/kmz-source.d.ts +62 -0
- package/dist/kml/kmz-source.d.ts.map +1 -0
- package/dist/kml/kmz-source.js +177 -0
- package/dist/kml/kmz-source.js.map +1 -0
- package/dist/kml/lib/feature-collection-to-arrow.d.ts +90 -0
- package/dist/kml/lib/feature-collection-to-arrow.d.ts.map +1 -0
- package/dist/kml/lib/feature-collection-to-arrow.js +181 -0
- package/dist/kml/lib/feature-collection-to-arrow.js.map +1 -0
- package/dist/kml/sports-track-parser.d.ts +6 -0
- package/dist/kml/sports-track-parser.d.ts.map +1 -0
- package/dist/kml/sports-track-parser.js +411 -0
- package/dist/kml/sports-track-parser.js.map +1 -0
- package/dist/kml/tcx-loader-types.d.ts +61 -0
- package/dist/kml/tcx-loader-types.d.ts.map +1 -0
- package/dist/kml/tcx-loader-types.js +25 -0
- package/dist/kml/tcx-loader-types.js.map +1 -0
- package/dist/kml/tcx-loader.d.ts +56 -0
- package/dist/kml/tcx-loader.d.ts.map +1 -0
- package/dist/kml/tcx-loader.js +62 -0
- package/dist/kml/tcx-loader.js.map +1 -0
- package/dist/kml/unbundled.d.ts +13 -0
- package/dist/kml/unbundled.d.ts.map +1 -0
- package/dist/kml/unbundled.js +10 -0
- package/dist/kml/unbundled.js.map +1 -0
- package/dist/kml.d.ts +2 -0
- package/dist/kml.d.ts.map +1 -0
- package/dist/kml.js +5 -0
- package/dist/kml.js.map +1 -0
- package/dist/kmz.d.ts +2 -0
- package/dist/kmz.d.ts.map +1 -0
- package/dist/kmz.js +5 -0
- package/dist/kmz.js.map +1 -0
- package/dist/shapefile/bundled.d.ts +7 -0
- package/dist/shapefile/bundled.d.ts.map +1 -0
- package/dist/shapefile/bundled.js +7 -0
- package/dist/shapefile/bundled.js.map +1 -0
- package/dist/shapefile/dbf-format.d.ts +12 -0
- package/dist/shapefile/dbf-format.d.ts.map +1 -0
- package/dist/shapefile/dbf-format.js +15 -0
- package/dist/shapefile/dbf-format.js.map +1 -0
- package/dist/shapefile/dbf-loader-types.d.ts +15 -0
- package/dist/shapefile/dbf-loader-types.d.ts.map +1 -0
- package/dist/shapefile/dbf-loader-types.js +34 -0
- package/dist/shapefile/dbf-loader-types.js.map +1 -0
- package/dist/shapefile/dbf-loader.d.ts +49 -0
- package/dist/shapefile/dbf-loader.d.ts.map +1 -0
- package/dist/shapefile/dbf-loader.js +39 -0
- package/dist/shapefile/dbf-loader.js.map +1 -0
- package/dist/shapefile/index.cjs +5742 -0
- package/dist/shapefile/index.cjs.map +6 -0
- package/dist/shapefile/index.d.ts +16 -0
- package/dist/shapefile/index.d.ts.map +1 -0
- package/dist/shapefile/index.js +18 -0
- package/dist/shapefile/index.js.map +1 -0
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.d.ts +18 -0
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.js +129 -0
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.js.map +1 -0
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.d.ts +12 -0
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.js +206 -0
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-dbf-to-arrow.d.ts +26 -0
- package/dist/shapefile/lib/parsers/parse-dbf-to-arrow.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-dbf-to-arrow.js +347 -0
- package/dist/shapefile/lib/parsers/parse-dbf-to-arrow.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-dbf.d.ts +14 -0
- package/dist/shapefile/lib/parsers/parse-dbf.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-dbf.js +352 -0
- package/dist/shapefile/lib/parsers/parse-dbf.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shapefile.d.ts +50 -0
- package/dist/shapefile/lib/parsers/parse-shapefile.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shapefile.js +306 -0
- package/dist/shapefile/lib/parsers/parse-shapefile.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-geometry.d.ts +50 -0
- package/dist/shapefile/lib/parsers/parse-shp-geometry.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-geometry.js +384 -0
- package/dist/shapefile/lib/parsers/parse-shp-geometry.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-header.d.ts +26 -0
- package/dist/shapefile/lib/parsers/parse-shp-header.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-header.js +43 -0
- package/dist/shapefile/lib/parsers/parse-shp-header.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.d.ts +5 -0
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.js +130 -0
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp.d.ts +24 -0
- package/dist/shapefile/lib/parsers/parse-shp.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shp.js +194 -0
- package/dist/shapefile/lib/parsers/parse-shp.js.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shx.d.ts +10 -0
- package/dist/shapefile/lib/parsers/parse-shx.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/parse-shx.js +28 -0
- package/dist/shapefile/lib/parsers/parse-shx.js.map +1 -0
- package/dist/shapefile/lib/parsers/types.d.ts +85 -0
- package/dist/shapefile/lib/parsers/types.d.ts.map +1 -0
- package/dist/shapefile/lib/parsers/types.js +5 -0
- package/dist/shapefile/lib/parsers/types.js.map +1 -0
- package/dist/shapefile/lib/shapefile-worker-transport.d.ts +10 -0
- package/dist/shapefile/lib/shapefile-worker-transport.d.ts.map +1 -0
- package/dist/shapefile/lib/shapefile-worker-transport.js +46 -0
- package/dist/shapefile/lib/shapefile-worker-transport.js.map +1 -0
- package/dist/shapefile/lib/streaming/binary-chunk-reader.d.ts +2 -0
- package/dist/shapefile/lib/streaming/binary-chunk-reader.d.ts.map +1 -0
- package/dist/shapefile/lib/streaming/binary-chunk-reader.js +5 -0
- package/dist/shapefile/lib/streaming/binary-chunk-reader.js.map +1 -0
- package/dist/shapefile/lib/streaming/binary-reader.d.ts +32 -0
- package/dist/shapefile/lib/streaming/binary-reader.d.ts.map +1 -0
- package/dist/shapefile/lib/streaming/binary-reader.js +55 -0
- package/dist/shapefile/lib/streaming/binary-reader.js.map +1 -0
- package/dist/shapefile/lib/streaming/zip-batch-iterators.d.ts +11 -0
- package/dist/shapefile/lib/streaming/zip-batch-iterators.d.ts.map +1 -0
- package/dist/shapefile/lib/streaming/zip-batch-iterators.js +67 -0
- package/dist/shapefile/lib/streaming/zip-batch-iterators.js.map +1 -0
- package/dist/shapefile/shapefile-arrow-loader.d.ts +8 -0
- package/dist/shapefile/shapefile-arrow-loader.d.ts.map +1 -0
- package/dist/shapefile/shapefile-arrow-loader.js +316 -0
- package/dist/shapefile/shapefile-arrow-loader.js.map +1 -0
- package/dist/shapefile/shapefile-loader-types.d.ts +80 -0
- package/dist/shapefile/shapefile-loader-types.d.ts.map +1 -0
- package/dist/shapefile/shapefile-loader-types.js +29 -0
- package/dist/shapefile/shapefile-loader-types.js.map +1 -0
- package/dist/shapefile/shapefile-loader.d.ts +57 -0
- package/dist/shapefile/shapefile-loader.d.ts.map +1 -0
- package/dist/shapefile/shapefile-loader.js +29 -0
- package/dist/shapefile/shapefile-loader.js.map +1 -0
- package/dist/shapefile/shp-format.d.ts +27 -0
- package/dist/shapefile/shp-format.d.ts.map +1 -0
- package/dist/shapefile/shp-format.js +31 -0
- package/dist/shapefile/shp-format.js.map +1 -0
- package/dist/shapefile/shp-loader-types.d.ts +28 -0
- package/dist/shapefile/shp-loader-types.d.ts.map +1 -0
- package/dist/shapefile/shp-loader-types.js +31 -0
- package/dist/shapefile/shp-loader-types.js.map +1 -0
- package/dist/shapefile/shp-loader.d.ts +54 -0
- package/dist/shapefile/shp-loader.d.ts.map +1 -0
- package/dist/shapefile/shp-loader.js +38 -0
- package/dist/shapefile/shp-loader.js.map +1 -0
- package/dist/shapefile/unbundled.d.ts +7 -0
- package/dist/shapefile/unbundled.d.ts.map +1 -0
- package/dist/shapefile/unbundled.js +7 -0
- package/dist/shapefile/unbundled.js.map +1 -0
- package/dist/shapefile.d.ts +2 -0
- package/dist/shapefile.d.ts.map +1 -0
- package/dist/shapefile.js +5 -0
- package/dist/shapefile.js.map +1 -0
- package/dist/shp-worker.js +20232 -0
- package/dist/shp.d.ts +2 -0
- package/dist/shp.d.ts.map +1 -0
- package/dist/shp.js +5 -0
- package/dist/shp.js.map +1 -0
- package/dist/tcx.d.ts +2 -0
- package/dist/tcx.d.ts.map +1 -0
- package/dist/tcx.js +5 -0
- package/dist/tcx.js.map +1 -0
- package/dist/workers/dbf-worker.d.ts +2 -0
- package/dist/workers/dbf-worker.d.ts.map +1 -0
- package/dist/workers/dbf-worker.js +7 -0
- package/dist/workers/dbf-worker.js.map +1 -0
- package/dist/workers/flatgeobuf-worker.d.ts +2 -0
- package/dist/workers/flatgeobuf-worker.d.ts.map +1 -0
- package/dist/workers/flatgeobuf-worker.js +7 -0
- package/dist/workers/flatgeobuf-worker.js.map +1 -0
- package/dist/workers/geopackage-worker.d.ts +2 -0
- package/dist/workers/geopackage-worker.d.ts.map +1 -0
- package/dist/workers/geopackage-worker.js +7 -0
- package/dist/workers/geopackage-worker.js.map +1 -0
- package/dist/workers/shp-worker.d.ts +2 -0
- package/dist/workers/shp-worker.d.ts.map +1 -0
- package/dist/workers/shp-worker.js +7 -0
- package/dist/workers/shp-worker.js.map +1 -0
- package/package.json +291 -4
- package/src/dbf.ts +5 -0
- package/src/flatgeobuf/LICENSE +9 -0
- package/src/flatgeobuf/bundled.ts +9 -0
- package/src/flatgeobuf/flatgeobuf-format.ts +17 -0
- package/src/flatgeobuf/flatgeobuf-loader-types.ts +70 -0
- package/src/flatgeobuf/flatgeobuf-loader.ts +66 -0
- package/src/flatgeobuf/flatgeobuf-source-loader.ts +338 -0
- package/src/flatgeobuf/flatgeobuf-table-query-capabilities.ts +14 -0
- package/src/flatgeobuf/index.ts +24 -0
- package/src/flatgeobuf/lib/flatgeobuf-reader.ts +719 -0
- package/src/flatgeobuf/lib/flatgeobuf-worker-transport.ts +63 -0
- package/src/flatgeobuf/lib/parse-flatgeobuf.ts +383 -0
- package/src/flatgeobuf/unbundled.ts +6 -0
- package/src/flatgeobuf.ts +5 -0
- package/src/geopackage/bundled.ts +6 -0
- package/src/geopackage/geopackage-format.ts +16 -0
- package/src/geopackage/geopackage-loader-options.ts +13 -0
- package/src/geopackage/geopackage-loader-types.ts +60 -0
- package/src/geopackage/geopackage-loader.ts +21 -0
- package/src/geopackage/geopackage-source-loader.ts +364 -0
- package/src/geopackage/index.ts +16 -0
- package/src/geopackage/lib/geopackage-tile-metadata.ts +156 -0
- package/src/geopackage/lib/parse-geopackage.ts +679 -0
- package/src/geopackage/lib/types.ts +293 -0
- package/src/geopackage/unbundled.ts +6 -0
- package/src/geopackage.ts +5 -0
- package/src/gpx.ts +5 -0
- package/src/index.ts +30 -0
- package/src/kml/bundled.ts +21 -0
- package/src/kml/gpx-loader-types.ts +50 -0
- package/src/kml/gpx-loader.ts +101 -0
- package/src/kml/index.ts +39 -0
- package/src/kml/kml-format.ts +70 -0
- package/src/kml/kml-loader-types.ts +46 -0
- package/src/kml/kml-loader.ts +98 -0
- package/src/kml/kml-parser.ts +593 -0
- package/src/kml/kml-writer.ts +252 -0
- package/src/kml/kmz-archive.ts +92 -0
- package/src/kml/kmz-loader-types.ts +37 -0
- package/src/kml/kmz-loader.ts +56 -0
- package/src/kml/kmz-source.ts +234 -0
- package/src/kml/lib/feature-collection-to-arrow.ts +231 -0
- package/src/kml/sports-track-parser.ts +426 -0
- package/src/kml/tcx-loader-types.ts +50 -0
- package/src/kml/tcx-loader.ts +101 -0
- package/src/kml/unbundled.ts +21 -0
- package/src/kml.ts +5 -0
- package/src/kmz.ts +5 -0
- package/src/shapefile/bundled.ts +18 -0
- package/src/shapefile/dbf-format.ts +17 -0
- package/src/shapefile/dbf-loader-types.ts +51 -0
- package/src/shapefile/dbf-loader.ts +79 -0
- package/src/shapefile/index.ts +25 -0
- package/src/shapefile/lib/parsers/build-geoarrow-geometry-arrow.ts +172 -0
- package/src/shapefile/lib/parsers/build-wkb-geometry-arrow.ts +340 -0
- package/src/shapefile/lib/parsers/parse-dbf-to-arrow.ts +429 -0
- package/src/shapefile/lib/parsers/parse-dbf.ts +422 -0
- package/src/shapefile/lib/parsers/parse-shapefile.ts +417 -0
- package/src/shapefile/lib/parsers/parse-shp-geometry.ts +527 -0
- package/src/shapefile/lib/parsers/parse-shp-header.ts +64 -0
- package/src/shapefile/lib/parsers/parse-shp-to-arrow.ts +184 -0
- package/src/shapefile/lib/parsers/parse-shp.ts +245 -0
- package/src/shapefile/lib/parsers/parse-shx.ts +39 -0
- package/src/shapefile/lib/parsers/types.ts +96 -0
- package/src/shapefile/lib/shapefile-worker-transport.ts +72 -0
- package/src/shapefile/lib/streaming/binary-chunk-reader.ts +8 -0
- package/src/shapefile/lib/streaming/binary-reader.ts +60 -0
- package/src/shapefile/lib/streaming/zip-batch-iterators.ts +78 -0
- package/src/shapefile/shapefile-arrow-loader.ts +448 -0
- package/src/shapefile/shapefile-loader-types.ts +70 -0
- package/src/shapefile/shapefile-loader.ts +76 -0
- package/src/shapefile/shp-format.ts +34 -0
- package/src/shapefile/shp-loader-types.ts +60 -0
- package/src/shapefile/shp-loader.ts +80 -0
- package/src/shapefile/unbundled.ts +12 -0
- package/src/shapefile.ts +5 -0
- package/src/shp.ts +5 -0
- package/src/tcx.ts +5 -0
- package/src/workers/dbf-worker.ts +8 -0
- package/src/workers/flatgeobuf-worker.ts +8 -0
- package/src/workers/geopackage-worker.ts +8 -0
- package/src/workers/shp-worker.ts +8 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {WKTCRSDefinition} from '@math.gl/geospatial/crs';
|
|
6
|
+
|
|
7
|
+
/* eslint-disable camelcase */
|
|
8
|
+
export interface GeometryBitFlags {
|
|
9
|
+
littleEndian: boolean;
|
|
10
|
+
envelopeLength: number;
|
|
11
|
+
emptyGeometry: boolean;
|
|
12
|
+
extendedGeometryType: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ProjectionMapping = {[srsId: number]: WKTCRSDefinition};
|
|
16
|
+
export type DataColumnsMapping = {[columnName: string]: string | null};
|
|
17
|
+
export type SQLiteTypes =
|
|
18
|
+
| 'BOOLEAN'
|
|
19
|
+
| 'TINYINT'
|
|
20
|
+
| 'SMALLINT'
|
|
21
|
+
| 'MEDIUMINT'
|
|
22
|
+
| 'INT'
|
|
23
|
+
| 'INTEGER'
|
|
24
|
+
| 'FLOAT'
|
|
25
|
+
| 'DOUBLE'
|
|
26
|
+
| 'REAL'
|
|
27
|
+
| 'TEXT'
|
|
28
|
+
| 'BLOB'
|
|
29
|
+
| 'DATE'
|
|
30
|
+
| 'DATETIME';
|
|
31
|
+
|
|
32
|
+
/** Type names for geopackage geometries
|
|
33
|
+
*
|
|
34
|
+
* As defined in https://www.geopackage.org/spec130/index.html#table_column_data_types, geometries
|
|
35
|
+
* can be stored with any geometry name listed here:
|
|
36
|
+
* https://www.geopackage.org/spec130/index.html#geometry_types
|
|
37
|
+
*/
|
|
38
|
+
export type GeoPackageGeometryTypes =
|
|
39
|
+
| 'GEOMETRY'
|
|
40
|
+
| 'POINT'
|
|
41
|
+
| 'LINESTRING'
|
|
42
|
+
| 'POLYGON'
|
|
43
|
+
| 'MULTIPOINT'
|
|
44
|
+
| 'MULTILINESTRING'
|
|
45
|
+
| 'MULTIPOLYGON'
|
|
46
|
+
| 'GEOMETRYCOLLECTION';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* https://www.geopackage.org/spec121/#spatial_ref_sys
|
|
50
|
+
*/
|
|
51
|
+
export interface SpatialRefSysRow {
|
|
52
|
+
/**
|
|
53
|
+
* Human readable name of this SRS
|
|
54
|
+
*/
|
|
55
|
+
srs_name: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Unique identifier for each Spatial Reference System within a GeoPackage
|
|
59
|
+
*/
|
|
60
|
+
srs_id: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Case-insensitive name of the defining organization e.g. EPSG or epsg
|
|
64
|
+
*/
|
|
65
|
+
organization: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Numeric ID of the Spatial Reference System assigned by the organization
|
|
69
|
+
*/
|
|
70
|
+
organization_coordsys_id: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Well-known Text [A32] Representation of the Spatial Reference System
|
|
74
|
+
*/
|
|
75
|
+
definition: WKTCRSDefinition;
|
|
76
|
+
|
|
77
|
+
/** WKT2 definition supplied by the GeoPackage CRS WKT extension. */
|
|
78
|
+
definition_12_063?: WKTCRSDefinition | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Human readable description of this SRS
|
|
82
|
+
*/
|
|
83
|
+
description?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* https://www.geopackage.org/spec121/#_contents
|
|
88
|
+
*/
|
|
89
|
+
export interface ContentsRow {
|
|
90
|
+
/**
|
|
91
|
+
* The name of the actual content (e.g., tiles, features, or attributes) table
|
|
92
|
+
*/
|
|
93
|
+
table_name: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Type of data stored in the table
|
|
97
|
+
*/
|
|
98
|
+
data_type: 'features' | 'attributes' | 'tiles';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* A human-readable identifier (e.g. short name) for the table_name content
|
|
102
|
+
*/
|
|
103
|
+
identifier?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A human-readable description for the table_name content
|
|
107
|
+
*/
|
|
108
|
+
description?: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* timestamp of last change to content, in ISO 8601 format
|
|
112
|
+
*/
|
|
113
|
+
last_change: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Bounding box minimum easting or longitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.
|
|
117
|
+
*/
|
|
118
|
+
min_x?: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Bounding box minimum northing or latitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.
|
|
122
|
+
*/
|
|
123
|
+
min_y?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Bounding box maximum easting or longitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.
|
|
126
|
+
*/
|
|
127
|
+
max_x?: number;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Bounding box maximum northing or latitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.
|
|
131
|
+
*/
|
|
132
|
+
max_y?: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Spatial Reference System ID: gpkg_spatial_ref_sys.srs_id; when data_type is features, SHALL also match gpkg_geometry_columns.srs_id; When data_type is tiles, SHALL also match gpkg_tile_matrix_set.srs_id
|
|
136
|
+
*/
|
|
137
|
+
srs_id?: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type GeoPackageBounds = {
|
|
141
|
+
minX: number;
|
|
142
|
+
minY: number;
|
|
143
|
+
maxX: number;
|
|
144
|
+
maxY: number;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export interface GeoPackageVectorTableInfo {
|
|
148
|
+
name: string;
|
|
149
|
+
identifier?: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
lastChange: string;
|
|
152
|
+
srsId?: number;
|
|
153
|
+
geometryColumnName: string;
|
|
154
|
+
geometryTypeName: GeometryType;
|
|
155
|
+
z: 0 | 1 | 2;
|
|
156
|
+
m: 0 | 1 | 2;
|
|
157
|
+
bounds?: GeoPackageBounds;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// https://www.geopackage.org/spec121/#geometry_types_extension
|
|
161
|
+
type GeometryType =
|
|
162
|
+
| 'GEOMETRY'
|
|
163
|
+
| 'POINT'
|
|
164
|
+
| 'LINESTRING'
|
|
165
|
+
| 'POLYGON'
|
|
166
|
+
| 'MULTIPOINT'
|
|
167
|
+
| 'MULTILINESTRING'
|
|
168
|
+
| 'MULTIPOLYGON'
|
|
169
|
+
| 'GEOMETRYCOLLECTION'
|
|
170
|
+
| 'CIRCULARSTRING'
|
|
171
|
+
| 'COMPOUNDCURVE'
|
|
172
|
+
| 'CURVEPOLYGON'
|
|
173
|
+
| 'MULTICURVE'
|
|
174
|
+
| 'MULTISURFACE'
|
|
175
|
+
| 'CURVE'
|
|
176
|
+
| 'SURFACE';
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* https://www.geopackage.org/spec121/#_geometry_columns
|
|
180
|
+
*/
|
|
181
|
+
export interface GeometryColumnsRow {
|
|
182
|
+
/**
|
|
183
|
+
* Name of the table containing the geometry column
|
|
184
|
+
*/
|
|
185
|
+
table_name: string;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Name of a column in the feature table that is a Geometry Column
|
|
189
|
+
*/
|
|
190
|
+
column_name: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Name from Geometry Type Codes (Core) or Geometry Type Codes (Extension) in Geometry Types (Normative)
|
|
194
|
+
*/
|
|
195
|
+
geometry_type_name: GeometryType;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Spatial Reference System ID: gpkg_spatial_ref_sys.srs_id
|
|
199
|
+
*/
|
|
200
|
+
srs_id: number;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 0: z values prohibited; 1: z values mandatory; 2: z values optional
|
|
204
|
+
*/
|
|
205
|
+
z: 0 | 1 | 2;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* 0: m values prohibited; 1: m values mandatory; 2: m values optional
|
|
209
|
+
*/
|
|
210
|
+
m: 0 | 1 | 2;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* https://www.geopackage.org/spec121/#extensions_table_definition
|
|
215
|
+
*/
|
|
216
|
+
export interface ExtensionsRow {
|
|
217
|
+
/**
|
|
218
|
+
* Name of the table that requires the extension. When NULL, the extension is required for the entire GeoPackage. SHALL NOT be NULL when the column_name is not NULL.
|
|
219
|
+
*/
|
|
220
|
+
table_name?: string;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Name of the column that requires the extension. When NULL, the extension is required for the entire table.
|
|
224
|
+
*/
|
|
225
|
+
column_name?: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The case sensitive name of the extension that is required, in the form <author>_<extension_name>.
|
|
229
|
+
*/
|
|
230
|
+
extension_name: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Permalink, URI, or reference to a document that defines the extension
|
|
234
|
+
*/
|
|
235
|
+
definition: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Indicates scope of extension effects on readers / writers: 'read-write' or 'write-only' in lowercase.
|
|
239
|
+
*/
|
|
240
|
+
scope: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* https://www.geopackage.org/spec121/#gpkg_data_columns_cols
|
|
245
|
+
*/
|
|
246
|
+
export interface DataColumnsRow {
|
|
247
|
+
/**
|
|
248
|
+
* Name of the tiles or feature table
|
|
249
|
+
*/
|
|
250
|
+
table_name: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Name of the table column
|
|
254
|
+
*/
|
|
255
|
+
column_name: string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* A human-readable identifier (e.g. short name) for the column_name content
|
|
259
|
+
*/
|
|
260
|
+
name?: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* A human-readable formal title for the column_name content
|
|
264
|
+
*/
|
|
265
|
+
title?: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A human-readable description for the column_name content
|
|
269
|
+
*/
|
|
270
|
+
description?: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* MIME [A21] type of column_name if BLOB type, or NULL for other types
|
|
274
|
+
*/
|
|
275
|
+
mime_type?: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Column value constraint name (lowercase) specified by reference to gpkg_data_column_constraints.constraint name
|
|
279
|
+
*/
|
|
280
|
+
constraint_name?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Type for PRAGMA table_info(tableName);
|
|
285
|
+
*/
|
|
286
|
+
export interface PragmaTableInfoRow {
|
|
287
|
+
cid: number;
|
|
288
|
+
name: string;
|
|
289
|
+
type: SQLiteTypes;
|
|
290
|
+
notnull: 0 | 1;
|
|
291
|
+
dflt_value: any;
|
|
292
|
+
pk: 0 | 1;
|
|
293
|
+
}
|
package/src/gpx.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export {KMLFormat, KMZFormat, GPXFormat, TCXFormat} from './kml/kml-format';
|
|
6
|
+
export {KMLLoader} from './kml/kml-loader-types';
|
|
7
|
+
export type {KMLLoaderOptions} from './kml/kml-loader-types';
|
|
8
|
+
export {GPXLoader} from './kml/gpx-loader-types';
|
|
9
|
+
export type {GPXLoaderOptions} from './kml/gpx-loader-types';
|
|
10
|
+
export {TCXLoader} from './kml/tcx-loader-types';
|
|
11
|
+
export type {TCXLoaderOptions} from './kml/tcx-loader-types';
|
|
12
|
+
export {KMZLoader} from './kml/kmz-loader-types';
|
|
13
|
+
export type {KMZLoaderOptions} from './kml/kmz-loader-types';
|
|
14
|
+
export {KMLWriter, KMZWriter} from './kml/kml-writer';
|
|
15
|
+
export type {KMLWriterData, KMLWriterOptions, KMZWriterOptions} from './kml/kml-writer';
|
|
16
|
+
export {ShapefileFormat, SHPFormat} from './shapefile/shp-format';
|
|
17
|
+
export {DBFFormat} from './shapefile/dbf-format';
|
|
18
|
+
export {ShapefileLoader} from './shapefile/shapefile-loader-types';
|
|
19
|
+
export type {ShapefileLoaderOptions} from './shapefile/shapefile-loader-types';
|
|
20
|
+
export {SHPLoader, SHPWorkerLoader} from './shapefile/shp-loader-types';
|
|
21
|
+
export type {SHPLoaderOptions} from './shapefile/shp-loader-types';
|
|
22
|
+
export {DBFLoader, DBFWorkerLoader} from './shapefile/dbf-loader-types';
|
|
23
|
+
export type {DBFLoaderOptions} from './shapefile/dbf-loader-types';
|
|
24
|
+
export {FlatGeobufFormat} from './flatgeobuf/flatgeobuf-format';
|
|
25
|
+
export {FlatGeobufLoader} from './flatgeobuf/flatgeobuf-loader-types';
|
|
26
|
+
export type {FlatGeobufLoaderOptions} from './flatgeobuf/flatgeobuf-loader-types';
|
|
27
|
+
export {FlatGeobufWorkerLoader} from './flatgeobuf/flatgeobuf-loader-types';
|
|
28
|
+
export {GeoPackageFormat} from './geopackage/geopackage-format';
|
|
29
|
+
export {GeoPackageLoader} from './geopackage/geopackage-loader-types';
|
|
30
|
+
export type {GeoPackageLoaderOptions} from './geopackage/geopackage-loader-types';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export type {GPXLoaderOptions} from './gpx-loader';
|
|
6
|
+
export {GPXLoaderWithParser as GPXLoader} from './gpx-loader';
|
|
7
|
+
|
|
8
|
+
export type {KMLLoaderOptions} from './kml-loader';
|
|
9
|
+
export {KMLLoaderWithParser as KMLLoader} from './kml-loader';
|
|
10
|
+
|
|
11
|
+
export type {KMZLoaderOptions} from './kmz-loader-types';
|
|
12
|
+
export {KMZLoaderWithParser as KMZLoader} from './kmz-loader';
|
|
13
|
+
|
|
14
|
+
export type {KMZSourceOptions} from './kmz-source';
|
|
15
|
+
export {KMZSourceLoader, KMZVectorSource} from './kmz-source';
|
|
16
|
+
|
|
17
|
+
export type {KMLWriterData, KMLWriterOptions, KMZWriterOptions} from './kml-writer';
|
|
18
|
+
export {KMLWriter, KMZWriter, encodeKMLText} from './kml-writer';
|
|
19
|
+
|
|
20
|
+
export type {TCXLoaderOptions} from './tcx-loader';
|
|
21
|
+
export {TCXLoaderWithParser as TCXLoader} from './tcx-loader';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {
|
|
7
|
+
GeoJSONTable,
|
|
8
|
+
ObjectRowTable,
|
|
9
|
+
BinaryFeatureCollection,
|
|
10
|
+
ArrowTable,
|
|
11
|
+
GeoArrowEncodingPreference
|
|
12
|
+
} from '@loaders.gl/core/schema';
|
|
13
|
+
import {GPXFormat} from './kml-format';
|
|
14
|
+
|
|
15
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
16
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
17
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
18
|
+
|
|
19
|
+
export type GPXLoaderOptions = LoaderOptions & {
|
|
20
|
+
/** Preferred encoding for Arrow geometry output. */
|
|
21
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
22
|
+
gpx?: {
|
|
23
|
+
shape?: 'object-row-table' | 'geojson-table' | 'arrow-table' | 'binary-geometry' | 'raw';
|
|
24
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** Preloads the parser-bearing GPX loader implementation. */
|
|
29
|
+
async function preloadGPXLoader() {
|
|
30
|
+
const {GPXLoaderWithParser} = await import('@loaders.gl/geospatial/gpx');
|
|
31
|
+
return GPXLoaderWithParser;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Metadata-only loader for GPX (GPS exchange format). */
|
|
35
|
+
export const GPXLoader = {
|
|
36
|
+
dataType: null as unknown as ObjectRowTable | GeoJSONTable | BinaryFeatureCollection | ArrowTable,
|
|
37
|
+
batchType: null as never,
|
|
38
|
+
|
|
39
|
+
...GPXFormat,
|
|
40
|
+
version: VERSION,
|
|
41
|
+
options: {
|
|
42
|
+
gpx: {shape: 'arrow-table'},
|
|
43
|
+
gis: {}
|
|
44
|
+
},
|
|
45
|
+
preload: preloadGPXLoader
|
|
46
|
+
} as const satisfies Loader<
|
|
47
|
+
ObjectRowTable | GeoJSONTable | BinaryFeatureCollection | ArrowTable,
|
|
48
|
+
never,
|
|
49
|
+
GPXLoaderOptions
|
|
50
|
+
>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import {convertGeojsonToBinaryFeatureCollection as geojsonToBinary} from '@loaders.gl/arrow-geometry/legacy-binary';
|
|
7
|
+
import type {
|
|
8
|
+
GeoJSONTable,
|
|
9
|
+
FeatureCollection,
|
|
10
|
+
ObjectRowTable,
|
|
11
|
+
BinaryFeatureCollection,
|
|
12
|
+
ArrowTable,
|
|
13
|
+
GeoArrowEncodingPreference
|
|
14
|
+
} from '@loaders.gl/core/schema';
|
|
15
|
+
import {
|
|
16
|
+
buildFeatureTableSchema,
|
|
17
|
+
convertFeatureCollectionToArrowTable
|
|
18
|
+
} from './lib/feature-collection-to-arrow';
|
|
19
|
+
import {GPXLoader as GPXLoaderMetadata} from './gpx-loader-types';
|
|
20
|
+
import {parseGPXTextToFeatureCollection as parseGPXDocumentText} from './sports-track-parser';
|
|
21
|
+
|
|
22
|
+
const {preload: _GPXLoaderPreload, ...GPXLoaderMetadataWithoutPreload} = GPXLoaderMetadata;
|
|
23
|
+
|
|
24
|
+
export type GPXLoaderOptions = LoaderOptions & {
|
|
25
|
+
/** Preferred encoding for Arrow geometry output. */
|
|
26
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
27
|
+
gpx?: {
|
|
28
|
+
shape?: 'object-row-table' | 'geojson-table' | 'arrow-table' | 'binary-geometry' | 'raw';
|
|
29
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Loader for GPX (GPS exchange format)
|
|
35
|
+
*/
|
|
36
|
+
export const GPXLoaderWithParser = {
|
|
37
|
+
...GPXLoaderMetadataWithoutPreload,
|
|
38
|
+
parse: async (arrayBuffer, options?: GPXLoaderOptions) =>
|
|
39
|
+
parseTextSync(new TextDecoder().decode(arrayBuffer), options),
|
|
40
|
+
parseTextSync
|
|
41
|
+
} as const satisfies LoaderWithParser<
|
|
42
|
+
ObjectRowTable | GeoJSONTable | BinaryFeatureCollection | ArrowTable,
|
|
43
|
+
never,
|
|
44
|
+
GPXLoaderOptions
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Parses GPX XML text into a GeoJSON feature collection.
|
|
49
|
+
*
|
|
50
|
+
* @param text - GPX XML document text.
|
|
51
|
+
* @returns Parsed GeoJSON feature collection.
|
|
52
|
+
*/
|
|
53
|
+
export function parseGPXTextToFeatureCollection(text: string): FeatureCollection {
|
|
54
|
+
return parseGPXDocumentText(text);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Parses GPX text into the requested table shape.
|
|
59
|
+
*
|
|
60
|
+
* @param text - GPX XML document text.
|
|
61
|
+
* @param options - Loader options controlling the output shape.
|
|
62
|
+
* @returns A GeoJSON table, object-row table, or binary feature collection.
|
|
63
|
+
*/
|
|
64
|
+
function parseTextSync(
|
|
65
|
+
text: string,
|
|
66
|
+
options?: GPXLoaderOptions
|
|
67
|
+
): ObjectRowTable | GeoJSONTable | BinaryFeatureCollection | ArrowTable {
|
|
68
|
+
const geojson = parseGPXTextToFeatureCollection(text);
|
|
69
|
+
const schema = buildFeatureTableSchema(geojson.features);
|
|
70
|
+
|
|
71
|
+
const gpxOptions = {...GPXLoaderWithParser.options.gpx, ...options?.gpx};
|
|
72
|
+
|
|
73
|
+
switch (gpxOptions.shape) {
|
|
74
|
+
case 'object-row-table': {
|
|
75
|
+
const table: ObjectRowTable = {
|
|
76
|
+
shape: 'object-row-table',
|
|
77
|
+
data: geojson.features
|
|
78
|
+
};
|
|
79
|
+
return table;
|
|
80
|
+
}
|
|
81
|
+
case 'geojson-table': {
|
|
82
|
+
const table: GeoJSONTable = {
|
|
83
|
+
shape: 'geojson-table',
|
|
84
|
+
schema,
|
|
85
|
+
type: 'FeatureCollection',
|
|
86
|
+
features: geojson.features
|
|
87
|
+
};
|
|
88
|
+
return table;
|
|
89
|
+
}
|
|
90
|
+
case 'arrow-table':
|
|
91
|
+
return convertFeatureCollectionToArrowTable(
|
|
92
|
+
geojson.features,
|
|
93
|
+
options?.geoarrow || gpxOptions.geoarrow
|
|
94
|
+
);
|
|
95
|
+
case 'binary-geometry':
|
|
96
|
+
return geojsonToBinary(geojson.features);
|
|
97
|
+
|
|
98
|
+
default:
|
|
99
|
+
throw new Error(gpxOptions.shape);
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/kml/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export {KMLFormat, KMZFormat, GPXFormat, TCXFormat} from './kml-format';
|
|
6
|
+
export type {GPXLoaderOptions} from './gpx-loader-types';
|
|
7
|
+
export {GPXLoader} from './gpx-loader-types';
|
|
8
|
+
|
|
9
|
+
export type {KMLLoaderOptions} from './kml-loader-types';
|
|
10
|
+
export {KMLLoader} from './kml-loader-types';
|
|
11
|
+
|
|
12
|
+
export type {KMZLoaderOptions} from './kmz-loader-types';
|
|
13
|
+
export {KMZLoader} from './kmz-loader-types';
|
|
14
|
+
|
|
15
|
+
export type {KMZArchive} from './kmz-archive';
|
|
16
|
+
export {openKMZArchive, resolveKMZResourcePath} from './kmz-archive';
|
|
17
|
+
|
|
18
|
+
export type {KMZSourceOptions} from './kmz-source';
|
|
19
|
+
export {KMZSourceLoader, KMZVectorSource} from './kmz-source';
|
|
20
|
+
|
|
21
|
+
export type {KMLWriterData, KMLWriterOptions, KMZWriterOptions} from './kml-writer';
|
|
22
|
+
export {KMLWriter, KMZWriter, encodeKMLText} from './kml-writer';
|
|
23
|
+
|
|
24
|
+
export type {
|
|
25
|
+
KMLDocument,
|
|
26
|
+
KMLFeatureConversionOptions,
|
|
27
|
+
KMLFolder,
|
|
28
|
+
KMLModel,
|
|
29
|
+
KMLNetworkLink,
|
|
30
|
+
KMLOverlay,
|
|
31
|
+
KMLStyle
|
|
32
|
+
} from './kml-parser';
|
|
33
|
+
export {
|
|
34
|
+
convertKMLDocumentToFeatureCollection,
|
|
35
|
+
parseKMLDocument
|
|
36
|
+
} from './kml-parser';
|
|
37
|
+
|
|
38
|
+
export type {TCXLoaderOptions} from './tcx-loader-types';
|
|
39
|
+
export {TCXLoader} from './tcx-loader-types';
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
const KML_HEADER = `\
|
|
8
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
9
|
+
<kml xmlns="http://www.opengis.net/kml/2.2">`;
|
|
10
|
+
|
|
11
|
+
const GPX_HEADER = `\
|
|
12
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
13
|
+
<gpx`;
|
|
14
|
+
|
|
15
|
+
const TCX_HEADER = `\
|
|
16
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
17
|
+
<TrainingCenterDatabase`;
|
|
18
|
+
|
|
19
|
+
/** KML geospatial XML format. */
|
|
20
|
+
export const KMLFormat = {
|
|
21
|
+
name: 'KML (Keyhole Markup Language)',
|
|
22
|
+
id: 'kml',
|
|
23
|
+
module: 'geospatial',
|
|
24
|
+
encoding: 'xml',
|
|
25
|
+
format: 'kml',
|
|
26
|
+
extensions: ['kml'],
|
|
27
|
+
mimeTypes: ['application/vnd.google-earth.kml+xml'],
|
|
28
|
+
text: true,
|
|
29
|
+
tests: [KML_HEADER]
|
|
30
|
+
} as const satisfies Format;
|
|
31
|
+
|
|
32
|
+
/** KMZ archive format containing a KML document and optional resources. */
|
|
33
|
+
export const KMZFormat = {
|
|
34
|
+
name: 'KMZ (KML compressed archive)',
|
|
35
|
+
id: 'kmz',
|
|
36
|
+
module: 'geospatial',
|
|
37
|
+
encoding: 'zip',
|
|
38
|
+
format: 'kmz',
|
|
39
|
+
extensions: ['kmz'],
|
|
40
|
+
mimeTypes: ['application/vnd.google-earth.kmz', 'application/vnd.google-earth.kmz+zip'],
|
|
41
|
+
category: 'archive',
|
|
42
|
+
binary: true,
|
|
43
|
+
tests: ['PK']
|
|
44
|
+
} as const satisfies Format;
|
|
45
|
+
|
|
46
|
+
/** GPX geospatial XML format. */
|
|
47
|
+
export const GPXFormat = {
|
|
48
|
+
name: 'GPX (GPS exchange format)',
|
|
49
|
+
id: 'gpx',
|
|
50
|
+
module: 'geospatial',
|
|
51
|
+
encoding: 'xml',
|
|
52
|
+
format: 'gpx',
|
|
53
|
+
extensions: ['gpx'],
|
|
54
|
+
mimeTypes: ['application/gpx+xml'],
|
|
55
|
+
text: true,
|
|
56
|
+
tests: [GPX_HEADER]
|
|
57
|
+
} as const satisfies Format;
|
|
58
|
+
|
|
59
|
+
/** TCX geospatial XML format. */
|
|
60
|
+
export const TCXFormat = {
|
|
61
|
+
name: 'TCX (Training Center XML)',
|
|
62
|
+
id: 'tcx',
|
|
63
|
+
module: 'geospatial',
|
|
64
|
+
encoding: 'xml',
|
|
65
|
+
format: 'tcx',
|
|
66
|
+
extensions: ['tcx'],
|
|
67
|
+
mimeTypes: ['application/vnd.garmin.tcx+xml'],
|
|
68
|
+
text: true,
|
|
69
|
+
tests: [TCX_HEADER]
|
|
70
|
+
} as const satisfies Format;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
// import {GeoJSONTable} from '@loaders.gl/core/schema';
|
|
7
|
+
import type {
|
|
8
|
+
GeoArrowEncodingPreference,
|
|
9
|
+
GeoJSONTable,
|
|
10
|
+
ObjectRowTable,
|
|
11
|
+
ArrowTable
|
|
12
|
+
} from '@loaders.gl/core/schema';
|
|
13
|
+
import {KMLFormat} from './kml-format';
|
|
14
|
+
|
|
15
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
16
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
17
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
18
|
+
|
|
19
|
+
export type KMLLoaderOptions = LoaderOptions & {
|
|
20
|
+
/** Preferred encoding for Arrow geometry output. */
|
|
21
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
22
|
+
kml?: {
|
|
23
|
+
shape?: 'object-row-table' | 'geojson-table' | 'arrow-table' | 'raw';
|
|
24
|
+
geoarrow?: {encodingPreference?: GeoArrowEncodingPreference};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** Preloads the parser-bearing KML loader implementation. */
|
|
29
|
+
async function preloadKMLLoader() {
|
|
30
|
+
const {KMLLoaderWithParser} = await import('@loaders.gl/geospatial/kml/kml-loader');
|
|
31
|
+
return KMLLoaderWithParser;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Metadata-only loader for KML (Keyhole Markup Language). */
|
|
35
|
+
export const KMLLoader = {
|
|
36
|
+
dataType: null as unknown as ObjectRowTable | GeoJSONTable | ArrowTable,
|
|
37
|
+
batchType: null as never,
|
|
38
|
+
|
|
39
|
+
...KMLFormat,
|
|
40
|
+
version: VERSION,
|
|
41
|
+
options: {
|
|
42
|
+
kml: {shape: 'arrow-table'},
|
|
43
|
+
gis: {}
|
|
44
|
+
},
|
|
45
|
+
preload: preloadKMLLoader
|
|
46
|
+
} as const satisfies Loader<ObjectRowTable | GeoJSONTable | ArrowTable, never, KMLLoaderOptions>;
|