@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,306 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { CRSReprojectionError, parseInBatchesFromContext, parseFromContext, toArrayBufferIterator } from '@loaders.gl/core/loader-utils';
|
|
5
|
+
import { convertWKBToGeometry } from '@loaders.gl/arrow-geometry/geometry-codecs';
|
|
6
|
+
import { transformGeoJsonCoords } from '@loaders.gl/arrow-geometry/legacy-binary';
|
|
7
|
+
import { projectionEngine } from '@math.gl/geospatial/projection';
|
|
8
|
+
import { parseShx } from "./parse-shx.js";
|
|
9
|
+
import { zipBatchIterators } from "../streaming/zip-batch-iterators.js";
|
|
10
|
+
import { SHPLoaderWithParser } from "../../shp-loader.js";
|
|
11
|
+
import { DBFLoaderWithParser } from "../../dbf-loader.js";
|
|
12
|
+
/**
|
|
13
|
+
* Parsing of file in batches
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line max-statements, complexity
|
|
16
|
+
export async function* parseShapefileInBatches(asyncIterator, options, context) {
|
|
17
|
+
const { reproject = false, targetCrs = 'WGS84' } = options?.gis || {};
|
|
18
|
+
const { shx, cpg, prj } = await loadShapefileSidecarFiles(options, context);
|
|
19
|
+
// parse geometries
|
|
20
|
+
const shapeIterable = await parseInBatchesFromContext(toArrayBufferIterator(asyncIterator), SHPLoaderWithParser, {
|
|
21
|
+
...options,
|
|
22
|
+
shp: {
|
|
23
|
+
...options?.shp,
|
|
24
|
+
shape: 'wkb'
|
|
25
|
+
}
|
|
26
|
+
}, context);
|
|
27
|
+
const shapeIterator = shapeIterable[Symbol.asyncIterator]?.() || shapeIterable[Symbol.iterator]?.();
|
|
28
|
+
// parse properties
|
|
29
|
+
let propertyIterator = null;
|
|
30
|
+
const dbfResponse = context?.url
|
|
31
|
+
? await context?.fetch(replaceExtension(context.url, 'dbf')).catch(() => null)
|
|
32
|
+
: null;
|
|
33
|
+
if (dbfResponse?.ok) {
|
|
34
|
+
const propertyIterable = await parseInBatchesFromContext(dbfResponse, DBFLoaderWithParser, {
|
|
35
|
+
...options,
|
|
36
|
+
dbf: {
|
|
37
|
+
...options?.dbf,
|
|
38
|
+
shape: 'object-row-table',
|
|
39
|
+
encoding: cpg || 'latin1'
|
|
40
|
+
}
|
|
41
|
+
}, context);
|
|
42
|
+
propertyIterator =
|
|
43
|
+
propertyIterable[Symbol.asyncIterator]?.() || propertyIterable[Symbol.iterator]();
|
|
44
|
+
}
|
|
45
|
+
// When `options.metadata` is `true`, there's an extra initial `metadata`
|
|
46
|
+
// object before the iterator starts. zipBatchIterators expects to receive
|
|
47
|
+
// batches of Array objects, and will fail with non-iterable batches, so it's
|
|
48
|
+
// important to skip over the first batch.
|
|
49
|
+
let shapeHeader = (await shapeIterator.next()).value;
|
|
50
|
+
if (shapeHeader && shapeHeader.batchType === 'metadata') {
|
|
51
|
+
shapeHeader = (await shapeIterator.next()).value;
|
|
52
|
+
}
|
|
53
|
+
let dbfHeader = {};
|
|
54
|
+
if (propertyIterator) {
|
|
55
|
+
dbfHeader = (await propertyIterator.next()).value;
|
|
56
|
+
if (dbfHeader && dbfHeader.batchType === 'metadata') {
|
|
57
|
+
dbfHeader = (await propertyIterator.next()).value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const zippedIterator = propertyIterator
|
|
61
|
+
? zipBatchIterators(shapeIterator, propertyIterator, 'object-row-table')
|
|
62
|
+
: shapeIterator;
|
|
63
|
+
const zippedBatchIterable = {
|
|
64
|
+
[Symbol.asyncIterator]() {
|
|
65
|
+
return zippedIterator;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
for await (const batch of zippedBatchIterable) {
|
|
69
|
+
let geometries;
|
|
70
|
+
let properties = [];
|
|
71
|
+
if (!propertyIterator) {
|
|
72
|
+
geometries = batch;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
[geometries, properties] = batch.data;
|
|
76
|
+
}
|
|
77
|
+
const geojsonGeometries = parseGeometries(geometries);
|
|
78
|
+
let features = joinProperties(geojsonGeometries, properties);
|
|
79
|
+
if (reproject) {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
features = reprojectFeatures(features, prj, targetCrs);
|
|
82
|
+
}
|
|
83
|
+
yield {
|
|
84
|
+
encoding: cpg,
|
|
85
|
+
prj,
|
|
86
|
+
shx,
|
|
87
|
+
header: shapeHeader,
|
|
88
|
+
data: features
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Parse shapefile
|
|
94
|
+
*
|
|
95
|
+
* @param arrayBuffer
|
|
96
|
+
* @param options
|
|
97
|
+
* @param context
|
|
98
|
+
* @returns output of shapefile
|
|
99
|
+
*/
|
|
100
|
+
export async function parseShapefile(arrayBuffer, options, context) {
|
|
101
|
+
const { reproject = false, targetCrs = 'WGS84' } = options?.gis || {};
|
|
102
|
+
const { shx, cpg, prj } = await loadShapefileSidecarFiles(options, context);
|
|
103
|
+
// parse geometries
|
|
104
|
+
const { header, geometries } = (await parseFromContext(arrayBuffer, SHPLoaderWithParser, {
|
|
105
|
+
...options,
|
|
106
|
+
shp: {
|
|
107
|
+
...options?.shp,
|
|
108
|
+
shape: 'wkb'
|
|
109
|
+
}
|
|
110
|
+
}, context)); // {shp: shx}
|
|
111
|
+
const geojsonGeometries = parseGeometries(geometries);
|
|
112
|
+
// parse properties
|
|
113
|
+
let propertyTable;
|
|
114
|
+
const dbfResponse = context?.url
|
|
115
|
+
? await context?.fetch(replaceExtension(context.url, 'dbf')).catch(() => null)
|
|
116
|
+
: null;
|
|
117
|
+
if (dbfResponse?.ok) {
|
|
118
|
+
const dbfOptions = {
|
|
119
|
+
...options,
|
|
120
|
+
dbf: {
|
|
121
|
+
...options?.dbf,
|
|
122
|
+
shape: 'object-row-table',
|
|
123
|
+
encoding: cpg || 'latin1'
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
propertyTable = (await parseFromContext(dbfResponse, DBFLoaderWithParser, dbfOptions, context));
|
|
127
|
+
}
|
|
128
|
+
let features = joinProperties(geojsonGeometries, propertyTable?.data || []);
|
|
129
|
+
if (reproject) {
|
|
130
|
+
features = reprojectFeatures(features, prj, targetCrs);
|
|
131
|
+
}
|
|
132
|
+
switch (options?.shapefile?.shape) {
|
|
133
|
+
case 'geojson-table':
|
|
134
|
+
return {
|
|
135
|
+
shape: 'geojson-table',
|
|
136
|
+
type: 'FeatureCollection',
|
|
137
|
+
encoding: cpg,
|
|
138
|
+
schema: propertyTable?.schema || { metadata: {}, fields: [] },
|
|
139
|
+
prj,
|
|
140
|
+
shx,
|
|
141
|
+
header: header,
|
|
142
|
+
features
|
|
143
|
+
};
|
|
144
|
+
default:
|
|
145
|
+
return {
|
|
146
|
+
encoding: cpg,
|
|
147
|
+
prj,
|
|
148
|
+
shx,
|
|
149
|
+
header: header,
|
|
150
|
+
data: features
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Parse geometries
|
|
156
|
+
*
|
|
157
|
+
* @param geometries
|
|
158
|
+
* @returns geometries as an array
|
|
159
|
+
*/
|
|
160
|
+
function parseGeometries(geometries) {
|
|
161
|
+
const geojsonGeometries = [];
|
|
162
|
+
for (const geom of geometries) {
|
|
163
|
+
if (geom) {
|
|
164
|
+
geojsonGeometries.push(convertWKBToGeometry(toArrayBuffer(geom)));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return geojsonGeometries;
|
|
168
|
+
}
|
|
169
|
+
function toArrayBuffer(wkb) {
|
|
170
|
+
return wkb.buffer.slice(wkb.byteOffset, wkb.byteOffset + wkb.byteLength);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Join properties and geometries into features
|
|
174
|
+
*
|
|
175
|
+
* @param geometries [description]
|
|
176
|
+
* @param properties [description]
|
|
177
|
+
* @return [description]
|
|
178
|
+
*/
|
|
179
|
+
function joinProperties(geometries, properties) {
|
|
180
|
+
const features = [];
|
|
181
|
+
for (let i = 0; i < geometries.length; i++) {
|
|
182
|
+
const geometry = geometries[i];
|
|
183
|
+
const feature = {
|
|
184
|
+
type: 'Feature',
|
|
185
|
+
geometry,
|
|
186
|
+
// properties can be undefined if dbfResponse above was empty
|
|
187
|
+
properties: (properties && properties[i]) || {}
|
|
188
|
+
};
|
|
189
|
+
features.push(feature);
|
|
190
|
+
}
|
|
191
|
+
return features;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Reproject GeoJSON features to output CRS
|
|
195
|
+
*
|
|
196
|
+
* @param features parsed GeoJSON features
|
|
197
|
+
* @param sourceCrs source coordinate reference system
|
|
198
|
+
* @param targetCrs Target coordinate reference system
|
|
199
|
+
* @return Reprojected Features
|
|
200
|
+
*/
|
|
201
|
+
function reprojectFeatures(features, sourceCrs, targetCrs) {
|
|
202
|
+
if (!sourceCrs) {
|
|
203
|
+
throw new CRSReprojectionError('missing-source-crs', 'Shapefile reprojection requires a source CRS from the .prj sidecar file', { targetCrs });
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
const projection = projectionEngine.createProjection({
|
|
207
|
+
from: sourceCrs,
|
|
208
|
+
to: (targetCrs || 'WGS84')
|
|
209
|
+
});
|
|
210
|
+
return transformGeoJsonCoords(features, coord => projection.projectSync(coord));
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
214
|
+
throw new CRSReprojectionError('transformation-failed', `Shapefile reprojection failed: ${message}`, { sourceCrs, targetCrs: targetCrs || 'WGS84', cause: error });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
* @param options
|
|
220
|
+
* @param context
|
|
221
|
+
* @returns Promise
|
|
222
|
+
*/
|
|
223
|
+
// eslint-disable-next-line max-statements
|
|
224
|
+
export async function loadShapefileSidecarFiles(options, context) {
|
|
225
|
+
if (!context?.url || !context.fetch) {
|
|
226
|
+
return {};
|
|
227
|
+
}
|
|
228
|
+
// Attempt a parallel load of the small sidecar files
|
|
229
|
+
const { url, fetch } = context;
|
|
230
|
+
const shxPromise = fetch(replaceExtension(url, 'shx')).catch(() => null);
|
|
231
|
+
const cpgPromise = fetch(replaceExtension(url, 'cpg')).catch(() => null);
|
|
232
|
+
const prjPromise = fetch(replaceExtension(url, 'prj')).catch(() => null);
|
|
233
|
+
await Promise.all([shxPromise, cpgPromise, prjPromise]);
|
|
234
|
+
let shx;
|
|
235
|
+
let cpg;
|
|
236
|
+
let prj;
|
|
237
|
+
const shxResponse = await shxPromise;
|
|
238
|
+
if (shxResponse?.ok && !isHtmlFallbackResponse(shxResponse)) {
|
|
239
|
+
const arrayBuffer = await shxResponse.arrayBuffer();
|
|
240
|
+
shx = parseShx(arrayBuffer);
|
|
241
|
+
}
|
|
242
|
+
const cpgResponse = await cpgPromise;
|
|
243
|
+
if (cpgResponse?.ok && !isHtmlFallbackResponse(cpgResponse)) {
|
|
244
|
+
const encoding = await cpgResponse.text();
|
|
245
|
+
// Vite serves the test page for missing sidecar files; only accept plausible encoding labels.
|
|
246
|
+
if (/^[\w-]+$/.test(encoding.trim())) {
|
|
247
|
+
cpg = encoding;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const prjResponse = await prjPromise;
|
|
251
|
+
if (prjResponse?.ok && !isHtmlFallbackResponse(prjResponse)) {
|
|
252
|
+
prj = await prjResponse.text();
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
shx,
|
|
256
|
+
cpg,
|
|
257
|
+
prj
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function isHtmlFallbackResponse(response) {
|
|
261
|
+
return (response.headers.get('content-type') || '').includes('text/html');
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Replace the extension at the end of a path.
|
|
265
|
+
*
|
|
266
|
+
* Matches the case of new extension with the case of the original file extension,
|
|
267
|
+
* to increase the chance of finding files without firing off a request storm looking for various case combinations
|
|
268
|
+
*
|
|
269
|
+
* NOTE: Extensions can be both lower and uppercase
|
|
270
|
+
* per spec, extensions should be lower case, but that doesn't mean they always are. See:
|
|
271
|
+
* calvinmetcalf/shapefile-js#64, mapserver/mapserver#4712
|
|
272
|
+
* https://trac.osgeo.org/mapserver/ticket/166
|
|
273
|
+
*/
|
|
274
|
+
export function replaceExtension(url, newExtension) {
|
|
275
|
+
const baseName = basename(url);
|
|
276
|
+
const extension = extname(url);
|
|
277
|
+
const isUpperCase = extension === extension.toUpperCase();
|
|
278
|
+
if (isUpperCase) {
|
|
279
|
+
newExtension = newExtension.toUpperCase();
|
|
280
|
+
}
|
|
281
|
+
return `${baseName}.${newExtension}`;
|
|
282
|
+
}
|
|
283
|
+
// NOTE - this gives the entire path minus extension (i.e. NOT same as path.basename)
|
|
284
|
+
/**
|
|
285
|
+
* @param url
|
|
286
|
+
* @returns string
|
|
287
|
+
*/
|
|
288
|
+
function basename(url) {
|
|
289
|
+
const extIndex = url && url.lastIndexOf('.');
|
|
290
|
+
if (typeof extIndex === 'number') {
|
|
291
|
+
return extIndex >= 0 ? url.substr(0, extIndex) : '';
|
|
292
|
+
}
|
|
293
|
+
return extIndex;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @param url
|
|
297
|
+
* @returns string
|
|
298
|
+
*/
|
|
299
|
+
function extname(url) {
|
|
300
|
+
const extIndex = url && url.lastIndexOf('.');
|
|
301
|
+
if (typeof extIndex === 'number') {
|
|
302
|
+
return extIndex >= 0 ? url.substr(extIndex + 1) : '';
|
|
303
|
+
}
|
|
304
|
+
return extIndex;
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=parse-shapefile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-shapefile.js","sourceRoot":"","sources":["../../../../src/shapefile/lib/parsers/parse-shapefile.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,oBAAoB,EAEpB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;AAShF,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAOhE,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AACrC,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AACnE,OAAO,EAAC,mBAAmB,EAAC,4BAAyB;AACrD,OAAO,EAAC,mBAAmB,EAAC,4BAAyB;AASrD;;GAEG;AACH,sDAAsD;AACtD,MAAM,CAAC,KAAK,S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view Record data
|
|
7
|
+
* @return WKB geometry bytes, or null for Null Shape records.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseRecord(view: DataView, options?: SHPLoaderOptions): Uint8Array | null;
|
|
10
|
+
/**
|
|
11
|
+
* Parses one SHP record directly into WKB bytes.
|
|
12
|
+
*
|
|
13
|
+
* @param view Record data.
|
|
14
|
+
* @param options Loader options.
|
|
15
|
+
* @return WKB geometry bytes, or null for Null Shape records.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseRecordToWKB(view: DataView, options?: SHPLoaderOptions): Uint8Array | null;
|
|
18
|
+
/**
|
|
19
|
+
* Writes one SHP record directly into a WKB builder.
|
|
20
|
+
*
|
|
21
|
+
* @param builder WKB builder.
|
|
22
|
+
* @param view Record data.
|
|
23
|
+
* @param type SHP record type.
|
|
24
|
+
*/
|
|
25
|
+
export declare function writeRecordToWKB(builder: WKBBuilder, view: DataView, type: number): void;
|
|
26
|
+
/**
|
|
27
|
+
* Writes one SHP record directly into a typed GeoArrow builder.
|
|
28
|
+
*
|
|
29
|
+
* @param builder GeoArrow builder.
|
|
30
|
+
* @param view Record data.
|
|
31
|
+
* @param recordType Optional record type, read from the record when omitted.
|
|
32
|
+
*/
|
|
33
|
+
export declare function writeRecordToGeoArrow(builder: GeoArrowBuilder, view: DataView, recordType?: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Returns WKB dimensional options for an SHP record type.
|
|
36
|
+
*
|
|
37
|
+
* @param type SHP record type.
|
|
38
|
+
* @param options Loader options.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRecordWKBOptions(type: number, options?: SHPLoaderOptions): {
|
|
41
|
+
hasZ: boolean;
|
|
42
|
+
hasM: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
hasM: boolean;
|
|
45
|
+
hasZ?: undefined;
|
|
46
|
+
} | {
|
|
47
|
+
hasZ?: undefined;
|
|
48
|
+
hasM?: undefined;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=parse-shp-geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-shp-geometry.d.ts","sourceRoot":"","sources":["../../../../src/shapefile/lib/parsers/parse-shp-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,eAAe,EAAE,UAAU,EAAC,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAC,gBAAgB,EAAC,mBAAgB;AAIzC;;;;;GAKG;AAEH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI,CAEzF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI,CAoB9F;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CA0BxF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,QAAQ,EACd,UAAU,SAAkC,GAC3C,IAAI,CAmCN;AA0WD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB;;;;;;;;;EAmB3E"}
|