@math.gl/geospatial 5.0.0-alpha.9 → 5.0.0-beta.1
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/GEOGRAPHICLIB-LICENSE.txt +28 -0
- package/LICENSE +268 -69
- package/README.md +51 -0
- package/THIRD-PARTY-NOTICES.md +116 -0
- package/crs/README.md +84 -0
- package/crs/schemas/README.md +9 -0
- package/crs/schemas/projjson.schema.json +1174 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -3
- package/dist/constants.js.map +1 -1
- package/dist/coordinates/angles.d.ts +20 -0
- package/dist/coordinates/angles.d.ts.map +1 -0
- package/dist/coordinates/angles.js +117 -0
- package/dist/coordinates/angles.js.map +1 -0
- package/dist/coordinates/grid.d.ts +23 -0
- package/dist/coordinates/grid.d.ts.map +1 -0
- package/dist/coordinates/grid.js +110 -0
- package/dist/coordinates/grid.js.map +1 -0
- package/dist/coordinates/mgrs.d.ts +25 -0
- package/dist/coordinates/mgrs.d.ts.map +1 -0
- package/dist/coordinates/mgrs.js +124 -0
- package/dist/coordinates/mgrs.js.map +1 -0
- package/dist/coordinates.d.ts +7 -0
- package/dist/coordinates.d.ts.map +1 -0
- package/dist/coordinates.js +7 -0
- package/dist/coordinates.js.map +1 -0
- package/dist/crs/crs-descriptor-types.d.ts +71 -0
- package/dist/crs/crs-descriptor-types.d.ts.map +1 -0
- package/dist/crs/crs-descriptor-types.js +5 -0
- package/dist/crs/crs-descriptor-types.js.map +1 -0
- package/dist/crs/crs-descriptor.d.ts +26 -0
- package/dist/crs/crs-descriptor.d.ts.map +1 -0
- package/dist/crs/crs-descriptor.js +131 -0
- package/dist/crs/crs-descriptor.js.map +1 -0
- package/dist/crs/crs-metadata.d.ts +43 -0
- package/dist/crs/crs-metadata.d.ts.map +1 -0
- package/dist/crs/crs-metadata.js +26 -0
- package/dist/crs/crs-metadata.js.map +1 -0
- package/dist/crs/crs.d.ts +22 -0
- package/dist/crs/crs.d.ts.map +1 -0
- package/dist/crs/crs.js +5 -0
- package/dist/crs/crs.js.map +1 -0
- package/dist/crs/execution-identity.d.ts +26 -0
- package/dist/crs/execution-identity.d.ts.map +1 -0
- package/dist/crs/execution-identity.js +76 -0
- package/dist/crs/execution-identity.js.map +1 -0
- package/dist/crs/index.cjs +1252 -0
- package/dist/crs/index.cjs.map +6 -0
- package/dist/crs/index.d.ts +21 -0
- package/dist/crs/index.d.ts.map +1 -0
- package/dist/crs/index.js +15 -0
- package/dist/crs/index.js.map +1 -0
- package/dist/crs/proj-string.d.ts +32 -0
- package/dist/crs/proj-string.d.ts.map +1 -0
- package/dist/crs/proj-string.js +204 -0
- package/dist/crs/proj-string.js.map +1 -0
- package/dist/crs/projection-domain.d.ts +33 -0
- package/dist/crs/projection-domain.d.ts.map +1 -0
- package/dist/crs/projection-domain.js +69 -0
- package/dist/crs/projection-domain.js.map +1 -0
- package/dist/crs/projjson-schema-constants.d.ts +5 -0
- package/dist/crs/projjson-schema-constants.d.ts.map +1 -0
- package/dist/crs/projjson-schema-constants.js +8 -0
- package/dist/crs/projjson-schema-constants.js.map +1 -0
- package/dist/crs/projjson-types.d.ts +557 -0
- package/dist/crs/projjson-types.d.ts.map +1 -0
- package/dist/crs/projjson-types.js +5 -0
- package/dist/crs/projjson-types.js.map +1 -0
- package/dist/crs/resolver.d.ts +43 -0
- package/dist/crs/resolver.d.ts.map +1 -0
- package/dist/crs/resolver.js +142 -0
- package/dist/crs/resolver.js.map +1 -0
- package/dist/crs/spatial-reference.d.ts +106 -0
- package/dist/crs/spatial-reference.d.ts.map +1 -0
- package/dist/crs/spatial-reference.js +86 -0
- package/dist/crs/spatial-reference.js.map +1 -0
- package/dist/crs/units-table.d.ts +4 -0
- package/dist/crs/units-table.d.ts.map +1 -0
- package/dist/crs/units-table.js +29 -0
- package/dist/crs/units-table.js.map +1 -0
- package/dist/crs/wkt-crs.d.ts +86 -0
- package/dist/crs/wkt-crs.d.ts.map +1 -0
- package/dist/crs/wkt-crs.js +613 -0
- package/dist/crs/wkt-crs.js.map +1 -0
- package/dist/discontinuous/air-ocean-mesh.d.ts +15 -0
- package/dist/discontinuous/air-ocean-mesh.d.ts.map +1 -0
- package/dist/discontinuous/air-ocean-mesh.js +75 -0
- package/dist/discontinuous/air-ocean-mesh.js.map +1 -0
- package/dist/discontinuous/albers-usa.d.ts +9 -0
- package/dist/discontinuous/albers-usa.d.ts.map +1 -0
- package/dist/discontinuous/albers-usa.js +105 -0
- package/dist/discontinuous/albers-usa.js.map +1 -0
- package/dist/discontinuous/cap-map.d.ts +23 -0
- package/dist/discontinuous/cap-map.d.ts.map +1 -0
- package/dist/discontinuous/cap-map.js +314 -0
- package/dist/discontinuous/cap-map.js.map +1 -0
- package/dist/discontinuous/elastic/data.d.ts +26 -0
- package/dist/discontinuous/elastic/data.d.ts.map +1 -0
- package/dist/discontinuous/elastic/data.js +72 -0
- package/dist/discontinuous/elastic/data.js.map +1 -0
- package/dist/discontinuous/elastic/elasticI.d.ts +3 -0
- package/dist/discontinuous/elastic/elasticI.d.ts.map +1 -0
- package/dist/discontinuous/elastic/elasticI.js +5233 -0
- package/dist/discontinuous/elastic/elasticI.js.map +1 -0
- package/dist/discontinuous/elastic/elasticII.d.ts +3 -0
- package/dist/discontinuous/elastic/elasticII.d.ts.map +1 -0
- package/dist/discontinuous/elastic/elasticII.js +18162 -0
- package/dist/discontinuous/elastic/elasticII.js.map +1 -0
- package/dist/discontinuous/elastic/elasticIII.d.ts +3 -0
- package/dist/discontinuous/elastic/elasticIII.d.ts.map +1 -0
- package/dist/discontinuous/elastic/elasticIII.js +29566 -0
- package/dist/discontinuous/elastic/elasticIII.js.map +1 -0
- package/dist/discontinuous/elastic/geometry.d.ts +22 -0
- package/dist/discontinuous/elastic/geometry.d.ts.map +1 -0
- package/dist/discontinuous/elastic/geometry.js +131 -0
- package/dist/discontinuous/elastic/geometry.js.map +1 -0
- package/dist/discontinuous/elastic/grid.d.ts +15 -0
- package/dist/discontinuous/elastic/grid.d.ts.map +1 -0
- package/dist/discontinuous/elastic/grid.js +177 -0
- package/dist/discontinuous/elastic/grid.js.map +1 -0
- package/dist/discontinuous/elastic/map.d.ts +8 -0
- package/dist/discontinuous/elastic/map.d.ts.map +1 -0
- package/dist/discontinuous/elastic/map.js +260 -0
- package/dist/discontinuous/elastic/map.js.map +1 -0
- package/dist/discontinuous/global-polygons.d.ts +35 -0
- package/dist/discontinuous/global-polygons.d.ts.map +1 -0
- package/dist/discontinuous/global-polygons.js +215 -0
- package/dist/discontinuous/global-polygons.js.map +1 -0
- package/dist/discontinuous/gray-fuller.d.ts +5 -0
- package/dist/discontinuous/gray-fuller.d.ts.map +1 -0
- package/dist/discontinuous/gray-fuller.js +36 -0
- package/dist/discontinuous/gray-fuller.js.map +1 -0
- package/dist/discontinuous/gringorten-kernel.d.ts +5 -0
- package/dist/discontinuous/gringorten-kernel.d.ts.map +1 -0
- package/dist/discontinuous/gringorten-kernel.js +94 -0
- package/dist/discontinuous/gringorten-kernel.js.map +1 -0
- package/dist/discontinuous/healpix.d.ts +13 -0
- package/dist/discontinuous/healpix.d.ts.map +1 -0
- package/dist/discontinuous/healpix.js +61 -0
- package/dist/discontinuous/healpix.js.map +1 -0
- package/dist/discontinuous/layout.d.ts +72 -0
- package/dist/discontinuous/layout.d.ts.map +1 -0
- package/dist/discontinuous/layout.js +114 -0
- package/dist/discontinuous/layout.js.map +1 -0
- package/dist/discontinuous/map-engine.d.ts +214 -0
- package/dist/discontinuous/map-engine.d.ts.map +1 -0
- package/dist/discontinuous/map-engine.js +408 -0
- package/dist/discontinuous/map-engine.js.map +1 -0
- package/dist/discontinuous/map-layout.d.ts +93 -0
- package/dist/discontinuous/map-layout.d.ts.map +1 -0
- package/dist/discontinuous/map-layout.js +490 -0
- package/dist/discontinuous/map-layout.js.map +1 -0
- package/dist/discontinuous/map-transition.d.ts +42 -0
- package/dist/discontinuous/map-transition.d.ts.map +1 -0
- package/dist/discontinuous/map-transition.js +283 -0
- package/dist/discontinuous/map-transition.js.map +1 -0
- package/dist/discontinuous/math.d.ts +19 -0
- package/dist/discontinuous/math.d.ts.map +1 -0
- package/dist/discontinuous/math.js +65 -0
- package/dist/discontinuous/math.js.map +1 -0
- package/dist/discontinuous/mercator-map.d.ts +24 -0
- package/dist/discontinuous/mercator-map.d.ts.map +1 -0
- package/dist/discontinuous/mercator-map.js +134 -0
- package/dist/discontinuous/mercator-map.js.map +1 -0
- package/dist/discontinuous/myriahedral/graticule.d.ts +6 -0
- package/dist/discontinuous/myriahedral/graticule.d.ts.map +1 -0
- package/dist/discontinuous/myriahedral/graticule.js +37 -0
- package/dist/discontinuous/myriahedral/graticule.js.map +1 -0
- package/dist/discontinuous/myriahedral/mesh.d.ts +18 -0
- package/dist/discontinuous/myriahedral/mesh.d.ts.map +1 -0
- package/dist/discontinuous/myriahedral/mesh.js +131 -0
- package/dist/discontinuous/myriahedral/mesh.js.map +1 -0
- package/dist/discontinuous/myriahedral/unfold.d.ts +56 -0
- package/dist/discontinuous/myriahedral/unfold.d.ts.map +1 -0
- package/dist/discontinuous/myriahedral/unfold.js +191 -0
- package/dist/discontinuous/myriahedral/unfold.js.map +1 -0
- package/dist/discontinuous/myriahedral.d.ts +62 -0
- package/dist/discontinuous/myriahedral.d.ts.map +1 -0
- package/dist/discontinuous/myriahedral.js +217 -0
- package/dist/discontinuous/myriahedral.js.map +1 -0
- package/dist/discontinuous/petroff.d.ts +8 -0
- package/dist/discontinuous/petroff.d.ts.map +1 -0
- package/dist/discontinuous/petroff.js +159 -0
- package/dist/discontinuous/petroff.js.map +1 -0
- package/dist/discontinuous/polyhedral.d.ts +8 -0
- package/dist/discontinuous/polyhedral.d.ts.map +1 -0
- package/dist/discontinuous/polyhedral.js +117 -0
- package/dist/discontinuous/polyhedral.js.map +1 -0
- package/dist/discontinuous/prepare-features.d.ts +81 -0
- package/dist/discontinuous/prepare-features.d.ts.map +1 -0
- package/dist/discontinuous/prepare-features.js +149 -0
- package/dist/discontinuous/prepare-features.js.map +1 -0
- package/dist/discontinuous/presets.d.ts +71 -0
- package/dist/discontinuous/presets.d.ts.map +1 -0
- package/dist/discontinuous/presets.js +372 -0
- package/dist/discontinuous/presets.js.map +1 -0
- package/dist/discontinuous/projection-catalog.d.ts +33 -0
- package/dist/discontinuous/projection-catalog.d.ts.map +1 -0
- package/dist/discontinuous/projection-catalog.js +96 -0
- package/dist/discontinuous/projection-catalog.js.map +1 -0
- package/dist/discontinuous/quincuncial-kernel.d.ts +9 -0
- package/dist/discontinuous/quincuncial-kernel.d.ts.map +1 -0
- package/dist/discontinuous/quincuncial-kernel.js +139 -0
- package/dist/discontinuous/quincuncial-kernel.js.map +1 -0
- package/dist/discontinuous/quincuncial-star.d.ts +29 -0
- package/dist/discontinuous/quincuncial-star.d.ts.map +1 -0
- package/dist/discontinuous/quincuncial-star.js +307 -0
- package/dist/discontinuous/quincuncial-star.js.map +1 -0
- package/dist/discontinuous/regional-map.d.ts +19 -0
- package/dist/discontinuous/regional-map.d.ts.map +1 -0
- package/dist/discontinuous/regional-map.js +190 -0
- package/dist/discontinuous/regional-map.js.map +1 -0
- package/dist/discontinuous/retroazimuthal-map.d.ts +6 -0
- package/dist/discontinuous/retroazimuthal-map.d.ts.map +1 -0
- package/dist/discontinuous/retroazimuthal-map.js +52 -0
- package/dist/discontinuous/retroazimuthal-map.js.map +1 -0
- package/dist/discontinuous/rotated-map.d.ts +31 -0
- package/dist/discontinuous/rotated-map.d.ts.map +1 -0
- package/dist/discontinuous/rotated-map.js +66 -0
- package/dist/discontinuous/rotated-map.js.map +1 -0
- package/dist/discontinuous/snyder-mesh.d.ts +11 -0
- package/dist/discontinuous/snyder-mesh.d.ts.map +1 -0
- package/dist/discontinuous/snyder-mesh.js +88 -0
- package/dist/discontinuous/snyder-mesh.js.map +1 -0
- package/dist/discontinuous/snyder.d.ts +16 -0
- package/dist/discontinuous/snyder.d.ts.map +1 -0
- package/dist/discontinuous/snyder.js +153 -0
- package/dist/discontinuous/snyder.js.map +1 -0
- package/dist/discontinuous/spherical-clip/cartesian.d.ts +8 -0
- package/dist/discontinuous/spherical-clip/cartesian.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/cartesian.js +34 -0
- package/dist/discontinuous/spherical-clip/cartesian.js.map +1 -0
- package/dist/discontinuous/spherical-clip/circle.d.ts +2 -0
- package/dist/discontinuous/spherical-clip/circle.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/circle.js +34 -0
- package/dist/discontinuous/spherical-clip/circle.js.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-buffer.d.ts +9 -0
- package/dist/discontinuous/spherical-clip/clip-buffer.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-buffer.js +28 -0
- package/dist/discontinuous/spherical-clip/clip-buffer.js.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-circle.d.ts +9 -0
- package/dist/discontinuous/spherical-clip/clip-circle.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-circle.js +160 -0
- package/dist/discontinuous/spherical-clip/clip-circle.js.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-index.d.ts +9 -0
- package/dist/discontinuous/spherical-clip/clip-index.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-index.js +117 -0
- package/dist/discontinuous/spherical-clip/clip-index.js.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-rejoin.d.ts +2 -0
- package/dist/discontinuous/spherical-clip/clip-rejoin.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/clip-rejoin.js +99 -0
- package/dist/discontinuous/spherical-clip/clip-rejoin.js.map +1 -0
- package/dist/discontinuous/spherical-clip/helpers.d.ts +8 -0
- package/dist/discontinuous/spherical-clip/helpers.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/helpers.js +21 -0
- package/dist/discontinuous/spherical-clip/helpers.js.map +1 -0
- package/dist/discontinuous/spherical-clip/math.d.ts +26 -0
- package/dist/discontinuous/spherical-clip/math.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/math.js +39 -0
- package/dist/discontinuous/spherical-clip/math.js.map +1 -0
- package/dist/discontinuous/spherical-clip/noop.d.ts +2 -0
- package/dist/discontinuous/spherical-clip/noop.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/noop.js +6 -0
- package/dist/discontinuous/spherical-clip/noop.js.map +1 -0
- package/dist/discontinuous/spherical-clip/pointEqual.d.ts +2 -0
- package/dist/discontinuous/spherical-clip/pointEqual.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/pointEqual.js +9 -0
- package/dist/discontinuous/spherical-clip/pointEqual.js.map +1 -0
- package/dist/discontinuous/spherical-clip/polygonContains.d.ts +2 -0
- package/dist/discontinuous/spherical-clip/polygonContains.d.ts.map +1 -0
- package/dist/discontinuous/spherical-clip/polygonContains.js +52 -0
- package/dist/discontinuous/spherical-clip/polygonContains.js.map +1 -0
- package/dist/discontinuous/world-composite-kernels.d.ts +11 -0
- package/dist/discontinuous/world-composite-kernels.d.ts.map +1 -0
- package/dist/discontinuous/world-composite-kernels.js +30 -0
- package/dist/discontinuous/world-composite-kernels.js.map +1 -0
- package/dist/discontinuous/world-kernels/airy.d.ts +5 -0
- package/dist/discontinuous/world-kernels/airy.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/airy.js +28 -0
- package/dist/discontinuous/world-kernels/airy.js.map +1 -0
- package/dist/discontinuous/world-kernels/aitoff.d.ts +5 -0
- package/dist/discontinuous/world-kernels/aitoff.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/aitoff.js +26 -0
- package/dist/discontinuous/world-kernels/aitoff.js.map +1 -0
- package/dist/discontinuous/world-kernels/armadillo.d.ts +5 -0
- package/dist/discontinuous/world-kernels/armadillo.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/armadillo.js +28 -0
- package/dist/discontinuous/world-kernels/armadillo.js.map +1 -0
- package/dist/discontinuous/world-kernels/august.d.ts +5 -0
- package/dist/discontinuous/world-kernels/august.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/august.js +21 -0
- package/dist/discontinuous/world-kernels/august.js.map +1 -0
- package/dist/discontinuous/world-kernels/baker.d.ts +5 -0
- package/dist/discontinuous/world-kernels/baker.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/baker.js +29 -0
- package/dist/discontinuous/world-kernels/baker.js.map +1 -0
- package/dist/discontinuous/world-kernels/bertin.d.ts +5 -0
- package/dist/discontinuous/world-kernels/bertin.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/bertin.js +32 -0
- package/dist/discontinuous/world-kernels/bertin.js.map +1 -0
- package/dist/discontinuous/world-kernels/boggs.d.ts +5 -0
- package/dist/discontinuous/world-kernels/boggs.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/boggs.js +24 -0
- package/dist/discontinuous/world-kernels/boggs.js.map +1 -0
- package/dist/discontinuous/world-kernels/bonne.d.ts +3 -0
- package/dist/discontinuous/world-kernels/bonne.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/bonne.js +22 -0
- package/dist/discontinuous/world-kernels/bonne.js.map +1 -0
- package/dist/discontinuous/world-kernels/bottomley.d.ts +5 -0
- package/dist/discontinuous/world-kernels/bottomley.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/bottomley.js +18 -0
- package/dist/discontinuous/world-kernels/bottomley.js.map +1 -0
- package/dist/discontinuous/world-kernels/bromley.d.ts +5 -0
- package/dist/discontinuous/world-kernels/bromley.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/bromley.js +9 -0
- package/dist/discontinuous/world-kernels/bromley.js.map +1 -0
- package/dist/discontinuous/world-kernels/chamberlin.d.ts +2 -0
- package/dist/discontinuous/world-kernels/chamberlin.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/chamberlin.js +81 -0
- package/dist/discontinuous/world-kernels/chamberlin.js.map +1 -0
- package/dist/discontinuous/world-kernels/collignon.d.ts +5 -0
- package/dist/discontinuous/world-kernels/collignon.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/collignon.js +15 -0
- package/dist/discontinuous/world-kernels/collignon.js.map +1 -0
- package/dist/discontinuous/world-kernels/craig.d.ts +5 -0
- package/dist/discontinuous/world-kernels/craig.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/craig.js +30 -0
- package/dist/discontinuous/world-kernels/craig.js.map +1 -0
- package/dist/discontinuous/world-kernels/craster.d.ts +5 -0
- package/dist/discontinuous/world-kernels/craster.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/craster.js +15 -0
- package/dist/discontinuous/world-kernels/craster.js.map +1 -0
- package/dist/discontinuous/world-kernels/cylindricalEqualArea.d.ts +5 -0
- package/dist/discontinuous/world-kernels/cylindricalEqualArea.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/cylindricalEqualArea.js +17 -0
- package/dist/discontinuous/world-kernels/cylindricalEqualArea.js.map +1 -0
- package/dist/discontinuous/world-kernels/cylindricalStereographic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/cylindricalStereographic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/cylindricalStereographic.js +17 -0
- package/dist/discontinuous/world-kernels/cylindricalStereographic.js.map +1 -0
- package/dist/discontinuous/world-kernels/d3-geo-raw.d.ts +9 -0
- package/dist/discontinuous/world-kernels/d3-geo-raw.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/d3-geo-raw.js +21 -0
- package/dist/discontinuous/world-kernels/d3-geo-raw.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert1.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert1.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert1.js +15 -0
- package/dist/discontinuous/world-kernels/eckert1.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert2.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert2.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert2.js +15 -0
- package/dist/discontinuous/world-kernels/eckert2.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert3.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert3.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert3.js +15 -0
- package/dist/discontinuous/world-kernels/eckert3.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert4.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert4.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert4.js +20 -0
- package/dist/discontinuous/world-kernels/eckert4.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert5.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert5.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert5.js +14 -0
- package/dist/discontinuous/world-kernels/eckert5.js.map +1 -0
- package/dist/discontinuous/world-kernels/eckert6.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eckert6.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eckert6.js +19 -0
- package/dist/discontinuous/world-kernels/eckert6.js.map +1 -0
- package/dist/discontinuous/world-kernels/eisenlohr.d.ts +5 -0
- package/dist/discontinuous/world-kernels/eisenlohr.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/eisenlohr.js +41 -0
- package/dist/discontinuous/world-kernels/eisenlohr.js.map +1 -0
- package/dist/discontinuous/world-kernels/fahey.d.ts +5 -0
- package/dist/discontinuous/world-kernels/fahey.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/fahey.js +16 -0
- package/dist/discontinuous/world-kernels/fahey.js.map +1 -0
- package/dist/discontinuous/world-kernels/foucaut.d.ts +5 -0
- package/dist/discontinuous/world-kernels/foucaut.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/foucaut.js +15 -0
- package/dist/discontinuous/world-kernels/foucaut.js.map +1 -0
- package/dist/discontinuous/world-kernels/foucautSinusoidal.d.ts +5 -0
- package/dist/discontinuous/world-kernels/foucautSinusoidal.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/foucautSinusoidal.js +27 -0
- package/dist/discontinuous/world-kernels/foucautSinusoidal.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg4.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburg4.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg4.js +8 -0
- package/dist/discontinuous/world-kernels/ginzburg4.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg5.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburg5.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg5.js +8 -0
- package/dist/discontinuous/world-kernels/ginzburg5.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg6.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburg6.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg6.js +9 -0
- package/dist/discontinuous/world-kernels/ginzburg6.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg8.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburg8.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg8.js +28 -0
- package/dist/discontinuous/world-kernels/ginzburg8.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg9.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburg9.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburg9.js +8 -0
- package/dist/discontinuous/world-kernels/ginzburg9.js.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburgPolyconic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/ginzburgPolyconic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/ginzburgPolyconic.js +29 -0
- package/dist/discontinuous/world-kernels/ginzburgPolyconic.js.map +1 -0
- package/dist/discontinuous/world-kernels/hammer.d.ts +3 -0
- package/dist/discontinuous/world-kernels/hammer.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/hammer.js +34 -0
- package/dist/discontinuous/world-kernels/hammer.js.map +1 -0
- package/dist/discontinuous/world-kernels/hammerRetroazimuthal.d.ts +5 -0
- package/dist/discontinuous/world-kernels/hammerRetroazimuthal.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/hammerRetroazimuthal.js +37 -0
- package/dist/discontinuous/world-kernels/hammerRetroazimuthal.js.map +1 -0
- package/dist/discontinuous/world-kernels/hill.d.ts +5 -0
- package/dist/discontinuous/world-kernels/hill.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/hill.js +36 -0
- package/dist/discontinuous/world-kernels/hill.js.map +1 -0
- package/dist/discontinuous/world-kernels/homolosine.d.ts +5 -0
- package/dist/discontinuous/world-kernels/homolosine.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/homolosine.js +22 -0
- package/dist/discontinuous/world-kernels/homolosine.js.map +1 -0
- package/dist/discontinuous/world-kernels/hufnagel.d.ts +5 -0
- package/dist/discontinuous/world-kernels/hufnagel.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/hufnagel.js +53 -0
- package/dist/discontinuous/world-kernels/hufnagel.js.map +1 -0
- package/dist/discontinuous/world-kernels/hyperelliptical.d.ts +5 -0
- package/dist/discontinuous/world-kernels/hyperelliptical.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/hyperelliptical.js +47 -0
- package/dist/discontinuous/world-kernels/hyperelliptical.js.map +1 -0
- package/dist/discontinuous/world-kernels/integrate.d.ts +2 -0
- package/dist/discontinuous/world-kernels/integrate.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/integrate.js +82 -0
- package/dist/discontinuous/world-kernels/integrate.js.map +1 -0
- package/dist/discontinuous/world-kernels/kavrayskiy7.d.ts +5 -0
- package/dist/discontinuous/world-kernels/kavrayskiy7.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/kavrayskiy7.js +13 -0
- package/dist/discontinuous/world-kernels/kavrayskiy7.js.map +1 -0
- package/dist/discontinuous/world-kernels/lagrange.d.ts +5 -0
- package/dist/discontinuous/world-kernels/lagrange.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/lagrange.js +27 -0
- package/dist/discontinuous/world-kernels/lagrange.js.map +1 -0
- package/dist/discontinuous/world-kernels/larrivee.d.ts +5 -0
- package/dist/discontinuous/world-kernels/larrivee.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/larrivee.js +26 -0
- package/dist/discontinuous/world-kernels/larrivee.js.map +1 -0
- package/dist/discontinuous/world-kernels/laskowski.d.ts +5 -0
- package/dist/discontinuous/world-kernels/laskowski.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/laskowski.js +31 -0
- package/dist/discontinuous/world-kernels/laskowski.js.map +1 -0
- package/dist/discontinuous/world-kernels/littrow.d.ts +5 -0
- package/dist/discontinuous/world-kernels/littrow.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/littrow.js +13 -0
- package/dist/discontinuous/world-kernels/littrow.js.map +1 -0
- package/dist/discontinuous/world-kernels/loximuthal.d.ts +5 -0
- package/dist/discontinuous/world-kernels/loximuthal.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/loximuthal.js +30 -0
- package/dist/discontinuous/world-kernels/loximuthal.js.map +1 -0
- package/dist/discontinuous/world-kernels/math.d.ts +36 -0
- package/dist/discontinuous/world-kernels/math.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/math.js +63 -0
- package/dist/discontinuous/world-kernels/math.js.map +1 -0
- package/dist/discontinuous/world-kernels/miller.d.ts +5 -0
- package/dist/discontinuous/world-kernels/miller.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/miller.js +13 -0
- package/dist/discontinuous/world-kernels/miller.js.map +1 -0
- package/dist/discontinuous/world-kernels/modifiedStereographic.d.ts +18 -0
- package/dist/discontinuous/world-kernels/modifiedStereographic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/modifiedStereographic.js +79 -0
- package/dist/discontinuous/world-kernels/modifiedStereographic.js.map +1 -0
- package/dist/discontinuous/world-kernels/mollweide.d.ts +10 -0
- package/dist/discontinuous/world-kernels/mollweide.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/mollweide.js +24 -0
- package/dist/discontinuous/world-kernels/mollweide.js.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.js +19 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.js.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.js +26 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.js.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.d.ts +5 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.js +22 -0
- package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.js.map +1 -0
- package/dist/discontinuous/world-kernels/naturalEarth2.d.ts +5 -0
- package/dist/discontinuous/world-kernels/naturalEarth2.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/naturalEarth2.js +37 -0
- package/dist/discontinuous/world-kernels/naturalEarth2.js.map +1 -0
- package/dist/discontinuous/world-kernels/nellHammer.d.ts +5 -0
- package/dist/discontinuous/world-kernels/nellHammer.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/nellHammer.js +18 -0
- package/dist/discontinuous/world-kernels/nellHammer.js.map +1 -0
- package/dist/discontinuous/world-kernels/newton.d.ts +3 -0
- package/dist/discontinuous/world-kernels/newton.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/newton.js +65 -0
- package/dist/discontinuous/world-kernels/newton.js.map +1 -0
- package/dist/discontinuous/world-kernels/nicolosi.d.ts +5 -0
- package/dist/discontinuous/world-kernels/nicolosi.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/nicolosi.js +38 -0
- package/dist/discontinuous/world-kernels/nicolosi.js.map +1 -0
- package/dist/discontinuous/world-kernels/patterson.d.ts +5 -0
- package/dist/discontinuous/world-kernels/patterson.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/patterson.js +32 -0
- package/dist/discontinuous/world-kernels/patterson.js.map +1 -0
- package/dist/discontinuous/world-kernels/polyconic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/polyconic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/polyconic.js +30 -0
- package/dist/discontinuous/world-kernels/polyconic.js.map +1 -0
- package/dist/discontinuous/world-kernels/rectangularPolyconic.d.ts +5 -0
- package/dist/discontinuous/world-kernels/rectangularPolyconic.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/rectangularPolyconic.js +31 -0
- package/dist/discontinuous/world-kernels/rectangularPolyconic.js.map +1 -0
- package/dist/discontinuous/world-kernels/robinson.d.ts +5 -0
- package/dist/discontinuous/world-kernels/robinson.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/robinson.js +63 -0
- package/dist/discontinuous/world-kernels/robinson.js.map +1 -0
- package/dist/discontinuous/world-kernels/satellite.d.ts +5 -0
- package/dist/discontinuous/world-kernels/satellite.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/satellite.js +32 -0
- package/dist/discontinuous/world-kernels/satellite.js.map +1 -0
- package/dist/discontinuous/world-kernels/sinuMollweide.d.ts +7 -0
- package/dist/discontinuous/world-kernels/sinuMollweide.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/sinuMollweide.js +20 -0
- package/dist/discontinuous/world-kernels/sinuMollweide.js.map +1 -0
- package/dist/discontinuous/world-kernels/sinusoidal.d.ts +5 -0
- package/dist/discontinuous/world-kernels/sinusoidal.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/sinusoidal.js +13 -0
- package/dist/discontinuous/world-kernels/sinusoidal.js.map +1 -0
- package/dist/discontinuous/world-kernels/times.d.ts +5 -0
- package/dist/discontinuous/world-kernels/times.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/times.js +15 -0
- package/dist/discontinuous/world-kernels/times.js.map +1 -0
- package/dist/discontinuous/world-kernels/twoPointEquidistant.d.ts +3 -0
- package/dist/discontinuous/world-kernels/twoPointEquidistant.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/twoPointEquidistant.js +28 -0
- package/dist/discontinuous/world-kernels/twoPointEquidistant.js.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten.d.ts +5 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten.js +30 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten.js.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten2.d.ts +5 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten2.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten2.js +25 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten2.js.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten3.d.ts +5 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten3.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten3.js +22 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten3.js.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten4.d.ts +5 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten4.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten4.js +38 -0
- package/dist/discontinuous/world-kernels/vanDerGrinten4.js.map +1 -0
- package/dist/discontinuous/world-kernels/wagner.d.ts +5 -0
- package/dist/discontinuous/world-kernels/wagner.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/wagner.js +44 -0
- package/dist/discontinuous/world-kernels/wagner.js.map +1 -0
- package/dist/discontinuous/world-kernels/wagner4.d.ts +5 -0
- package/dist/discontinuous/world-kernels/wagner4.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/wagner4.js +10 -0
- package/dist/discontinuous/world-kernels/wagner4.js.map +1 -0
- package/dist/discontinuous/world-kernels/wagner6.d.ts +5 -0
- package/dist/discontinuous/world-kernels/wagner6.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/wagner6.js +13 -0
- package/dist/discontinuous/world-kernels/wagner6.js.map +1 -0
- package/dist/discontinuous/world-kernels/wiechel.d.ts +5 -0
- package/dist/discontinuous/world-kernels/wiechel.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/wiechel.js +15 -0
- package/dist/discontinuous/world-kernels/wiechel.js.map +1 -0
- package/dist/discontinuous/world-kernels/winkel3.d.ts +5 -0
- package/dist/discontinuous/world-kernels/winkel3.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels/winkel3.js +20 -0
- package/dist/discontinuous/world-kernels/winkel3.js.map +1 -0
- package/dist/discontinuous/world-kernels.d.ts +150 -0
- package/dist/discontinuous/world-kernels.d.ts.map +1 -0
- package/dist/discontinuous/world-kernels.js +215 -0
- package/dist/discontinuous/world-kernels.js.map +1 -0
- package/dist/discontinuous/world-map.d.ts +25 -0
- package/dist/discontinuous/world-map.d.ts.map +1 -0
- package/dist/discontinuous/world-map.js +187 -0
- package/dist/discontinuous/world-map.js.map +1 -0
- package/dist/discontinuous.cjs +7310 -0
- package/dist/discontinuous.cjs.map +6 -0
- package/dist/discontinuous.d.ts +52 -0
- package/dist/discontinuous.d.ts.map +1 -0
- package/dist/discontinuous.js +36 -0
- package/dist/discontinuous.js.map +1 -0
- package/dist/elastic.cjs +52991 -0
- package/dist/elastic.cjs.map +6 -0
- package/dist/elastic.d.ts +5 -0
- package/dist/elastic.d.ts.map +1 -0
- package/dist/elastic.js +8 -0
- package/dist/elastic.js.map +1 -0
- package/dist/ellipsoid-geodesic.d.ts +63 -0
- package/dist/ellipsoid-geodesic.d.ts.map +1 -0
- package/dist/ellipsoid-geodesic.js +70 -0
- package/dist/ellipsoid-geodesic.js.map +1 -0
- package/dist/ellipsoid-helpers/ellipsoid-transform.d.ts +1 -1
- package/dist/ellipsoid-helpers/ellipsoid-transform.d.ts.map +1 -1
- package/dist/ellipsoid-helpers/ellipsoid-transform.js +59 -18
- package/dist/ellipsoid-helpers/ellipsoid-transform.js.map +1 -1
- package/dist/ellipsoid-helpers/exact-nearest-surface.d.ts +16 -0
- package/dist/ellipsoid-helpers/exact-nearest-surface.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/exact-nearest-surface.js +108 -0
- package/dist/ellipsoid-helpers/exact-nearest-surface.js.map +1 -0
- package/dist/ellipsoid-helpers/intersection-bounds.d.ts +18 -0
- package/dist/ellipsoid-helpers/intersection-bounds.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/intersection-bounds.js +60 -0
- package/dist/ellipsoid-helpers/intersection-bounds.js.map +1 -0
- package/dist/ellipsoid-helpers/nearest-surface.d.ts +12 -0
- package/dist/ellipsoid-helpers/nearest-surface.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/nearest-surface.js +127 -0
- package/dist/ellipsoid-helpers/nearest-surface.js.map +1 -0
- package/dist/ellipsoid-helpers/rhumb-pole-distance.d.ts +3 -0
- package/dist/ellipsoid-helpers/rhumb-pole-distance.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/rhumb-pole-distance.js +63 -0
- package/dist/ellipsoid-helpers/rhumb-pole-distance.js.map +1 -0
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.d.ts +2 -0
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.d.ts.map +1 -1
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js +32 -63
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js.map +1 -1
- package/dist/ellipsoid-helpers/surface-polygon.d.ts +65 -0
- package/dist/ellipsoid-helpers/surface-polygon.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/surface-polygon.js +159 -0
- package/dist/ellipsoid-helpers/surface-polygon.js.map +1 -0
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts +7 -0
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts.map +1 -0
- package/dist/ellipsoid-helpers/tangent-plane-numerics.js +88 -0
- package/dist/ellipsoid-helpers/tangent-plane-numerics.js.map +1 -0
- package/dist/ellipsoid-metrics.d.ts +31 -0
- package/dist/ellipsoid-metrics.d.ts.map +1 -0
- package/dist/ellipsoid-metrics.js +186 -0
- package/dist/ellipsoid-metrics.js.map +1 -0
- package/dist/ellipsoid-occluder.d.ts +28 -0
- package/dist/ellipsoid-occluder.d.ts.map +1 -0
- package/dist/ellipsoid-occluder.js +112 -0
- package/dist/ellipsoid-occluder.js.map +1 -0
- package/dist/ellipsoid-rhumb.d.ts +52 -0
- package/dist/ellipsoid-rhumb.d.ts.map +1 -0
- package/dist/ellipsoid-rhumb.js +321 -0
- package/dist/ellipsoid-rhumb.js.map +1 -0
- package/dist/ellipsoid-tangent-plane.d.ts +30 -8
- package/dist/ellipsoid-tangent-plane.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.js +181 -31
- package/dist/ellipsoid-tangent-plane.js.map +1 -1
- package/dist/ellipsoid-transforms.d.ts +12 -0
- package/dist/ellipsoid-transforms.d.ts.map +1 -0
- package/dist/ellipsoid-transforms.js +15 -0
- package/dist/ellipsoid-transforms.js.map +1 -0
- package/dist/ellipsoid.d.ts +13 -12
- package/dist/ellipsoid.d.ts.map +1 -1
- package/dist/ellipsoid.js +230 -66
- package/dist/ellipsoid.js.map +1 -1
- package/dist/entries/ellipsoid.d.ts +26 -0
- package/dist/entries/ellipsoid.d.ts.map +1 -0
- package/dist/entries/ellipsoid.js +17 -0
- package/dist/entries/ellipsoid.js.map +1 -0
- package/dist/expressions.d.ts +4 -0
- package/dist/expressions.d.ts.map +1 -0
- package/dist/expressions.js +24 -0
- package/dist/expressions.js.map +1 -0
- package/dist/geoarrow/builder-entry.d.ts +4 -0
- package/dist/geoarrow/builder-entry.d.ts.map +1 -0
- package/dist/geoarrow/builder-entry.js +5 -0
- package/dist/geoarrow/builder-entry.js.map +1 -0
- package/dist/geoarrow/builder.d.ts +106 -0
- package/dist/geoarrow/builder.d.ts.map +1 -0
- package/dist/geoarrow/builder.js +668 -0
- package/dist/geoarrow/builder.js.map +1 -0
- package/dist/geoarrow/codecs.d.ts +24 -0
- package/dist/geoarrow/codecs.d.ts.map +1 -0
- package/dist/geoarrow/codecs.js +916 -0
- package/dist/geoarrow/codecs.js.map +1 -0
- package/dist/geoarrow/index.cjs +4352 -0
- package/dist/geoarrow/index.cjs.map +6 -0
- package/dist/geoarrow/index.d.ts +21 -0
- package/dist/geoarrow/index.d.ts.map +1 -0
- package/dist/geoarrow/index.js +15 -0
- package/dist/geoarrow/index.js.map +1 -0
- package/dist/geoarrow/kernels.d.ts +56 -0
- package/dist/geoarrow/kernels.d.ts.map +1 -0
- package/dist/geoarrow/kernels.js +982 -0
- package/dist/geoarrow/kernels.js.map +1 -0
- package/dist/geoarrow/layout.d.ts +66 -0
- package/dist/geoarrow/layout.d.ts.map +1 -0
- package/dist/geoarrow/layout.js +723 -0
- package/dist/geoarrow/layout.js.map +1 -0
- package/dist/geoarrow/stream-tessellate.d.ts +34 -0
- package/dist/geoarrow/stream-tessellate.d.ts.map +1 -0
- package/dist/geoarrow/stream-tessellate.js +171 -0
- package/dist/geoarrow/stream-tessellate.js.map +1 -0
- package/dist/geoarrow/stream.d.ts +29 -0
- package/dist/geoarrow/stream.d.ts.map +1 -0
- package/dist/geoarrow/stream.js +100 -0
- package/dist/geoarrow/stream.js.map +1 -0
- package/dist/geoarrow/tessellate.d.ts +31 -0
- package/dist/geoarrow/tessellate.d.ts.map +1 -0
- package/dist/geoarrow/tessellate.js +102 -0
- package/dist/geoarrow/tessellate.js.map +1 -0
- package/dist/geoarrow/tessellation-entry.d.ts +4 -0
- package/dist/geoarrow/tessellation-entry.d.ts.map +1 -0
- package/dist/geoarrow/tessellation-entry.js +5 -0
- package/dist/geoarrow/tessellation-entry.js.map +1 -0
- package/dist/geoarrow/types.d.ts +155 -0
- package/dist/geoarrow/types.d.ts.map +1 -0
- package/dist/geoarrow/types.js +71 -0
- package/dist/geoarrow/types.js.map +1 -0
- package/dist/geoarrow/views.d.ts +45 -0
- package/dist/geoarrow/views.d.ts.map +1 -0
- package/dist/geoarrow/views.js +114 -0
- package/dist/geoarrow/views.js.map +1 -0
- package/dist/geoarrow/wkb-entry.d.ts +4 -0
- package/dist/geoarrow/wkb-entry.d.ts.map +1 -0
- package/dist/geoarrow/wkb-entry.js +6 -0
- package/dist/geoarrow/wkb-entry.js.map +1 -0
- package/dist/geoarrow/worker.d.ts +11 -0
- package/dist/geoarrow/worker.d.ts.map +1 -0
- package/dist/geoarrow/worker.js +10 -0
- package/dist/geoarrow/worker.js.map +1 -0
- package/dist/geodesic-buffer.d.ts +34 -0
- package/dist/geodesic-buffer.d.ts.map +1 -0
- package/dist/geodesic-buffer.js +86 -0
- package/dist/geodesic-buffer.js.map +1 -0
- package/dist/geodesic-exact/area.d.ts +5 -0
- package/dist/geodesic-exact/area.d.ts.map +1 -0
- package/dist/geodesic-exact/area.js +56 -0
- package/dist/geodesic-exact/area.js.map +1 -0
- package/dist/geodesic-exact/inverse-engine.d.ts +57 -0
- package/dist/geodesic-exact/inverse-engine.d.ts.map +1 -0
- package/dist/geodesic-exact/inverse-engine.js +56 -0
- package/dist/geodesic-exact/inverse-engine.js.map +1 -0
- package/dist/geodesic-exact/polygon.d.ts +12 -0
- package/dist/geodesic-exact/polygon.d.ts.map +1 -0
- package/dist/geodesic-exact/polygon.js +27 -0
- package/dist/geodesic-exact/polygon.js.map +1 -0
- package/dist/geodesic-exact/quadrature.d.ts +9 -0
- package/dist/geodesic-exact/quadrature.d.ts.map +1 -0
- package/dist/geodesic-exact/quadrature.js +62 -0
- package/dist/geodesic-exact/quadrature.js.map +1 -0
- package/dist/geodesic-exact.d.ts +23 -0
- package/dist/geodesic-exact.d.ts.map +1 -0
- package/dist/geodesic-exact.js +210 -0
- package/dist/geodesic-exact.js.map +1 -0
- package/dist/geodesic-intersections.d.ts +83 -0
- package/dist/geodesic-intersections.d.ts.map +1 -0
- package/dist/geodesic-intersections.js +451 -0
- package/dist/geodesic-intersections.js.map +1 -0
- package/dist/geodesic-path.d.ts +28 -0
- package/dist/geodesic-path.d.ts.map +1 -0
- package/dist/geodesic-path.js +102 -0
- package/dist/geodesic-path.js.map +1 -0
- package/dist/geodesic-polygon.d.ts +11 -0
- package/dist/geodesic-polygon.d.ts.map +1 -0
- package/dist/geodesic-polygon.js +16 -0
- package/dist/geodesic-polygon.js.map +1 -0
- package/dist/geographic-atlas/atlas.d.ts +34 -0
- package/dist/geographic-atlas/atlas.d.ts.map +1 -0
- package/dist/geographic-atlas/atlas.js +493 -0
- package/dist/geographic-atlas/atlas.js.map +1 -0
- package/dist/geographic-atlas/curves.d.ts +25 -0
- package/dist/geographic-atlas/curves.d.ts.map +1 -0
- package/dist/geographic-atlas/curves.js +270 -0
- package/dist/geographic-atlas/curves.js.map +1 -0
- package/dist/geographic-atlas/math.d.ts +38 -0
- package/dist/geographic-atlas/math.d.ts.map +1 -0
- package/dist/geographic-atlas/math.js +115 -0
- package/dist/geographic-atlas/math.js.map +1 -0
- package/dist/geographic-atlas/sampling.d.ts +18 -0
- package/dist/geographic-atlas/sampling.d.ts.map +1 -0
- package/dist/geographic-atlas/sampling.js +96 -0
- package/dist/geographic-atlas/sampling.js.map +1 -0
- package/dist/geographic-atlas/topology.d.ts +20 -0
- package/dist/geographic-atlas/topology.d.ts.map +1 -0
- package/dist/geographic-atlas/topology.js +159 -0
- package/dist/geographic-atlas/topology.js.map +1 -0
- package/dist/geographic-atlas/types.d.ts +55 -0
- package/dist/geographic-atlas/types.d.ts.map +1 -0
- package/dist/geographic-atlas/types.js +2 -0
- package/dist/geographic-atlas/types.js.map +1 -0
- package/dist/geographic-atlas.d.ts +37 -0
- package/dist/geographic-atlas.d.ts.map +1 -0
- package/dist/geographic-atlas.js +77 -0
- package/dist/geographic-atlas.js.map +1 -0
- package/dist/geographic-cuts.d.ts +35 -0
- package/dist/geographic-cuts.d.ts.map +1 -0
- package/dist/geographic-cuts.js +78 -0
- package/dist/geographic-cuts.js.map +1 -0
- package/dist/geographic-seams/cut-options.d.ts +13 -0
- package/dist/geographic-seams/cut-options.d.ts.map +1 -0
- package/dist/geographic-seams/cut-options.js +38 -0
- package/dist/geographic-seams/cut-options.js.map +1 -0
- package/dist/geographic-seams/edge.d.ts +46 -0
- package/dist/geographic-seams/edge.d.ts.map +1 -0
- package/dist/geographic-seams/edge.js +372 -0
- package/dist/geographic-seams/edge.js.map +1 -0
- package/dist/geographic-seams/latitude.d.ts +6 -0
- package/dist/geographic-seams/latitude.d.ts.map +1 -0
- package/dist/geographic-seams/latitude.js +47 -0
- package/dist/geographic-seams/latitude.js.map +1 -0
- package/dist/geographic-seams/polygon.d.ts +27 -0
- package/dist/geographic-seams/polygon.d.ts.map +1 -0
- package/dist/geographic-seams/polygon.js +422 -0
- package/dist/geographic-seams/polygon.js.map +1 -0
- package/dist/geographic-seams/subdivide-cut.d.ts +14 -0
- package/dist/geographic-seams/subdivide-cut.d.ts.map +1 -0
- package/dist/geographic-seams/subdivide-cut.js +149 -0
- package/dist/geographic-seams/subdivide-cut.js.map +1 -0
- package/dist/geographic-seams/types.d.ts +59 -0
- package/dist/geographic-seams/types.d.ts.map +1 -0
- package/dist/geographic-seams/types.js +8 -0
- package/dist/geographic-seams/types.js.map +1 -0
- package/dist/geographic-seams.d.ts +12 -0
- package/dist/geographic-seams.d.ts.map +1 -0
- package/dist/geographic-seams.js +54 -0
- package/dist/geographic-seams.js.map +1 -0
- package/dist/geographic-tiles.d.ts +24 -0
- package/dist/geographic-tiles.d.ts.map +1 -0
- package/dist/geographic-tiles.js +72 -0
- package/dist/geographic-tiles.js.map +1 -0
- package/dist/globe-horizon-bounds.d.ts +13 -0
- package/dist/globe-horizon-bounds.d.ts.map +1 -0
- package/dist/globe-horizon-bounds.js +59 -0
- package/dist/globe-horizon-bounds.js.map +1 -0
- package/dist/globe.d.ts +16 -0
- package/dist/globe.d.ts.map +1 -0
- package/dist/globe.js +12 -0
- package/dist/globe.js.map +1 -0
- package/dist/index.cjs +17735 -500
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +71 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -6
- package/dist/index.js.map +1 -1
- package/dist/lng-lat-rectangle.d.ts.map +1 -1
- package/dist/lng-lat-rectangle.js +5 -3
- package/dist/lng-lat-rectangle.js.map +1 -1
- package/dist/local-reference-frame.d.ts +57 -0
- package/dist/local-reference-frame.d.ts.map +1 -0
- package/dist/local-reference-frame.js +247 -0
- package/dist/local-reference-frame.js.map +1 -0
- package/dist/make-obb-from-region.d.ts +1 -1
- package/dist/make-obb-from-region.d.ts.map +1 -1
- package/dist/make-obb-from-region.js +6 -4
- package/dist/make-obb-from-region.js.map +1 -1
- package/dist/projection/analysis.cjs +239 -0
- package/dist/projection/analysis.cjs.map +6 -0
- package/dist/projection/analysis.d.ts +72 -0
- package/dist/projection/analysis.d.ts.map +1 -0
- package/dist/projection/analysis.js +221 -0
- package/dist/projection/analysis.js.map +1 -0
- package/dist/projection/bulk.cjs +203 -0
- package/dist/projection/bulk.cjs.map +6 -0
- package/dist/projection/bulk.d.ts +51 -0
- package/dist/projection/bulk.d.ts.map +1 -0
- package/dist/projection/bulk.js +215 -0
- package/dist/projection/bulk.js.map +1 -0
- package/dist/projection/datums.cjs +1383 -0
- package/dist/projection/datums.cjs.map +6 -0
- package/dist/projection/datums.d.ts +5 -0
- package/dist/projection/datums.d.ts.map +1 -0
- package/dist/projection/datums.js +10 -0
- package/dist/projection/datums.js.map +1 -0
- package/dist/projection/deformation.cjs +134 -0
- package/dist/projection/deformation.cjs.map +6 -0
- package/dist/projection/deformation.d.ts +3 -0
- package/dist/projection/deformation.d.ts.map +1 -0
- package/dist/projection/deformation.js +5 -0
- package/dist/projection/deformation.js.map +1 -0
- package/dist/projection/experimental/authalic-latitude.d.ts +7 -0
- package/dist/projection/experimental/authalic-latitude.d.ts.map +1 -0
- package/dist/projection/experimental/authalic-latitude.js +51 -0
- package/dist/projection/experimental/authalic-latitude.js.map +1 -0
- package/dist/projection/experimental/catalogue-kernel.d.ts +9 -0
- package/dist/projection/experimental/catalogue-kernel.d.ts.map +1 -0
- package/dist/projection/experimental/catalogue-kernel.js +44 -0
- package/dist/projection/experimental/catalogue-kernel.js.map +1 -0
- package/dist/projection/experimental/common/adjust_lat.d.ts +2 -0
- package/dist/projection/experimental/common/adjust_lat.d.ts.map +1 -0
- package/dist/projection/experimental/common/adjust_lat.js +10 -0
- package/dist/projection/experimental/common/adjust_lat.js.map +1 -0
- package/dist/projection/experimental/common/adjust_lon.d.ts +2 -0
- package/dist/projection/experimental/common/adjust_lon.d.ts.map +1 -0
- package/dist/projection/experimental/common/adjust_lon.js +13 -0
- package/dist/projection/experimental/common/adjust_lon.js.map +1 -0
- package/dist/projection/experimental/common/asinhy.d.ts +2 -0
- package/dist/projection/experimental/common/asinhy.d.ts.map +1 -0
- package/dist/projection/experimental/common/asinhy.js +12 -0
- package/dist/projection/experimental/common/asinhy.js.map +1 -0
- package/dist/projection/experimental/common/asinz.d.ts +2 -0
- package/dist/projection/experimental/common/asinz.d.ts.map +1 -0
- package/dist/projection/experimental/common/asinz.js +11 -0
- package/dist/projection/experimental/common/asinz.js.map +1 -0
- package/dist/projection/experimental/common/authlat.d.ts +2 -0
- package/dist/projection/experimental/common/authlat.d.ts.map +1 -0
- package/dist/projection/experimental/common/authlat.js +9 -0
- package/dist/projection/experimental/common/authlat.js.map +1 -0
- package/dist/projection/experimental/common/authset.d.ts +2 -0
- package/dist/projection/experimental/common/authset.d.ts.map +1 -0
- package/dist/projection/experimental/common/authset.js +24 -0
- package/dist/projection/experimental/common/authset.js.map +1 -0
- package/dist/projection/experimental/common/clens.d.ts +2 -0
- package/dist/projection/experimental/common/clens.d.ts.map +1 -0
- package/dist/projection/experimental/common/clens.js +18 -0
- package/dist/projection/experimental/common/clens.js.map +1 -0
- package/dist/projection/experimental/common/clens_cmplx.d.ts +5 -0
- package/dist/projection/experimental/common/clens_cmplx.d.ts.map +1 -0
- package/dist/projection/experimental/common/clens_cmplx.js +34 -0
- package/dist/projection/experimental/common/clens_cmplx.js.map +1 -0
- package/dist/projection/experimental/common/constants.d.ts +9 -0
- package/dist/projection/experimental/common/constants.d.ts.map +1 -0
- package/dist/projection/experimental/common/constants.js +14 -0
- package/dist/projection/experimental/common/constants.js.map +1 -0
- package/dist/projection/experimental/common/cosh.d.ts +2 -0
- package/dist/projection/experimental/common/cosh.d.ts.map +1 -0
- package/dist/projection/experimental/common/cosh.js +10 -0
- package/dist/projection/experimental/common/cosh.js.map +1 -0
- package/dist/projection/experimental/common/e0fn.d.ts +2 -0
- package/dist/projection/experimental/common/e0fn.d.ts.map +1 -0
- package/dist/projection/experimental/common/e0fn.js +8 -0
- package/dist/projection/experimental/common/e0fn.js.map +1 -0
- package/dist/projection/experimental/common/e1fn.d.ts +2 -0
- package/dist/projection/experimental/common/e1fn.d.ts.map +1 -0
- package/dist/projection/experimental/common/e1fn.js +8 -0
- package/dist/projection/experimental/common/e1fn.js.map +1 -0
- package/dist/projection/experimental/common/e2fn.d.ts +2 -0
- package/dist/projection/experimental/common/e2fn.d.ts.map +1 -0
- package/dist/projection/experimental/common/e2fn.js +8 -0
- package/dist/projection/experimental/common/e2fn.js.map +1 -0
- package/dist/projection/experimental/common/e3fn.d.ts +2 -0
- package/dist/projection/experimental/common/e3fn.d.ts.map +1 -0
- package/dist/projection/experimental/common/e3fn.js +8 -0
- package/dist/projection/experimental/common/e3fn.js.map +1 -0
- package/dist/projection/experimental/common/fL.d.ts +2 -0
- package/dist/projection/experimental/common/fL.d.ts.map +1 -0
- package/dist/projection/experimental/common/fL.js +9 -0
- package/dist/projection/experimental/common/fL.js.map +1 -0
- package/dist/projection/experimental/common/gN.d.ts +2 -0
- package/dist/projection/experimental/common/gN.d.ts.map +1 -0
- package/dist/projection/experimental/common/gN.js +9 -0
- package/dist/projection/experimental/common/gN.js.map +1 -0
- package/dist/projection/experimental/common/gatg.d.ts +2 -0
- package/dist/projection/experimental/common/gatg.d.ts.map +1 -0
- package/dist/projection/experimental/common/gatg.js +18 -0
- package/dist/projection/experimental/common/gatg.js.map +1 -0
- package/dist/projection/experimental/common/hypot.d.ts +2 -0
- package/dist/projection/experimental/common/hypot.d.ts.map +1 -0
- package/dist/projection/experimental/common/hypot.js +12 -0
- package/dist/projection/experimental/common/hypot.js.map +1 -0
- package/dist/projection/experimental/common/imlfn.d.ts +2 -0
- package/dist/projection/experimental/common/imlfn.d.ts.map +1 -0
- package/dist/projection/experimental/common/imlfn.js +21 -0
- package/dist/projection/experimental/common/imlfn.js.map +1 -0
- package/dist/projection/experimental/common/invlatiso.d.ts +2 -0
- package/dist/projection/experimental/common/invlatiso.d.ts.map +1 -0
- package/dist/projection/experimental/common/invlatiso.js +20 -0
- package/dist/projection/experimental/common/invlatiso.js.map +1 -0
- package/dist/projection/experimental/common/iqsfnz.d.ts +2 -0
- package/dist/projection/experimental/common/iqsfnz.d.ts.map +1 -0
- package/dist/projection/experimental/common/iqsfnz.js +44 -0
- package/dist/projection/experimental/common/iqsfnz.js.map +1 -0
- package/dist/projection/experimental/common/latiso.d.ts +2 -0
- package/dist/projection/experimental/common/latiso.d.ts.map +1 -0
- package/dist/projection/experimental/common/latiso.js +19 -0
- package/dist/projection/experimental/common/latiso.js.map +1 -0
- package/dist/projection/experimental/common/log1py.d.ts +2 -0
- package/dist/projection/experimental/common/log1py.d.ts.map +1 -0
- package/dist/projection/experimental/common/log1py.js +10 -0
- package/dist/projection/experimental/common/log1py.js.map +1 -0
- package/dist/projection/experimental/common/meridian-distance.d.ts +5 -0
- package/dist/projection/experimental/common/meridian-distance.d.ts.map +1 -0
- package/dist/projection/experimental/common/meridian-distance.js +47 -0
- package/dist/projection/experimental/common/meridian-distance.js.map +1 -0
- package/dist/projection/experimental/common/mlfn.d.ts +2 -0
- package/dist/projection/experimental/common/mlfn.d.ts.map +1 -0
- package/dist/projection/experimental/common/mlfn.js +8 -0
- package/dist/projection/experimental/common/mlfn.js.map +1 -0
- package/dist/projection/experimental/common/msfnz.d.ts +2 -0
- package/dist/projection/experimental/common/msfnz.d.ts.map +1 -0
- package/dist/projection/experimental/common/msfnz.js +9 -0
- package/dist/projection/experimental/common/msfnz.js.map +1 -0
- package/dist/projection/experimental/common/phi2z.d.ts +2 -0
- package/dist/projection/experimental/common/phi2z.d.ts.map +1 -0
- package/dist/projection/experimental/common/phi2z.js +21 -0
- package/dist/projection/experimental/common/phi2z.js.map +1 -0
- package/dist/projection/experimental/common/pj_enfn.d.ts +2 -0
- package/dist/projection/experimental/common/pj_enfn.d.ts.map +1 -0
- package/dist/projection/experimental/common/pj_enfn.js +28 -0
- package/dist/projection/experimental/common/pj_enfn.js.map +1 -0
- package/dist/projection/experimental/common/pj_inv_mlfn.d.ts +2 -0
- package/dist/projection/experimental/common/pj_inv_mlfn.d.ts.map +1 -0
- package/dist/projection/experimental/common/pj_inv_mlfn.js +26 -0
- package/dist/projection/experimental/common/pj_inv_mlfn.js.map +1 -0
- package/dist/projection/experimental/common/pj_mlfn.d.ts +2 -0
- package/dist/projection/experimental/common/pj_mlfn.d.ts.map +1 -0
- package/dist/projection/experimental/common/pj_mlfn.js +10 -0
- package/dist/projection/experimental/common/pj_mlfn.js.map +1 -0
- package/dist/projection/experimental/common/qsfnz.d.ts +2 -0
- package/dist/projection/experimental/common/qsfnz.d.ts.map +1 -0
- package/dist/projection/experimental/common/qsfnz.js +16 -0
- package/dist/projection/experimental/common/qsfnz.js.map +1 -0
- package/dist/projection/experimental/common/sign.d.ts +2 -0
- package/dist/projection/experimental/common/sign.d.ts.map +1 -0
- package/dist/projection/experimental/common/sign.js +8 -0
- package/dist/projection/experimental/common/sign.js.map +1 -0
- package/dist/projection/experimental/common/sinh.d.ts +2 -0
- package/dist/projection/experimental/common/sinh.d.ts.map +1 -0
- package/dist/projection/experimental/common/sinh.js +10 -0
- package/dist/projection/experimental/common/sinh.js.map +1 -0
- package/dist/projection/experimental/common/srat.d.ts +2 -0
- package/dist/projection/experimental/common/srat.d.ts.map +1 -0
- package/dist/projection/experimental/common/srat.js +8 -0
- package/dist/projection/experimental/common/srat.js.map +1 -0
- package/dist/projection/experimental/common/tsfnz.d.ts +2 -0
- package/dist/projection/experimental/common/tsfnz.d.ts.map +1 -0
- package/dist/projection/experimental/common/tsfnz.js +12 -0
- package/dist/projection/experimental/common/tsfnz.js.map +1 -0
- package/dist/projection/experimental/common/vincenty.d.ts +29 -0
- package/dist/projection/experimental/common/vincenty.d.ts.map +1 -0
- package/dist/projection/experimental/common/vincenty.js +134 -0
- package/dist/projection/experimental/common/vincenty.js.map +1 -0
- package/dist/projection/experimental/core.cjs +1995 -0
- package/dist/projection/experimental/core.cjs.map +6 -0
- package/dist/projection/experimental/core.d.ts +16 -0
- package/dist/projection/experimental/core.d.ts.map +1 -0
- package/dist/projection/experimental/core.js +10 -0
- package/dist/projection/experimental/core.js.map +1 -0
- package/dist/projection/experimental/crs/datum-catalog.d.ts +5 -0
- package/dist/projection/experimental/crs/datum-catalog.d.ts.map +1 -0
- package/dist/projection/experimental/crs/datum-catalog.js +47 -0
- package/dist/projection/experimental/crs/datum-catalog.js.map +1 -0
- package/dist/projection/experimental/crs/datum-table.d.ts +8 -0
- package/dist/projection/experimental/crs/datum-table.d.ts.map +1 -0
- package/dist/projection/experimental/crs/datum-table.js +1355 -0
- package/dist/projection/experimental/crs/datum-table.js.map +1 -0
- package/dist/projection/experimental/crs/ellipsoid-table.d.ts +8 -0
- package/dist/projection/experimental/crs/ellipsoid-table.d.ts.map +1 -0
- package/dist/projection/experimental/crs/ellipsoid-table.js +229 -0
- package/dist/projection/experimental/crs/ellipsoid-table.js.map +1 -0
- package/dist/projection/experimental/crs/normalize.d.ts +11 -0
- package/dist/projection/experimental/crs/normalize.d.ts.map +1 -0
- package/dist/projection/experimental/crs/normalize.js +286 -0
- package/dist/projection/experimental/crs/normalize.js.map +1 -0
- package/dist/projection/experimental/crs/primemeridian-table.d.ts +3 -0
- package/dist/projection/experimental/crs/primemeridian-table.d.ts.map +1 -0
- package/dist/projection/experimental/crs/primemeridian-table.js +20 -0
- package/dist/projection/experimental/crs/primemeridian-table.js.map +1 -0
- package/dist/projection/experimental/crs/projjson.cjs +564 -0
- package/dist/projection/experimental/crs/projjson.cjs.map +6 -0
- package/dist/projection/experimental/crs/projjson.d.ts +4 -0
- package/dist/projection/experimental/crs/projjson.d.ts.map +1 -0
- package/dist/projection/experimental/crs/projjson.js +12 -0
- package/dist/projection/experimental/crs/projjson.js.map +1 -0
- package/dist/projection/experimental/crs/resolve.d.ts +11 -0
- package/dist/projection/experimental/crs/resolve.d.ts.map +1 -0
- package/dist/projection/experimental/crs/resolve.js +61 -0
- package/dist/projection/experimental/crs/resolve.js.map +1 -0
- package/dist/projection/experimental/crs/spatial-reference.d.ts +11 -0
- package/dist/projection/experimental/crs/spatial-reference.d.ts.map +1 -0
- package/dist/projection/experimental/crs/spatial-reference.js +91 -0
- package/dist/projection/experimental/crs/spatial-reference.js.map +1 -0
- package/dist/projection/experimental/crs/structured.d.ts +8 -0
- package/dist/projection/experimental/crs/structured.d.ts.map +1 -0
- package/dist/projection/experimental/crs/structured.js +534 -0
- package/dist/projection/experimental/crs/structured.js.map +1 -0
- package/dist/projection/experimental/crs/types.d.ts +73 -0
- package/dist/projection/experimental/crs/types.d.ts.map +1 -0
- package/dist/projection/experimental/crs/types.js +21 -0
- package/dist/projection/experimental/crs/types.js.map +1 -0
- package/dist/projection/experimental/crs/wkt.cjs +1229 -0
- package/dist/projection/experimental/crs/wkt.cjs.map +6 -0
- package/dist/projection/experimental/crs/wkt.d.ts +3 -0
- package/dist/projection/experimental/crs/wkt.d.ts.map +1 -0
- package/dist/projection/experimental/crs/wkt.js +190 -0
- package/dist/projection/experimental/crs/wkt.js.map +1 -0
- package/dist/projection/experimental/crs-descriptor.d.ts +13 -0
- package/dist/projection/experimental/crs-descriptor.d.ts.map +1 -0
- package/dist/projection/experimental/crs-descriptor.js +174 -0
- package/dist/projection/experimental/crs-descriptor.js.map +1 -0
- package/dist/projection/experimental/crs-rendering-scale.d.ts +5 -0
- package/dist/projection/experimental/crs-rendering-scale.d.ts.map +1 -0
- package/dist/projection/experimental/crs-rendering-scale.js +97 -0
- package/dist/projection/experimental/crs-rendering-scale.js.map +1 -0
- package/dist/projection/experimental/datum.d.ts +17 -0
- package/dist/projection/experimental/datum.d.ts.map +1 -0
- package/dist/projection/experimental/datum.js +160 -0
- package/dist/projection/experimental/datum.js.map +1 -0
- package/dist/projection/experimental/deformation-inverse.d.ts +5 -0
- package/dist/projection/experimental/deformation-inverse.d.ts.map +1 -0
- package/dist/projection/experimental/deformation-inverse.js +89 -0
- package/dist/projection/experimental/deformation-inverse.js.map +1 -0
- package/dist/projection/experimental/deformation.d.ts +23 -0
- package/dist/projection/experimental/deformation.d.ts.map +1 -0
- package/dist/projection/experimental/deformation.js +13 -0
- package/dist/projection/experimental/deformation.js.map +1 -0
- package/dist/projection/experimental/ellipsoidal-gnomonic.d.ts +10 -0
- package/dist/projection/experimental/ellipsoidal-gnomonic.d.ts.map +1 -0
- package/dist/projection/experimental/ellipsoidal-gnomonic.js +59 -0
- package/dist/projection/experimental/ellipsoidal-gnomonic.js.map +1 -0
- package/dist/projection/experimental/engine-options.d.ts +10 -0
- package/dist/projection/experimental/engine-options.d.ts.map +1 -0
- package/dist/projection/experimental/engine-options.js +26 -0
- package/dist/projection/experimental/engine-options.js.map +1 -0
- package/dist/projection/experimental/entries/projections/aea.cjs +649 -0
- package/dist/projection/experimental/entries/projections/aea.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/aea.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/aea.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/aea.js +5 -0
- package/dist/projection/experimental/entries/projections/aea.js.map +1 -0
- package/dist/projection/experimental/entries/projections/aeqd.cjs +718 -0
- package/dist/projection/experimental/entries/projections/aeqd.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/aeqd.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/aeqd.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/aeqd.js +5 -0
- package/dist/projection/experimental/entries/projections/aeqd.js.map +1 -0
- package/dist/projection/experimental/entries/projections/bonne.cjs +621 -0
- package/dist/projection/experimental/entries/projections/bonne.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/bonne.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/bonne.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/bonne.js +5 -0
- package/dist/projection/experimental/entries/projections/bonne.js.map +1 -0
- package/dist/projection/experimental/entries/projections/cass.cjs +610 -0
- package/dist/projection/experimental/entries/projections/cass.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/cass.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/cass.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/cass.js +5 -0
- package/dist/projection/experimental/entries/projections/cass.js.map +1 -0
- package/dist/projection/experimental/entries/projections/cea.cjs +536 -0
- package/dist/projection/experimental/entries/projections/cea.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/cea.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/cea.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/cea.js +5 -0
- package/dist/projection/experimental/entries/projections/cea.js.map +1 -0
- package/dist/projection/experimental/entries/projections/eck6.cjs +562 -0
- package/dist/projection/experimental/entries/projections/eck6.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/eck6.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/eck6.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/eck6.js +5 -0
- package/dist/projection/experimental/entries/projections/eck6.js.map +1 -0
- package/dist/projection/experimental/entries/projections/eqc.cjs +256 -0
- package/dist/projection/experimental/entries/projections/eqc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/eqc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/eqc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/eqc.js +5 -0
- package/dist/projection/experimental/entries/projections/eqc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/eqdc.cjs +650 -0
- package/dist/projection/experimental/entries/projections/eqdc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/eqdc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/eqdc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/eqdc.js +5 -0
- package/dist/projection/experimental/entries/projections/eqdc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/eqearth.cjs +460 -0
- package/dist/projection/experimental/entries/projections/eqearth.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/eqearth.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/eqearth.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/eqearth.js +5 -0
- package/dist/projection/experimental/entries/projections/eqearth.js.map +1 -0
- package/dist/projection/experimental/entries/projections/equi.cjs +477 -0
- package/dist/projection/experimental/entries/projections/equi.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/equi.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/equi.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/equi.js +5 -0
- package/dist/projection/experimental/entries/projections/equi.js.map +1 -0
- package/dist/projection/experimental/entries/projections/etmerc.cjs +887 -0
- package/dist/projection/experimental/entries/projections/etmerc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/etmerc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/etmerc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/etmerc.js +5 -0
- package/dist/projection/experimental/entries/projections/etmerc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/geocent.cjs +215 -0
- package/dist/projection/experimental/entries/projections/geocent.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/geocent.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/geocent.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/geocent.js +5 -0
- package/dist/projection/experimental/entries/projections/geocent.js.map +1 -0
- package/dist/projection/experimental/entries/projections/geos.cjs +703 -0
- package/dist/projection/experimental/entries/projections/geos.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/geos.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/geos.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/geos.js +5 -0
- package/dist/projection/experimental/entries/projections/geos.js.map +1 -0
- package/dist/projection/experimental/entries/projections/gnom.cjs +2028 -0
- package/dist/projection/experimental/entries/projections/gnom.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/gnom.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/gnom.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/gnom.js +5 -0
- package/dist/projection/experimental/entries/projections/gnom.js.map +1 -0
- package/dist/projection/experimental/entries/projections/gstmerc.cjs +526 -0
- package/dist/projection/experimental/entries/projections/gstmerc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/gstmerc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/gstmerc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/gstmerc.js +5 -0
- package/dist/projection/experimental/entries/projections/gstmerc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/krovak.cjs +683 -0
- package/dist/projection/experimental/entries/projections/krovak.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/krovak.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/krovak.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/krovak.js +5 -0
- package/dist/projection/experimental/entries/projections/krovak.js.map +1 -0
- package/dist/projection/experimental/entries/projections/laea.cjs +797 -0
- package/dist/projection/experimental/entries/projections/laea.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/laea.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/laea.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/laea.js +5 -0
- package/dist/projection/experimental/entries/projections/laea.js.map +1 -0
- package/dist/projection/experimental/entries/projections/lcc.cjs +637 -0
- package/dist/projection/experimental/entries/projections/lcc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/lcc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/lcc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/lcc.js +5 -0
- package/dist/projection/experimental/entries/projections/lcc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/merc.cjs +354 -0
- package/dist/projection/experimental/entries/projections/merc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/merc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/merc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/merc.js +5 -0
- package/dist/projection/experimental/entries/projections/merc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/mill.cjs +470 -0
- package/dist/projection/experimental/entries/projections/mill.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/mill.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/mill.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/mill.js +5 -0
- package/dist/projection/experimental/entries/projections/mill.js.map +1 -0
- package/dist/projection/experimental/entries/projections/moll.cjs +517 -0
- package/dist/projection/experimental/entries/projections/moll.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/moll.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/moll.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/moll.js +5 -0
- package/dist/projection/experimental/entries/projections/moll.js.map +1 -0
- package/dist/projection/experimental/entries/projections/nzmg.cjs +623 -0
- package/dist/projection/experimental/entries/projections/nzmg.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/nzmg.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/nzmg.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/nzmg.js +5 -0
- package/dist/projection/experimental/entries/projections/nzmg.js.map +1 -0
- package/dist/projection/experimental/entries/projections/ob_tran.cjs +540 -0
- package/dist/projection/experimental/entries/projections/ob_tran.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/ob_tran.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/ob_tran.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/ob_tran.js +5 -0
- package/dist/projection/experimental/entries/projections/ob_tran.js.map +1 -0
- package/dist/projection/experimental/entries/projections/omerc.cjs +850 -0
- package/dist/projection/experimental/entries/projections/omerc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/omerc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/omerc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/omerc.js +5 -0
- package/dist/projection/experimental/entries/projections/omerc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/ortho.cjs +519 -0
- package/dist/projection/experimental/entries/projections/ortho.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/ortho.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/ortho.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/ortho.js +5 -0
- package/dist/projection/experimental/entries/projections/ortho.js.map +1 -0
- package/dist/projection/experimental/entries/projections/poly.cjs +622 -0
- package/dist/projection/experimental/entries/projections/poly.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/poly.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/poly.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/poly.js +5 -0
- package/dist/projection/experimental/entries/projections/poly.js.map +1 -0
- package/dist/projection/experimental/entries/projections/qsc.cjs +695 -0
- package/dist/projection/experimental/entries/projections/qsc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/qsc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/qsc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/qsc.js +5 -0
- package/dist/projection/experimental/entries/projections/qsc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/robin.cjs +584 -0
- package/dist/projection/experimental/entries/projections/robin.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/robin.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/robin.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/robin.js +5 -0
- package/dist/projection/experimental/entries/projections/robin.js.map +1 -0
- package/dist/projection/experimental/entries/projections/sinu.cjs +586 -0
- package/dist/projection/experimental/entries/projections/sinu.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/sinu.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/sinu.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/sinu.js +5 -0
- package/dist/projection/experimental/entries/projections/sinu.js.map +1 -0
- package/dist/projection/experimental/entries/projections/somerc.cjs +575 -0
- package/dist/projection/experimental/entries/projections/somerc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/somerc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/somerc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/somerc.js +5 -0
- package/dist/projection/experimental/entries/projections/somerc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/stere.cjs +697 -0
- package/dist/projection/experimental/entries/projections/stere.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/stere.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/stere.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/stere.js +5 -0
- package/dist/projection/experimental/entries/projections/stere.js.map +1 -0
- package/dist/projection/experimental/entries/projections/sterea.cjs +631 -0
- package/dist/projection/experimental/entries/projections/sterea.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/sterea.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/sterea.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/sterea.js +5 -0
- package/dist/projection/experimental/entries/projections/sterea.js.map +1 -0
- package/dist/projection/experimental/entries/projections/tmerc.cjs +887 -0
- package/dist/projection/experimental/entries/projections/tmerc.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/tmerc.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/tmerc.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/tmerc.js +5 -0
- package/dist/projection/experimental/entries/projections/tmerc.js.map +1 -0
- package/dist/projection/experimental/entries/projections/tpers.cjs +645 -0
- package/dist/projection/experimental/entries/projections/tpers.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/tpers.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/tpers.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/tpers.js +5 -0
- package/dist/projection/experimental/entries/projections/tpers.js.map +1 -0
- package/dist/projection/experimental/entries/projections/utm.cjs +915 -0
- package/dist/projection/experimental/entries/projections/utm.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/utm.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/utm.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/utm.js +5 -0
- package/dist/projection/experimental/entries/projections/utm.js.map +1 -0
- package/dist/projection/experimental/entries/projections/vandg.cjs +560 -0
- package/dist/projection/experimental/entries/projections/vandg.cjs.map +6 -0
- package/dist/projection/experimental/entries/projections/vandg.d.ts +2 -0
- package/dist/projection/experimental/entries/projections/vandg.d.ts.map +1 -0
- package/dist/projection/experimental/entries/projections/vandg.js +5 -0
- package/dist/projection/experimental/entries/projections/vandg.js.map +1 -0
- package/dist/projection/experimental/exact-helmert.d.ts +9 -0
- package/dist/projection/experimental/exact-helmert.d.ts.map +1 -0
- package/dist/projection/experimental/exact-helmert.js +32 -0
- package/dist/projection/experimental/exact-helmert.js.map +1 -0
- package/dist/projection/experimental/flat-projection.d.ts +15 -0
- package/dist/projection/experimental/flat-projection.d.ts.map +1 -0
- package/dist/projection/experimental/flat-projection.js +70 -0
- package/dist/projection/experimental/flat-projection.js.map +1 -0
- package/dist/projection/experimental/grids/geotiff.cjs +180 -0
- package/dist/projection/experimental/grids/geotiff.cjs.map +6 -0
- package/dist/projection/experimental/grids/geotiff.d.ts +23 -0
- package/dist/projection/experimental/grids/geotiff.d.ts.map +1 -0
- package/dist/projection/experimental/grids/geotiff.js +59 -0
- package/dist/projection/experimental/grids/geotiff.js.map +1 -0
- package/dist/projection/experimental/grids/grid.d.ts +4 -0
- package/dist/projection/experimental/grids/grid.d.ts.map +1 -0
- package/dist/projection/experimental/grids/grid.js +111 -0
- package/dist/projection/experimental/grids/grid.js.map +1 -0
- package/dist/projection/experimental/grids/gtx.cjs +91 -0
- package/dist/projection/experimental/grids/gtx.cjs.map +6 -0
- package/dist/projection/experimental/grids/gtx.d.ts +7 -0
- package/dist/projection/experimental/grids/gtx.d.ts.map +1 -0
- package/dist/projection/experimental/grids/gtx.js +30 -0
- package/dist/projection/experimental/grids/gtx.js.map +1 -0
- package/dist/projection/experimental/grids/ntv2.cjs +181 -0
- package/dist/projection/experimental/grids/ntv2.cjs.map +6 -0
- package/dist/projection/experimental/grids/ntv2.d.ts +8 -0
- package/dist/projection/experimental/grids/ntv2.d.ts.map +1 -0
- package/dist/projection/experimental/grids/ntv2.js +56 -0
- package/dist/projection/experimental/grids/ntv2.js.map +1 -0
- package/dist/projection/experimental/grids/scalar-geotiff.d.ts +58 -0
- package/dist/projection/experimental/grids/scalar-geotiff.d.ts.map +1 -0
- package/dist/projection/experimental/grids/scalar-geotiff.js +147 -0
- package/dist/projection/experimental/grids/scalar-geotiff.js.map +1 -0
- package/dist/projection/experimental/grids/types.d.ts +35 -0
- package/dist/projection/experimental/grids/types.d.ts.map +1 -0
- package/dist/projection/experimental/grids/types.js +2 -0
- package/dist/projection/experimental/grids/types.js.map +1 -0
- package/dist/projection/experimental/grids/velocity-geotiff.cjs +247 -0
- package/dist/projection/experimental/grids/velocity-geotiff.cjs.map +6 -0
- package/dist/projection/experimental/grids/velocity-geotiff.d.ts +11 -0
- package/dist/projection/experimental/grids/velocity-geotiff.d.ts.map +1 -0
- package/dist/projection/experimental/grids/velocity-geotiff.js +61 -0
- package/dist/projection/experimental/grids/velocity-geotiff.js.map +1 -0
- package/dist/projection/experimental/grids/velocity.d.ts +21 -0
- package/dist/projection/experimental/grids/velocity.d.ts.map +1 -0
- package/dist/projection/experimental/grids/velocity.js +29 -0
- package/dist/projection/experimental/grids/velocity.js.map +1 -0
- package/dist/projection/experimental/grids/vertical-geotiff.cjs +195 -0
- package/dist/projection/experimental/grids/vertical-geotiff.cjs.map +6 -0
- package/dist/projection/experimental/grids/vertical-geotiff.d.ts +6 -0
- package/dist/projection/experimental/grids/vertical-geotiff.d.ts.map +1 -0
- package/dist/projection/experimental/grids/vertical-geotiff.js +20 -0
- package/dist/projection/experimental/grids/vertical-geotiff.js.map +1 -0
- package/dist/projection/experimental/grids/vertical.cjs +80 -0
- package/dist/projection/experimental/grids/vertical.cjs.map +6 -0
- package/dist/projection/experimental/grids/vertical.d.ts +22 -0
- package/dist/projection/experimental/grids/vertical.d.ts.map +1 -0
- package/dist/projection/experimental/grids/vertical.js +73 -0
- package/dist/projection/experimental/grids/vertical.js.map +1 -0
- package/dist/projection/experimental/helmert-flat.d.ts +4 -0
- package/dist/projection/experimental/helmert-flat.d.ts.map +1 -0
- package/dist/projection/experimental/helmert-flat.js +53 -0
- package/dist/projection/experimental/helmert-flat.js.map +1 -0
- package/dist/projection/experimental/index.cjs +11607 -0
- package/dist/projection/experimental/index.cjs.map +6 -0
- package/dist/projection/experimental/index.d.ts +49 -0
- package/dist/projection/experimental/index.d.ts.map +1 -0
- package/dist/projection/experimental/index.js +48 -0
- package/dist/projection/experimental/index.js.map +1 -0
- package/dist/projection/experimental/inverse-spherical-latitude.d.ts +2 -0
- package/dist/projection/experimental/inverse-spherical-latitude.d.ts.map +1 -0
- package/dist/projection/experimental/inverse-spherical-latitude.js +11 -0
- package/dist/projection/experimental/inverse-spherical-latitude.js.map +1 -0
- package/dist/projection/experimental/kernel.d.ts +37 -0
- package/dist/projection/experimental/kernel.d.ts.map +1 -0
- package/dist/projection/experimental/kernel.js +81 -0
- package/dist/projection/experimental/kernel.js.map +1 -0
- package/dist/projection/experimental/kernels/aea.d.ts +25 -0
- package/dist/projection/experimental/kernels/aea.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/aea.js +118 -0
- package/dist/projection/experimental/kernels/aea.js.map +1 -0
- package/dist/projection/experimental/kernels/aeqd.d.ts +10 -0
- package/dist/projection/experimental/kernels/aeqd.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/aeqd.js +168 -0
- package/dist/projection/experimental/kernels/aeqd.js.map +1 -0
- package/dist/projection/experimental/kernels/bonne.d.ts +12 -0
- package/dist/projection/experimental/kernels/bonne.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/bonne.js +128 -0
- package/dist/projection/experimental/kernels/bonne.js.map +1 -0
- package/dist/projection/experimental/kernels/cass.d.ts +10 -0
- package/dist/projection/experimental/kernels/cass.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/cass.js +122 -0
- package/dist/projection/experimental/kernels/cass.js.map +1 -0
- package/dist/projection/experimental/kernels/cea.d.ts +6 -0
- package/dist/projection/experimental/kernels/cea.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/cea.js +63 -0
- package/dist/projection/experimental/kernels/cea.js.map +1 -0
- package/dist/projection/experimental/kernels/eck6.d.ts +13 -0
- package/dist/projection/experimental/kernels/eck6.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/eck6.js +23 -0
- package/dist/projection/experimental/kernels/eck6.js.map +1 -0
- package/dist/projection/experimental/kernels/eqdc.d.ts +19 -0
- package/dist/projection/experimental/kernels/eqdc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/eqdc.js +117 -0
- package/dist/projection/experimental/kernels/eqdc.js.map +1 -0
- package/dist/projection/experimental/kernels/eqearth.d.ts +10 -0
- package/dist/projection/experimental/kernels/eqearth.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/eqearth.js +114 -0
- package/dist/projection/experimental/kernels/eqearth.js.map +1 -0
- package/dist/projection/experimental/kernels/equi.d.ts +9 -0
- package/dist/projection/experimental/kernels/equi.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/equi.js +43 -0
- package/dist/projection/experimental/kernels/equi.js.map +1 -0
- package/dist/projection/experimental/kernels/etmerc.d.ts +13 -0
- package/dist/projection/experimental/kernels/etmerc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/etmerc.js +145 -0
- package/dist/projection/experimental/kernels/etmerc.js.map +1 -0
- package/dist/projection/experimental/kernels/gauss.d.ts +12 -0
- package/dist/projection/experimental/kernels/gauss.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/gauss.js +64 -0
- package/dist/projection/experimental/kernels/gauss.js.map +1 -0
- package/dist/projection/experimental/kernels/geos.d.ts +17 -0
- package/dist/projection/experimental/kernels/geos.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/geos.js +153 -0
- package/dist/projection/experimental/kernels/geos.js.map +1 -0
- package/dist/projection/experimental/kernels/gnom.d.ts +14 -0
- package/dist/projection/experimental/kernels/gnom.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/gnom.js +102 -0
- package/dist/projection/experimental/kernels/gnom.js.map +1 -0
- package/dist/projection/experimental/kernels/gstmerc.d.ts +13 -0
- package/dist/projection/experimental/kernels/gstmerc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/gstmerc.js +57 -0
- package/dist/projection/experimental/kernels/gstmerc.js.map +1 -0
- package/dist/projection/experimental/kernels/krovak.d.ts +23 -0
- package/dist/projection/experimental/kernels/krovak.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/krovak.js +128 -0
- package/dist/projection/experimental/kernels/krovak.js.map +1 -0
- package/dist/projection/experimental/kernels/laea.d.ts +22 -0
- package/dist/projection/experimental/kernels/laea.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/laea.js +296 -0
- package/dist/projection/experimental/kernels/laea.js.map +1 -0
- package/dist/projection/experimental/kernels/lcc.d.ts +10 -0
- package/dist/projection/experimental/kernels/lcc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/lcc.js +126 -0
- package/dist/projection/experimental/kernels/lcc.js.map +1 -0
- package/dist/projection/experimental/kernels/mill.d.ts +6 -0
- package/dist/projection/experimental/kernels/mill.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/mill.js +49 -0
- package/dist/projection/experimental/kernels/mill.js.map +1 -0
- package/dist/projection/experimental/kernels/moll.d.ts +6 -0
- package/dist/projection/experimental/kernels/moll.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/moll.js +104 -0
- package/dist/projection/experimental/kernels/moll.js.map +1 -0
- package/dist/projection/experimental/kernels/nzmg.d.ts +28 -0
- package/dist/projection/experimental/kernels/nzmg.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/nzmg.js +209 -0
- package/dist/projection/experimental/kernels/nzmg.js.map +1 -0
- package/dist/projection/experimental/kernels/omerc.d.ts +30 -0
- package/dist/projection/experimental/kernels/omerc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/omerc.js +260 -0
- package/dist/projection/experimental/kernels/omerc.js.map +1 -0
- package/dist/projection/experimental/kernels/ortho.d.ts +10 -0
- package/dist/projection/experimental/kernels/ortho.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/ortho.js +43 -0
- package/dist/projection/experimental/kernels/ortho.js.map +1 -0
- package/dist/projection/experimental/kernels/poly.d.ts +10 -0
- package/dist/projection/experimental/kernels/poly.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/poly.js +193 -0
- package/dist/projection/experimental/kernels/poly.js.map +1 -0
- package/dist/projection/experimental/kernels/qsc.d.ts +10 -0
- package/dist/projection/experimental/kernels/qsc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/qsc.js +364 -0
- package/dist/projection/experimental/kernels/qsc.js.map +1 -0
- package/dist/projection/experimental/kernels/robin.d.ts +6 -0
- package/dist/projection/experimental/kernels/robin.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/robin.js +166 -0
- package/dist/projection/experimental/kernels/robin.js.map +1 -0
- package/dist/projection/experimental/kernels/sinu.d.ts +12 -0
- package/dist/projection/experimental/kernels/sinu.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/sinu.js +107 -0
- package/dist/projection/experimental/kernels/sinu.js.map +1 -0
- package/dist/projection/experimental/kernels/somerc.d.ts +13 -0
- package/dist/projection/experimental/kernels/somerc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/somerc.js +79 -0
- package/dist/projection/experimental/kernels/somerc.js.map +1 -0
- package/dist/projection/experimental/kernels/stere.d.ts +15 -0
- package/dist/projection/experimental/kernels/stere.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/stere.js +207 -0
- package/dist/projection/experimental/kernels/stere.js.map +1 -0
- package/dist/projection/experimental/kernels/sterea.d.ts +11 -0
- package/dist/projection/experimental/kernels/sterea.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/sterea.js +67 -0
- package/dist/projection/experimental/kernels/sterea.js.map +1 -0
- package/dist/projection/experimental/kernels/tmerc.d.ts +9 -0
- package/dist/projection/experimental/kernels/tmerc.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/tmerc.js +201 -0
- package/dist/projection/experimental/kernels/tmerc.js.map +1 -0
- package/dist/projection/experimental/kernels/tpers.d.ts +22 -0
- package/dist/projection/experimental/kernels/tpers.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/tpers.js +156 -0
- package/dist/projection/experimental/kernels/tpers.js.map +1 -0
- package/dist/projection/experimental/kernels/vandg.d.ts +8 -0
- package/dist/projection/experimental/kernels/vandg.d.ts.map +1 -0
- package/dist/projection/experimental/kernels/vandg.js +133 -0
- package/dist/projection/experimental/kernels/vandg.js.map +1 -0
- package/dist/projection/experimental/kinematic-helmert-flat.d.ts +4 -0
- package/dist/projection/experimental/kinematic-helmert-flat.d.ts.map +1 -0
- package/dist/projection/experimental/kinematic-helmert-flat.js +60 -0
- package/dist/projection/experimental/kinematic-helmert-flat.js.map +1 -0
- package/dist/projection/experimental/kinematic-helmert.d.ts +11 -0
- package/dist/projection/experimental/kinematic-helmert.d.ts.map +1 -0
- package/dist/projection/experimental/kinematic-helmert.js +103 -0
- package/dist/projection/experimental/kinematic-helmert.js.map +1 -0
- package/dist/projection/experimental/lazy-projection.d.ts +17 -0
- package/dist/projection/experimental/lazy-projection.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projection.js +166 -0
- package/dist/projection/experimental/lazy-projection.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/aea.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/aea.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/aea.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/aea.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/aea.js +7 -0
- package/dist/projection/experimental/lazy-projections/aea.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/aeqd.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/aeqd.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/aeqd.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/aeqd.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/aeqd.js +8 -0
- package/dist/projection/experimental/lazy-projections/aeqd.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/bonne.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/bonne.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/bonne.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/bonne.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/bonne.js +7 -0
- package/dist/projection/experimental/lazy-projections/bonne.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/cass.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/cass.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/cass.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/cass.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/cass.js +7 -0
- package/dist/projection/experimental/lazy-projections/cass.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/cea.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/cea.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/cea.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/cea.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/cea.js +8 -0
- package/dist/projection/experimental/lazy-projections/cea.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/eck6.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/eck6.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/eck6.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/eck6.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/eck6.js +7 -0
- package/dist/projection/experimental/lazy-projections/eck6.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqc.cjs +82 -0
- package/dist/projection/experimental/lazy-projections/eqc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/eqc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/eqc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqc.js +11 -0
- package/dist/projection/experimental/lazy-projections/eqc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqdc.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/eqdc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/eqdc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/eqdc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqdc.js +8 -0
- package/dist/projection/experimental/lazy-projections/eqdc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqearth.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/eqearth.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/eqearth.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/eqearth.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/eqearth.js +7 -0
- package/dist/projection/experimental/lazy-projections/eqearth.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/equi.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/equi.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/equi.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/equi.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/equi.js +7 -0
- package/dist/projection/experimental/lazy-projections/equi.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/etmerc.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/etmerc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/etmerc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/etmerc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/etmerc.js +8 -0
- package/dist/projection/experimental/lazy-projections/etmerc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/geocent.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/geocent.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/geocent.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/geocent.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/geocent.js +7 -0
- package/dist/projection/experimental/lazy-projections/geocent.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/geos.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/geos.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/geos.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/geos.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/geos.js +7 -0
- package/dist/projection/experimental/lazy-projections/geos.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/gnom.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/gnom.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/gnom.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/gnom.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/gnom.js +7 -0
- package/dist/projection/experimental/lazy-projections/gnom.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.js +9 -0
- package/dist/projection/experimental/lazy-projections/gstmerc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/index.cjs +2401 -0
- package/dist/projection/experimental/lazy-projections/index.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/index.d.ts +38 -0
- package/dist/projection/experimental/lazy-projections/index.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/index.js +41 -0
- package/dist/projection/experimental/lazy-projections/index.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/krovak.cjs +87 -0
- package/dist/projection/experimental/lazy-projections/krovak.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/krovak.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/krovak.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/krovak.js +15 -0
- package/dist/projection/experimental/lazy-projections/krovak.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/laea.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/laea.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/laea.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/laea.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/laea.js +8 -0
- package/dist/projection/experimental/lazy-projections/laea.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/lcc.cjs +89 -0
- package/dist/projection/experimental/lazy-projections/lcc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/lcc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/lcc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/lcc.js +18 -0
- package/dist/projection/experimental/lazy-projections/lcc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/merc.cjs +88 -0
- package/dist/projection/experimental/lazy-projections/merc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/merc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/merc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/merc.js +16 -0
- package/dist/projection/experimental/lazy-projections/merc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/mill.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/mill.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/mill.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/mill.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/mill.js +8 -0
- package/dist/projection/experimental/lazy-projections/mill.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/moll.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/moll.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/moll.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/moll.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/moll.js +7 -0
- package/dist/projection/experimental/lazy-projections/moll.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/nzmg.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/nzmg.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/nzmg.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/nzmg.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/nzmg.js +8 -0
- package/dist/projection/experimental/lazy-projections/nzmg.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.cjs +90 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.d.ts +5 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.js +18 -0
- package/dist/projection/experimental/lazy-projections/ob_tran.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/omerc.cjs +91 -0
- package/dist/projection/experimental/lazy-projections/omerc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/omerc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/omerc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/omerc.js +19 -0
- package/dist/projection/experimental/lazy-projections/omerc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/ortho.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/ortho.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/ortho.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/ortho.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/ortho.js +7 -0
- package/dist/projection/experimental/lazy-projections/ortho.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/poly.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/poly.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/poly.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/poly.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/poly.js +7 -0
- package/dist/projection/experimental/lazy-projections/poly.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/qsc.cjs +82 -0
- package/dist/projection/experimental/lazy-projections/qsc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/qsc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/qsc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/qsc.js +12 -0
- package/dist/projection/experimental/lazy-projections/qsc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/robin.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/robin.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/robin.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/robin.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/robin.js +7 -0
- package/dist/projection/experimental/lazy-projections/robin.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/sinu.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/sinu.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/sinu.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/sinu.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/sinu.js +7 -0
- package/dist/projection/experimental/lazy-projections/sinu.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/somerc.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/somerc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/somerc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/somerc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/somerc.js +8 -0
- package/dist/projection/experimental/lazy-projections/somerc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/stere.cjs +87 -0
- package/dist/projection/experimental/lazy-projections/stere.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/stere.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/stere.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/stere.js +15 -0
- package/dist/projection/experimental/lazy-projections/stere.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/sterea.cjs +87 -0
- package/dist/projection/experimental/lazy-projections/sterea.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/sterea.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/sterea.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/sterea.js +16 -0
- package/dist/projection/experimental/lazy-projections/sterea.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/tmerc.cjs +89 -0
- package/dist/projection/experimental/lazy-projections/tmerc.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/tmerc.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/tmerc.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/tmerc.js +18 -0
- package/dist/projection/experimental/lazy-projections/tmerc.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/tpers.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/tpers.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/tpers.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/tpers.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/tpers.js +8 -0
- package/dist/projection/experimental/lazy-projections/tpers.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/utm.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/utm.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/utm.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/utm.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/utm.js +8 -0
- package/dist/projection/experimental/lazy-projections/utm.js.map +1 -0
- package/dist/projection/experimental/lazy-projections/vandg.cjs +79 -0
- package/dist/projection/experimental/lazy-projections/vandg.cjs.map +6 -0
- package/dist/projection/experimental/lazy-projections/vandg.d.ts +3 -0
- package/dist/projection/experimental/lazy-projections/vandg.d.ts.map +1 -0
- package/dist/projection/experimental/lazy-projections/vandg.js +7 -0
- package/dist/projection/experimental/lazy-projections/vandg.js.map +1 -0
- package/dist/projection/experimental/mutable-projection.d.ts +6 -0
- package/dist/projection/experimental/mutable-projection.d.ts.map +1 -0
- package/dist/projection/experimental/mutable-projection.js +53 -0
- package/dist/projection/experimental/mutable-projection.js.map +1 -0
- package/dist/projection/experimental/numeric-flat.d.ts +8 -0
- package/dist/projection/experimental/numeric-flat.d.ts.map +1 -0
- package/dist/projection/experimental/numeric-flat.js +54 -0
- package/dist/projection/experimental/numeric-flat.js.map +1 -0
- package/dist/projection/experimental/parameters.d.ts +8 -0
- package/dist/projection/experimental/parameters.d.ts.map +1 -0
- package/dist/projection/experimental/parameters.js +31 -0
- package/dist/projection/experimental/parameters.js.map +1 -0
- package/dist/projection/experimental/projection-descriptor.d.ts +13 -0
- package/dist/projection/experimental/projection-descriptor.d.ts.map +1 -0
- package/dist/projection/experimental/projection-descriptor.js +52 -0
- package/dist/projection/experimental/projection-descriptor.js.map +1 -0
- package/dist/projection/experimental/projection-engine.d.ts +23 -0
- package/dist/projection/experimental/projection-engine.d.ts.map +1 -0
- package/dist/projection/experimental/projection-engine.js +33 -0
- package/dist/projection/experimental/projection-engine.js.map +1 -0
- package/dist/projection/experimental/projection-pipeline.d.ts +142 -0
- package/dist/projection/experimental/projection-pipeline.d.ts.map +1 -0
- package/dist/projection/experimental/projection-pipeline.js +740 -0
- package/dist/projection/experimental/projection-pipeline.js.map +1 -0
- package/dist/projection/experimental/projection-scratch.d.ts +11 -0
- package/dist/projection/experimental/projection-scratch.d.ts.map +1 -0
- package/dist/projection/experimental/projection-scratch.js +25 -0
- package/dist/projection/experimental/projection-scratch.js.map +1 -0
- package/dist/projection/experimental/projections/aea.d.ts +3 -0
- package/dist/projection/experimental/projections/aea.d.ts.map +1 -0
- package/dist/projection/experimental/projections/aea.js +24 -0
- package/dist/projection/experimental/projections/aea.js.map +1 -0
- package/dist/projection/experimental/projections/aeqd.d.ts +3 -0
- package/dist/projection/experimental/projections/aeqd.d.ts.map +1 -0
- package/dist/projection/experimental/projections/aeqd.js +19 -0
- package/dist/projection/experimental/projections/aeqd.js.map +1 -0
- package/dist/projection/experimental/projections/bonne.d.ts +3 -0
- package/dist/projection/experimental/projections/bonne.d.ts.map +1 -0
- package/dist/projection/experimental/projections/bonne.js +25 -0
- package/dist/projection/experimental/projections/bonne.js.map +1 -0
- package/dist/projection/experimental/projections/cass.d.ts +3 -0
- package/dist/projection/experimental/projections/cass.d.ts.map +1 -0
- package/dist/projection/experimental/projections/cass.js +22 -0
- package/dist/projection/experimental/projections/cass.js.map +1 -0
- package/dist/projection/experimental/projections/cea.d.ts +3 -0
- package/dist/projection/experimental/projections/cea.d.ts.map +1 -0
- package/dist/projection/experimental/projections/cea.js +24 -0
- package/dist/projection/experimental/projections/cea.js.map +1 -0
- package/dist/projection/experimental/projections/eck6.d.ts +3 -0
- package/dist/projection/experimental/projections/eck6.d.ts.map +1 -0
- package/dist/projection/experimental/projections/eck6.js +22 -0
- package/dist/projection/experimental/projections/eck6.js.map +1 -0
- package/dist/projection/experimental/projections/eqdc.d.ts +3 -0
- package/dist/projection/experimental/projections/eqdc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/eqdc.js +23 -0
- package/dist/projection/experimental/projections/eqdc.js.map +1 -0
- package/dist/projection/experimental/projections/eqearth.d.ts +3 -0
- package/dist/projection/experimental/projections/eqearth.d.ts.map +1 -0
- package/dist/projection/experimental/projections/eqearth.js +47 -0
- package/dist/projection/experimental/projections/eqearth.js.map +1 -0
- package/dist/projection/experimental/projections/equi.d.ts +3 -0
- package/dist/projection/experimental/projections/equi.d.ts.map +1 -0
- package/dist/projection/experimental/projections/equi.js +24 -0
- package/dist/projection/experimental/projections/equi.js.map +1 -0
- package/dist/projection/experimental/projections/equidistant-cylindrical.d.ts +4 -0
- package/dist/projection/experimental/projections/equidistant-cylindrical.d.ts.map +1 -0
- package/dist/projection/experimental/projections/equidistant-cylindrical.js +47 -0
- package/dist/projection/experimental/projections/equidistant-cylindrical.js.map +1 -0
- package/dist/projection/experimental/projections/geocentric.d.ts +3 -0
- package/dist/projection/experimental/projections/geocentric.d.ts.map +1 -0
- package/dist/projection/experimental/projections/geocentric.js +34 -0
- package/dist/projection/experimental/projections/geocentric.js.map +1 -0
- package/dist/projection/experimental/projections/geos.d.ts +3 -0
- package/dist/projection/experimental/projections/geos.d.ts.map +1 -0
- package/dist/projection/experimental/projections/geos.js +30 -0
- package/dist/projection/experimental/projections/geos.js.map +1 -0
- package/dist/projection/experimental/projections/gnom.d.ts +3 -0
- package/dist/projection/experimental/projections/gnom.d.ts.map +1 -0
- package/dist/projection/experimental/projections/gnom.js +22 -0
- package/dist/projection/experimental/projections/gnom.js.map +1 -0
- package/dist/projection/experimental/projections/gstmerc.d.ts +3 -0
- package/dist/projection/experimental/projections/gstmerc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/gstmerc.js +23 -0
- package/dist/projection/experimental/projections/gstmerc.js.map +1 -0
- package/dist/projection/experimental/projections/krovak.d.ts +3 -0
- package/dist/projection/experimental/projections/krovak.d.ts.map +1 -0
- package/dist/projection/experimental/projections/krovak.js +41 -0
- package/dist/projection/experimental/projections/krovak.js.map +1 -0
- package/dist/projection/experimental/projections/laea.d.ts +3 -0
- package/dist/projection/experimental/projections/laea.d.ts.map +1 -0
- package/dist/projection/experimental/projections/laea.js +22 -0
- package/dist/projection/experimental/projections/laea.js.map +1 -0
- package/dist/projection/experimental/projections/lcc.d.ts +3 -0
- package/dist/projection/experimental/projections/lcc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/lcc.js +39 -0
- package/dist/projection/experimental/projections/lcc.js.map +1 -0
- package/dist/projection/experimental/projections/mercator.d.ts +4 -0
- package/dist/projection/experimental/projections/mercator.d.ts.map +1 -0
- package/dist/projection/experimental/projections/mercator.js +106 -0
- package/dist/projection/experimental/projections/mercator.js.map +1 -0
- package/dist/projection/experimental/projections/mill.d.ts +3 -0
- package/dist/projection/experimental/projections/mill.d.ts.map +1 -0
- package/dist/projection/experimental/projections/mill.js +22 -0
- package/dist/projection/experimental/projections/mill.js.map +1 -0
- package/dist/projection/experimental/projections/moll.d.ts +3 -0
- package/dist/projection/experimental/projections/moll.d.ts.map +1 -0
- package/dist/projection/experimental/projections/moll.js +22 -0
- package/dist/projection/experimental/projections/moll.js.map +1 -0
- package/dist/projection/experimental/projections/nzmg.d.ts +3 -0
- package/dist/projection/experimental/projections/nzmg.d.ts.map +1 -0
- package/dist/projection/experimental/projections/nzmg.js +29 -0
- package/dist/projection/experimental/projections/nzmg.js.map +1 -0
- package/dist/projection/experimental/projections/ob-tran.d.ts +4 -0
- package/dist/projection/experimental/projections/ob-tran.d.ts.map +1 -0
- package/dist/projection/experimental/projections/ob-tran.js +194 -0
- package/dist/projection/experimental/projections/ob-tran.js.map +1 -0
- package/dist/projection/experimental/projections/omerc.d.ts +3 -0
- package/dist/projection/experimental/projections/omerc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/omerc.js +69 -0
- package/dist/projection/experimental/projections/omerc.js.map +1 -0
- package/dist/projection/experimental/projections/ortho.d.ts +3 -0
- package/dist/projection/experimental/projections/ortho.d.ts.map +1 -0
- package/dist/projection/experimental/projections/ortho.js +20 -0
- package/dist/projection/experimental/projections/ortho.js.map +1 -0
- package/dist/projection/experimental/projections/poly.d.ts +3 -0
- package/dist/projection/experimental/projections/poly.d.ts.map +1 -0
- package/dist/projection/experimental/projections/poly.js +22 -0
- package/dist/projection/experimental/projections/poly.js.map +1 -0
- package/dist/projection/experimental/projections/qsc.d.ts +3 -0
- package/dist/projection/experimental/projections/qsc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/qsc.js +64 -0
- package/dist/projection/experimental/projections/qsc.js.map +1 -0
- package/dist/projection/experimental/projections/robin.d.ts +3 -0
- package/dist/projection/experimental/projections/robin.d.ts.map +1 -0
- package/dist/projection/experimental/projections/robin.js +22 -0
- package/dist/projection/experimental/projections/robin.js.map +1 -0
- package/dist/projection/experimental/projections/sinu.d.ts +3 -0
- package/dist/projection/experimental/projections/sinu.d.ts.map +1 -0
- package/dist/projection/experimental/projections/sinu.js +22 -0
- package/dist/projection/experimental/projections/sinu.js.map +1 -0
- package/dist/projection/experimental/projections/somerc.d.ts +3 -0
- package/dist/projection/experimental/projections/somerc.d.ts.map +1 -0
- package/dist/projection/experimental/projections/somerc.js +22 -0
- package/dist/projection/experimental/projections/somerc.js.map +1 -0
- package/dist/projection/experimental/projections/stere.d.ts +3 -0
- package/dist/projection/experimental/projections/stere.d.ts.map +1 -0
- package/dist/projection/experimental/projections/stere.js +32 -0
- package/dist/projection/experimental/projections/stere.js.map +1 -0
- package/dist/projection/experimental/projections/sterea.d.ts +3 -0
- package/dist/projection/experimental/projections/sterea.d.ts.map +1 -0
- package/dist/projection/experimental/projections/sterea.js +32 -0
- package/dist/projection/experimental/projections/sterea.js.map +1 -0
- package/dist/projection/experimental/projections/tpers.d.ts +3 -0
- package/dist/projection/experimental/projections/tpers.d.ts.map +1 -0
- package/dist/projection/experimental/projections/tpers.js +31 -0
- package/dist/projection/experimental/projections/tpers.js.map +1 -0
- package/dist/projection/experimental/projections/transverse-mercator.d.ts +6 -0
- package/dist/projection/experimental/projections/transverse-mercator.d.ts.map +1 -0
- package/dist/projection/experimental/projections/transverse-mercator.js +48 -0
- package/dist/projection/experimental/projections/transverse-mercator.js.map +1 -0
- package/dist/projection/experimental/projections/utm.d.ts +3 -0
- package/dist/projection/experimental/projections/utm.d.ts.map +1 -0
- package/dist/projection/experimental/projections/utm.js +37 -0
- package/dist/projection/experimental/projections/utm.js.map +1 -0
- package/dist/projection/experimental/projections/vandg.d.ts +3 -0
- package/dist/projection/experimental/projections/vandg.d.ts.map +1 -0
- package/dist/projection/experimental/projections/vandg.js +22 -0
- package/dist/projection/experimental/projections/vandg.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/angular-rendering-profile.d.ts +9 -0
- package/dist/projection/experimental/rendering-profile/angular-rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/angular-rendering-profile.js +79 -0
- package/dist/projection/experimental/rendering-profile/angular-rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/azimuthal-rendering-bounds.d.ts +23 -0
- package/dist/projection/experimental/rendering-profile/azimuthal-rendering-bounds.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/azimuthal-rendering-bounds.js +131 -0
- package/dist/projection/experimental/rendering-profile/azimuthal-rendering-bounds.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/geographic-bounds.d.ts +29 -0
- package/dist/projection/experimental/rendering-profile/geographic-bounds.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/geographic-bounds.js +127 -0
- package/dist/projection/experimental/rendering-profile/geographic-bounds.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/geographic-rendering-profile.d.ts +4 -0
- package/dist/projection/experimental/rendering-profile/geographic-rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/geographic-rendering-profile.js +18 -0
- package/dist/projection/experimental/rendering-profile/geographic-rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/geostationary-rendering-profile.d.ts +7 -0
- package/dist/projection/experimental/rendering-profile/geostationary-rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/geostationary-rendering-profile.js +86 -0
- package/dist/projection/experimental/rendering-profile/geostationary-rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/identity-rendering-profile.d.ts +4 -0
- package/dist/projection/experimental/rendering-profile/identity-rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/identity-rendering-profile.js +13 -0
- package/dist/projection/experimental/rendering-profile/identity-rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/rectangular-rendering-profile.d.ts +13 -0
- package/dist/projection/experimental/rendering-profile/rectangular-rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/rectangular-rendering-profile.js +76 -0
- package/dist/projection/experimental/rendering-profile/rectangular-rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/regional-rendering-bounds.d.ts +29 -0
- package/dist/projection/experimental/rendering-profile/regional-rendering-bounds.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/regional-rendering-bounds.js +143 -0
- package/dist/projection/experimental/rendering-profile/regional-rendering-bounds.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/rendering-bounds.d.ts +28 -0
- package/dist/projection/experimental/rendering-profile/rendering-bounds.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/rendering-bounds.js +111 -0
- package/dist/projection/experimental/rendering-profile/rendering-bounds.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/rendering-profile.d.ts +11 -0
- package/dist/projection/experimental/rendering-profile/rendering-profile.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/rendering-profile.js +81 -0
- package/dist/projection/experimental/rendering-profile/rendering-profile.js.map +1 -0
- package/dist/projection/experimental/rendering-profile/spherical-rendering-domain.d.ts +24 -0
- package/dist/projection/experimental/rendering-profile/spherical-rendering-domain.d.ts.map +1 -0
- package/dist/projection/experimental/rendering-profile/spherical-rendering-domain.js +129 -0
- package/dist/projection/experimental/rendering-profile/spherical-rendering-domain.js.map +1 -0
- package/dist/projection/experimental/scalar-output.d.ts +8 -0
- package/dist/projection/experimental/scalar-output.d.ts.map +1 -0
- package/dist/projection/experimental/scalar-output.js +46 -0
- package/dist/projection/experimental/scalar-output.js.map +1 -0
- package/dist/projection/experimental/spatial-deformation.d.ts +6 -0
- package/dist/projection/experimental/spatial-deformation.d.ts.map +1 -0
- package/dist/projection/experimental/spatial-deformation.js +85 -0
- package/dist/projection/experimental/spatial-deformation.js.map +1 -0
- package/dist/projection/experimental/types.d.ts +98 -0
- package/dist/projection/experimental/types.d.ts.map +1 -0
- package/dist/projection/experimental/types.js +5 -0
- package/dist/projection/experimental/types.js.map +1 -0
- package/dist/projection/experimental/typescript-projection.d.ts +76 -0
- package/dist/projection/experimental/typescript-projection.d.ts.map +1 -0
- package/dist/projection/experimental/typescript-projection.js +459 -0
- package/dist/projection/experimental/typescript-projection.js.map +1 -0
- package/dist/projection/experimental/vertical-datum.d.ts +4 -0
- package/dist/projection/experimental/vertical-datum.d.ts.map +1 -0
- package/dist/projection/experimental/vertical-datum.js +43 -0
- package/dist/projection/experimental/vertical-datum.js.map +1 -0
- package/dist/projection/grids/velocity.cjs +92 -0
- package/dist/projection/grids/velocity.cjs.map +6 -0
- package/dist/projection/grids/velocity.d.ts +3 -0
- package/dist/projection/grids/velocity.d.ts.map +1 -0
- package/dist/projection/grids/velocity.js +5 -0
- package/dist/projection/grids/velocity.js.map +1 -0
- package/dist/projection/index.cjs +13064 -0
- package/dist/projection/index.cjs.map +6 -0
- package/dist/projection/index.d.ts +3 -0
- package/dist/projection/index.d.ts.map +1 -0
- package/dist/projection/index.js +6 -0
- package/dist/projection/index.js.map +1 -0
- package/dist/projection/lib/projection.d.ts +8 -0
- package/dist/projection/lib/projection.d.ts.map +1 -0
- package/dist/projection/lib/projection.js +115 -0
- package/dist/projection/lib/projection.js.map +1 -0
- package/dist/projection/numerical-derivative.d.ts +15 -0
- package/dist/projection/numerical-derivative.d.ts.map +1 -0
- package/dist/projection/numerical-derivative.js +47 -0
- package/dist/projection/numerical-derivative.js.map +1 -0
- package/dist/projection/operations.cjs +322 -0
- package/dist/projection/operations.cjs.map +6 -0
- package/dist/projection/operations.d.ts +89 -0
- package/dist/projection/operations.d.ts.map +1 -0
- package/dist/projection/operations.js +344 -0
- package/dist/projection/operations.js.map +1 -0
- package/dist/projection/pipeline.cjs +1965 -0
- package/dist/projection/pipeline.cjs.map +6 -0
- package/dist/projection/pipeline.d.ts +2 -0
- package/dist/projection/pipeline.d.ts.map +1 -0
- package/dist/projection/pipeline.js +5 -0
- package/dist/projection/pipeline.js.map +1 -0
- package/dist/projection/temporal.cjs +290 -0
- package/dist/projection/temporal.cjs.map +6 -0
- package/dist/projection/temporal.d.ts +31 -0
- package/dist/projection/temporal.d.ts.map +1 -0
- package/dist/projection/temporal.js +91 -0
- package/dist/projection/temporal.js.map +1 -0
- package/dist/projection/transform-analysis.cjs +1893 -0
- package/dist/projection/transform-analysis.cjs.map +6 -0
- package/dist/projection/transform-analysis.d.ts +43 -0
- package/dist/projection/transform-analysis.d.ts.map +1 -0
- package/dist/projection/transform-analysis.js +110 -0
- package/dist/projection/transform-analysis.js.map +1 -0
- package/dist/projection/types.cjs +18 -0
- package/dist/projection/types.cjs.map +6 -0
- package/dist/projection/types.d.ts +51 -0
- package/dist/projection/types.d.ts.map +1 -0
- package/dist/projection/types.js +5 -0
- package/dist/projection/types.js.map +1 -0
- package/dist/projection/web-mercator.cjs +171 -0
- package/dist/projection/web-mercator.cjs.map +6 -0
- package/dist/projection/web-mercator.d.ts +7 -0
- package/dist/projection/web-mercator.d.ts.map +1 -0
- package/dist/projection/web-mercator.js +113 -0
- package/dist/projection/web-mercator.js.map +1 -0
- package/dist/rhumb-path.d.ts +28 -0
- package/dist/rhumb-path.d.ts.map +1 -0
- package/dist/rhumb-path.js +100 -0
- package/dist/rhumb-path.js.map +1 -0
- package/dist/rhumb-polygon.d.ts +11 -0
- package/dist/rhumb-polygon.d.ts.map +1 -0
- package/dist/rhumb-polygon.js +19 -0
- package/dist/rhumb-polygon.js.map +1 -0
- package/dist/subdivide-geodesic-polyline.d.ts +15 -0
- package/dist/subdivide-geodesic-polyline.d.ts.map +1 -0
- package/dist/subdivide-geodesic-polyline.js +52 -0
- package/dist/subdivide-geodesic-polyline.js.map +1 -0
- package/dist/subdivide-globe-mesh.d.ts +20 -0
- package/dist/subdivide-globe-mesh.d.ts.map +1 -0
- package/dist/subdivide-globe-mesh.js +54 -0
- package/dist/subdivide-globe-mesh.js.map +1 -0
- package/dist/subdivide-rhumb-polyline.d.ts +12 -0
- package/dist/subdivide-rhumb-polyline.d.ts.map +1 -0
- package/dist/subdivide-rhumb-polyline.js +82 -0
- package/dist/subdivide-rhumb-polyline.js.map +1 -0
- package/dist/terrain/adaptive-mesh-types.d.ts +21 -0
- package/dist/terrain/adaptive-mesh-types.d.ts.map +1 -0
- package/dist/terrain/adaptive-mesh-types.js +5 -0
- package/dist/terrain/adaptive-mesh-types.js.map +1 -0
- package/dist/terrain/bounds.d.ts +41 -0
- package/dist/terrain/bounds.d.ts.map +1 -0
- package/dist/terrain/bounds.js +141 -0
- package/dist/terrain/bounds.js.map +1 -0
- package/dist/terrain/contour-path-data.d.ts +26 -0
- package/dist/terrain/contour-path-data.d.ts.map +1 -0
- package/dist/terrain/contour-path-data.js +59 -0
- package/dist/terrain/contour-path-data.js.map +1 -0
- package/dist/terrain/contour-paths.d.ts +8 -0
- package/dist/terrain/contour-paths.d.ts.map +1 -0
- package/dist/terrain/contour-paths.js +83 -0
- package/dist/terrain/contour-paths.js.map +1 -0
- package/dist/terrain/contour-simplify.d.ts +18 -0
- package/dist/terrain/contour-simplify.d.ts.map +1 -0
- package/dist/terrain/contour-simplify.js +152 -0
- package/dist/terrain/contour-simplify.js.map +1 -0
- package/dist/terrain/contours.d.ts +29 -0
- package/dist/terrain/contours.d.ts.map +1 -0
- package/dist/terrain/contours.js +133 -0
- package/dist/terrain/contours.js.map +1 -0
- package/dist/terrain/delatin.d.ts +12 -0
- package/dist/terrain/delatin.d.ts.map +1 -0
- package/dist/terrain/delatin.js +69 -0
- package/dist/terrain/delatin.js.map +1 -0
- package/dist/terrain/derivatives.d.ts +23 -0
- package/dist/terrain/derivatives.d.ts.map +1 -0
- package/dist/terrain/derivatives.js +71 -0
- package/dist/terrain/derivatives.js.map +1 -0
- package/dist/terrain/geographic.d.ts +21 -0
- package/dist/terrain/geographic.d.ts.map +1 -0
- package/dist/terrain/geographic.js +91 -0
- package/dist/terrain/geographic.js.map +1 -0
- package/dist/terrain/geometry.d.ts +14 -0
- package/dist/terrain/geometry.d.ts.map +1 -0
- package/dist/terrain/geometry.js +116 -0
- package/dist/terrain/geometry.js.map +1 -0
- package/dist/terrain/height-field.d.ts +31 -0
- package/dist/terrain/height-field.d.ts.map +1 -0
- package/dist/terrain/height-field.js +305 -0
- package/dist/terrain/height-field.js.map +1 -0
- package/dist/terrain/index.cjs +3099 -0
- package/dist/terrain/index.cjs.map +6 -0
- package/dist/terrain/index.d.ts +46 -0
- package/dist/terrain/index.d.ts.map +1 -0
- package/dist/terrain/index.js +28 -0
- package/dist/terrain/index.js.map +1 -0
- package/dist/terrain/martini.d.ts +13 -0
- package/dist/terrain/martini.d.ts.map +1 -0
- package/dist/terrain/martini.js +65 -0
- package/dist/terrain/martini.js.map +1 -0
- package/dist/terrain/mesh-data.d.ts +21 -0
- package/dist/terrain/mesh-data.d.ts.map +1 -0
- package/dist/terrain/mesh-data.js +79 -0
- package/dist/terrain/mesh-data.js.map +1 -0
- package/dist/terrain/mesh-edges.d.ts +7 -0
- package/dist/terrain/mesh-edges.d.ts.map +1 -0
- package/dist/terrain/mesh-edges.js +21 -0
- package/dist/terrain/mesh-edges.js.map +1 -0
- package/dist/terrain/mesh-error.d.ts +16 -0
- package/dist/terrain/mesh-error.d.ts.map +1 -0
- package/dist/terrain/mesh-error.js +114 -0
- package/dist/terrain/mesh-error.js.map +1 -0
- package/dist/terrain/mesh-skirts.d.ts +29 -0
- package/dist/terrain/mesh-skirts.d.ts.map +1 -0
- package/dist/terrain/mesh-skirts.js +119 -0
- package/dist/terrain/mesh-skirts.js.map +1 -0
- package/dist/terrain/mesh-stitch.d.ts +35 -0
- package/dist/terrain/mesh-stitch.d.ts.map +1 -0
- package/dist/terrain/mesh-stitch.js +267 -0
- package/dist/terrain/mesh-stitch.js.map +1 -0
- package/dist/terrain/mesh.d.ts +6 -0
- package/dist/terrain/mesh.d.ts.map +1 -0
- package/dist/terrain/mesh.js +38 -0
- package/dist/terrain/mesh.js.map +1 -0
- package/dist/terrain/packed.d.ts +33 -0
- package/dist/terrain/packed.d.ts.map +1 -0
- package/dist/terrain/packed.js +136 -0
- package/dist/terrain/packed.js.map +1 -0
- package/dist/terrain/profile-measure.d.ts +26 -0
- package/dist/terrain/profile-measure.d.ts.map +1 -0
- package/dist/terrain/profile-measure.js +111 -0
- package/dist/terrain/profile-measure.js.map +1 -0
- package/dist/terrain/profile.d.ts +22 -0
- package/dist/terrain/profile.d.ts.map +1 -0
- package/dist/terrain/profile.js +76 -0
- package/dist/terrain/profile.js.map +1 -0
- package/dist/terrain/slope-aspect.d.ts +21 -0
- package/dist/terrain/slope-aspect.d.ts.map +1 -0
- package/dist/terrain/slope-aspect.js +52 -0
- package/dist/terrain/slope-aspect.js.map +1 -0
- package/dist/terrain/surface.d.ts +123 -0
- package/dist/terrain/surface.d.ts.map +1 -0
- package/dist/terrain/surface.js +366 -0
- package/dist/terrain/surface.js.map +1 -0
- package/dist/terrain/tiled.d.ts +80 -0
- package/dist/terrain/tiled.d.ts.map +1 -0
- package/dist/terrain/tiled.js +378 -0
- package/dist/terrain/tiled.js.map +1 -0
- package/dist/terrain/types.d.ts +58 -0
- package/dist/terrain/types.d.ts.map +1 -0
- package/dist/terrain/types.js +13 -0
- package/dist/terrain/types.js.map +1 -0
- package/dist/terrain/vendor/delatin.d.ts +38 -0
- package/dist/terrain/vendor/delatin.d.ts.map +1 -0
- package/dist/terrain/vendor/delatin.js +407 -0
- package/dist/terrain/vendor/delatin.js.map +1 -0
- package/dist/terrain/vertex-tiles.d.ts +35 -0
- package/dist/terrain/vertex-tiles.d.ts.map +1 -0
- package/dist/terrain/vertex-tiles.js +120 -0
- package/dist/terrain/vertex-tiles.js.map +1 -0
- package/dist/tile-matrix.d.ts +107 -0
- package/dist/tile-matrix.d.ts.map +1 -0
- package/dist/tile-matrix.js +383 -0
- package/dist/tile-matrix.js.map +1 -0
- package/dist/tiles.d.ts +5 -0
- package/dist/tiles.d.ts.map +1 -0
- package/dist/tiles.js +6 -0
- package/dist/tiles.js.map +1 -0
- package/dist/triaxial/integrate.d.ts +2 -0
- package/dist/triaxial/integrate.d.ts.map +1 -0
- package/dist/triaxial/integrate.js +76 -0
- package/dist/triaxial/integrate.js.map +1 -0
- package/dist/triaxial.d.ts +42 -0
- package/dist/triaxial.d.ts.map +1 -0
- package/dist/triaxial.js +141 -0
- package/dist/triaxial.js.map +1 -0
- package/dist/turf.cjs +1660 -0
- package/dist/turf.cjs.map +6 -0
- package/dist/turf.d.ts +103 -0
- package/dist/turf.d.ts.map +1 -0
- package/dist/turf.js +1026 -0
- package/dist/turf.js.map +1 -0
- package/dist/type-utils.d.ts +2 -0
- package/dist/type-utils.d.ts.map +1 -1
- package/dist/type-utils.js +25 -2
- package/dist/type-utils.js.map +1 -1
- package/dist/vendor/geographiclib-geodesic/runtime.d.ts +9 -0
- package/dist/vendor/geographiclib-geodesic/runtime.d.ts.map +1 -0
- package/dist/vendor/geographiclib-geodesic/runtime.js +2245 -0
- package/dist/vendor/geographiclib-geodesic/runtime.js.map +1 -0
- package/dist/web-mercator.d.ts +2 -0
- package/dist/web-mercator.d.ts.map +1 -0
- package/dist/web-mercator.js +5 -0
- package/dist/web-mercator.js.map +1 -0
- package/dist/wkb/index.d.ts +11 -0
- package/dist/wkb/index.d.ts.map +1 -0
- package/dist/wkb/index.js +9 -0
- package/dist/wkb/index.js.map +1 -0
- package/dist/wkb/types.d.ts +30 -0
- package/dist/wkb/types.d.ts.map +1 -0
- package/dist/wkb/types.js +34 -0
- package/dist/wkb/types.js.map +1 -0
- package/dist/wkb/wkb-builder.d.ts +91 -0
- package/dist/wkb/wkb-builder.d.ts.map +1 -0
- package/dist/wkb/wkb-builder.js +283 -0
- package/dist/wkb/wkb-builder.js.map +1 -0
- package/dist/wkb/wkb-reader.d.ts +74 -0
- package/dist/wkb/wkb-reader.d.ts.map +1 -0
- package/dist/wkb/wkb-reader.js +251 -0
- package/dist/wkb/wkb-reader.js.map +1 -0
- package/dist/wkb/wkb.d.ts +21 -0
- package/dist/wkb/wkb.d.ts.map +1 -0
- package/dist/wkb/wkb.js +204 -0
- package/dist/wkb/wkb.js.map +1 -0
- package/dist/wkb/wkt.d.ts +19 -0
- package/dist/wkb/wkt.d.ts.map +1 -0
- package/dist/wkb/wkt.js +321 -0
- package/dist/wkb/wkt.js.map +1 -0
- package/dist/workers/index.cjs +20879 -0
- package/dist/workers/index.cjs.map +6 -0
- package/dist/workers/index.d.ts +12 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +41 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/map-worker.d.ts +2 -0
- package/dist/workers/map-worker.d.ts.map +1 -0
- package/dist/workers/map-worker.js +7 -0
- package/dist/workers/map-worker.js.map +1 -0
- package/dist/workers/operations.cjs +20036 -0
- package/dist/workers/operations.cjs.map +6 -0
- package/dist/workers/operations.d.ts +15 -0
- package/dist/workers/operations.d.ts.map +1 -0
- package/dist/workers/operations.js +46 -0
- package/dist/workers/operations.js.map +1 -0
- package/dist/workers/projection-worker.d.ts +2 -0
- package/dist/workers/projection-worker.d.ts.map +1 -0
- package/dist/workers/projection-worker.js +7 -0
- package/dist/workers/projection-worker.js.map +1 -0
- package/package.json +1023 -6
- package/projection/APACHE-2.0-LICENSE.txt +55 -0
- package/projection/PROJ-LICENSE.txt +37 -0
- package/projection/PROJ4-LICENSE.md +29 -0
- package/projection/THIRD-PARTY-NOTICES.md +210 -0
- package/src/constants.ts +5 -3
- package/src/coordinates/angles.ts +160 -0
- package/src/coordinates/grid.ts +141 -0
- package/src/coordinates/mgrs.ts +157 -0
- package/src/coordinates.ts +24 -0
- package/src/crs/crs-descriptor-types.ts +81 -0
- package/src/crs/crs-descriptor.ts +203 -0
- package/src/crs/crs-metadata.ts +63 -0
- package/src/crs/crs.ts +36 -0
- package/src/crs/execution-identity.ts +98 -0
- package/src/crs/index.ts +101 -0
- package/src/crs/proj-string.ts +239 -0
- package/src/crs/projection-domain.ts +100 -0
- package/src/crs/projjson-schema-constants.ts +9 -0
- package/src/crs/projjson-types.ts +665 -0
- package/src/crs/resolver.ts +194 -0
- package/src/crs/spatial-reference.ts +224 -0
- package/src/crs/units-table.ts +51 -0
- package/src/crs/wkt-crs.ts +790 -0
- package/src/discontinuous/AIR-OCEAN-LICENSE.txt +26 -0
- package/src/discontinuous/D3-LICENSE.txt +37 -0
- package/src/discontinuous/PETROFF-LICENSE.txt +55 -0
- package/src/discontinuous/PROJ-LICENSE.txt +34 -0
- package/src/discontinuous/air-ocean-mesh.ts +86 -0
- package/src/discontinuous/albers-usa.ts +181 -0
- package/src/discontinuous/cap-map.ts +406 -0
- package/src/discontinuous/elastic/README.md +20 -0
- package/src/discontinuous/elastic/UNLICENSE.txt +24 -0
- package/src/discontinuous/elastic/data.ts +86 -0
- package/src/discontinuous/elastic/elasticI.ts +5238 -0
- package/src/discontinuous/elastic/elasticII.ts +18167 -0
- package/src/discontinuous/elastic/elasticIII.ts +29571 -0
- package/src/discontinuous/elastic/geometry.ts +172 -0
- package/src/discontinuous/elastic/grid.ts +194 -0
- package/src/discontinuous/elastic/map.ts +317 -0
- package/src/discontinuous/global-polygons.ts +273 -0
- package/src/discontinuous/gray-fuller.ts +38 -0
- package/src/discontinuous/gringorten-kernel.ts +160 -0
- package/src/discontinuous/healpix.ts +61 -0
- package/src/discontinuous/layout.ts +177 -0
- package/src/discontinuous/map-engine.ts +602 -0
- package/src/discontinuous/map-layout.ts +605 -0
- package/src/discontinuous/map-transition.ts +339 -0
- package/src/discontinuous/math.ts +67 -0
- package/src/discontinuous/mercator-map.ts +160 -0
- package/src/discontinuous/myriahedral/graticule.ts +40 -0
- package/src/discontinuous/myriahedral/mesh.ts +138 -0
- package/src/discontinuous/myriahedral/unfold.ts +240 -0
- package/src/discontinuous/myriahedral.ts +311 -0
- package/src/discontinuous/petroff.ts +178 -0
- package/src/discontinuous/polyhedral.ts +138 -0
- package/src/discontinuous/prepare-features.ts +245 -0
- package/src/discontinuous/presets.ts +450 -0
- package/src/discontinuous/projection-catalog.ts +132 -0
- package/src/discontinuous/quincuncial-kernel.ts +173 -0
- package/src/discontinuous/quincuncial-star.ts +328 -0
- package/src/discontinuous/regional-map.ts +229 -0
- package/src/discontinuous/retroazimuthal-map.ts +52 -0
- package/src/discontinuous/rotated-map.ts +86 -0
- package/src/discontinuous/snyder-mesh.ts +88 -0
- package/src/discontinuous/snyder.ts +171 -0
- package/src/discontinuous/spherical-clip/D3-GEO-LICENSE.txt +34 -0
- package/src/discontinuous/spherical-clip/README.md +16 -0
- package/src/discontinuous/spherical-clip/cartesian.js +43 -0
- package/src/discontinuous/spherical-clip/circle.js +35 -0
- package/src/discontinuous/spherical-clip/clip-buffer.js +29 -0
- package/src/discontinuous/spherical-clip/clip-circle.js +197 -0
- package/src/discontinuous/spherical-clip/clip-index.js +140 -0
- package/src/discontinuous/spherical-clip/clip-rejoin.js +111 -0
- package/src/discontinuous/spherical-clip/helpers.js +20 -0
- package/src/discontinuous/spherical-clip/math.js +45 -0
- package/src/discontinuous/spherical-clip/noop.js +6 -0
- package/src/discontinuous/spherical-clip/pointEqual.js +10 -0
- package/src/discontinuous/spherical-clip/polygonContains.js +96 -0
- package/src/discontinuous/world-composite-kernels.ts +30 -0
- package/src/discontinuous/world-kernels/INTEGRATE-LICENSE.txt +21 -0
- package/src/discontinuous/world-kernels/README.md +24 -0
- package/src/discontinuous/world-kernels/airy.js +43 -0
- package/src/discontinuous/world-kernels/aitoff.js +48 -0
- package/src/discontinuous/world-kernels/armadillo.js +51 -0
- package/src/discontinuous/world-kernels/august.js +36 -0
- package/src/discontinuous/world-kernels/baker.js +50 -0
- package/src/discontinuous/world-kernels/bertin.js +41 -0
- package/src/discontinuous/world-kernels/boggs.js +32 -0
- package/src/discontinuous/world-kernels/bonne.js +27 -0
- package/src/discontinuous/world-kernels/bottomley.js +25 -0
- package/src/discontinuous/world-kernels/bromley.js +10 -0
- package/src/discontinuous/world-kernels/chamberlin.js +97 -0
- package/src/discontinuous/world-kernels/collignon.js +17 -0
- package/src/discontinuous/world-kernels/craig.js +33 -0
- package/src/discontinuous/world-kernels/craster.js +18 -0
- package/src/discontinuous/world-kernels/cylindricalEqualArea.js +21 -0
- package/src/discontinuous/world-kernels/cylindricalStereographic.js +21 -0
- package/src/discontinuous/world-kernels/d3-geo-raw.js +26 -0
- package/src/discontinuous/world-kernels/eckert1.js +18 -0
- package/src/discontinuous/world-kernels/eckert2.js +17 -0
- package/src/discontinuous/world-kernels/eckert3.js +17 -0
- package/src/discontinuous/world-kernels/eckert4.js +24 -0
- package/src/discontinuous/world-kernels/eckert5.js +17 -0
- package/src/discontinuous/world-kernels/eckert6.js +22 -0
- package/src/discontinuous/world-kernels/eisenlohr.js +88 -0
- package/src/discontinuous/world-kernels/fahey.js +19 -0
- package/src/discontinuous/world-kernels/foucaut.js +20 -0
- package/src/discontinuous/world-kernels/foucautSinusoidal.js +38 -0
- package/src/discontinuous/world-kernels/ginzburg4.js +17 -0
- package/src/discontinuous/world-kernels/ginzburg5.js +17 -0
- package/src/discontinuous/world-kernels/ginzburg6.js +19 -0
- package/src/discontinuous/world-kernels/ginzburg8.js +34 -0
- package/src/discontinuous/world-kernels/ginzburg9.js +17 -0
- package/src/discontinuous/world-kernels/ginzburgPolyconic.js +64 -0
- package/src/discontinuous/world-kernels/hammer.js +37 -0
- package/src/discontinuous/world-kernels/hammerRetroazimuthal.js +63 -0
- package/src/discontinuous/world-kernels/hill.js +57 -0
- package/src/discontinuous/world-kernels/homolosine.js +24 -0
- package/src/discontinuous/world-kernels/hufnagel.js +68 -0
- package/src/discontinuous/world-kernels/hyperelliptical.js +56 -0
- package/src/discontinuous/world-kernels/integrate.js +99 -0
- package/src/discontinuous/world-kernels/kavrayskiy7.js +15 -0
- package/src/discontinuous/world-kernels/lagrange.js +32 -0
- package/src/discontinuous/world-kernels/larrivee.js +43 -0
- package/src/discontinuous/world-kernels/laskowski.js +50 -0
- package/src/discontinuous/world-kernels/littrow.js +19 -0
- package/src/discontinuous/world-kernels/loximuthal.js +38 -0
- package/src/discontinuous/world-kernels/math.js +98 -0
- package/src/discontinuous/world-kernels/miller.js +15 -0
- package/src/discontinuous/world-kernels/modifiedStereographic.js +112 -0
- package/src/discontinuous/world-kernels/mollweide.js +30 -0
- package/src/discontinuous/world-kernels/mtFlatPolarParabolic.js +23 -0
- package/src/discontinuous/world-kernels/mtFlatPolarQuartic.js +29 -0
- package/src/discontinuous/world-kernels/mtFlatPolarSinusoidal.js +25 -0
- package/src/discontinuous/world-kernels/naturalEarth2.js +46 -0
- package/src/discontinuous/world-kernels/nellHammer.js +20 -0
- package/src/discontinuous/world-kernels/newton.js +77 -0
- package/src/discontinuous/world-kernels/nicolosi.js +60 -0
- package/src/discontinuous/world-kernels/patterson.js +45 -0
- package/src/discontinuous/world-kernels/polyconic.js +36 -0
- package/src/discontinuous/world-kernels/rectangularPolyconic.js +41 -0
- package/src/discontinuous/world-kernels/robinson.js +88 -0
- package/src/discontinuous/world-kernels/satellite.js +44 -0
- package/src/discontinuous/world-kernels/sinuMollweide.js +24 -0
- package/src/discontinuous/world-kernels/sinusoidal.js +15 -0
- package/src/discontinuous/world-kernels/times.js +19 -0
- package/src/discontinuous/world-kernels/twoPointEquidistant.js +41 -0
- package/src/discontinuous/world-kernels/vanDerGrinten.js +48 -0
- package/src/discontinuous/world-kernels/vanDerGrinten2.js +32 -0
- package/src/discontinuous/world-kernels/vanDerGrinten3.js +24 -0
- package/src/discontinuous/world-kernels/vanDerGrinten4.js +70 -0
- package/src/discontinuous/world-kernels/wagner.js +61 -0
- package/src/discontinuous/world-kernels/wagner4.js +13 -0
- package/src/discontinuous/world-kernels/wagner6.js +15 -0
- package/src/discontinuous/world-kernels/wiechel.js +25 -0
- package/src/discontinuous/world-kernels/winkel3.js +45 -0
- package/src/discontinuous/world-kernels.ts +249 -0
- package/src/discontinuous/world-map.ts +257 -0
- package/src/discontinuous.ts +142 -0
- package/src/elastic.ts +7 -0
- package/src/ellipsoid-geodesic.ts +170 -0
- package/src/ellipsoid-helpers/ellipsoid-transform.ts +79 -20
- package/src/ellipsoid-helpers/exact-nearest-surface.ts +118 -0
- package/src/ellipsoid-helpers/intersection-bounds.ts +85 -0
- package/src/ellipsoid-helpers/nearest-surface.ts +157 -0
- package/src/ellipsoid-helpers/rhumb-pole-distance.ts +76 -0
- package/src/ellipsoid-helpers/scale-to-geodetic-surface.ts +31 -90
- package/src/ellipsoid-helpers/surface-polygon.ts +210 -0
- package/src/ellipsoid-helpers/tangent-plane-numerics.ts +124 -0
- package/src/ellipsoid-metrics.ts +225 -0
- package/src/ellipsoid-occluder.ts +135 -0
- package/src/ellipsoid-rhumb.ts +408 -0
- package/src/ellipsoid-tangent-plane.ts +236 -38
- package/src/ellipsoid-transforms.ts +61 -0
- package/src/ellipsoid.ts +281 -117
- package/src/entries/ellipsoid.ts +44 -0
- package/src/expressions.ts +35 -0
- package/src/geoarrow/builder-entry.ts +18 -0
- package/src/geoarrow/builder.ts +860 -0
- package/src/geoarrow/codecs.ts +1268 -0
- package/src/geoarrow/index.ts +111 -0
- package/src/geoarrow/kernels.ts +1290 -0
- package/src/geoarrow/layout.ts +900 -0
- package/src/geoarrow/stream-tessellate.ts +205 -0
- package/src/geoarrow/stream.ts +130 -0
- package/src/geoarrow/tessellate.ts +133 -0
- package/src/geoarrow/tessellation-entry.ts +7 -0
- package/src/geoarrow/types.ts +259 -0
- package/src/geoarrow/views.ts +150 -0
- package/src/geoarrow/wkb-entry.ts +13 -0
- package/src/geoarrow/worker.ts +20 -0
- package/src/geodesic-buffer.ts +120 -0
- package/src/geodesic-exact/area.ts +70 -0
- package/src/geodesic-exact/inverse-engine.ts +166 -0
- package/src/geodesic-exact/polygon.ts +36 -0
- package/src/geodesic-exact/quadrature.ts +60 -0
- package/src/geodesic-exact.ts +290 -0
- package/src/geodesic-intersections.ts +598 -0
- package/src/geodesic-path.ts +128 -0
- package/src/geodesic-polygon.ts +19 -0
- package/src/geographic-atlas/atlas.ts +645 -0
- package/src/geographic-atlas/curves.ts +360 -0
- package/src/geographic-atlas/math.ts +125 -0
- package/src/geographic-atlas/sampling.ts +146 -0
- package/src/geographic-atlas/topology.ts +196 -0
- package/src/geographic-atlas/types.ts +48 -0
- package/src/geographic-atlas.ts +104 -0
- package/src/geographic-cuts.ts +114 -0
- package/src/geographic-seams/cut-options.ts +50 -0
- package/src/geographic-seams/edge.ts +416 -0
- package/src/geographic-seams/latitude.ts +47 -0
- package/src/geographic-seams/polygon.ts +551 -0
- package/src/geographic-seams/subdivide-cut.ts +203 -0
- package/src/geographic-seams/types.ts +67 -0
- package/src/geographic-seams.ts +81 -0
- package/src/geographic-tiles.ts +87 -0
- package/src/globe-horizon-bounds.ts +68 -0
- package/src/globe.ts +31 -0
- package/src/index.ts +392 -7
- package/src/lng-lat-rectangle.ts +5 -3
- package/src/local-reference-frame.ts +316 -0
- package/src/make-obb-from-region.ts +6 -4
- package/src/projection/analysis.ts +284 -0
- package/src/projection/bulk.ts +343 -0
- package/src/projection/datums.ts +13 -0
- package/src/projection/deformation.ts +5 -0
- package/src/projection/experimental/authalic-latitude.ts +49 -0
- package/src/projection/experimental/catalogue-kernel.ts +65 -0
- package/src/projection/experimental/common/adjust_lat.ts +11 -0
- package/src/projection/experimental/common/adjust_lon.ts +14 -0
- package/src/projection/experimental/common/asinhy.ts +14 -0
- package/src/projection/experimental/common/asinz.ts +11 -0
- package/src/projection/experimental/common/authlat.ts +9 -0
- package/src/projection/experimental/common/authset.ts +25 -0
- package/src/projection/experimental/common/clens.ts +20 -0
- package/src/projection/experimental/common/clens_cmplx.ts +43 -0
- package/src/projection/experimental/common/constants.ts +15 -0
- package/src/projection/experimental/common/cosh.ts +10 -0
- package/src/projection/experimental/common/e0fn.ts +8 -0
- package/src/projection/experimental/common/e1fn.ts +8 -0
- package/src/projection/experimental/common/e2fn.ts +8 -0
- package/src/projection/experimental/common/e3fn.ts +8 -0
- package/src/projection/experimental/common/fL.ts +10 -0
- package/src/projection/experimental/common/gN.ts +9 -0
- package/src/projection/experimental/common/gatg.ts +20 -0
- package/src/projection/experimental/common/hypot.ts +13 -0
- package/src/projection/experimental/common/imlfn.ts +23 -0
- package/src/projection/experimental/common/invlatiso.ts +20 -0
- package/src/projection/experimental/common/iqsfnz.ts +45 -0
- package/src/projection/experimental/common/latiso.ts +21 -0
- package/src/projection/experimental/common/log1py.ts +11 -0
- package/src/projection/experimental/common/meridian-distance.ts +45 -0
- package/src/projection/experimental/common/mlfn.ts +8 -0
- package/src/projection/experimental/common/msfnz.ts +9 -0
- package/src/projection/experimental/common/phi2z.ts +22 -0
- package/src/projection/experimental/common/pj_enfn.ts +29 -0
- package/src/projection/experimental/common/pj_inv_mlfn.ts +28 -0
- package/src/projection/experimental/common/pj_mlfn.ts +10 -0
- package/src/projection/experimental/common/qsfnz.ts +17 -0
- package/src/projection/experimental/common/sign.ts +8 -0
- package/src/projection/experimental/common/sinh.ts +10 -0
- package/src/projection/experimental/common/srat.ts +8 -0
- package/src/projection/experimental/common/tsfnz.ts +14 -0
- package/src/projection/experimental/common/vincenty.ts +180 -0
- package/src/projection/experimental/core.ts +77 -0
- package/src/projection/experimental/crs/datum-catalog.ts +65 -0
- package/src/projection/experimental/crs/datum-table.ts +1360 -0
- package/src/projection/experimental/crs/ellipsoid-table.ts +230 -0
- package/src/projection/experimental/crs/normalize.ts +318 -0
- package/src/projection/experimental/crs/primemeridian-table.ts +22 -0
- package/src/projection/experimental/crs/projjson.ts +12 -0
- package/src/projection/experimental/crs/resolve.ts +78 -0
- package/src/projection/experimental/crs/spatial-reference.ts +120 -0
- package/src/projection/experimental/crs/structured.ts +580 -0
- package/src/projection/experimental/crs/types.ts +97 -0
- package/src/projection/experimental/crs/wkt.ts +201 -0
- package/src/projection/experimental/crs-descriptor.ts +256 -0
- package/src/projection/experimental/crs-rendering-scale.ts +115 -0
- package/src/projection/experimental/datum.ts +185 -0
- package/src/projection/experimental/deformation-inverse.ts +125 -0
- package/src/projection/experimental/deformation.ts +30 -0
- package/src/projection/experimental/ellipsoidal-gnomonic.ts +83 -0
- package/src/projection/experimental/engine-options.ts +36 -0
- package/src/projection/experimental/entries/projections/aea.ts +5 -0
- package/src/projection/experimental/entries/projections/aeqd.ts +5 -0
- package/src/projection/experimental/entries/projections/bonne.ts +5 -0
- package/src/projection/experimental/entries/projections/cass.ts +5 -0
- package/src/projection/experimental/entries/projections/cea.ts +5 -0
- package/src/projection/experimental/entries/projections/eck6.ts +5 -0
- package/src/projection/experimental/entries/projections/eqc.ts +5 -0
- package/src/projection/experimental/entries/projections/eqdc.ts +5 -0
- package/src/projection/experimental/entries/projections/eqearth.ts +5 -0
- package/src/projection/experimental/entries/projections/equi.ts +5 -0
- package/src/projection/experimental/entries/projections/etmerc.ts +5 -0
- package/src/projection/experimental/entries/projections/geocent.ts +5 -0
- package/src/projection/experimental/entries/projections/geos.ts +5 -0
- package/src/projection/experimental/entries/projections/gnom.ts +5 -0
- package/src/projection/experimental/entries/projections/gstmerc.ts +5 -0
- package/src/projection/experimental/entries/projections/krovak.ts +5 -0
- package/src/projection/experimental/entries/projections/laea.ts +5 -0
- package/src/projection/experimental/entries/projections/lcc.ts +5 -0
- package/src/projection/experimental/entries/projections/merc.ts +5 -0
- package/src/projection/experimental/entries/projections/mill.ts +5 -0
- package/src/projection/experimental/entries/projections/moll.ts +5 -0
- package/src/projection/experimental/entries/projections/nzmg.ts +5 -0
- package/src/projection/experimental/entries/projections/ob_tran.ts +5 -0
- package/src/projection/experimental/entries/projections/omerc.ts +5 -0
- package/src/projection/experimental/entries/projections/ortho.ts +5 -0
- package/src/projection/experimental/entries/projections/poly.ts +5 -0
- package/src/projection/experimental/entries/projections/qsc.ts +5 -0
- package/src/projection/experimental/entries/projections/robin.ts +5 -0
- package/src/projection/experimental/entries/projections/sinu.ts +5 -0
- package/src/projection/experimental/entries/projections/somerc.ts +5 -0
- package/src/projection/experimental/entries/projections/stere.ts +5 -0
- package/src/projection/experimental/entries/projections/sterea.ts +5 -0
- package/src/projection/experimental/entries/projections/tmerc.ts +5 -0
- package/src/projection/experimental/entries/projections/tpers.ts +5 -0
- package/src/projection/experimental/entries/projections/utm.ts +5 -0
- package/src/projection/experimental/entries/projections/vandg.ts +5 -0
- package/src/projection/experimental/exact-helmert.ts +58 -0
- package/src/projection/experimental/flat-projection.ts +80 -0
- package/src/projection/experimental/grids/geotiff.ts +88 -0
- package/src/projection/experimental/grids/grid.ts +141 -0
- package/src/projection/experimental/grids/gtx.ts +31 -0
- package/src/projection/experimental/grids/ntv2.ts +71 -0
- package/src/projection/experimental/grids/scalar-geotiff.ts +231 -0
- package/src/projection/experimental/grids/types.ts +35 -0
- package/src/projection/experimental/grids/velocity-geotiff.ts +82 -0
- package/src/projection/experimental/grids/velocity.ts +58 -0
- package/src/projection/experimental/grids/vertical-geotiff.ts +28 -0
- package/src/projection/experimental/grids/vertical.ts +99 -0
- package/src/projection/experimental/helmert-flat.ts +76 -0
- package/src/projection/experimental/index.ts +59 -0
- package/src/projection/experimental/inverse-spherical-latitude.ts +19 -0
- package/src/projection/experimental/kernel.ts +142 -0
- package/src/projection/experimental/kernels/aea.ts +149 -0
- package/src/projection/experimental/kernels/aeqd.ts +171 -0
- package/src/projection/experimental/kernels/bonne.ts +141 -0
- package/src/projection/experimental/kernels/cass.ts +140 -0
- package/src/projection/experimental/kernels/cea.ts +71 -0
- package/src/projection/experimental/kernels/eck6.ts +36 -0
- package/src/projection/experimental/kernels/eqdc.ts +137 -0
- package/src/projection/experimental/kernels/eqearth.ts +146 -0
- package/src/projection/experimental/kernels/equi.ts +55 -0
- package/src/projection/experimental/kernels/etmerc.ts +190 -0
- package/src/projection/experimental/kernels/gauss.ts +79 -0
- package/src/projection/experimental/kernels/geos.ts +183 -0
- package/src/projection/experimental/kernels/gnom.ts +123 -0
- package/src/projection/experimental/kernels/gstmerc.ts +74 -0
- package/src/projection/experimental/kernels/krovak.ts +166 -0
- package/src/projection/experimental/kernels/laea.ts +320 -0
- package/src/projection/experimental/kernels/lcc.ts +141 -0
- package/src/projection/experimental/kernels/mill.ts +60 -0
- package/src/projection/experimental/kernels/moll.ts +109 -0
- package/src/projection/experimental/kernels/nzmg.ts +249 -0
- package/src/projection/experimental/kernels/omerc.ts +343 -0
- package/src/projection/experimental/kernels/ortho.ts +52 -0
- package/src/projection/experimental/kernels/poly.ts +217 -0
- package/src/projection/experimental/kernels/qsc.ts +359 -0
- package/src/projection/experimental/kernels/robin.ts +189 -0
- package/src/projection/experimental/kernels/sinu.ts +118 -0
- package/src/projection/experimental/kernels/somerc.ts +102 -0
- package/src/projection/experimental/kernels/stere.ts +249 -0
- package/src/projection/experimental/kernels/sterea.ts +82 -0
- package/src/projection/experimental/kernels/tmerc.ts +227 -0
- package/src/projection/experimental/kernels/tpers.ts +187 -0
- package/src/projection/experimental/kernels/vandg.ts +147 -0
- package/src/projection/experimental/kinematic-helmert-flat.ts +85 -0
- package/src/projection/experimental/kinematic-helmert.ts +132 -0
- package/src/projection/experimental/lazy-projection.ts +190 -0
- package/src/projection/experimental/lazy-projections/aea.ts +10 -0
- package/src/projection/experimental/lazy-projections/aeqd.ts +12 -0
- package/src/projection/experimental/lazy-projections/bonne.ts +10 -0
- package/src/projection/experimental/lazy-projections/cass.ts +10 -0
- package/src/projection/experimental/lazy-projections/cea.ts +12 -0
- package/src/projection/experimental/lazy-projections/eck6.ts +10 -0
- package/src/projection/experimental/lazy-projections/eqc.ts +15 -0
- package/src/projection/experimental/lazy-projections/eqdc.ts +11 -0
- package/src/projection/experimental/lazy-projections/eqearth.ts +10 -0
- package/src/projection/experimental/lazy-projections/equi.ts +10 -0
- package/src/projection/experimental/lazy-projections/etmerc.ts +12 -0
- package/src/projection/experimental/lazy-projections/geocent.ts +10 -0
- package/src/projection/experimental/lazy-projections/geos.ts +10 -0
- package/src/projection/experimental/lazy-projections/gnom.ts +10 -0
- package/src/projection/experimental/lazy-projections/gstmerc.ts +13 -0
- package/src/projection/experimental/lazy-projections/index.ts +41 -0
- package/src/projection/experimental/lazy-projections/krovak.ts +18 -0
- package/src/projection/experimental/lazy-projections/laea.ts +12 -0
- package/src/projection/experimental/lazy-projections/lcc.ts +22 -0
- package/src/projection/experimental/lazy-projections/merc.ts +19 -0
- package/src/projection/experimental/lazy-projections/mill.ts +11 -0
- package/src/projection/experimental/lazy-projections/moll.ts +10 -0
- package/src/projection/experimental/lazy-projections/nzmg.ts +11 -0
- package/src/projection/experimental/lazy-projections/ob_tran.ts +25 -0
- package/src/projection/experimental/lazy-projections/omerc.ts +22 -0
- package/src/projection/experimental/lazy-projections/ortho.ts +10 -0
- package/src/projection/experimental/lazy-projections/poly.ts +10 -0
- package/src/projection/experimental/lazy-projections/qsc.ts +16 -0
- package/src/projection/experimental/lazy-projections/robin.ts +10 -0
- package/src/projection/experimental/lazy-projections/sinu.ts +10 -0
- package/src/projection/experimental/lazy-projections/somerc.ts +12 -0
- package/src/projection/experimental/lazy-projections/stere.ts +18 -0
- package/src/projection/experimental/lazy-projections/sterea.ts +20 -0
- package/src/projection/experimental/lazy-projections/tmerc.ts +22 -0
- package/src/projection/experimental/lazy-projections/tpers.ts +11 -0
- package/src/projection/experimental/lazy-projections/utm.ts +12 -0
- package/src/projection/experimental/lazy-projections/vandg.ts +10 -0
- package/src/projection/experimental/mutable-projection.ts +63 -0
- package/src/projection/experimental/numeric-flat.ts +73 -0
- package/src/projection/experimental/parameters.ts +36 -0
- package/src/projection/experimental/projection-descriptor.ts +79 -0
- package/src/projection/experimental/projection-engine.ts +62 -0
- package/src/projection/experimental/projection-pipeline.ts +1047 -0
- package/src/projection/experimental/projection-scratch.ts +26 -0
- package/src/projection/experimental/projections/aea.ts +41 -0
- package/src/projection/experimental/projections/aeqd.ts +27 -0
- package/src/projection/experimental/projections/bonne.ts +38 -0
- package/src/projection/experimental/projections/cass.ts +39 -0
- package/src/projection/experimental/projections/cea.ts +31 -0
- package/src/projection/experimental/projections/eck6.ts +30 -0
- package/src/projection/experimental/projections/eqdc.ts +40 -0
- package/src/projection/experimental/projections/eqearth.ts +72 -0
- package/src/projection/experimental/projections/equi.ts +31 -0
- package/src/projection/experimental/projections/equidistant-cylindrical.ts +79 -0
- package/src/projection/experimental/projections/geocentric.ts +42 -0
- package/src/projection/experimental/projections/geos.ts +46 -0
- package/src/projection/experimental/projections/gnom.ts +51 -0
- package/src/projection/experimental/projections/gstmerc.ts +43 -0
- package/src/projection/experimental/projections/krovak.ts +61 -0
- package/src/projection/experimental/projections/laea.ts +39 -0
- package/src/projection/experimental/projections/lcc.ts +67 -0
- package/src/projection/experimental/projections/mercator.ts +150 -0
- package/src/projection/experimental/projections/mill.ts +30 -0
- package/src/projection/experimental/projections/moll.ts +30 -0
- package/src/projection/experimental/projections/nzmg.ts +47 -0
- package/src/projection/experimental/projections/ob-tran.ts +279 -0
- package/src/projection/experimental/projections/omerc.ts +86 -0
- package/src/projection/experimental/projections/ortho.ts +34 -0
- package/src/projection/experimental/projections/poly.ts +40 -0
- package/src/projection/experimental/projections/qsc.ts +84 -0
- package/src/projection/experimental/projections/robin.ts +30 -0
- package/src/projection/experimental/projections/sinu.ts +30 -0
- package/src/projection/experimental/projections/somerc.ts +39 -0
- package/src/projection/experimental/projections/stere.ts +59 -0
- package/src/projection/experimental/projections/sterea.ts +61 -0
- package/src/projection/experimental/projections/tpers.ts +59 -0
- package/src/projection/experimental/projections/transverse-mercator.ts +89 -0
- package/src/projection/experimental/projections/utm.ts +50 -0
- package/src/projection/experimental/projections/vandg.ts +30 -0
- package/src/projection/experimental/rendering-profile/angular-rendering-profile.ts +117 -0
- package/src/projection/experimental/rendering-profile/azimuthal-rendering-bounds.ts +251 -0
- package/src/projection/experimental/rendering-profile/geographic-bounds.ts +190 -0
- package/src/projection/experimental/rendering-profile/geographic-rendering-profile.ts +29 -0
- package/src/projection/experimental/rendering-profile/geostationary-rendering-profile.ts +128 -0
- package/src/projection/experimental/rendering-profile/identity-rendering-profile.ts +15 -0
- package/src/projection/experimental/rendering-profile/rectangular-rendering-profile.ts +133 -0
- package/src/projection/experimental/rendering-profile/regional-rendering-bounds.ts +252 -0
- package/src/projection/experimental/rendering-profile/rendering-bounds.ts +163 -0
- package/src/projection/experimental/rendering-profile/rendering-profile.ts +96 -0
- package/src/projection/experimental/rendering-profile/spherical-rendering-domain.ts +175 -0
- package/src/projection/experimental/scalar-output.ts +77 -0
- package/src/projection/experimental/spatial-deformation.ts +115 -0
- package/src/projection/experimental/types.ts +117 -0
- package/src/projection/experimental/typescript-projection.ts +581 -0
- package/src/projection/experimental/vertical-datum.ts +39 -0
- package/src/projection/grids/velocity.ts +5 -0
- package/src/projection/index.ts +6 -0
- package/src/projection/lib/projection.ts +161 -0
- package/src/projection/numerical-derivative.ts +50 -0
- package/src/projection/operations.ts +479 -0
- package/src/projection/pipeline.ts +4 -0
- package/src/projection/temporal.ts +133 -0
- package/src/projection/transform-analysis.ts +169 -0
- package/src/projection/types.ts +83 -0
- package/src/projection/web-mercator.ts +148 -0
- package/src/rhumb-path.ts +128 -0
- package/src/rhumb-polygon.ts +24 -0
- package/src/subdivide-geodesic-polyline.ts +74 -0
- package/src/subdivide-globe-mesh.ts +75 -0
- package/src/subdivide-rhumb-polyline.ts +108 -0
- package/src/terrain/adaptive-mesh-types.ts +25 -0
- package/src/terrain/bounds.ts +189 -0
- package/src/terrain/contour-path-data.ts +106 -0
- package/src/terrain/contour-paths.ts +107 -0
- package/src/terrain/contour-simplify.ts +189 -0
- package/src/terrain/contours.ts +180 -0
- package/src/terrain/delatin.ts +82 -0
- package/src/terrain/derivatives.ts +100 -0
- package/src/terrain/geographic.ts +131 -0
- package/src/terrain/geometry.ts +128 -0
- package/src/terrain/height-field.ts +361 -0
- package/src/terrain/index.ts +82 -0
- package/src/terrain/martini.ts +77 -0
- package/src/terrain/mesh-data.ts +111 -0
- package/src/terrain/mesh-edges.ts +27 -0
- package/src/terrain/mesh-error.ts +158 -0
- package/src/terrain/mesh-skirts.ts +166 -0
- package/src/terrain/mesh-stitch.ts +345 -0
- package/src/terrain/mesh.ts +49 -0
- package/src/terrain/packed.ts +172 -0
- package/src/terrain/profile-measure.ts +146 -0
- package/src/terrain/profile.ts +111 -0
- package/src/terrain/slope-aspect.ts +74 -0
- package/src/terrain/surface.ts +511 -0
- package/src/terrain/tiled.ts +488 -0
- package/src/terrain/types.ts +65 -0
- package/src/terrain/vendor/DELATIN-LICENSE.txt +17 -0
- package/src/terrain/vendor/README.md +20 -0
- package/src/terrain/vendor/delatin.js +491 -0
- package/src/terrain/vertex-tiles.ts +160 -0
- package/src/tile-matrix.ts +589 -0
- package/src/tiles.ts +32 -0
- package/src/triaxial/integrate.ts +82 -0
- package/src/triaxial.ts +195 -0
- package/src/turf.ts +1200 -0
- package/src/type-utils.ts +31 -3
- package/src/vendor/geographiclib-geodesic/README.md +26 -0
- package/src/vendor/geographiclib-geodesic/runtime.js +2339 -0
- package/src/web-mercator.ts +5 -0
- package/src/wkb/index.ts +38 -0
- package/src/wkb/types.ts +54 -0
- package/src/wkb/wkb-builder.ts +395 -0
- package/src/wkb/wkb-reader.ts +401 -0
- package/src/wkb/wkb.ts +255 -0
- package/src/wkb/wkt.ts +375 -0
- package/src/workers/index.ts +59 -0
- package/src/workers/map-worker.ts +7 -0
- package/src/workers/operations.ts +65 -0
- package/src/workers/projection-worker.ts +7 -0
|
@@ -0,0 +1,3099 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// dist/terrain/index.js
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
GeographicHeightField: () => GeographicHeightField,
|
|
33
|
+
HeightField: () => HeightField,
|
|
34
|
+
HeightFieldGeometry: () => HeightFieldGeometry,
|
|
35
|
+
HeightFieldMinMax: () => HeightFieldMinMax,
|
|
36
|
+
TERRAIN_BUFFER_VERSION: () => TERRAIN_BUFFER_VERSION,
|
|
37
|
+
TerrainSampleStatus: () => TerrainSampleStatus,
|
|
38
|
+
TerrainSurface: () => TerrainSurface,
|
|
39
|
+
TiledHeightField: () => TiledHeightField,
|
|
40
|
+
createDelatinTerrainMesh: () => createDelatinTerrainMesh,
|
|
41
|
+
createMartiniTerrainMesh: () => createMartiniTerrainMesh,
|
|
42
|
+
createTerrainContours: () => createTerrainContours,
|
|
43
|
+
createTerrainGradientGrid: () => createTerrainGradientGrid,
|
|
44
|
+
createTerrainMesh: () => createTerrainMesh,
|
|
45
|
+
createTerrainSkirt: () => createTerrainSkirt,
|
|
46
|
+
createTerrainSlopeAspectGrid: () => createTerrainSlopeAspectGrid,
|
|
47
|
+
createTerrainSurface: () => createTerrainSurface,
|
|
48
|
+
getTerrainMeshEdge: () => getTerrainMeshEdge,
|
|
49
|
+
getTerrainSlopeAspect: () => getTerrainSlopeAspect,
|
|
50
|
+
measureTerrainMeshError: () => measureTerrainMeshError,
|
|
51
|
+
measureTerrainProfile: () => measureTerrainProfile,
|
|
52
|
+
packTerrainHeightField: () => packTerrainHeightField,
|
|
53
|
+
reconcileTerrainVertexTiles: () => reconcileTerrainVertexTiles,
|
|
54
|
+
sampleTerrainProfile: () => sampleTerrainProfile,
|
|
55
|
+
simplifyTerrainContourPaths: () => simplifyTerrainContourPaths,
|
|
56
|
+
stitchTerrainContours: () => stitchTerrainContours,
|
|
57
|
+
stitchTerrainMeshEdges: () => stitchTerrainMeshEdges,
|
|
58
|
+
unpackTerrainHeightField: () => unpackTerrainHeightField
|
|
59
|
+
});
|
|
60
|
+
module.exports = __toCommonJS(index_exports);
|
|
61
|
+
|
|
62
|
+
// dist/terrain/types.js
|
|
63
|
+
var TerrainSampleStatus = {
|
|
64
|
+
VALID: 0,
|
|
65
|
+
OUTSIDE_DOMAIN: 1,
|
|
66
|
+
NO_DATA: 2,
|
|
67
|
+
INVALID_INPUT: 3,
|
|
68
|
+
NUMERIC_ERROR: 4,
|
|
69
|
+
UNAVAILABLE: 5,
|
|
70
|
+
NOT_RESIDENT: 6
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// dist/terrain/height-field.js
|
|
74
|
+
var HeightField = class {
|
|
75
|
+
constructor(props) {
|
|
76
|
+
this.batchSample = createSample();
|
|
77
|
+
const { width, height, heights, validity, offset = 0, stride = width } = props;
|
|
78
|
+
if (!Number.isSafeInteger(width) || width < 2 || !Number.isSafeInteger(height) || height < 2) {
|
|
79
|
+
throw new Error("HeightField width and height must be integers >= 2");
|
|
80
|
+
}
|
|
81
|
+
if (!isTerrainArray(heights) || validity !== void 0 && !(validity instanceof Uint8Array)) {
|
|
82
|
+
throw new Error("HeightField requires Float32/Float64 heights and an optional Uint8 validity mask");
|
|
83
|
+
}
|
|
84
|
+
if (!Number.isSafeInteger(offset) || offset < 0 || !Number.isSafeInteger(stride) || stride < width) {
|
|
85
|
+
throw new Error("HeightField offset must be nonnegative and stride must be >= width");
|
|
86
|
+
}
|
|
87
|
+
const end = offset + (height - 1) * stride + width;
|
|
88
|
+
if (!Number.isSafeInteger(end) || end > heights.length || validity && end > validity.length) {
|
|
89
|
+
throw new Error("HeightField input buffers are too small");
|
|
90
|
+
}
|
|
91
|
+
this.width = width;
|
|
92
|
+
this.height = height;
|
|
93
|
+
this.origin = copyVector(props.origin ?? [0, 0]);
|
|
94
|
+
this.columnStep = copyVector(props.columnStep ?? [1, 0]);
|
|
95
|
+
this.rowStep = copyVector(props.rowStep ?? [0, 1]);
|
|
96
|
+
this.registration = props.registration ?? "vertex";
|
|
97
|
+
this.diagonal = props.diagonal ?? "00-11";
|
|
98
|
+
this.heightReference = props.heightReference ?? "unknown";
|
|
99
|
+
if (this.registration !== "vertex" && this.registration !== "cell") {
|
|
100
|
+
throw new Error("HeightField registration must be vertex or cell");
|
|
101
|
+
}
|
|
102
|
+
if (this.diagonal !== "00-11" && this.diagonal !== "10-01") {
|
|
103
|
+
throw new Error("HeightField diagonal must be 00-11 or 10-01");
|
|
104
|
+
}
|
|
105
|
+
if (typeof this.heightReference !== "string") {
|
|
106
|
+
throw new Error("HeightField heightReference must be a string");
|
|
107
|
+
}
|
|
108
|
+
const [a, c] = this.columnStep;
|
|
109
|
+
const [b, d] = this.rowStep;
|
|
110
|
+
const determinant = a * d - b * c;
|
|
111
|
+
const scale = Math.hypot(a, c) * Math.hypot(b, d);
|
|
112
|
+
if (!Number.isFinite(determinant) || Math.abs(determinant) <= Number.EPSILON * scale) {
|
|
113
|
+
throw new Error("HeightField grid transform must be finite and nonsingular");
|
|
114
|
+
}
|
|
115
|
+
this.inverse = [d / determinant, -b / determinant, -c / determinant, a / determinant];
|
|
116
|
+
if (!this.inverse.every(Number.isFinite)) {
|
|
117
|
+
throw new Error("HeightField inverse transform must be finite");
|
|
118
|
+
}
|
|
119
|
+
this.heights = heights instanceof Float64Array ? new Float64Array(width * height) : new Float32Array(width * height);
|
|
120
|
+
this.validity = new Uint8Array(width * height);
|
|
121
|
+
let min = Infinity;
|
|
122
|
+
let max = -Infinity;
|
|
123
|
+
let validCount = 0;
|
|
124
|
+
for (let row = 0; row < height; row++) {
|
|
125
|
+
for (let column = 0; column < width; column++) {
|
|
126
|
+
const input = offset + row * stride + column;
|
|
127
|
+
const output = row * width + column;
|
|
128
|
+
const value = heights[input];
|
|
129
|
+
if (Number.isFinite(value) && (!validity || validity[input] !== 0)) {
|
|
130
|
+
this.heights[output] = value;
|
|
131
|
+
this.validity[output] = 1;
|
|
132
|
+
min = Math.min(min, value);
|
|
133
|
+
max = Math.max(max, value);
|
|
134
|
+
validCount++;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
this.validCount = validCount;
|
|
139
|
+
this.heightRange = validCount ? Object.freeze([min, max]) : void 0;
|
|
140
|
+
}
|
|
141
|
+
/** Reads an original grid sample, independently of interpolation footprints. */
|
|
142
|
+
getHeight(column, row) {
|
|
143
|
+
if (!Number.isInteger(column) || !Number.isInteger(row) || column < 0 || row < 0 || column >= this.width || row >= this.height)
|
|
144
|
+
return void 0;
|
|
145
|
+
const index = row * this.width + column;
|
|
146
|
+
return this.validity[index] ? this.heights[index] : void 0;
|
|
147
|
+
}
|
|
148
|
+
/** Independent, tightly packed copies, suitable for worker transfer or GPU preparation. */
|
|
149
|
+
copyData() {
|
|
150
|
+
return { heights: this.heights.slice(), validity: this.validity.slice() };
|
|
151
|
+
}
|
|
152
|
+
/** Samples world XY in meters. Supply result to avoid allocating a result object. */
|
|
153
|
+
sample(x, y, options, result = createSample()) {
|
|
154
|
+
resetSample(result, TerrainSampleStatus.INVALID_INPUT);
|
|
155
|
+
const interpolation = (options == null ? void 0 : options.interpolation) ?? "bilinear";
|
|
156
|
+
if (interpolation !== "nearest" && interpolation !== "bilinear" && interpolation !== "triangle") {
|
|
157
|
+
throw new Error("Unknown terrain interpolation");
|
|
158
|
+
}
|
|
159
|
+
if (!Number.isFinite(x) || !Number.isFinite(y))
|
|
160
|
+
return result;
|
|
161
|
+
const dx = x - this.origin[0];
|
|
162
|
+
const dy = y - this.origin[1];
|
|
163
|
+
const offset = this.registration === "cell" ? 0.5 : 0;
|
|
164
|
+
let u = this.inverse[0] * dx + this.inverse[1] * dy - offset;
|
|
165
|
+
let v = this.inverse[2] * dx + this.inverse[3] * dy - offset;
|
|
166
|
+
if (!Number.isFinite(u) || !Number.isFinite(v))
|
|
167
|
+
return resetSample(result, TerrainSampleStatus.NUMERIC_ERROR);
|
|
168
|
+
const tolerance = 8 * Number.EPSILON * Math.max(this.width, this.height);
|
|
169
|
+
const errorX = 4 * Number.EPSILON * Math.abs(x) + 4 * Number.EPSILON * Math.abs(this.origin[0]);
|
|
170
|
+
const errorY = 4 * Number.EPSILON * Math.abs(y) + 4 * Number.EPSILON * Math.abs(this.origin[1]);
|
|
171
|
+
const toleranceU = tolerance + Math.abs(this.inverse[0]) * errorX + Math.abs(this.inverse[1]) * errorY;
|
|
172
|
+
const toleranceV = tolerance + Math.abs(this.inverse[2]) * errorX + Math.abs(this.inverse[3]) * errorY;
|
|
173
|
+
if (u < -toleranceU || v < -toleranceV || u > this.width - 1 + toleranceU || v > this.height - 1 + toleranceV) {
|
|
174
|
+
return resetSample(result, TerrainSampleStatus.OUTSIDE_DOMAIN);
|
|
175
|
+
}
|
|
176
|
+
u = Math.max(0, Math.min(this.width - 1, u));
|
|
177
|
+
v = Math.max(0, Math.min(this.height - 1, v));
|
|
178
|
+
if (interpolation === "nearest") {
|
|
179
|
+
const value = this.getHeight(Math.floor(u + 0.5), Math.floor(v + 0.5));
|
|
180
|
+
if (value === void 0)
|
|
181
|
+
return resetSample(result, TerrainSampleStatus.NO_DATA);
|
|
182
|
+
result.status = TerrainSampleStatus.VALID;
|
|
183
|
+
result.height = value;
|
|
184
|
+
result.gradientStatus = TerrainSampleStatus.UNAVAILABLE;
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
const column = Math.min(Math.floor(u), this.width - 2);
|
|
188
|
+
const row = Math.min(Math.floor(v), this.height - 2);
|
|
189
|
+
u -= column;
|
|
190
|
+
v -= row;
|
|
191
|
+
const a = row * this.width + column;
|
|
192
|
+
const b = a + 1;
|
|
193
|
+
const c = a + this.width;
|
|
194
|
+
const d = c + 1;
|
|
195
|
+
const za = this.heights[a];
|
|
196
|
+
const zb = this.heights[b];
|
|
197
|
+
const zc = this.heights[c];
|
|
198
|
+
const zd = this.heights[d];
|
|
199
|
+
let du;
|
|
200
|
+
let dv;
|
|
201
|
+
if (interpolation === "bilinear") {
|
|
202
|
+
if (!this.validity[a] || !this.validity[b] || !this.validity[c] || !this.validity[d]) {
|
|
203
|
+
return resetSample(result, TerrainSampleStatus.NO_DATA);
|
|
204
|
+
}
|
|
205
|
+
result.height = (1 - v) * ((1 - u) * za + u * zb) + v * ((1 - u) * zc + u * zd);
|
|
206
|
+
du = (1 - v) * (zb - za) + v * (zd - zc);
|
|
207
|
+
dv = (1 - u) * (zc - za) + u * (zd - zb);
|
|
208
|
+
} else if (this.diagonal === "00-11" ? v <= u : u + v <= 1) {
|
|
209
|
+
const last = this.diagonal === "00-11" ? d : c;
|
|
210
|
+
if (!this.validity[a] || !this.validity[b] || !this.validity[last]) {
|
|
211
|
+
return resetSample(result, TerrainSampleStatus.NO_DATA);
|
|
212
|
+
}
|
|
213
|
+
du = zb - za;
|
|
214
|
+
dv = this.diagonal === "00-11" ? zd - zb : zc - za;
|
|
215
|
+
result.height = this.diagonal === "00-11" ? (1 - u) * za + (u - v) * zb + v * zd : (1 - u - v) * za + u * zb + v * zc;
|
|
216
|
+
} else {
|
|
217
|
+
const first = this.diagonal === "00-11" ? a : b;
|
|
218
|
+
if (!this.validity[first] || !this.validity[c] || !this.validity[d]) {
|
|
219
|
+
return resetSample(result, TerrainSampleStatus.NO_DATA);
|
|
220
|
+
}
|
|
221
|
+
du = zd - zc;
|
|
222
|
+
dv = this.diagonal === "00-11" ? zc - za : zd - zb;
|
|
223
|
+
result.height = this.diagonal === "00-11" ? (1 - v) * za + u * zd + (v - u) * zc : (1 - v) * zb + (1 - u) * zc + (u + v - 1) * zd;
|
|
224
|
+
}
|
|
225
|
+
if (!Number.isFinite(result.height))
|
|
226
|
+
return resetSample(result, TerrainSampleStatus.NUMERIC_ERROR);
|
|
227
|
+
result.status = TerrainSampleStatus.VALID;
|
|
228
|
+
const gx = du * this.inverse[0] + dv * this.inverse[2];
|
|
229
|
+
const gy = du * this.inverse[1] + dv * this.inverse[3];
|
|
230
|
+
if (!Number.isFinite(gx) || !Number.isFinite(gy)) {
|
|
231
|
+
result.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
const normalScale = Math.max(Math.abs(gx), Math.abs(gy), 1);
|
|
235
|
+
const nx = -gx / normalScale;
|
|
236
|
+
const ny = -gy / normalScale;
|
|
237
|
+
const nz = 1 / normalScale;
|
|
238
|
+
const length = Math.hypot(nx, ny, nz);
|
|
239
|
+
result.gradientStatus = TerrainSampleStatus.VALID;
|
|
240
|
+
result.gradientX = gx;
|
|
241
|
+
result.gradientY = gy;
|
|
242
|
+
result.normalX = nx / length;
|
|
243
|
+
result.normalY = ny / length;
|
|
244
|
+
result.normalZ = nz / length;
|
|
245
|
+
return result;
|
|
246
|
+
}
|
|
247
|
+
/** Interleaved XY inputs and caller-owned outputs, with no per-sample allocation. */
|
|
248
|
+
sampleBatch(positions, output, options) {
|
|
249
|
+
validateBatch(positions, output);
|
|
250
|
+
for (let i = 0; i < positions.length / 2; i++) {
|
|
251
|
+
const sample = this.sample(positions[2 * i], positions[2 * i + 1], options, this.batchSample);
|
|
252
|
+
output.heights[i] = sample.height;
|
|
253
|
+
if (!Number.isFinite(output.heights[i])) {
|
|
254
|
+
resetSample(sample, TerrainSampleStatus.NUMERIC_ERROR);
|
|
255
|
+
output.heights[i] = 0;
|
|
256
|
+
}
|
|
257
|
+
if (output.gradients) {
|
|
258
|
+
output.gradients[2 * i] = sample.gradientX;
|
|
259
|
+
output.gradients[2 * i + 1] = sample.gradientY;
|
|
260
|
+
if (!Number.isFinite(output.gradients[2 * i]) || !Number.isFinite(output.gradients[2 * i + 1])) {
|
|
261
|
+
output.gradients[2 * i] = output.gradients[2 * i + 1] = 0;
|
|
262
|
+
sample.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
263
|
+
sample.normalX = sample.normalY = sample.normalZ = 0;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (output.normals) {
|
|
267
|
+
output.normals[3 * i] = sample.normalX;
|
|
268
|
+
output.normals[3 * i + 1] = sample.normalY;
|
|
269
|
+
output.normals[3 * i + 2] = sample.normalZ;
|
|
270
|
+
}
|
|
271
|
+
output.statuses[i] = sample.status;
|
|
272
|
+
if (output.gradientStatuses)
|
|
273
|
+
output.gradientStatuses[i] = sample.gradientStatus;
|
|
274
|
+
}
|
|
275
|
+
return output;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
function copyVector(value) {
|
|
279
|
+
if (value.length !== 2 || !value.every(Number.isFinite))
|
|
280
|
+
throw new Error("Grid vectors must be finite XY pairs");
|
|
281
|
+
return Object.freeze([value[0], value[1]]);
|
|
282
|
+
}
|
|
283
|
+
function createSample() {
|
|
284
|
+
return {
|
|
285
|
+
status: TerrainSampleStatus.NO_DATA,
|
|
286
|
+
height: 0,
|
|
287
|
+
gradientStatus: TerrainSampleStatus.NO_DATA,
|
|
288
|
+
gradientX: 0,
|
|
289
|
+
gradientY: 0,
|
|
290
|
+
normalX: 0,
|
|
291
|
+
normalY: 0,
|
|
292
|
+
normalZ: 0
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function resetSample(result, status) {
|
|
296
|
+
result.status = status;
|
|
297
|
+
result.gradientStatus = status;
|
|
298
|
+
result.height = result.gradientX = result.gradientY = result.normalX = result.normalY = result.normalZ = 0;
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
301
|
+
function isTerrainArray(value) {
|
|
302
|
+
return value instanceof Float32Array || value instanceof Float64Array;
|
|
303
|
+
}
|
|
304
|
+
function validateBatch(positions, output) {
|
|
305
|
+
if (!isTerrainArray(positions) || positions.length % 2 !== 0) {
|
|
306
|
+
throw new Error("Terrain batch positions must contain Float32/Float64 XY pairs");
|
|
307
|
+
}
|
|
308
|
+
const count = positions.length / 2;
|
|
309
|
+
const buffers = [positions];
|
|
310
|
+
for (const [key, size] of [
|
|
311
|
+
["heights", 1],
|
|
312
|
+
["statuses", 1],
|
|
313
|
+
["gradients", 2],
|
|
314
|
+
["normals", 3],
|
|
315
|
+
["gradientStatuses", 1]
|
|
316
|
+
]) {
|
|
317
|
+
const buffer = output[key];
|
|
318
|
+
if (buffer === void 0 && key !== "heights" && key !== "statuses")
|
|
319
|
+
continue;
|
|
320
|
+
const byte = key === "statuses" || key === "gradientStatuses";
|
|
321
|
+
if ((byte ? !(buffer instanceof Uint8Array) : !isTerrainArray(buffer)) || buffer.length < count * size) {
|
|
322
|
+
throw new Error(`Terrain batch ${key} has an invalid type or insufficient length`);
|
|
323
|
+
}
|
|
324
|
+
for (const other of buffers) {
|
|
325
|
+
if (buffer.buffer === other.buffer && buffer.byteOffset < other.byteOffset + other.byteLength && other.byteOffset < buffer.byteOffset + buffer.byteLength) {
|
|
326
|
+
throw new Error("Terrain batch input and output buffers must not overlap");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
buffers.push(buffer);
|
|
330
|
+
}
|
|
331
|
+
if ((output.gradients || output.normals) && !output.gradientStatuses) {
|
|
332
|
+
throw new Error("Terrain batch derivatives require gradientStatuses");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// dist/terrain/mesh-skirts.js
|
|
337
|
+
function createTerrainSkirt(mesh, options) {
|
|
338
|
+
const { positions, indices } = mesh, { height, edges } = options;
|
|
339
|
+
const maxVertices = options.maxVertices ?? 2e6, maxTriangles = options.maxTriangles ?? 4e6;
|
|
340
|
+
if (!Number.isFinite(height) || height <= 0 || !Number.isSafeInteger(maxVertices) || maxVertices < 0 || maxVertices > 4294967295 || !Number.isSafeInteger(maxTriangles) || maxTriangles < 0 || maxTriangles > 4294967295)
|
|
341
|
+
throw new Error("Invalid terrain skirt height or capacity");
|
|
342
|
+
if (!(positions instanceof Float32Array || positions instanceof Float64Array) || positions.length < 3 || positions.length % 3 || !positions.every(Number.isFinite) || !(indices instanceof Uint16Array || indices instanceof Uint32Array) || indices.length % 3 || positions.length / 3 > maxVertices || indices.length / 3 > maxTriangles)
|
|
343
|
+
throw new Error("Invalid terrain skirt mesh or capacity");
|
|
344
|
+
if (edges !== void 0 && (!(edges instanceof Uint16Array || edges instanceof Uint32Array) || edges.length % 2))
|
|
345
|
+
throw new Error("Invalid terrain skirt edge pairs");
|
|
346
|
+
const vertexCount = positions.length / 3, triangleCount = indices.length / 3;
|
|
347
|
+
const boundary = /* @__PURE__ */ new Map();
|
|
348
|
+
for (let i = 0; i < indices.length; i += 3) {
|
|
349
|
+
const ids = [indices[i], indices[i + 1], indices[i + 2]];
|
|
350
|
+
if (ids.some((id) => id >= vertexCount))
|
|
351
|
+
throw new Error("Terrain skirt index out of range");
|
|
352
|
+
const [a, b, c] = ids.map((id) => id * 3);
|
|
353
|
+
const area = (positions[b] - positions[a]) * (positions[c + 1] - positions[a + 1]) - (positions[b + 1] - positions[a + 1]) * (positions[c] - positions[a]);
|
|
354
|
+
if (!Number.isFinite(area) || area <= 0)
|
|
355
|
+
throw new Error("Terrain skirt requires upward nondegenerate XY triangles");
|
|
356
|
+
for (let j = 0; j < 3; j++) {
|
|
357
|
+
const u = ids[j], v = ids[(j + 1) % 3], key = edgeKey(u, v), prior = boundary.get(key);
|
|
358
|
+
if (!prior)
|
|
359
|
+
boundary.set(key, { a: u, b: v, count: 1 });
|
|
360
|
+
else {
|
|
361
|
+
if (prior.count !== 1 || prior.a !== v || prior.b !== u)
|
|
362
|
+
throw new Error("Terrain skirt mesh has nonmanifold or inconsistent edges");
|
|
363
|
+
prior.count++;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
let selected;
|
|
368
|
+
if (edges) {
|
|
369
|
+
selected = [];
|
|
370
|
+
const used = /* @__PURE__ */ new Set();
|
|
371
|
+
for (let i = 0; i < edges.length; i += 2) {
|
|
372
|
+
const key = edgeKey(edges[i], edges[i + 1]), edge = boundary.get(key);
|
|
373
|
+
if (!edge || edge.count !== 1 || used.has(key))
|
|
374
|
+
throw new Error("Terrain skirt selection must contain unique boundary edges");
|
|
375
|
+
used.add(key);
|
|
376
|
+
selected.push(edge);
|
|
377
|
+
}
|
|
378
|
+
} else
|
|
379
|
+
selected = [...boundary.values()].filter((edge) => edge.count === 1);
|
|
380
|
+
const outputVertices = vertexCount + selected.length * 2, outputTriangles = triangleCount + selected.length * 2;
|
|
381
|
+
if (!Number.isSafeInteger(outputVertices) || outputVertices > maxVertices || outputVertices > 4294967295 || !Number.isSafeInteger(outputTriangles) || outputTriangles > maxTriangles)
|
|
382
|
+
throw new Error("Terrain skirt output capacity exceeded");
|
|
383
|
+
const resultPositions = positions instanceof Float32Array ? new Float32Array(outputVertices * 3) : new Float64Array(outputVertices * 3);
|
|
384
|
+
resultPositions.set(positions);
|
|
385
|
+
const resultIndices = indices instanceof Uint16Array && outputVertices <= 65536 ? new Uint16Array(outputTriangles * 3) : new Uint32Array(outputTriangles * 3);
|
|
386
|
+
resultIndices.set(indices);
|
|
387
|
+
const sourceVertexIndices = new Uint32Array(selected.length * 2), triangleValidity = new Uint8Array(outputTriangles);
|
|
388
|
+
triangleValidity.fill(1, 0, triangleCount);
|
|
389
|
+
for (let i = 0; i < selected.length; i++) {
|
|
390
|
+
const { a, b } = selected[i], lowerA = vertexCount + 2 * i, lowerB = lowerA + 1;
|
|
391
|
+
for (const [source, target] of [
|
|
392
|
+
[a, lowerA],
|
|
393
|
+
[b, lowerB]
|
|
394
|
+
]) {
|
|
395
|
+
resultPositions.set(positions.subarray(3 * source, 3 * source + 3), 3 * target);
|
|
396
|
+
resultPositions[3 * target + 2] = positions[3 * source + 2] - height;
|
|
397
|
+
if (!Number.isFinite(resultPositions[3 * target + 2]) || resultPositions[3 * target + 2] >= positions[3 * source + 2])
|
|
398
|
+
throw new Error("Terrain skirt height cannot be represented in position precision");
|
|
399
|
+
sourceVertexIndices[target - vertexCount] = source;
|
|
400
|
+
}
|
|
401
|
+
resultIndices.set([a, lowerB, b, lowerB, a, lowerA], indices.length + i * 6);
|
|
402
|
+
}
|
|
403
|
+
const min = [Infinity, Infinity, Infinity], max = [-Infinity, -Infinity, -Infinity];
|
|
404
|
+
for (let i = 0; i < resultPositions.length; i++) {
|
|
405
|
+
const axis = i % 3;
|
|
406
|
+
min[axis] = Math.min(min[axis], resultPositions[i]);
|
|
407
|
+
max[axis] = Math.max(max[axis], resultPositions[i]);
|
|
408
|
+
}
|
|
409
|
+
return {
|
|
410
|
+
positions: resultPositions,
|
|
411
|
+
indices: resultIndices,
|
|
412
|
+
sourceVertexIndices,
|
|
413
|
+
skirtVertexOffset: vertexCount,
|
|
414
|
+
skirtTriangleOffset: triangleCount,
|
|
415
|
+
triangleValidity,
|
|
416
|
+
bounds: [min, max]
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
function edgeKey(a, b) {
|
|
420
|
+
return a < b ? `${a},${b}` : `${b},${a}`;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// dist/terrain/geometry.js
|
|
424
|
+
var import_geometry = require("@math.gl/geometry");
|
|
425
|
+
var HeightFieldGeometry = class extends import_geometry.Geometry {
|
|
426
|
+
constructor(field, options = {}) {
|
|
427
|
+
const origin = options.origin ?? [field.origin[0], field.origin[1], 0];
|
|
428
|
+
if (origin.length !== 3 || !origin.every(Number.isFinite))
|
|
429
|
+
throw new Error("Mesh origin must be a finite XYZ triple");
|
|
430
|
+
const precision = options.precision ?? "float32";
|
|
431
|
+
if (precision !== "float32" && precision !== "float64")
|
|
432
|
+
throw new Error("Unknown terrain mesh precision");
|
|
433
|
+
const count = field.width * field.height;
|
|
434
|
+
const positions = precision === "float64" ? new Float64Array(count * 3) : new Float32Array(count * 3);
|
|
435
|
+
const normals = new Float32Array(count * 3);
|
|
436
|
+
const accumulatedNormals = new Float64Array(count * 3);
|
|
437
|
+
const uv = new Float32Array(count * 2);
|
|
438
|
+
const valid = new Uint8Array(count);
|
|
439
|
+
const indices = count > 65535 ? new Uint32Array((field.width - 1) * (field.height - 1) * 6) : new Uint16Array((field.width - 1) * (field.height - 1) * 6);
|
|
440
|
+
const shift = field.registration === "cell" ? 0.5 : 0;
|
|
441
|
+
for (let row = 0; row < field.height; row++) {
|
|
442
|
+
for (let column = 0; column < field.width; column++) {
|
|
443
|
+
const i = row * field.width + column;
|
|
444
|
+
const height = field.getHeight(column, row);
|
|
445
|
+
valid[i] = height === void 0 ? 0 : 1;
|
|
446
|
+
positions[3 * i] = field.origin[0] - origin[0] + (column + shift) * field.columnStep[0] + (row + shift) * field.rowStep[0];
|
|
447
|
+
positions[3 * i + 1] = field.origin[1] - origin[1] + (column + shift) * field.columnStep[1] + (row + shift) * field.rowStep[1];
|
|
448
|
+
positions[3 * i + 2] = height === void 0 ? 0 : height - origin[2];
|
|
449
|
+
uv[2 * i] = (column + shift) / (field.registration === "cell" ? field.width : field.width - 1);
|
|
450
|
+
uv[2 * i + 1] = (row + shift) / (field.registration === "cell" ? field.height : field.height - 1);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (!positions.every(Number.isFinite))
|
|
454
|
+
throw new Error("Terrain mesh positions overflow the selected precision");
|
|
455
|
+
const reverse = field.columnStep[0] * field.rowStep[1] - field.columnStep[1] * field.rowStep[0] < 0;
|
|
456
|
+
let indexCount = 0;
|
|
457
|
+
const addTriangle = (a, b, c) => {
|
|
458
|
+
if (!valid[a] || !valid[b] || !valid[c])
|
|
459
|
+
return;
|
|
460
|
+
if (reverse)
|
|
461
|
+
[b, c] = [c, b];
|
|
462
|
+
indices[indexCount++] = a;
|
|
463
|
+
indices[indexCount++] = b;
|
|
464
|
+
indices[indexCount++] = c;
|
|
465
|
+
const abx = positions[3 * b] - positions[3 * a];
|
|
466
|
+
const aby = positions[3 * b + 1] - positions[3 * a + 1];
|
|
467
|
+
const abz = positions[3 * b + 2] - positions[3 * a + 2];
|
|
468
|
+
const acx = positions[3 * c] - positions[3 * a];
|
|
469
|
+
const acy = positions[3 * c + 1] - positions[3 * a + 1];
|
|
470
|
+
const acz = positions[3 * c + 2] - positions[3 * a + 2];
|
|
471
|
+
const nx = aby * acz - abz * acy;
|
|
472
|
+
const ny = abz * acx - abx * acz;
|
|
473
|
+
const nz = abx * acy - aby * acx;
|
|
474
|
+
if (!Number.isFinite(nx) || !Number.isFinite(ny) || !Number.isFinite(nz) || nz <= 0) {
|
|
475
|
+
throw new Error("Terrain triangle degenerates or overflows at the selected precision; use a local origin");
|
|
476
|
+
}
|
|
477
|
+
for (const i of [a, b, c]) {
|
|
478
|
+
accumulatedNormals[3 * i] += nx;
|
|
479
|
+
accumulatedNormals[3 * i + 1] += ny;
|
|
480
|
+
accumulatedNormals[3 * i + 2] += nz;
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
for (let row = 0; row < field.height - 1; row++) {
|
|
484
|
+
for (let column = 0; column < field.width - 1; column++) {
|
|
485
|
+
const a = row * field.width + column;
|
|
486
|
+
const b = a + 1;
|
|
487
|
+
const c = a + field.width;
|
|
488
|
+
const d = c + 1;
|
|
489
|
+
if (field.diagonal === "00-11") {
|
|
490
|
+
addTriangle(a, b, d);
|
|
491
|
+
addTriangle(a, d, c);
|
|
492
|
+
} else {
|
|
493
|
+
addTriangle(a, b, c);
|
|
494
|
+
addTriangle(b, d, c);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
for (let i = 0; i < count; i++) {
|
|
499
|
+
const nx = accumulatedNormals[3 * i];
|
|
500
|
+
const ny = accumulatedNormals[3 * i + 1];
|
|
501
|
+
const nz = accumulatedNormals[3 * i + 2];
|
|
502
|
+
const length = Math.hypot(nx, ny, nz);
|
|
503
|
+
if (!Number.isFinite(length))
|
|
504
|
+
throw new Error("Terrain normal accumulation overflow");
|
|
505
|
+
normals[3 * i] = length ? nx / length : 0;
|
|
506
|
+
normals[3 * i + 1] = length ? ny / length : 0;
|
|
507
|
+
normals[3 * i + 2] = length ? nz / length : 1;
|
|
508
|
+
}
|
|
509
|
+
super({
|
|
510
|
+
id: options.id,
|
|
511
|
+
topology: "triangle-list",
|
|
512
|
+
indices: indexCount === indices.length ? indices : indices.slice(0, indexCount),
|
|
513
|
+
attributes: {
|
|
514
|
+
POSITION: { size: 3, value: positions },
|
|
515
|
+
NORMAL: { size: 3, value: normals },
|
|
516
|
+
TEXCOORD_0: { size: 2, value: uv }
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
this.origin = Object.freeze([...origin]);
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
// dist/terrain/geographic.js
|
|
524
|
+
var RADIANS = Math.PI / 180;
|
|
525
|
+
var RADIUS = 6378137;
|
|
526
|
+
var ECCENTRICITY_SQUARED = 0.0066943799901413165;
|
|
527
|
+
var MAX_MERCATOR_LATITUDE = Math.atan(Math.sinh(Math.PI)) / RADIANS;
|
|
528
|
+
var GeographicHeightField = class {
|
|
529
|
+
constructor(props) {
|
|
530
|
+
const { bounds } = props;
|
|
531
|
+
this.projection = props.projection ?? "geographic";
|
|
532
|
+
this.heightReference = props.heightReference ?? "unknown";
|
|
533
|
+
const limit = this.projection === "web-mercator" ? MAX_MERCATOR_LATITUDE : 90;
|
|
534
|
+
if (bounds.length !== 4 || !bounds.every(Number.isFinite) || bounds[2] <= bounds[0] || bounds[2] - bounds[0] > 360 || bounds[3] <= bounds[1] || bounds[1] < -limit || bounds[3] > limit || this.projection === "geographic" && (bounds[1] === -90 || bounds[3] === 90)) {
|
|
535
|
+
throw new Error("Terrain bounds must be increasing, span at most 360 degrees and exclude the projection limits");
|
|
536
|
+
}
|
|
537
|
+
if (this.projection !== "geographic" && this.projection !== "web-mercator")
|
|
538
|
+
throw new Error("Unknown terrain projection");
|
|
539
|
+
const direction = props.rowDirection ?? "north-to-south";
|
|
540
|
+
if (direction !== "north-to-south" && direction !== "south-to-north")
|
|
541
|
+
throw new Error("Unknown terrain row direction");
|
|
542
|
+
this.bounds = Object.freeze([...bounds]);
|
|
543
|
+
const west = this.projectX(bounds[0]);
|
|
544
|
+
const east = this.projectX(bounds[2]);
|
|
545
|
+
const south = this.projectY(bounds[1]);
|
|
546
|
+
const north = this.projectY(bounds[3]);
|
|
547
|
+
const cell = props.registration === "cell";
|
|
548
|
+
const descending = direction === "north-to-south";
|
|
549
|
+
this.field = new HeightField({
|
|
550
|
+
...props,
|
|
551
|
+
origin: [west, descending ? north : south],
|
|
552
|
+
columnStep: [(east - west) / (props.width - (cell ? 0 : 1)), 0],
|
|
553
|
+
rowStep: [0, (descending ? south - north : north - south) / (props.height - (cell ? 0 : 1))]
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
/** Longitude must use the bounds' unwrapped interval; no implicit wrapping or clamping. */
|
|
557
|
+
sample(longitude, latitude, options, result) {
|
|
558
|
+
const valid = Number.isFinite(longitude) && Number.isFinite(latitude);
|
|
559
|
+
const inside = valid && longitude >= this.bounds[0] && longitude <= this.bounds[2] && latitude >= this.bounds[1] && latitude <= this.bounds[3];
|
|
560
|
+
const sample = this.field.sample(inside ? this.projectX(longitude) : NaN, inside ? this.projectY(latitude) : NaN, options, result);
|
|
561
|
+
if (!inside) {
|
|
562
|
+
sample.status = sample.gradientStatus = valid ? TerrainSampleStatus.OUTSIDE_DOMAIN : TerrainSampleStatus.INVALID_INPUT;
|
|
563
|
+
return sample;
|
|
564
|
+
}
|
|
565
|
+
if (sample.gradientStatus !== TerrainSampleStatus.VALID)
|
|
566
|
+
return sample;
|
|
567
|
+
const phi = latitude * RADIANS;
|
|
568
|
+
const denominator = 1 - ECCENTRICITY_SQUARED * Math.sin(phi) ** 2;
|
|
569
|
+
const n = RADIUS / Math.sqrt(denominator);
|
|
570
|
+
const m = RADIUS * (1 - ECCENTRICITY_SQUARED) / denominator ** 1.5;
|
|
571
|
+
const mercator = this.projection === "web-mercator";
|
|
572
|
+
const gx = sample.gradientX * (mercator ? RADIUS : 1 / RADIANS) / (n * Math.cos(phi));
|
|
573
|
+
const gy = sample.gradientY * (mercator ? RADIUS / Math.cos(phi) : 1 / RADIANS) / m;
|
|
574
|
+
if (!Number.isFinite(gx) || !Number.isFinite(gy)) {
|
|
575
|
+
sample.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
576
|
+
sample.gradientX = sample.gradientY = sample.normalX = sample.normalY = sample.normalZ = 0;
|
|
577
|
+
return sample;
|
|
578
|
+
}
|
|
579
|
+
sample.gradientX = gx;
|
|
580
|
+
sample.gradientY = gy;
|
|
581
|
+
const scale = Math.max(1, Math.abs(gx), Math.abs(gy));
|
|
582
|
+
const length = Math.hypot(gx / scale, gy / scale, 1 / scale);
|
|
583
|
+
sample.normalX = -gx / scale / length;
|
|
584
|
+
sample.normalY = -gy / scale / length;
|
|
585
|
+
sample.normalZ = 1 / scale / length;
|
|
586
|
+
return sample;
|
|
587
|
+
}
|
|
588
|
+
projectX(longitude) {
|
|
589
|
+
return this.projection === "web-mercator" ? RADIUS * longitude * RADIANS : longitude;
|
|
590
|
+
}
|
|
591
|
+
projectY(latitude) {
|
|
592
|
+
return this.projection === "web-mercator" ? RADIUS * Math.asinh(Math.tan(latitude * RADIANS)) : latitude;
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
// dist/tile-matrix.js
|
|
597
|
+
function validateTileMatrix(matrix) {
|
|
598
|
+
validateTileMatrixGeometry(matrix);
|
|
599
|
+
}
|
|
600
|
+
function validateTileMatrixGeometry(matrix) {
|
|
601
|
+
if (!matrix || typeof matrix.id !== "string" || !Array.isArray(matrix.origin) || !Array.isArray(matrix.tileSize) || !Array.isArray(matrix.matrixSize) || matrix.variableMatrixWidths !== void 0 && !Array.isArray(matrix.variableMatrixWidths) || !matrix.id || matrix.origin.length !== 2 || matrix.tileSize.length !== 2 || matrix.matrixSize.length !== 2 || !Number.isFinite(matrix.resolution) || matrix.resolution <= 0 || matrix.resolutionY !== void 0 && (!Number.isFinite(matrix.resolutionY) || matrix.resolutionY <= 0) || !matrix.origin.every(Number.isFinite) || ![...matrix.tileSize, ...matrix.matrixSize].every((value) => Number.isSafeInteger(value) && value > 0) || !["topLeft", "bottomLeft"].includes(matrix.cornerOfOrigin)) {
|
|
602
|
+
throw new RangeError("Invalid tile matrix geometry");
|
|
603
|
+
}
|
|
604
|
+
const bands = [...matrix.variableMatrixWidths ?? []];
|
|
605
|
+
if (bands.some((band) => !band))
|
|
606
|
+
throw new RangeError("Invalid variable matrix width");
|
|
607
|
+
bands.sort((first, second) => first.minTileRow - second.minTileRow);
|
|
608
|
+
let previousRow = -1;
|
|
609
|
+
for (const band of bands) {
|
|
610
|
+
if (!Number.isSafeInteger(band.coalesce) || band.coalesce <= 1 || matrix.matrixSize[0] % band.coalesce !== 0 || !Number.isSafeInteger(band.minTileRow) || !Number.isSafeInteger(band.maxTileRow) || band.minTileRow <= previousRow || band.maxTileRow < band.minTileRow || band.maxTileRow >= matrix.matrixSize[1])
|
|
611
|
+
throw new RangeError("Invalid variable matrix width");
|
|
612
|
+
previousRow = band.maxTileRow;
|
|
613
|
+
}
|
|
614
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
615
|
+
const resolution = axis === 1 ? matrix.resolutionY ?? matrix.resolution : matrix.resolution;
|
|
616
|
+
const tileSpan = resolution * matrix.tileSize[axis];
|
|
617
|
+
const span = tileSpan * matrix.matrixSize[axis];
|
|
618
|
+
const direction = axis === 1 && matrix.cornerOfOrigin === "topLeft" ? -1 : 1;
|
|
619
|
+
const end = matrix.origin[axis] + direction * span;
|
|
620
|
+
if (!Number.isFinite(span) || span <= 0 || !Number.isFinite(end) || matrix.origin[axis] + direction * tileSpan === matrix.origin[axis] || end - direction * tileSpan === end) {
|
|
621
|
+
throw new RangeError("Tile matrix extent must be finite");
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return bands;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// dist/terrain/tiled.js
|
|
628
|
+
var TiledHeightField = class _TiledHeightField {
|
|
629
|
+
constructor(props) {
|
|
630
|
+
this.changes = Object.freeze([]);
|
|
631
|
+
this.tiles = /* @__PURE__ */ new Map();
|
|
632
|
+
this.halos = /* @__PURE__ */ new Map();
|
|
633
|
+
if (typeof props.revision !== "string")
|
|
634
|
+
throw new Error("Terrain revision must be a string");
|
|
635
|
+
this.revision = props.revision;
|
|
636
|
+
this.crs = props.matrixSet.crs;
|
|
637
|
+
this.diagonal = props.diagonal ?? "00-11";
|
|
638
|
+
if (this.diagonal !== "00-11" && this.diagonal !== "10-01")
|
|
639
|
+
throw new Error("Unknown terrain diagonal");
|
|
640
|
+
this.heightReference = props.heightReference ?? "unknown";
|
|
641
|
+
this.matrices = props.matrixSet.matrices.map((matrix) => {
|
|
642
|
+
var _a;
|
|
643
|
+
validateTileMatrix(matrix);
|
|
644
|
+
if ((_a = matrix.variableMatrixWidths) == null ? void 0 : _a.length)
|
|
645
|
+
throw new Error("Terrain does not yet support coalesced tile rows");
|
|
646
|
+
if (matrix.tileSize.some((size, axis) => size * matrix.matrixSize[axis] < 2))
|
|
647
|
+
throw new Error("Terrain matrices need at least two samples per axis");
|
|
648
|
+
return {
|
|
649
|
+
...matrix,
|
|
650
|
+
variableMatrixWidths: matrix.variableMatrixWidths ? [] : void 0,
|
|
651
|
+
origin: [...matrix.origin],
|
|
652
|
+
tileSize: [...matrix.tileSize],
|
|
653
|
+
matrixSize: [...matrix.matrixSize]
|
|
654
|
+
};
|
|
655
|
+
});
|
|
656
|
+
if (!this.matrices.length || new Set(this.matrices.map((matrix) => matrix.id)).size !== this.matrices.length)
|
|
657
|
+
throw new Error("Terrain requires unique matrix identifiers");
|
|
658
|
+
for (const tile of props.tiles) {
|
|
659
|
+
const matrix = this.validateTileId(tile);
|
|
660
|
+
const key = tileKey(tile.matrixId, tile.column, tile.row);
|
|
661
|
+
if (this.tiles.has(key))
|
|
662
|
+
throw new Error("Duplicate terrain tile");
|
|
663
|
+
this.tiles.set(key, copyTileData(tile, matrix));
|
|
664
|
+
}
|
|
665
|
+
for (const tile of props.tiles)
|
|
666
|
+
this.buildHalo(this.getMatrix(tile.matrixId), tile.column, tile.row, props.diagonal);
|
|
667
|
+
this.changes = freezeChanges(props.tiles.map((tile) => ({
|
|
668
|
+
matrixId: tile.matrixId,
|
|
669
|
+
column: tile.column,
|
|
670
|
+
row: tile.row,
|
|
671
|
+
resident: true
|
|
672
|
+
})));
|
|
673
|
+
}
|
|
674
|
+
/** Number of resident source tiles. */
|
|
675
|
+
get tileCount() {
|
|
676
|
+
return this.tiles.size;
|
|
677
|
+
}
|
|
678
|
+
/** Halos to upload or evict relative to the preceding snapshot; initial snapshots list all tiles. */
|
|
679
|
+
get haloChanges() {
|
|
680
|
+
return this.changes;
|
|
681
|
+
}
|
|
682
|
+
/** Copy-on-write update. Only changed sources and resident one-tile neighborhoods rebuild halos.
|
|
683
|
+
* Old snapshots keep their original source buffers and halos. Map copying is O(resident tiles).
|
|
684
|
+
*/
|
|
685
|
+
withTiles(update) {
|
|
686
|
+
if (typeof update.revision !== "string" || update.revision === this.revision)
|
|
687
|
+
throw new Error("Terrain updates require a different revision string");
|
|
688
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
689
|
+
const touched = /* @__PURE__ */ new Map();
|
|
690
|
+
for (const tile of [...update.tiles ?? [], ...update.remove ?? []]) {
|
|
691
|
+
this.validateTileId(tile);
|
|
692
|
+
const key = tileKey(tile.matrixId, tile.column, tile.row);
|
|
693
|
+
if (touched.has(key))
|
|
694
|
+
throw new Error("Terrain update contains duplicate or conflicting tile identifiers");
|
|
695
|
+
touched.set(key, tile);
|
|
696
|
+
}
|
|
697
|
+
for (const tile of update.tiles ?? [])
|
|
698
|
+
replacements.set(tileKey(tile.matrixId, tile.column, tile.row), copyTileData(tile, this.getMatrix(tile.matrixId)));
|
|
699
|
+
const next = new _TiledHeightField({
|
|
700
|
+
matrixSet: { crs: this.crs, matrices: this.matrices },
|
|
701
|
+
tiles: [],
|
|
702
|
+
revision: update.revision,
|
|
703
|
+
diagonal: this.diagonal,
|
|
704
|
+
heightReference: this.heightReference
|
|
705
|
+
});
|
|
706
|
+
for (const [key, tile] of this.tiles)
|
|
707
|
+
next.tiles.set(key, tile);
|
|
708
|
+
for (const [key, halo] of this.halos)
|
|
709
|
+
next.halos.set(key, halo);
|
|
710
|
+
const affected = /* @__PURE__ */ new Map();
|
|
711
|
+
for (const [key, tile] of touched) {
|
|
712
|
+
if (replacements.has(key))
|
|
713
|
+
next.tiles.set(key, replacements.get(key));
|
|
714
|
+
else {
|
|
715
|
+
if (!next.tiles.delete(key))
|
|
716
|
+
continue;
|
|
717
|
+
next.halos.delete(key);
|
|
718
|
+
}
|
|
719
|
+
for (let row = tile.row - 1; row <= tile.row + 1; row++)
|
|
720
|
+
for (let column = tile.column - 1; column <= tile.column + 1; column++) {
|
|
721
|
+
affected.set(tileKey(tile.matrixId, column, row), {
|
|
722
|
+
matrixId: tile.matrixId,
|
|
723
|
+
column,
|
|
724
|
+
row,
|
|
725
|
+
resident: false
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
const changes = [];
|
|
730
|
+
for (const [key, tile] of affected) {
|
|
731
|
+
if (next.tiles.has(key)) {
|
|
732
|
+
next.buildHalo(next.getMatrix(tile.matrixId), tile.column, tile.row, this.diagonal);
|
|
733
|
+
changes.push({ ...tile, resident: true });
|
|
734
|
+
} else if (this.tiles.has(key))
|
|
735
|
+
changes.push(tile);
|
|
736
|
+
}
|
|
737
|
+
next.changes = freezeChanges(changes);
|
|
738
|
+
return next;
|
|
739
|
+
}
|
|
740
|
+
/** Independent finite halo buffers for workers or GPU upload; missing values use validity zero.
|
|
741
|
+
* Origin is the first sample center in local meters. No GPU resources are created.
|
|
742
|
+
*/
|
|
743
|
+
copyTileHalo(matrixId, column, row) {
|
|
744
|
+
const matrix = this.getMatrix(matrixId);
|
|
745
|
+
const halo = this.halos.get(tileKey(matrixId, column, row));
|
|
746
|
+
if (!halo)
|
|
747
|
+
return void 0;
|
|
748
|
+
const dy = (matrix.resolutionY ?? matrix.resolution) * (matrix.cornerOfOrigin === "topLeft" ? -1 : 1);
|
|
749
|
+
return {
|
|
750
|
+
...halo.field.copyData(),
|
|
751
|
+
width: halo.field.width,
|
|
752
|
+
height: halo.field.height,
|
|
753
|
+
origin: [
|
|
754
|
+
matrix.origin[0] + (column * matrix.tileSize[0] + halo.field.origin[0] - 0.5) * matrix.resolution,
|
|
755
|
+
matrix.origin[1] + (row * matrix.tileSize[1] + halo.field.origin[1] - 0.5) * dy
|
|
756
|
+
],
|
|
757
|
+
columnStep: [matrix.resolution, 0],
|
|
758
|
+
rowStep: [0, dy],
|
|
759
|
+
revision: this.revision,
|
|
760
|
+
diagonal: this.diagonal,
|
|
761
|
+
registration: "vertex",
|
|
762
|
+
heightReference: this.heightReference
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
/** Queries never mix resolutions. Only absent residency permits coarser fallback. */
|
|
766
|
+
sample(x, y, options) {
|
|
767
|
+
const requested = this.getMatrix(options.matrixId);
|
|
768
|
+
if (options.fallback !== void 0 && options.fallback !== "none" && options.fallback !== "coarser")
|
|
769
|
+
throw new Error("Unknown terrain fallback");
|
|
770
|
+
const candidates = [requested];
|
|
771
|
+
if (options.fallback === "coarser")
|
|
772
|
+
candidates.push(...this.matrices.filter((matrix) => matrix.resolution >= requested.resolution && (matrix.resolutionY ?? matrix.resolution) >= (requested.resolutionY ?? requested.resolution) && (matrix.resolution > requested.resolution || (matrix.resolutionY ?? matrix.resolution) > (requested.resolutionY ?? requested.resolution))).sort((a, b) => a.resolution - b.resolution || (a.resolutionY ?? a.resolution) - (b.resolutionY ?? b.resolution) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)));
|
|
773
|
+
let result = this.sampleMatrix(requested, x, y, options);
|
|
774
|
+
for (let i = 1; result.status === TerrainSampleStatus.NOT_RESIDENT && i < candidates.length; i++) {
|
|
775
|
+
const candidate = this.sampleMatrix(candidates[i], x, y, options);
|
|
776
|
+
if (candidate.status !== TerrainSampleStatus.OUTSIDE_DOMAIN)
|
|
777
|
+
result = candidate;
|
|
778
|
+
}
|
|
779
|
+
return {
|
|
780
|
+
...result,
|
|
781
|
+
revision: this.revision,
|
|
782
|
+
matrixId: result.matrixId,
|
|
783
|
+
fallback: result.matrixId !== requested.id
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
sampleMatrix(matrix, x, y, options) {
|
|
787
|
+
const invalid = (status) => ({
|
|
788
|
+
status,
|
|
789
|
+
gradientStatus: status,
|
|
790
|
+
height: 0,
|
|
791
|
+
gradientX: 0,
|
|
792
|
+
gradientY: 0,
|
|
793
|
+
normalX: 0,
|
|
794
|
+
normalY: 0,
|
|
795
|
+
normalZ: 0,
|
|
796
|
+
matrixId: matrix.id
|
|
797
|
+
});
|
|
798
|
+
const interpolation = options.interpolation ?? "bilinear";
|
|
799
|
+
if (!["nearest", "bilinear", "triangle"].includes(interpolation))
|
|
800
|
+
throw new Error("Unknown terrain interpolation");
|
|
801
|
+
if (!Number.isFinite(x) || !Number.isFinite(y))
|
|
802
|
+
return invalid(TerrainSampleStatus.INVALID_INPUT);
|
|
803
|
+
const [width, height] = matrix.tileSize;
|
|
804
|
+
const dy = (matrix.resolutionY ?? matrix.resolution) * (matrix.cornerOfOrigin === "topLeft" ? -1 : 1);
|
|
805
|
+
let u = (x - matrix.origin[0]) * (1 / matrix.resolution);
|
|
806
|
+
let v = (y - matrix.origin[1]) * (1 / dy);
|
|
807
|
+
if (!Number.isFinite(u) || !Number.isFinite(v))
|
|
808
|
+
return invalid(TerrainSampleStatus.NUMERIC_ERROR);
|
|
809
|
+
const tolerance = 8 * Number.EPSILON * Math.max(width * matrix.matrixSize[0], height * matrix.matrixSize[1]);
|
|
810
|
+
const toleranceU = tolerance + (4 * Number.EPSILON * Math.abs(x) + 4 * Number.EPSILON * Math.abs(matrix.origin[0])) / matrix.resolution;
|
|
811
|
+
const toleranceV = tolerance + (4 * Number.EPSILON * Math.abs(y) + 4 * Number.EPSILON * Math.abs(matrix.origin[1])) / Math.abs(dy);
|
|
812
|
+
if (u < 0.5 - toleranceU || v < 0.5 - toleranceV || u > width * matrix.matrixSize[0] - 0.5 + toleranceU || v > height * matrix.matrixSize[1] - 0.5 + toleranceV)
|
|
813
|
+
return invalid(TerrainSampleStatus.OUTSIDE_DOMAIN);
|
|
814
|
+
u = Math.max(0.5, Math.min(width * matrix.matrixSize[0] - 0.5, u));
|
|
815
|
+
v = Math.max(0.5, Math.min(height * matrix.matrixSize[1] - 0.5, v));
|
|
816
|
+
const gridU = u - 0.5;
|
|
817
|
+
const gridV = v - 0.5;
|
|
818
|
+
const c = Math.min(Math.floor(gridU), width * matrix.matrixSize[0] - 2);
|
|
819
|
+
const r = Math.min(Math.floor(gridV), height * matrix.matrixSize[1] - 2);
|
|
820
|
+
const first = this.diagonal === "00-11" ? gridV - r <= gridU - c : gridU - c + gridV - r <= 1;
|
|
821
|
+
const a = [c, r];
|
|
822
|
+
const b = [c + 1, r];
|
|
823
|
+
const cc = [c, r + 1];
|
|
824
|
+
const d = [c + 1, r + 1];
|
|
825
|
+
const taps = interpolation === "nearest" ? [[Math.floor(gridU + 0.5), Math.floor(gridV + 0.5)]] : interpolation === "bilinear" ? [a, b, cc, d] : first ? [a, b, this.diagonal === "00-11" ? d : cc] : [this.diagonal === "00-11" ? a : b, cc, d];
|
|
826
|
+
let missing = false;
|
|
827
|
+
const values = [];
|
|
828
|
+
for (const [column, row] of taps) {
|
|
829
|
+
const tileColumn = Math.floor(column / width);
|
|
830
|
+
const tileRow = Math.floor(row / height);
|
|
831
|
+
const tile = this.tiles.get(tileKey(matrix.id, tileColumn, tileRow));
|
|
832
|
+
if (!tile) {
|
|
833
|
+
missing = true;
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
const index = (row - tileRow * height) * width + column - tileColumn * width;
|
|
837
|
+
if (!tile.validity[index])
|
|
838
|
+
return invalid(TerrainSampleStatus.NO_DATA);
|
|
839
|
+
values.push(tile.heights[index]);
|
|
840
|
+
}
|
|
841
|
+
if (missing)
|
|
842
|
+
return invalid(TerrainSampleStatus.NOT_RESIDENT);
|
|
843
|
+
if (interpolation === "nearest")
|
|
844
|
+
return { ...invalid(TerrainSampleStatus.VALID), height: values[0], gradientStatus: TerrainSampleStatus.UNAVAILABLE };
|
|
845
|
+
const fu = gridU - c;
|
|
846
|
+
const fv = gridV - r;
|
|
847
|
+
const [za, zb, zc, zd] = values;
|
|
848
|
+
const result = invalid(TerrainSampleStatus.VALID);
|
|
849
|
+
if (interpolation === "bilinear") {
|
|
850
|
+
result.height = (1 - fv) * ((1 - fu) * za + fu * zb) + fv * ((1 - fu) * zc + fu * zd);
|
|
851
|
+
result.gradientX = (1 - fv) * (zb - za) + fv * (zd - zc);
|
|
852
|
+
result.gradientY = (1 - fu) * (zc - za) + fu * (zd - zb);
|
|
853
|
+
} else if (first) {
|
|
854
|
+
result.gradientX = zb - za;
|
|
855
|
+
result.gradientY = this.diagonal === "00-11" ? zc - zb : zc - za;
|
|
856
|
+
result.height = this.diagonal === "00-11" ? (1 - fu) * za + (fu - fv) * zb + fv * zc : (1 - fu - fv) * za + fu * zb + fv * zc;
|
|
857
|
+
} else {
|
|
858
|
+
result.gradientX = zc - zb;
|
|
859
|
+
result.gradientY = this.diagonal === "00-11" ? zb - za : zc - za;
|
|
860
|
+
result.height = this.diagonal === "00-11" ? (1 - fv) * za + fu * zc + (fv - fu) * zb : (1 - fv) * za + (1 - fu) * zb + (fu + fv - 1) * zc;
|
|
861
|
+
}
|
|
862
|
+
if (!Number.isFinite(result.height))
|
|
863
|
+
return invalid(TerrainSampleStatus.NUMERIC_ERROR);
|
|
864
|
+
if (result.gradientStatus === TerrainSampleStatus.VALID) {
|
|
865
|
+
result.gradientX /= matrix.resolution;
|
|
866
|
+
result.gradientY /= dy;
|
|
867
|
+
const scale = Math.max(1, Math.abs(result.gradientX), Math.abs(result.gradientY));
|
|
868
|
+
if (!Number.isFinite(scale)) {
|
|
869
|
+
result.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
870
|
+
result.gradientX = result.gradientY = result.normalX = result.normalY = result.normalZ = 0;
|
|
871
|
+
} else {
|
|
872
|
+
const length = Math.hypot(result.gradientX / scale, result.gradientY / scale, 1 / scale);
|
|
873
|
+
result.normalX = -result.gradientX / scale / length;
|
|
874
|
+
result.normalY = -result.gradientY / scale / length;
|
|
875
|
+
result.normalZ = 1 / scale / length;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return { ...result, matrixId: matrix.id };
|
|
879
|
+
}
|
|
880
|
+
buildHalo(matrix, column, row, diagonal) {
|
|
881
|
+
const [width, height] = matrix.tileSize;
|
|
882
|
+
const left = column > 0 ? 1 : 0;
|
|
883
|
+
const top = row > 0 ? 1 : 0;
|
|
884
|
+
const right = column < matrix.matrixSize[0] - 1 ? 1 : 0;
|
|
885
|
+
const bottom = row < matrix.matrixSize[1] - 1 ? 1 : 0;
|
|
886
|
+
const haloWidth = width + left + right;
|
|
887
|
+
const haloHeight = height + top + bottom;
|
|
888
|
+
const heights = new Float64Array(haloWidth * haloHeight);
|
|
889
|
+
const validity = new Uint8Array(heights.length);
|
|
890
|
+
for (let y = -top; y < height + bottom; y++)
|
|
891
|
+
for (let x = -left; x < width + right; x++) {
|
|
892
|
+
const globalX = column * width + x;
|
|
893
|
+
const globalY = row * height + y;
|
|
894
|
+
const ownerX = Math.floor(globalX / width);
|
|
895
|
+
const ownerY = Math.floor(globalY / height);
|
|
896
|
+
const tile = this.tiles.get(tileKey(matrix.id, ownerX, ownerY));
|
|
897
|
+
const index = (y + top) * haloWidth + x + left;
|
|
898
|
+
if (tile) {
|
|
899
|
+
const source = (globalY - ownerY * height) * width + globalX - ownerX * width;
|
|
900
|
+
heights[index] = tile.heights[source];
|
|
901
|
+
validity[index] = tile.validity[source];
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
this.halos.set(tileKey(matrix.id, column, row), {
|
|
905
|
+
field: new HeightField({
|
|
906
|
+
width: haloWidth,
|
|
907
|
+
height: haloHeight,
|
|
908
|
+
origin: [1 - left, 1 - top],
|
|
909
|
+
heights,
|
|
910
|
+
validity,
|
|
911
|
+
diagonal
|
|
912
|
+
})
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
validateTileId(tile) {
|
|
916
|
+
const matrix = this.getMatrix(tile.matrixId);
|
|
917
|
+
if (!Number.isInteger(tile.column) || !Number.isInteger(tile.row) || tile.column < 0 || tile.row < 0 || tile.column >= matrix.matrixSize[0] || tile.row >= matrix.matrixSize[1])
|
|
918
|
+
throw new Error("Terrain tile index is outside its matrix");
|
|
919
|
+
return matrix;
|
|
920
|
+
}
|
|
921
|
+
getMatrix(id) {
|
|
922
|
+
const matrix = this.matrices.find((candidate) => candidate.id === id);
|
|
923
|
+
if (!matrix)
|
|
924
|
+
throw new Error(`Unknown terrain matrix: ${id}`);
|
|
925
|
+
return matrix;
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
function tileKey(id, column, row) {
|
|
929
|
+
return JSON.stringify([id, column, row]);
|
|
930
|
+
}
|
|
931
|
+
function copyTileData(tile, matrix) {
|
|
932
|
+
const [width, height] = matrix.tileSize;
|
|
933
|
+
if (tile.heights.length !== width * height || tile.validity && tile.validity.length !== width * height)
|
|
934
|
+
throw new Error("Terrain tile buffers must match tileSize");
|
|
935
|
+
if (!(tile.heights instanceof Float32Array || tile.heights instanceof Float64Array) || tile.validity !== void 0 && !(tile.validity instanceof Uint8Array))
|
|
936
|
+
throw new Error("Invalid terrain tile buffer types");
|
|
937
|
+
const heights = new Float64Array(width * height);
|
|
938
|
+
const validity = new Uint8Array(width * height);
|
|
939
|
+
for (let index = 0; index < heights.length; index++) {
|
|
940
|
+
if (Number.isFinite(tile.heights[index]) && (!tile.validity || tile.validity[index])) {
|
|
941
|
+
heights[index] = tile.heights[index];
|
|
942
|
+
validity[index] = 1;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return { heights, validity };
|
|
946
|
+
}
|
|
947
|
+
function freezeChanges(changes) {
|
|
948
|
+
changes.sort((a, b) => (a.matrixId < b.matrixId ? -1 : a.matrixId > b.matrixId ? 1 : 0) || a.row - b.row || a.column - b.column);
|
|
949
|
+
return Object.freeze(changes.map((change) => Object.freeze(change)));
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// dist/terrain/packed.js
|
|
953
|
+
var TERRAIN_BUFFER_VERSION = 1;
|
|
954
|
+
function packTerrainHeightField(field, options = {}) {
|
|
955
|
+
const heightOrigin = options.heightOrigin ?? 0;
|
|
956
|
+
const maxBytes = options.maxBytes ?? 64 * 1024 * 1024;
|
|
957
|
+
const maxHeightError = options.maxHeightError ?? Infinity;
|
|
958
|
+
const count = field.width * field.height;
|
|
959
|
+
if (!Number.isFinite(heightOrigin))
|
|
960
|
+
throw new Error("Terrain height origin must be finite");
|
|
961
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 0)
|
|
962
|
+
throw new Error("Terrain byte budget must be a nonnegative safe integer");
|
|
963
|
+
if (!(maxHeightError >= 0))
|
|
964
|
+
throw new Error("Terrain height error budget must be nonnegative");
|
|
965
|
+
if (!Number.isSafeInteger(count) || count > 4294967295 || count * 8 + 64 > maxBytes)
|
|
966
|
+
throw new Error("Terrain upload exceeds the sample or byte budget");
|
|
967
|
+
const transform = createTransform([...field.columnStep, ...field.rowStep]);
|
|
968
|
+
const header = new Uint32Array([
|
|
969
|
+
TERRAIN_BUFFER_VERSION,
|
|
970
|
+
field.width,
|
|
971
|
+
field.height,
|
|
972
|
+
field.registration === "cell" ? 1 : 0,
|
|
973
|
+
field.diagonal === "10-01" ? 1 : 0,
|
|
974
|
+
count,
|
|
975
|
+
0,
|
|
976
|
+
0
|
|
977
|
+
]);
|
|
978
|
+
const heights = new Float32Array(count);
|
|
979
|
+
const validity = new Uint32Array(count);
|
|
980
|
+
let error = 0;
|
|
981
|
+
for (let row = 0; row < field.height; row++)
|
|
982
|
+
for (let column = 0; column < field.width; column++) {
|
|
983
|
+
const value = field.getHeight(column, row);
|
|
984
|
+
if (value === void 0)
|
|
985
|
+
continue;
|
|
986
|
+
const index = row * field.width + column;
|
|
987
|
+
heights[index] = value - heightOrigin;
|
|
988
|
+
const reconstructed = heights[index] + heightOrigin;
|
|
989
|
+
if (!Number.isFinite(heights[index]) || !Number.isFinite(reconstructed))
|
|
990
|
+
throw new Error("Terrain height is not representable in the packed frame");
|
|
991
|
+
const difference2 = Math.abs(reconstructed - value);
|
|
992
|
+
if (!Number.isFinite(difference2) || difference2 > maxHeightError)
|
|
993
|
+
throw new Error("Terrain upload exceeds the height error budget");
|
|
994
|
+
error = Math.max(error, difference2);
|
|
995
|
+
validity[index] = 1;
|
|
996
|
+
}
|
|
997
|
+
return {
|
|
998
|
+
header,
|
|
999
|
+
transform,
|
|
1000
|
+
heights,
|
|
1001
|
+
validity,
|
|
1002
|
+
origin: Object.freeze([field.origin[0], field.origin[1], heightOrigin]),
|
|
1003
|
+
heightReference: field.heightReference,
|
|
1004
|
+
maxHeightError: error
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
function unpackTerrainHeightField(packed) {
|
|
1008
|
+
const { header, transform, heights, validity, origin } = packed;
|
|
1009
|
+
if (!(header instanceof Uint32Array) || header.length !== 8 || header[0] !== TERRAIN_BUFFER_VERSION || header[1] < 2 || header[2] < 2 || header[3] > 1 || header[4] > 1 || header[5] !== header[1] * header[2] || header[6] !== 0 || header[7] !== 0)
|
|
1010
|
+
throw new Error("Invalid terrain buffer header");
|
|
1011
|
+
if (!(transform instanceof Float32Array) || transform.length !== 8 || !transform.every(Number.isFinite))
|
|
1012
|
+
throw new Error("Invalid terrain buffer transform");
|
|
1013
|
+
const expected = createTransform(Array.from(transform.subarray(0, 4)));
|
|
1014
|
+
if (!transform.every((value, index) => value === expected[index]))
|
|
1015
|
+
throw new Error("Terrain inverse transform does not match its grid");
|
|
1016
|
+
if (!(heights instanceof Float32Array) || heights.length !== header[5] || !(validity instanceof Uint32Array) || validity.length !== header[5])
|
|
1017
|
+
throw new Error("Invalid terrain sample buffers");
|
|
1018
|
+
if (!origin || origin.length !== 3 || !Number.isFinite(origin[0]) || !Number.isFinite(origin[1]) || !Number.isFinite(origin[2]) || typeof packed.heightReference !== "string" || !Number.isFinite(packed.maxHeightError) || packed.maxHeightError < 0)
|
|
1019
|
+
throw new Error("Invalid terrain host metadata");
|
|
1020
|
+
const values = new Float64Array(heights.length);
|
|
1021
|
+
const mask = new Uint8Array(heights.length);
|
|
1022
|
+
for (let i = 0; i < heights.length; i++) {
|
|
1023
|
+
if (!Number.isFinite(heights[i]) || validity[i] > 1 || !validity[i] && heights[i] !== 0)
|
|
1024
|
+
throw new Error("Invalid terrain height or validity value");
|
|
1025
|
+
if (validity[i]) {
|
|
1026
|
+
values[i] = heights[i] + origin[2];
|
|
1027
|
+
if (!Number.isFinite(values[i]))
|
|
1028
|
+
throw new Error("Terrain height reconstruction overflow");
|
|
1029
|
+
mask[i] = 1;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
return new HeightField({
|
|
1033
|
+
width: header[1],
|
|
1034
|
+
height: header[2],
|
|
1035
|
+
heights: values,
|
|
1036
|
+
validity: mask,
|
|
1037
|
+
origin: [origin[0], origin[1]],
|
|
1038
|
+
columnStep: [transform[0], transform[1]],
|
|
1039
|
+
rowStep: [transform[2], transform[3]],
|
|
1040
|
+
registration: header[3] ? "cell" : "vertex",
|
|
1041
|
+
diagonal: header[4] ? "10-01" : "00-11",
|
|
1042
|
+
heightReference: packed.heightReference
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
function createTransform(steps) {
|
|
1046
|
+
const transform = new Float32Array(8);
|
|
1047
|
+
transform.set(steps);
|
|
1048
|
+
const [a, c, b, d] = transform;
|
|
1049
|
+
const determinant = a * d - b * c;
|
|
1050
|
+
const scale = Math.hypot(a, c) * Math.hypot(b, d);
|
|
1051
|
+
if (!Number.isFinite(determinant) || Math.abs(determinant) <= Number.EPSILON * scale)
|
|
1052
|
+
throw new Error("Terrain grid is singular after float32 conversion");
|
|
1053
|
+
transform.set([d / determinant, -b / determinant, -c / determinant, a / determinant], 4);
|
|
1054
|
+
if (!transform.every(Number.isFinite))
|
|
1055
|
+
throw new Error("Terrain transform is not representable in float32");
|
|
1056
|
+
return transform;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// dist/terrain/surface.js
|
|
1060
|
+
var import_geometry2 = require("@math.gl/geometry");
|
|
1061
|
+
|
|
1062
|
+
// dist/terrain/mesh-data.js
|
|
1063
|
+
function assembleTerrainMesh(field, gridCoordinates, indices, options) {
|
|
1064
|
+
const origin = options.origin ?? [field.origin[0], field.origin[1], 0];
|
|
1065
|
+
if (origin.length !== 3 || !Number.isFinite(origin[0]) || !Number.isFinite(origin[1]) || !Number.isFinite(origin[2]))
|
|
1066
|
+
throw new Error("Terrain mesh origin must be finite XYZ");
|
|
1067
|
+
const positions = new Float64Array(gridCoordinates.length / 2 * 3);
|
|
1068
|
+
for (let i = 0; i < gridCoordinates.length / 2; i++) {
|
|
1069
|
+
const column = gridCoordinates[2 * i], row = gridCoordinates[2 * i + 1];
|
|
1070
|
+
const shift = field.registration === "cell" ? 0.5 : 0;
|
|
1071
|
+
positions[3 * i] = field.origin[0] - origin[0] + (column + shift) * field.columnStep[0] + (row + shift) * field.rowStep[0];
|
|
1072
|
+
positions[3 * i + 1] = field.origin[1] - origin[1] + (column + shift) * field.columnStep[1] + (row + shift) * field.rowStep[1];
|
|
1073
|
+
const height = field.getHeight(column, row);
|
|
1074
|
+
positions[3 * i + 2] = height === void 0 ? 0 : height - origin[2];
|
|
1075
|
+
}
|
|
1076
|
+
if (!positions.every(Number.isFinite))
|
|
1077
|
+
throw new Error("Terrain mesh coordinate overflow");
|
|
1078
|
+
const reverse = field.columnStep[0] * field.rowStep[1] - field.columnStep[1] * field.rowStep[0] < 0;
|
|
1079
|
+
for (let i = 0; i < indices.length; i += 3) {
|
|
1080
|
+
if (reverse)
|
|
1081
|
+
[indices[i + 1], indices[i + 2]] = [indices[i + 2], indices[i + 1]];
|
|
1082
|
+
const a = indices[i] * 3, b = indices[i + 1] * 3, c = indices[i + 2] * 3;
|
|
1083
|
+
const area = (positions[b] - positions[a]) * (positions[c + 1] - positions[a + 1]) - (positions[b + 1] - positions[a + 1]) * (positions[c] - positions[a]);
|
|
1084
|
+
if (!Number.isFinite(area) || area <= 0)
|
|
1085
|
+
throw new Error("Terrain mesh triangles degenerate or overflow; use a local origin");
|
|
1086
|
+
}
|
|
1087
|
+
return {
|
|
1088
|
+
positions,
|
|
1089
|
+
indices,
|
|
1090
|
+
gridCoordinates,
|
|
1091
|
+
width: field.width,
|
|
1092
|
+
height: field.height,
|
|
1093
|
+
origin: Object.freeze([...origin]),
|
|
1094
|
+
heightReference: field.heightReference
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function validateTerrainGridMesh(mesh) {
|
|
1098
|
+
if (!Number.isSafeInteger(mesh.width) || !Number.isSafeInteger(mesh.height) || mesh.width < 2 || mesh.height < 2 || mesh.width * mesh.height > 4294967295)
|
|
1099
|
+
throw new Error("Invalid terrain mesh grid dimensions");
|
|
1100
|
+
if (!(mesh.positions instanceof Float64Array) || mesh.positions.length % 3 || !mesh.positions.every(Number.isFinite) || !(mesh.indices instanceof Uint32Array) || mesh.indices.length % 3 || !(mesh.gridCoordinates instanceof Uint32Array) || mesh.gridCoordinates.length !== mesh.positions.length / 3 * 2)
|
|
1101
|
+
throw new Error("Invalid terrain mesh buffers");
|
|
1102
|
+
if (mesh.origin.length !== 3 || !Number.isFinite(mesh.origin[0]) || !Number.isFinite(mesh.origin[1]) || !Number.isFinite(mesh.origin[2]))
|
|
1103
|
+
throw new Error("Invalid terrain mesh origin");
|
|
1104
|
+
for (let i = 0; i < mesh.gridCoordinates.length; i += 2)
|
|
1105
|
+
if (mesh.gridCoordinates[i] >= mesh.width || mesh.gridCoordinates[i + 1] >= mesh.height)
|
|
1106
|
+
throw new Error("Terrain mesh grid coordinate out of bounds");
|
|
1107
|
+
for (const i of mesh.indices)
|
|
1108
|
+
if (i >= mesh.positions.length / 3)
|
|
1109
|
+
throw new Error("Terrain mesh vertex index out of bounds");
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
// dist/terrain/mesh.js
|
|
1113
|
+
function createTerrainMesh(field, options = {}) {
|
|
1114
|
+
const count = field.width * field.height;
|
|
1115
|
+
if (count > 4294967295)
|
|
1116
|
+
throw new Error("Terrain mesh exceeds uint32 capacity");
|
|
1117
|
+
const coordinates = new Uint32Array(count * 2);
|
|
1118
|
+
for (let row = 0; row < field.height; row++)
|
|
1119
|
+
for (let column = 0; column < field.width; column++)
|
|
1120
|
+
coordinates.set([column, row], (row * field.width + column) * 2);
|
|
1121
|
+
const output = new Uint32Array((field.width - 1) * (field.height - 1) * 6);
|
|
1122
|
+
let used = 0;
|
|
1123
|
+
const add = (a, b, c) => {
|
|
1124
|
+
for (const i of [a, b, c])
|
|
1125
|
+
if (field.getHeight(i % field.width, Math.floor(i / field.width)) === void 0)
|
|
1126
|
+
return;
|
|
1127
|
+
output[used++] = a;
|
|
1128
|
+
output[used++] = b;
|
|
1129
|
+
output[used++] = c;
|
|
1130
|
+
};
|
|
1131
|
+
for (let row = 0; row < field.height - 1; row++)
|
|
1132
|
+
for (let column = 0; column < field.width - 1; column++) {
|
|
1133
|
+
const a = row * field.width + column, b = a + 1, c = a + field.width, d = c + 1;
|
|
1134
|
+
if (field.diagonal === "00-11") {
|
|
1135
|
+
add(a, b, d);
|
|
1136
|
+
add(a, d, c);
|
|
1137
|
+
} else {
|
|
1138
|
+
add(a, b, c);
|
|
1139
|
+
add(b, d, c);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return assembleTerrainMesh(field, coordinates, used === output.length ? output : output.slice(0, used), options);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// dist/terrain/surface.js
|
|
1146
|
+
var TerrainSurface = class {
|
|
1147
|
+
constructor(props) {
|
|
1148
|
+
if (!(props.positions instanceof Float32Array || props.positions instanceof Float64Array) || props.positions.length % 3)
|
|
1149
|
+
throw new Error("Terrain positions must be packed Float32/Float64 XYZ");
|
|
1150
|
+
if (!(props.indices instanceof Uint16Array || props.indices instanceof Uint32Array) || props.indices.length % 3 || props.indices.length > 2147483647)
|
|
1151
|
+
throw new Error("Terrain indices must form a Uint16/Uint32 triangle list within int32 topology capacity");
|
|
1152
|
+
const origin = props.origin ?? [0, 0, 0];
|
|
1153
|
+
if (origin.length !== 3 || !Number.isFinite(origin[0]) || !Number.isFinite(origin[1]) || !Number.isFinite(origin[2]))
|
|
1154
|
+
throw new Error("Terrain origin must be finite XYZ");
|
|
1155
|
+
this.origin = Object.freeze([origin[0], origin[1], origin[2]]);
|
|
1156
|
+
this.heightReference = props.heightReference ?? "unknown";
|
|
1157
|
+
if (typeof this.heightReference !== "string")
|
|
1158
|
+
throw new Error("Terrain height reference must be a string");
|
|
1159
|
+
this.positions = Float64Array.from(props.positions);
|
|
1160
|
+
if (!this.positions.every(Number.isFinite))
|
|
1161
|
+
throw new Error("Terrain positions must be finite");
|
|
1162
|
+
this.indices = Uint32Array.from(props.indices);
|
|
1163
|
+
this.triangleCount = this.indices.length / 3;
|
|
1164
|
+
if (props.triangleValidity !== void 0 && (!(props.triangleValidity instanceof Uint8Array) || props.triangleValidity.length !== this.triangleCount))
|
|
1165
|
+
throw new Error("Terrain triangle validity must match triangle count");
|
|
1166
|
+
this.validity = Uint8Array.from({ length: this.triangleCount }, (_, i) => !props.triangleValidity || props.triangleValidity[i] ? 1 : 0);
|
|
1167
|
+
for (const index of this.indices)
|
|
1168
|
+
if (index >= this.positions.length / 3)
|
|
1169
|
+
throw new Error("Terrain vertex index out of bounds");
|
|
1170
|
+
this.gradients = new Float64Array(this.triangleCount * 2);
|
|
1171
|
+
this.normals = new Float64Array(this.triangleCount * 3);
|
|
1172
|
+
const bounds = new Float64Array(this.triangleCount * 4);
|
|
1173
|
+
let active = 0;
|
|
1174
|
+
for (let i = 0; i < this.triangleCount; i++) {
|
|
1175
|
+
const [a, b, c] = this.triangle(i);
|
|
1176
|
+
bounds.set([
|
|
1177
|
+
Math.min(a[0], b[0], c[0]),
|
|
1178
|
+
Math.min(a[1], b[1], c[1]),
|
|
1179
|
+
Math.max(a[0], b[0], c[0]),
|
|
1180
|
+
Math.max(a[1], b[1], c[1])
|
|
1181
|
+
], i * 4);
|
|
1182
|
+
if (!this.validity[i])
|
|
1183
|
+
continue;
|
|
1184
|
+
const ax = b[0] - a[0], ay = b[1] - a[1], az = b[2] - a[2];
|
|
1185
|
+
const bx = c[0] - a[0], by = c[1] - a[1], bz = c[2] - a[2];
|
|
1186
|
+
const determinant = ax * by - ay * bx;
|
|
1187
|
+
const scale = Math.hypot(ax, ay) * Math.hypot(bx, by);
|
|
1188
|
+
if (!Number.isFinite(determinant) || Math.abs(determinant) <= Number.EPSILON * scale)
|
|
1189
|
+
throw new Error("Active terrain triangles need finite, nondegenerate XY projections; use a local frame");
|
|
1190
|
+
const gx = (az * by - ay * bz) / determinant;
|
|
1191
|
+
const gy = (ax * bz - az * bx) / determinant;
|
|
1192
|
+
if (!Number.isFinite(gx) || !Number.isFinite(gy))
|
|
1193
|
+
throw new Error("Terrain gradient overflow");
|
|
1194
|
+
this.gradients.set([gx, gy], i * 2);
|
|
1195
|
+
const s = Math.max(1, Math.abs(gx), Math.abs(gy));
|
|
1196
|
+
const length = Math.hypot(gx / s, gy / s, 1 / s);
|
|
1197
|
+
this.normals.set([-gx / s / length, -gy / s / length, 1 / s / length], i * 3);
|
|
1198
|
+
active++;
|
|
1199
|
+
}
|
|
1200
|
+
this.activeTriangleCount = active;
|
|
1201
|
+
this.topology = buildTopology(this.indices, this.validity);
|
|
1202
|
+
this.xyIndex = new import_geometry2.BoxIndex({ bounds, dimension: 2 });
|
|
1203
|
+
this.bvh = new import_geometry2.TriangleBVH({ positions: this.positions, indices: this.indices });
|
|
1204
|
+
}
|
|
1205
|
+
/** Detached source data; changing these buffers never changes this surface. */
|
|
1206
|
+
copyData() {
|
|
1207
|
+
return {
|
|
1208
|
+
positions: this.positions.slice(),
|
|
1209
|
+
indices: this.indices.slice(),
|
|
1210
|
+
triangleValidity: this.validity.slice()
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
copyTopology() {
|
|
1214
|
+
return {
|
|
1215
|
+
halfedges: this.topology.halfedges.slice(),
|
|
1216
|
+
boundaryHalfedges: this.topology.boundaryHalfedges.slice()
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
/** World XY height, planar gradient and contact normal. Highest local Z wins; exact ties use the lowest triangle index. */
|
|
1220
|
+
sample(x, y) {
|
|
1221
|
+
const result = {
|
|
1222
|
+
status: TerrainSampleStatus.INVALID_INPUT,
|
|
1223
|
+
height: 0,
|
|
1224
|
+
gradientStatus: TerrainSampleStatus.INVALID_INPUT,
|
|
1225
|
+
gradientX: 0,
|
|
1226
|
+
gradientY: 0,
|
|
1227
|
+
normalX: 0,
|
|
1228
|
+
normalY: 0,
|
|
1229
|
+
normalZ: 0,
|
|
1230
|
+
triangleIndex: -1,
|
|
1231
|
+
barycentric: [0, 0, 0]
|
|
1232
|
+
};
|
|
1233
|
+
if (!Number.isFinite(x) || !Number.isFinite(y))
|
|
1234
|
+
return result;
|
|
1235
|
+
const px = x - this.origin[0], py = y - this.origin[1];
|
|
1236
|
+
if (!Number.isFinite(px) || !Number.isFinite(py)) {
|
|
1237
|
+
result.status = result.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
1238
|
+
return result;
|
|
1239
|
+
}
|
|
1240
|
+
result.status = result.gradientStatus = TerrainSampleStatus.NO_DATA;
|
|
1241
|
+
let best = -Infinity;
|
|
1242
|
+
for (const i2 of this.xyIndex.search([px, py], [px, py])) {
|
|
1243
|
+
if (!this.validity[i2])
|
|
1244
|
+
continue;
|
|
1245
|
+
const [a, b, c] = this.triangle(i2);
|
|
1246
|
+
const ax = b[0] - a[0], ay = b[1] - a[1], bx = c[0] - a[0], by = c[1] - a[1];
|
|
1247
|
+
const determinant = ax * by - ay * bx;
|
|
1248
|
+
const dx = px - a[0], dy = py - a[1];
|
|
1249
|
+
const u = (dx * by - dy * bx) / determinant;
|
|
1250
|
+
const v = (ax * dy - ay * dx) / determinant;
|
|
1251
|
+
if (u < 0 || v < 0 || u + v > 1 || !Number.isFinite(u) || !Number.isFinite(v))
|
|
1252
|
+
continue;
|
|
1253
|
+
const weights = [1 - u - v, u, v];
|
|
1254
|
+
const height2 = weights[0] * a[2] + u * b[2] + v * c[2];
|
|
1255
|
+
if (!Number.isFinite(height2)) {
|
|
1256
|
+
result.status = result.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
1257
|
+
result.triangleIndex = -1;
|
|
1258
|
+
result.barycentric = [0, 0, 0];
|
|
1259
|
+
return result;
|
|
1260
|
+
}
|
|
1261
|
+
if (height2 <= best)
|
|
1262
|
+
continue;
|
|
1263
|
+
best = height2;
|
|
1264
|
+
result.triangleIndex = i2;
|
|
1265
|
+
result.barycentric = weights;
|
|
1266
|
+
}
|
|
1267
|
+
if (result.triangleIndex < 0)
|
|
1268
|
+
return result;
|
|
1269
|
+
const height = best + this.origin[2];
|
|
1270
|
+
if (!Number.isFinite(height)) {
|
|
1271
|
+
result.triangleIndex = -1;
|
|
1272
|
+
result.barycentric = [0, 0, 0];
|
|
1273
|
+
result.status = result.gradientStatus = TerrainSampleStatus.NUMERIC_ERROR;
|
|
1274
|
+
return result;
|
|
1275
|
+
}
|
|
1276
|
+
const i = result.triangleIndex;
|
|
1277
|
+
result.status = result.gradientStatus = TerrainSampleStatus.VALID;
|
|
1278
|
+
result.height = height;
|
|
1279
|
+
result.gradientX = this.gradients[i * 2];
|
|
1280
|
+
result.gradientY = this.gradients[i * 2 + 1];
|
|
1281
|
+
result.normalX = this.normals[i * 3];
|
|
1282
|
+
result.normalY = this.normals[i * 3 + 1];
|
|
1283
|
+
result.normalZ = this.normals[i * 3 + 2];
|
|
1284
|
+
return result;
|
|
1285
|
+
}
|
|
1286
|
+
/** Two-sided ray query; distance limits are Euclidean meters, independent of direction magnitude. */
|
|
1287
|
+
intersectRay(origin, direction, options = {}) {
|
|
1288
|
+
return this.intersectRayQuery(origin, direction, { ...options, maxWork: Infinity }).result;
|
|
1289
|
+
}
|
|
1290
|
+
/** A partial hit is provisional; an incomplete null result does not establish a miss. */
|
|
1291
|
+
intersectRayQuery(origin, direction, options = {}) {
|
|
1292
|
+
const query = this.bvh.intersectRayQuery(this.localPoint(origin), direction, {
|
|
1293
|
+
...options,
|
|
1294
|
+
filter: (i) => Boolean(this.validity[i])
|
|
1295
|
+
});
|
|
1296
|
+
const hit = query.result;
|
|
1297
|
+
return { ...query, result: hit ? { ...this.toHit(hit), barycentric: [...hit.barycentric] } : null };
|
|
1298
|
+
}
|
|
1299
|
+
/** Closed segment query. A zero-length segment has no directional intersection. */
|
|
1300
|
+
intersectSegment(start, end) {
|
|
1301
|
+
return this.intersectSegmentQuery(start, end).result;
|
|
1302
|
+
}
|
|
1303
|
+
intersectSegmentQuery(start, end, options = {}) {
|
|
1304
|
+
this.localPoint(start);
|
|
1305
|
+
this.localPoint(end);
|
|
1306
|
+
const direction = [
|
|
1307
|
+
end[0] - start[0],
|
|
1308
|
+
end[1] - start[1],
|
|
1309
|
+
end[2] - start[2]
|
|
1310
|
+
];
|
|
1311
|
+
const distance = Math.hypot(...direction);
|
|
1312
|
+
if (!Number.isFinite(distance))
|
|
1313
|
+
throw new Error("Terrain segment length overflow");
|
|
1314
|
+
if (!distance) {
|
|
1315
|
+
const limit = options.maxWork ?? Infinity;
|
|
1316
|
+
if (limit !== Infinity && (!Number.isSafeInteger(limit) || limit < 0))
|
|
1317
|
+
throw new Error("Invalid terrain query work limit");
|
|
1318
|
+
return { result: null, complete: true, work: 0 };
|
|
1319
|
+
}
|
|
1320
|
+
return this.intersectRayQuery(start, direction, { ...options, maxDistance: distance });
|
|
1321
|
+
}
|
|
1322
|
+
/** Exact Euclidean nearest point, not vertical ground clearance. */
|
|
1323
|
+
nearest(point, options = {}) {
|
|
1324
|
+
return this.nearestQuery(point, { ...options, maxWork: Infinity }).result;
|
|
1325
|
+
}
|
|
1326
|
+
nearestQuery(point, options = {}) {
|
|
1327
|
+
const query = this.bvh.nearestQuery(this.localPoint(point), {
|
|
1328
|
+
...options,
|
|
1329
|
+
filter: (i) => Boolean(this.validity[i])
|
|
1330
|
+
});
|
|
1331
|
+
return { ...query, result: query.result ? this.toHit(query.result) : null };
|
|
1332
|
+
}
|
|
1333
|
+
/** Two-sided contacts with the triangle sheet, not solid-ground penetration or swept collision.
|
|
1334
|
+
* Adjacent triangles may contribute coincident contacts. Incomplete lists are not manifolds.
|
|
1335
|
+
*/
|
|
1336
|
+
intersectSphere(center, radius, options = {}) {
|
|
1337
|
+
const local = this.localPoint(center);
|
|
1338
|
+
const query = this.bvh.intersectSphere(local, radius, {
|
|
1339
|
+
maxWork: options.maxWork,
|
|
1340
|
+
maxResults: options.maxContacts,
|
|
1341
|
+
filter: (i) => Boolean(this.validity[i])
|
|
1342
|
+
});
|
|
1343
|
+
return {
|
|
1344
|
+
...query,
|
|
1345
|
+
result: query.result.map((hit) => {
|
|
1346
|
+
const contact = this.toHit(hit);
|
|
1347
|
+
const normal = hit.distance ? [
|
|
1348
|
+
(local[0] - hit.point[0]) / hit.distance,
|
|
1349
|
+
(local[1] - hit.point[1]) / hit.distance,
|
|
1350
|
+
(local[2] - hit.point[2]) / hit.distance
|
|
1351
|
+
] : [...contact.normal];
|
|
1352
|
+
return { ...contact, faceNormal: contact.normal, normal, penetration: radius - hit.distance };
|
|
1353
|
+
})
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
/** Minimum Euclidean clearance along a closed segment; this is not vertical clearance. */
|
|
1357
|
+
nearestSegment(start, end, options = {}) {
|
|
1358
|
+
return this.nearestSegmentQuery(start, end, { ...options, maxWork: Infinity }).result;
|
|
1359
|
+
}
|
|
1360
|
+
nearestSegmentQuery(start, end, options = {}) {
|
|
1361
|
+
const query = this.bvh.nearestSegmentQuery(this.localPoint(start), this.localPoint(end), {
|
|
1362
|
+
...options,
|
|
1363
|
+
filter: (i) => Boolean(this.validity[i])
|
|
1364
|
+
});
|
|
1365
|
+
const hit = query.result;
|
|
1366
|
+
return {
|
|
1367
|
+
...query,
|
|
1368
|
+
result: hit ? {
|
|
1369
|
+
...this.toHit(hit),
|
|
1370
|
+
segmentPoint: this.worldPoint(hit.segmentPoint),
|
|
1371
|
+
segmentFraction: hit.segmentFraction
|
|
1372
|
+
} : null
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
/** Contacts with a closed capsule's entire axis, including its interior and both caps.
|
|
1376
|
+
* Fractions locate minimum separation, not the first time a translating sphere touches terrain.
|
|
1377
|
+
*/
|
|
1378
|
+
intersectCapsule(start, end, radius, options = {}) {
|
|
1379
|
+
const query = this.bvh.intersectCapsule(this.localPoint(start), this.localPoint(end), radius, {
|
|
1380
|
+
maxWork: options.maxWork,
|
|
1381
|
+
maxResults: options.maxContacts,
|
|
1382
|
+
filter: (i) => Boolean(this.validity[i])
|
|
1383
|
+
});
|
|
1384
|
+
return {
|
|
1385
|
+
...query,
|
|
1386
|
+
result: query.result.map((hit) => {
|
|
1387
|
+
const contact = this.toHit(hit);
|
|
1388
|
+
const normal = hit.distance ? [
|
|
1389
|
+
(hit.segmentPoint[0] - hit.point[0]) / hit.distance,
|
|
1390
|
+
(hit.segmentPoint[1] - hit.point[1]) / hit.distance,
|
|
1391
|
+
(hit.segmentPoint[2] - hit.point[2]) / hit.distance
|
|
1392
|
+
] : [...contact.normal];
|
|
1393
|
+
return {
|
|
1394
|
+
...contact,
|
|
1395
|
+
normal,
|
|
1396
|
+
faceNormal: contact.normal,
|
|
1397
|
+
penetration: radius - hit.distance,
|
|
1398
|
+
segmentPoint: this.worldPoint(hit.segmentPoint),
|
|
1399
|
+
segmentFraction: hit.segmentFraction
|
|
1400
|
+
};
|
|
1401
|
+
})
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
worldPoint(point) {
|
|
1405
|
+
const world = [
|
|
1406
|
+
point[0] + this.origin[0],
|
|
1407
|
+
point[1] + this.origin[1],
|
|
1408
|
+
point[2] + this.origin[2]
|
|
1409
|
+
];
|
|
1410
|
+
if (!world.every(Number.isFinite))
|
|
1411
|
+
throw new Error("Terrain query result overflow");
|
|
1412
|
+
return world;
|
|
1413
|
+
}
|
|
1414
|
+
localPoint(point) {
|
|
1415
|
+
if (point.length !== 3 || !Number.isFinite(point[0]) || !Number.isFinite(point[1]) || !Number.isFinite(point[2]))
|
|
1416
|
+
throw new Error("Terrain query point must be finite XYZ");
|
|
1417
|
+
const local = [
|
|
1418
|
+
point[0] - this.origin[0],
|
|
1419
|
+
point[1] - this.origin[1],
|
|
1420
|
+
point[2] - this.origin[2]
|
|
1421
|
+
];
|
|
1422
|
+
if (!local.every(Number.isFinite))
|
|
1423
|
+
throw new Error("Terrain query coordinate overflow");
|
|
1424
|
+
return local;
|
|
1425
|
+
}
|
|
1426
|
+
toHit(hit) {
|
|
1427
|
+
const point = this.worldPoint(hit.point);
|
|
1428
|
+
if (!Number.isFinite(hit.distance))
|
|
1429
|
+
throw new Error("Terrain query result overflow");
|
|
1430
|
+
const i = hit.index * 3;
|
|
1431
|
+
return {
|
|
1432
|
+
triangleIndex: hit.index,
|
|
1433
|
+
distance: hit.distance,
|
|
1434
|
+
point,
|
|
1435
|
+
normal: [this.normals[i], this.normals[i + 1], this.normals[i + 2]]
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
triangle(index) {
|
|
1439
|
+
return [0, 1, 2].map((j) => {
|
|
1440
|
+
const start = this.indices[index * 3 + j] * 3;
|
|
1441
|
+
return this.positions.subarray(start, start + 3);
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
function buildTopology(indices, validity) {
|
|
1446
|
+
const halfedges = new Int32Array(indices.length).fill(-1);
|
|
1447
|
+
const edges = /* @__PURE__ */ new Map();
|
|
1448
|
+
for (let i = 0; i < indices.length; i++) {
|
|
1449
|
+
const triangle = Math.floor(i / 3);
|
|
1450
|
+
if (!validity[triangle])
|
|
1451
|
+
continue;
|
|
1452
|
+
const a = indices[i], b = indices[triangle * 3 + (i % 3 + 1) % 3];
|
|
1453
|
+
const key = a < b ? `${a}/${b}` : `${b}/${a}`;
|
|
1454
|
+
const opposite = edges.get(key);
|
|
1455
|
+
if (opposite === void 0)
|
|
1456
|
+
edges.set(key, i);
|
|
1457
|
+
else {
|
|
1458
|
+
if (halfedges[opposite] !== -1)
|
|
1459
|
+
throw new Error("Nonmanifold terrain edge");
|
|
1460
|
+
if (indices[opposite] === a)
|
|
1461
|
+
throw new Error("Inconsistent terrain triangle winding");
|
|
1462
|
+
halfedges[i] = opposite;
|
|
1463
|
+
halfedges[opposite] = i;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
const boundary = [];
|
|
1467
|
+
for (let i = 0; i < halfedges.length; i++)
|
|
1468
|
+
if (validity[Math.floor(i / 3)] && halfedges[i] === -1)
|
|
1469
|
+
boundary.push(i);
|
|
1470
|
+
return { halfedges, boundaryHalfedges: Uint32Array.from(boundary) };
|
|
1471
|
+
}
|
|
1472
|
+
function createTerrainSurface(field, options = {}) {
|
|
1473
|
+
const mesh = createTerrainMesh(field, options);
|
|
1474
|
+
return new TerrainSurface({
|
|
1475
|
+
positions: mesh.positions,
|
|
1476
|
+
indices: mesh.indices,
|
|
1477
|
+
origin: mesh.origin,
|
|
1478
|
+
heightReference: field.heightReference
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
// dist/terrain/bounds.js
|
|
1483
|
+
var HeightFieldMinMax = class {
|
|
1484
|
+
constructor(field) {
|
|
1485
|
+
this.levels = [];
|
|
1486
|
+
this.width = field.width - 1;
|
|
1487
|
+
this.height = field.height - 1;
|
|
1488
|
+
if (this.width * this.height > 4294967295)
|
|
1489
|
+
throw new Error("Terrain bounds exceed uint32 cell capacity");
|
|
1490
|
+
const base = createLevel(this.width, this.height, 1);
|
|
1491
|
+
for (let row = 0; row < this.height; row++)
|
|
1492
|
+
for (let column = 0; column < this.width; column++) {
|
|
1493
|
+
const index = row * this.width + column;
|
|
1494
|
+
let min = Infinity, max = -Infinity, count = 0;
|
|
1495
|
+
for (const [x, y] of [
|
|
1496
|
+
[column, row],
|
|
1497
|
+
[column + 1, row],
|
|
1498
|
+
[column, row + 1],
|
|
1499
|
+
[column + 1, row + 1]
|
|
1500
|
+
]) {
|
|
1501
|
+
const value = field.getHeight(x, y);
|
|
1502
|
+
if (value === void 0)
|
|
1503
|
+
continue;
|
|
1504
|
+
min = Math.min(min, value);
|
|
1505
|
+
max = Math.max(max, value);
|
|
1506
|
+
count++;
|
|
1507
|
+
}
|
|
1508
|
+
if (count) {
|
|
1509
|
+
base.minimums[index] = min;
|
|
1510
|
+
base.maximums[index] = max;
|
|
1511
|
+
base.populatedCellCounts[index] = 1;
|
|
1512
|
+
}
|
|
1513
|
+
if (count === 4)
|
|
1514
|
+
base.completeCellCounts[index] = 1;
|
|
1515
|
+
}
|
|
1516
|
+
this.levels.push(base);
|
|
1517
|
+
let previous = base;
|
|
1518
|
+
while (previous.width > 1 || previous.height > 1) {
|
|
1519
|
+
const next = createLevel(Math.ceil(previous.width / 2), Math.ceil(previous.height / 2), previous.blockSize * 2);
|
|
1520
|
+
for (let row = 0; row < next.height; row++)
|
|
1521
|
+
for (let column = 0; column < next.width; column++) {
|
|
1522
|
+
const index = row * next.width + column;
|
|
1523
|
+
let min = Infinity, max = -Infinity;
|
|
1524
|
+
for (let y = row * 2; y < Math.min(row * 2 + 2, previous.height); y++)
|
|
1525
|
+
for (let x = column * 2; x < Math.min(column * 2 + 2, previous.width); x++) {
|
|
1526
|
+
const child = y * previous.width + x;
|
|
1527
|
+
if (previous.populatedCellCounts[child]) {
|
|
1528
|
+
min = Math.min(min, previous.minimums[child]);
|
|
1529
|
+
max = Math.max(max, previous.maximums[child]);
|
|
1530
|
+
}
|
|
1531
|
+
next.populatedCellCounts[index] += previous.populatedCellCounts[child];
|
|
1532
|
+
next.completeCellCounts[index] += previous.completeCellCounts[child];
|
|
1533
|
+
}
|
|
1534
|
+
if (next.populatedCellCounts[index]) {
|
|
1535
|
+
next.minimums[index] = min;
|
|
1536
|
+
next.maximums[index] = max;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
this.levels.push(next);
|
|
1540
|
+
previous = next;
|
|
1541
|
+
}
|
|
1542
|
+
this.levelCount = this.levels.length;
|
|
1543
|
+
}
|
|
1544
|
+
/** Exact rectangular aggregation through fully covered hierarchy nodes; no clipping or truncation. */
|
|
1545
|
+
query(window = {
|
|
1546
|
+
minColumn: 0,
|
|
1547
|
+
minRow: 0,
|
|
1548
|
+
maxColumn: this.width - 1,
|
|
1549
|
+
maxRow: this.height - 1
|
|
1550
|
+
}) {
|
|
1551
|
+
const { minColumn, minRow, maxColumn, maxRow } = window;
|
|
1552
|
+
if (![minColumn, minRow, maxColumn, maxRow].every(Number.isInteger) || minColumn < 0 || minRow < 0 || maxColumn >= this.width || maxRow >= this.height || minColumn > maxColumn || minRow > maxRow)
|
|
1553
|
+
throw new Error("Invalid terrain cell window");
|
|
1554
|
+
let min = Infinity, max = -Infinity, populated = 0, complete = 0;
|
|
1555
|
+
const stack = [[this.levelCount - 1, 0, 0]];
|
|
1556
|
+
while (stack.length) {
|
|
1557
|
+
const [levelIndex, column, row] = stack.pop();
|
|
1558
|
+
const level = this.levels[levelIndex];
|
|
1559
|
+
const left = column * level.blockSize, bottom = row * level.blockSize;
|
|
1560
|
+
const right = Math.min(left + level.blockSize, this.width) - 1;
|
|
1561
|
+
const top = Math.min(bottom + level.blockSize, this.height) - 1;
|
|
1562
|
+
if (left > maxColumn || bottom > maxRow || right < minColumn || top < minRow)
|
|
1563
|
+
continue;
|
|
1564
|
+
const index = row * level.width + column;
|
|
1565
|
+
if (left >= minColumn && bottom >= minRow && right <= maxColumn && top <= maxRow) {
|
|
1566
|
+
if (level.populatedCellCounts[index]) {
|
|
1567
|
+
min = Math.min(min, level.minimums[index]);
|
|
1568
|
+
max = Math.max(max, level.maximums[index]);
|
|
1569
|
+
}
|
|
1570
|
+
populated += level.populatedCellCounts[index];
|
|
1571
|
+
complete += level.completeCellCounts[index];
|
|
1572
|
+
} else {
|
|
1573
|
+
const child = this.levels[levelIndex - 1];
|
|
1574
|
+
for (let y = row * 2; y < Math.min(row * 2 + 2, child.height); y++)
|
|
1575
|
+
for (let x = column * 2; x < Math.min(column * 2 + 2, child.width); x++)
|
|
1576
|
+
stack.push([levelIndex - 1, x, y]);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
heightRange: populated ? [min, max] : void 0,
|
|
1581
|
+
cellCount: (maxColumn - minColumn + 1) * (maxRow - minRow + 1),
|
|
1582
|
+
populatedCellCount: populated,
|
|
1583
|
+
completeCellCount: complete
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
/** Detached hierarchy arrays, suitable for inspection, transfer or a separate device adapter. */
|
|
1587
|
+
copyLevel(index) {
|
|
1588
|
+
if (!Number.isInteger(index) || index < 0 || index >= this.levelCount)
|
|
1589
|
+
throw new Error("Invalid terrain hierarchy level");
|
|
1590
|
+
const level = this.levels[index];
|
|
1591
|
+
return {
|
|
1592
|
+
...level,
|
|
1593
|
+
minimums: level.minimums.slice(),
|
|
1594
|
+
maximums: level.maximums.slice(),
|
|
1595
|
+
populatedCellCounts: level.populatedCellCounts.slice(),
|
|
1596
|
+
completeCellCounts: level.completeCellCounts.slice()
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
function createLevel(width, height, blockSize) {
|
|
1601
|
+
const count = width * height;
|
|
1602
|
+
return {
|
|
1603
|
+
width,
|
|
1604
|
+
height,
|
|
1605
|
+
blockSize,
|
|
1606
|
+
minimums: new Float64Array(count),
|
|
1607
|
+
maximums: new Float64Array(count),
|
|
1608
|
+
populatedCellCounts: new Uint32Array(count),
|
|
1609
|
+
completeCellCounts: new Uint32Array(count)
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
// dist/terrain/mesh-error.js
|
|
1614
|
+
function measureTerrainMeshError(field, mesh, options = {}) {
|
|
1615
|
+
validateTerrainGridMesh(mesh);
|
|
1616
|
+
if (mesh.width !== field.width || mesh.height !== field.height || mesh.heightReference !== field.heightReference)
|
|
1617
|
+
throw new Error("Terrain mesh and field metadata differ");
|
|
1618
|
+
const limit = options.maxSampleTests ?? 1e7;
|
|
1619
|
+
if (!Number.isSafeInteger(limit) || limit < 0)
|
|
1620
|
+
throw new Error("Invalid terrain mesh sample-test limit");
|
|
1621
|
+
const shift = field.registration === "cell" ? 0.5 : 0;
|
|
1622
|
+
for (let i = 0; i < mesh.positions.length / 3; i++) {
|
|
1623
|
+
const x = mesh.gridCoordinates[i * 2] + shift, y = mesh.gridCoordinates[i * 2 + 1] + shift;
|
|
1624
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
1625
|
+
const expected = field.origin[axis] - mesh.origin[axis] + x * field.columnStep[axis] + y * field.rowStep[axis];
|
|
1626
|
+
if (!Number.isFinite(expected) || mesh.positions[i * 3 + axis] !== expected)
|
|
1627
|
+
throw new Error("Terrain mesh XY does not match the source grid frame");
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
const baseX = field.origin[0] - mesh.origin[0], baseY = field.origin[1] - mesh.origin[1];
|
|
1631
|
+
const [columnX, columnY] = field.columnStep, [rowX, rowY] = field.rowStep;
|
|
1632
|
+
const frameArea = Math.abs(columnX * rowY - columnY * rowX);
|
|
1633
|
+
const roundX = 16 * Number.EPSILON * (Math.abs(baseX) + (field.width + 1) * Math.abs(columnX) + (field.height + 1) * Math.abs(rowX));
|
|
1634
|
+
const roundY = 16 * Number.EPSILON * (Math.abs(baseY) + (field.width + 1) * Math.abs(columnY) + (field.height + 1) * Math.abs(rowY));
|
|
1635
|
+
const gridRoundoff = Math.max((Math.abs(rowY) * roundX + Math.abs(rowX) * roundY) / frameArea, (Math.abs(columnY) * roundX + Math.abs(columnX) * roundY) / frameArea);
|
|
1636
|
+
if (!Number.isFinite(gridRoundoff) || gridRoundoff >= 0.125)
|
|
1637
|
+
throw new Error("Terrain mesh XY precision is insufficient; use a local origin and a well-conditioned frame");
|
|
1638
|
+
const errors = new Float64Array(field.width * field.height);
|
|
1639
|
+
const covered = new Uint8Array(errors.length);
|
|
1640
|
+
let sampleTests = 0, coveredSampleCount = 0, maxSampleError = 0;
|
|
1641
|
+
for (let t = 0; t < mesh.indices.length; t += 3) {
|
|
1642
|
+
const a = mesh.indices[t], b = mesh.indices[t + 1], c = mesh.indices[t + 2];
|
|
1643
|
+
const ax = mesh.gridCoordinates[a * 2], ay = mesh.gridCoordinates[a * 2 + 1];
|
|
1644
|
+
const bx = mesh.gridCoordinates[b * 2], by = mesh.gridCoordinates[b * 2 + 1];
|
|
1645
|
+
const cx = mesh.gridCoordinates[c * 2], cy = mesh.gridCoordinates[c * 2 + 1];
|
|
1646
|
+
const determinant = (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);
|
|
1647
|
+
if (!Number.isFinite(determinant) || determinant === 0)
|
|
1648
|
+
throw new Error("Degenerate terrain mesh grid triangle");
|
|
1649
|
+
const px = mesh.positions[a * 3], py = mesh.positions[a * 3 + 1];
|
|
1650
|
+
const ux = mesh.positions[b * 3] - px, uy = mesh.positions[b * 3 + 1] - py;
|
|
1651
|
+
const vx = mesh.positions[c * 3] - px, vy = mesh.positions[c * 3 + 1] - py;
|
|
1652
|
+
const xyArea = ux * vy - uy * vx;
|
|
1653
|
+
if (!Number.isFinite(xyArea) || xyArea === 0)
|
|
1654
|
+
throw new Error("Degenerate terrain mesh XY triangle");
|
|
1655
|
+
for (let row = Math.max(0, Math.min(ay, by, cy) - 1); row <= Math.min(field.height - 1, Math.max(ay, by, cy) + 1); row++)
|
|
1656
|
+
for (let column = Math.max(0, Math.min(ax, bx, cx) - 1); column <= Math.min(field.width - 1, Math.max(ax, bx, cx) + 1); column++) {
|
|
1657
|
+
if (sampleTests++ === limit)
|
|
1658
|
+
throw new Error("Terrain mesh sample-test budget exceeded");
|
|
1659
|
+
const dx = baseX + (column + shift) * columnX + (row + shift) * rowX - px;
|
|
1660
|
+
const dy = baseY + (column + shift) * columnY + (row + shift) * rowY - py;
|
|
1661
|
+
const sign = Math.sign(xyArea), area = Math.abs(xyArea);
|
|
1662
|
+
const nu = (dx * vy - dy * vx) * sign;
|
|
1663
|
+
const nv = (ux * dy - uy * dx) * sign;
|
|
1664
|
+
const tolerance = 16 * Number.EPSILON * (Math.abs(dx * vy) + Math.abs(dy * vx) + Math.abs(ux * dy) + Math.abs(uy * dx) + area);
|
|
1665
|
+
if (nu < -tolerance || nv < -tolerance || nu + nv > area + tolerance)
|
|
1666
|
+
continue;
|
|
1667
|
+
const u = nu / area, v = nv / area, w = (area - nu - nv) / area;
|
|
1668
|
+
const height = field.getHeight(column, row);
|
|
1669
|
+
if (height === void 0)
|
|
1670
|
+
continue;
|
|
1671
|
+
const predicted = w * mesh.positions[a * 3 + 2] + u * mesh.positions[b * 3 + 2] + v * mesh.positions[c * 3 + 2];
|
|
1672
|
+
const localHeight = height - mesh.origin[2];
|
|
1673
|
+
const virtualOrigin = height - localHeight;
|
|
1674
|
+
const remainder = height - (localHeight + virtualOrigin) + (virtualOrigin - mesh.origin[2]);
|
|
1675
|
+
const error = Math.abs(predicted - localHeight - remainder);
|
|
1676
|
+
if (!Number.isFinite(error))
|
|
1677
|
+
throw new Error("Terrain mesh error arithmetic overflow");
|
|
1678
|
+
const index = row * field.width + column;
|
|
1679
|
+
if (!covered[index]) {
|
|
1680
|
+
covered[index] = 1;
|
|
1681
|
+
coveredSampleCount++;
|
|
1682
|
+
}
|
|
1683
|
+
errors[index] = Math.max(errors[index], error);
|
|
1684
|
+
maxSampleError = Math.max(maxSampleError, error);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
let squares = 0;
|
|
1688
|
+
if (maxSampleError)
|
|
1689
|
+
for (const error of errors)
|
|
1690
|
+
squares += (error / maxSampleError) ** 2;
|
|
1691
|
+
return {
|
|
1692
|
+
maxSampleError,
|
|
1693
|
+
rmsSampleError: coveredSampleCount ? maxSampleError * Math.sqrt(squares / coveredSampleCount) : 0,
|
|
1694
|
+
coveredSampleCount,
|
|
1695
|
+
uncoveredSampleCount: field.validCount - coveredSampleCount,
|
|
1696
|
+
sampleTests
|
|
1697
|
+
};
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
// dist/terrain/mesh-edges.js
|
|
1701
|
+
function getTerrainMeshEdge(mesh, edge) {
|
|
1702
|
+
validateTerrainGridMesh(mesh);
|
|
1703
|
+
if (!["minColumn", "maxColumn", "minRow", "maxRow"].includes(edge))
|
|
1704
|
+
throw new Error("Unknown terrain mesh edge");
|
|
1705
|
+
const column = edge === "minColumn" || edge === "maxColumn";
|
|
1706
|
+
const axis = column ? 0 : 1;
|
|
1707
|
+
const value = edge.startsWith("min") ? 0 : (column ? mesh.width : mesh.height) - 1;
|
|
1708
|
+
const vertices = /* @__PURE__ */ new Set();
|
|
1709
|
+
for (const index of mesh.indices)
|
|
1710
|
+
if (mesh.gridCoordinates[2 * index + axis] === value)
|
|
1711
|
+
vertices.add(index);
|
|
1712
|
+
return Uint32Array.from([...vertices].sort((a, b) => mesh.gridCoordinates[2 * a + 1 - axis] - mesh.gridCoordinates[2 * b + 1 - axis] || a - b));
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// dist/terrain/martini.js
|
|
1716
|
+
var import_martini = __toESM(require("@mapbox/martini"), 1);
|
|
1717
|
+
function createMartiniTerrainMesh(field, options) {
|
|
1718
|
+
const size = field.width, cells = size - 1;
|
|
1719
|
+
const maxSamples = options.maxSamples ?? 11e5, maxTriangles = options.maxTriangles ?? 2 * cells * cells;
|
|
1720
|
+
if (!Number.isFinite(options.maxError) || options.maxError < 0)
|
|
1721
|
+
throw new Error("Adaptive terrain maxError must be finite and nonnegative");
|
|
1722
|
+
for (const value of [maxSamples, maxTriangles])
|
|
1723
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
1724
|
+
throw new Error("Invalid adaptive terrain capacity");
|
|
1725
|
+
if (size !== field.height || cells < 1 || cells > 32768 || (cells & cells - 1) !== 0)
|
|
1726
|
+
throw new Error("Adaptive terrain requires a square (2^k+1) grid within uint16 coordinates");
|
|
1727
|
+
if (size * size > maxSamples)
|
|
1728
|
+
throw new Error("Adaptive terrain sample capacity exceeded");
|
|
1729
|
+
if (field.validCount !== size * size)
|
|
1730
|
+
throw new Error("Adaptive terrain requires complete source data; use a regular mesh for holes");
|
|
1731
|
+
const edges = options.fullEdges ?? [];
|
|
1732
|
+
for (const edge of edges)
|
|
1733
|
+
if (!["minColumn", "maxColumn", "minRow", "maxRow"].includes(edge))
|
|
1734
|
+
throw new Error("Unknown adaptive terrain edge");
|
|
1735
|
+
const { heights } = field.copyData();
|
|
1736
|
+
const tile = new import_martini.default(size).createTile(heights);
|
|
1737
|
+
for (const edge of edges)
|
|
1738
|
+
for (let i = 0; i < size; i++) {
|
|
1739
|
+
const column = edge === "minColumn" ? 0 : edge === "maxColumn" ? cells : i;
|
|
1740
|
+
const row = edge === "minRow" ? 0 : edge === "maxRow" ? cells : i;
|
|
1741
|
+
tile.errors[row * size + column] = Infinity;
|
|
1742
|
+
}
|
|
1743
|
+
if (edges.length)
|
|
1744
|
+
tile.update();
|
|
1745
|
+
let threshold = options.maxError;
|
|
1746
|
+
for (let pass = 0; pass <= 8; pass++) {
|
|
1747
|
+
const { vertices, triangles } = tile.getMesh(pass === 8 ? -1 : threshold);
|
|
1748
|
+
if (triangles.length / 3 > maxTriangles)
|
|
1749
|
+
throw new Error("Adaptive terrain triangle capacity exceeded");
|
|
1750
|
+
const indices = Uint32Array.from(triangles);
|
|
1751
|
+
for (let i = 0; i < indices.length; i += 3)
|
|
1752
|
+
[indices[i + 1], indices[i + 2]] = [indices[i + 2], indices[i + 1]];
|
|
1753
|
+
const mesh = assembleTerrainMesh(field, Uint32Array.from(vertices), indices, options);
|
|
1754
|
+
const error = measureTerrainMeshError(field, mesh, { maxSampleTests: options.maxSampleTests });
|
|
1755
|
+
if (!error.uncoveredSampleCount && error.maxSampleError <= options.maxError)
|
|
1756
|
+
return {
|
|
1757
|
+
...mesh,
|
|
1758
|
+
error,
|
|
1759
|
+
requestedMaxError: options.maxError,
|
|
1760
|
+
refinementPasses: pass + 1,
|
|
1761
|
+
tessellator: "martini"
|
|
1762
|
+
};
|
|
1763
|
+
threshold /= 2;
|
|
1764
|
+
}
|
|
1765
|
+
throw new Error("Adaptive terrain could not meet the requested sample error");
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
// dist/terrain/vendor/delatin.js
|
|
1769
|
+
var Delatin = class {
|
|
1770
|
+
constructor(data, width, height = width) {
|
|
1771
|
+
this.data = data;
|
|
1772
|
+
this.width = width;
|
|
1773
|
+
this.height = height;
|
|
1774
|
+
this.coords = [];
|
|
1775
|
+
this.triangles = [];
|
|
1776
|
+
this._halfedges = [];
|
|
1777
|
+
this._candidates = [];
|
|
1778
|
+
this._queueIndices = [];
|
|
1779
|
+
this._queue = [];
|
|
1780
|
+
this._errors = [];
|
|
1781
|
+
this._rms = [];
|
|
1782
|
+
this._pending = [];
|
|
1783
|
+
this._pendingLen = 0;
|
|
1784
|
+
this._rmsSum = 0;
|
|
1785
|
+
const x1 = width - 1;
|
|
1786
|
+
const y1 = height - 1;
|
|
1787
|
+
const p0 = this._addPoint(0, 0);
|
|
1788
|
+
const p1 = this._addPoint(x1, 0);
|
|
1789
|
+
const p2 = this._addPoint(0, y1);
|
|
1790
|
+
const p3 = this._addPoint(x1, y1);
|
|
1791
|
+
const t0 = this._addTriangle(p3, p0, p2, -1, -1, -1);
|
|
1792
|
+
this._addTriangle(p0, p3, p1, t0, -1, -1);
|
|
1793
|
+
this._flush();
|
|
1794
|
+
}
|
|
1795
|
+
// refine the mesh until its maximum error gets below the given one
|
|
1796
|
+
run(maxError = 1) {
|
|
1797
|
+
while (this.getMaxError() > maxError) {
|
|
1798
|
+
this.refine();
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
// refine the mesh with a single point
|
|
1802
|
+
refine() {
|
|
1803
|
+
this._step();
|
|
1804
|
+
this._flush();
|
|
1805
|
+
}
|
|
1806
|
+
// max error of the current mesh
|
|
1807
|
+
getMaxError() {
|
|
1808
|
+
return this._errors[0];
|
|
1809
|
+
}
|
|
1810
|
+
// root-mean-square deviation of the current mesh
|
|
1811
|
+
getRMSD() {
|
|
1812
|
+
return this._rmsSum > 0 ? Math.sqrt(this._rmsSum / (this.width * this.height)) : 0;
|
|
1813
|
+
}
|
|
1814
|
+
// height value at a given position
|
|
1815
|
+
heightAt(x, y) {
|
|
1816
|
+
return this.data[this.width * y + x];
|
|
1817
|
+
}
|
|
1818
|
+
// rasterize and queue all triangles that got added or updated in _step
|
|
1819
|
+
_flush() {
|
|
1820
|
+
const coords = this.coords;
|
|
1821
|
+
for (let i = 0; i < this._pendingLen; i++) {
|
|
1822
|
+
const t = this._pending[i];
|
|
1823
|
+
const a = 2 * this.triangles[t * 3 + 0];
|
|
1824
|
+
const b = 2 * this.triangles[t * 3 + 1];
|
|
1825
|
+
const c = 2 * this.triangles[t * 3 + 2];
|
|
1826
|
+
this._findCandidate(coords[a], coords[a + 1], coords[b], coords[b + 1], coords[c], coords[c + 1], t);
|
|
1827
|
+
}
|
|
1828
|
+
this._pendingLen = 0;
|
|
1829
|
+
}
|
|
1830
|
+
// rasterize a triangle, find its max error, and queue it for processing
|
|
1831
|
+
_findCandidate(p0x, p0y, p1x, p1y, p2x, p2y, t) {
|
|
1832
|
+
const minX = Math.min(p0x, p1x, p2x);
|
|
1833
|
+
const minY = Math.min(p0y, p1y, p2y);
|
|
1834
|
+
const maxX = Math.max(p0x, p1x, p2x);
|
|
1835
|
+
const maxY = Math.max(p0y, p1y, p2y);
|
|
1836
|
+
let w00 = orient(p1x, p1y, p2x, p2y, minX, minY);
|
|
1837
|
+
let w01 = orient(p2x, p2y, p0x, p0y, minX, minY);
|
|
1838
|
+
let w02 = orient(p0x, p0y, p1x, p1y, minX, minY);
|
|
1839
|
+
const a01 = p1y - p0y;
|
|
1840
|
+
const b01 = p0x - p1x;
|
|
1841
|
+
const a12 = p2y - p1y;
|
|
1842
|
+
const b12 = p1x - p2x;
|
|
1843
|
+
const a20 = p0y - p2y;
|
|
1844
|
+
const b20 = p2x - p0x;
|
|
1845
|
+
const a = orient(p0x, p0y, p1x, p1y, p2x, p2y);
|
|
1846
|
+
const z0 = this.heightAt(p0x, p0y) / a;
|
|
1847
|
+
const z1 = this.heightAt(p1x, p1y) / a;
|
|
1848
|
+
const z2 = this.heightAt(p2x, p2y) / a;
|
|
1849
|
+
let maxError = 0;
|
|
1850
|
+
let mx = 0;
|
|
1851
|
+
let my = 0;
|
|
1852
|
+
let rms = 0;
|
|
1853
|
+
for (let y = minY; y <= maxY; y++) {
|
|
1854
|
+
let dx = 0;
|
|
1855
|
+
if (w00 < 0 && a12 !== 0) {
|
|
1856
|
+
dx = Math.max(dx, Math.floor(-w00 / a12));
|
|
1857
|
+
}
|
|
1858
|
+
if (w01 < 0 && a20 !== 0) {
|
|
1859
|
+
dx = Math.max(dx, Math.floor(-w01 / a20));
|
|
1860
|
+
}
|
|
1861
|
+
if (w02 < 0 && a01 !== 0) {
|
|
1862
|
+
dx = Math.max(dx, Math.floor(-w02 / a01));
|
|
1863
|
+
}
|
|
1864
|
+
let w0 = w00 + a12 * dx;
|
|
1865
|
+
let w1 = w01 + a20 * dx;
|
|
1866
|
+
let w2 = w02 + a01 * dx;
|
|
1867
|
+
let wasInside = false;
|
|
1868
|
+
for (let x = minX + dx; x <= maxX; x++) {
|
|
1869
|
+
if (w0 >= 0 && w1 >= 0 && w2 >= 0) {
|
|
1870
|
+
wasInside = true;
|
|
1871
|
+
const z = z0 * w0 + z1 * w1 + z2 * w2;
|
|
1872
|
+
const dz = Math.abs(z - this.heightAt(x, y));
|
|
1873
|
+
rms += dz * dz;
|
|
1874
|
+
if (dz > maxError) {
|
|
1875
|
+
maxError = dz;
|
|
1876
|
+
mx = x;
|
|
1877
|
+
my = y;
|
|
1878
|
+
}
|
|
1879
|
+
} else if (wasInside) {
|
|
1880
|
+
break;
|
|
1881
|
+
}
|
|
1882
|
+
w0 += a12;
|
|
1883
|
+
w1 += a20;
|
|
1884
|
+
w2 += a01;
|
|
1885
|
+
}
|
|
1886
|
+
w00 += b12;
|
|
1887
|
+
w01 += b20;
|
|
1888
|
+
w02 += b01;
|
|
1889
|
+
}
|
|
1890
|
+
if (mx === p0x && my === p0y || mx === p1x && my === p1y || mx === p2x && my === p2y) {
|
|
1891
|
+
maxError = 0;
|
|
1892
|
+
}
|
|
1893
|
+
this._candidates[2 * t] = mx;
|
|
1894
|
+
this._candidates[2 * t + 1] = my;
|
|
1895
|
+
this._rms[t] = rms;
|
|
1896
|
+
this._queuePush(t, maxError, rms);
|
|
1897
|
+
}
|
|
1898
|
+
// process the next triangle in the queue, splitting it with a new point
|
|
1899
|
+
_step() {
|
|
1900
|
+
const t = this._queuePop();
|
|
1901
|
+
const e0 = t * 3 + 0;
|
|
1902
|
+
const e1 = t * 3 + 1;
|
|
1903
|
+
const e2 = t * 3 + 2;
|
|
1904
|
+
const p0 = this.triangles[e0];
|
|
1905
|
+
const p1 = this.triangles[e1];
|
|
1906
|
+
const p2 = this.triangles[e2];
|
|
1907
|
+
const ax = this.coords[2 * p0];
|
|
1908
|
+
const ay = this.coords[2 * p0 + 1];
|
|
1909
|
+
const bx = this.coords[2 * p1];
|
|
1910
|
+
const by = this.coords[2 * p1 + 1];
|
|
1911
|
+
const cx = this.coords[2 * p2];
|
|
1912
|
+
const cy = this.coords[2 * p2 + 1];
|
|
1913
|
+
const px = this._candidates[2 * t];
|
|
1914
|
+
const py = this._candidates[2 * t + 1];
|
|
1915
|
+
const pn = this._addPoint(px, py);
|
|
1916
|
+
if (orient(ax, ay, bx, by, px, py) === 0) {
|
|
1917
|
+
this._handleCollinear(pn, e0);
|
|
1918
|
+
} else if (orient(bx, by, cx, cy, px, py) === 0) {
|
|
1919
|
+
this._handleCollinear(pn, e1);
|
|
1920
|
+
} else if (orient(cx, cy, ax, ay, px, py) === 0) {
|
|
1921
|
+
this._handleCollinear(pn, e2);
|
|
1922
|
+
} else {
|
|
1923
|
+
const h0 = this._halfedges[e0];
|
|
1924
|
+
const h1 = this._halfedges[e1];
|
|
1925
|
+
const h2 = this._halfedges[e2];
|
|
1926
|
+
const t0 = this._addTriangle(p0, p1, pn, h0, -1, -1, e0);
|
|
1927
|
+
const t1 = this._addTriangle(p1, p2, pn, h1, -1, t0 + 1);
|
|
1928
|
+
const t2 = this._addTriangle(p2, p0, pn, h2, t0 + 2, t1 + 1);
|
|
1929
|
+
this._legalize(t0);
|
|
1930
|
+
this._legalize(t1);
|
|
1931
|
+
this._legalize(t2);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
// add coordinates for a new vertex
|
|
1935
|
+
_addPoint(x, y) {
|
|
1936
|
+
const i = this.coords.length >> 1;
|
|
1937
|
+
this.coords.push(x, y);
|
|
1938
|
+
return i;
|
|
1939
|
+
}
|
|
1940
|
+
// add or update a triangle in the mesh
|
|
1941
|
+
_addTriangle(a, b, c, ab, bc, ca, e = this.triangles.length) {
|
|
1942
|
+
const t = e / 3;
|
|
1943
|
+
this.triangles[e + 0] = a;
|
|
1944
|
+
this.triangles[e + 1] = b;
|
|
1945
|
+
this.triangles[e + 2] = c;
|
|
1946
|
+
this._halfedges[e + 0] = ab;
|
|
1947
|
+
this._halfedges[e + 1] = bc;
|
|
1948
|
+
this._halfedges[e + 2] = ca;
|
|
1949
|
+
if (ab >= 0) {
|
|
1950
|
+
this._halfedges[ab] = e + 0;
|
|
1951
|
+
}
|
|
1952
|
+
if (bc >= 0) {
|
|
1953
|
+
this._halfedges[bc] = e + 1;
|
|
1954
|
+
}
|
|
1955
|
+
if (ca >= 0) {
|
|
1956
|
+
this._halfedges[ca] = e + 2;
|
|
1957
|
+
}
|
|
1958
|
+
this._candidates[2 * t + 0] = 0;
|
|
1959
|
+
this._candidates[2 * t + 1] = 0;
|
|
1960
|
+
this._queueIndices[t] = -1;
|
|
1961
|
+
this._rms[t] = 0;
|
|
1962
|
+
this._pending[this._pendingLen++] = t;
|
|
1963
|
+
return e;
|
|
1964
|
+
}
|
|
1965
|
+
_legalize(a) {
|
|
1966
|
+
const b = this._halfedges[a];
|
|
1967
|
+
if (b < 0) {
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
const a0 = a - a % 3;
|
|
1971
|
+
const b0 = b - b % 3;
|
|
1972
|
+
const al = a0 + (a + 1) % 3;
|
|
1973
|
+
const ar = a0 + (a + 2) % 3;
|
|
1974
|
+
const bl = b0 + (b + 2) % 3;
|
|
1975
|
+
const br = b0 + (b + 1) % 3;
|
|
1976
|
+
const p0 = this.triangles[ar];
|
|
1977
|
+
const pr = this.triangles[a];
|
|
1978
|
+
const pl = this.triangles[al];
|
|
1979
|
+
const p1 = this.triangles[bl];
|
|
1980
|
+
const coords = this.coords;
|
|
1981
|
+
if (!inCircle(coords[2 * p0], coords[2 * p0 + 1], coords[2 * pr], coords[2 * pr + 1], coords[2 * pl], coords[2 * pl + 1], coords[2 * p1], coords[2 * p1 + 1])) {
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
const hal = this._halfedges[al];
|
|
1985
|
+
const har = this._halfedges[ar];
|
|
1986
|
+
const hbl = this._halfedges[bl];
|
|
1987
|
+
const hbr = this._halfedges[br];
|
|
1988
|
+
this._queueRemove(a0 / 3);
|
|
1989
|
+
this._queueRemove(b0 / 3);
|
|
1990
|
+
const t0 = this._addTriangle(p0, p1, pl, -1, hbl, hal, a0);
|
|
1991
|
+
const t1 = this._addTriangle(p1, p0, pr, t0, har, hbr, b0);
|
|
1992
|
+
this._legalize(t0 + 1);
|
|
1993
|
+
this._legalize(t1 + 2);
|
|
1994
|
+
}
|
|
1995
|
+
// handle a case where new vertex is on the edge of a triangle
|
|
1996
|
+
_handleCollinear(pn, a) {
|
|
1997
|
+
const a0 = a - a % 3;
|
|
1998
|
+
const al = a0 + (a + 1) % 3;
|
|
1999
|
+
const ar = a0 + (a + 2) % 3;
|
|
2000
|
+
const p0 = this.triangles[ar];
|
|
2001
|
+
const pr = this.triangles[a];
|
|
2002
|
+
const pl = this.triangles[al];
|
|
2003
|
+
const hal = this._halfedges[al];
|
|
2004
|
+
const har = this._halfedges[ar];
|
|
2005
|
+
const b = this._halfedges[a];
|
|
2006
|
+
if (b < 0) {
|
|
2007
|
+
const t02 = this._addTriangle(pn, p0, pr, -1, har, -1, a0);
|
|
2008
|
+
const t12 = this._addTriangle(p0, pn, pl, t02, -1, hal);
|
|
2009
|
+
this._legalize(t02 + 1);
|
|
2010
|
+
this._legalize(t12 + 2);
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
const b0 = b - b % 3;
|
|
2014
|
+
const bl = b0 + (b + 2) % 3;
|
|
2015
|
+
const br = b0 + (b + 1) % 3;
|
|
2016
|
+
const p1 = this.triangles[bl];
|
|
2017
|
+
const hbl = this._halfedges[bl];
|
|
2018
|
+
const hbr = this._halfedges[br];
|
|
2019
|
+
this._queueRemove(b0 / 3);
|
|
2020
|
+
const t0 = this._addTriangle(p0, pr, pn, har, -1, -1, a0);
|
|
2021
|
+
const t1 = this._addTriangle(pr, p1, pn, hbr, -1, t0 + 1, b0);
|
|
2022
|
+
const t2 = this._addTriangle(p1, pl, pn, hbl, -1, t1 + 1);
|
|
2023
|
+
const t3 = this._addTriangle(pl, p0, pn, hal, t0 + 2, t2 + 1);
|
|
2024
|
+
this._legalize(t0);
|
|
2025
|
+
this._legalize(t1);
|
|
2026
|
+
this._legalize(t2);
|
|
2027
|
+
this._legalize(t3);
|
|
2028
|
+
}
|
|
2029
|
+
// priority queue methods
|
|
2030
|
+
_queuePush(t, error, rms) {
|
|
2031
|
+
const i = this._queue.length;
|
|
2032
|
+
this._queueIndices[t] = i;
|
|
2033
|
+
this._queue.push(t);
|
|
2034
|
+
this._errors.push(error);
|
|
2035
|
+
this._rmsSum += rms;
|
|
2036
|
+
this._queueUp(i);
|
|
2037
|
+
}
|
|
2038
|
+
_queuePop() {
|
|
2039
|
+
const n = this._queue.length - 1;
|
|
2040
|
+
this._queueSwap(0, n);
|
|
2041
|
+
this._queueDown(0, n);
|
|
2042
|
+
return this._queuePopBack();
|
|
2043
|
+
}
|
|
2044
|
+
_queuePopBack() {
|
|
2045
|
+
const t = this._queue.pop();
|
|
2046
|
+
this._errors.pop();
|
|
2047
|
+
this._rmsSum -= this._rms[t];
|
|
2048
|
+
this._queueIndices[t] = -1;
|
|
2049
|
+
return t;
|
|
2050
|
+
}
|
|
2051
|
+
_queueRemove(t) {
|
|
2052
|
+
const i = this._queueIndices[t];
|
|
2053
|
+
if (i < 0) {
|
|
2054
|
+
const it = this._pending.indexOf(t);
|
|
2055
|
+
if (it !== -1) {
|
|
2056
|
+
this._pending[it] = this._pending[--this._pendingLen];
|
|
2057
|
+
} else {
|
|
2058
|
+
throw new Error("Broken triangulation (something went wrong).");
|
|
2059
|
+
}
|
|
2060
|
+
return;
|
|
2061
|
+
}
|
|
2062
|
+
const n = this._queue.length - 1;
|
|
2063
|
+
if (n !== i) {
|
|
2064
|
+
this._queueSwap(i, n);
|
|
2065
|
+
if (!this._queueDown(i, n)) {
|
|
2066
|
+
this._queueUp(i);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
this._queuePopBack();
|
|
2070
|
+
}
|
|
2071
|
+
_queueLess(i, j) {
|
|
2072
|
+
return this._errors[i] > this._errors[j];
|
|
2073
|
+
}
|
|
2074
|
+
_queueSwap(i, j) {
|
|
2075
|
+
const pi = this._queue[i];
|
|
2076
|
+
const pj = this._queue[j];
|
|
2077
|
+
this._queue[i] = pj;
|
|
2078
|
+
this._queue[j] = pi;
|
|
2079
|
+
this._queueIndices[pi] = j;
|
|
2080
|
+
this._queueIndices[pj] = i;
|
|
2081
|
+
const e = this._errors[i];
|
|
2082
|
+
this._errors[i] = this._errors[j];
|
|
2083
|
+
this._errors[j] = e;
|
|
2084
|
+
}
|
|
2085
|
+
_queueUp(j0) {
|
|
2086
|
+
let j = j0;
|
|
2087
|
+
while (true) {
|
|
2088
|
+
const i = j - 1 >> 1;
|
|
2089
|
+
if (i === j || !this._queueLess(j, i)) {
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
2092
|
+
this._queueSwap(i, j);
|
|
2093
|
+
j = i;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
_queueDown(i0, n) {
|
|
2097
|
+
let i = i0;
|
|
2098
|
+
while (true) {
|
|
2099
|
+
const j1 = 2 * i + 1;
|
|
2100
|
+
if (j1 >= n || j1 < 0) {
|
|
2101
|
+
break;
|
|
2102
|
+
}
|
|
2103
|
+
const j2 = j1 + 1;
|
|
2104
|
+
let j = j1;
|
|
2105
|
+
if (j2 < n && this._queueLess(j2, j1)) {
|
|
2106
|
+
j = j2;
|
|
2107
|
+
}
|
|
2108
|
+
if (!this._queueLess(j, i)) {
|
|
2109
|
+
break;
|
|
2110
|
+
}
|
|
2111
|
+
this._queueSwap(i, j);
|
|
2112
|
+
i = j;
|
|
2113
|
+
}
|
|
2114
|
+
return i > i0;
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
function orient(ax, ay, bx, by, cx, cy) {
|
|
2118
|
+
return (bx - cx) * (ay - cy) - (by - cy) * (ax - cx);
|
|
2119
|
+
}
|
|
2120
|
+
function inCircle(ax, ay, bx, by, cx, cy, px, py) {
|
|
2121
|
+
const dx = ax - px;
|
|
2122
|
+
const dy = ay - py;
|
|
2123
|
+
const ex = bx - px;
|
|
2124
|
+
const ey = by - py;
|
|
2125
|
+
const fx = cx - px;
|
|
2126
|
+
const fy = cy - py;
|
|
2127
|
+
const ap = dx * dx + dy * dy;
|
|
2128
|
+
const bp = ex * ex + ey * ey;
|
|
2129
|
+
const cp = fx * fx + fy * fy;
|
|
2130
|
+
return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
// dist/terrain/delatin.js
|
|
2134
|
+
function createDelatinTerrainMesh(field, options) {
|
|
2135
|
+
const count = field.width * field.height;
|
|
2136
|
+
const maxSamples = options.maxSamples ?? 11e5;
|
|
2137
|
+
const maxTriangles = options.maxTriangles ?? 2 * (field.width - 1) * (field.height - 1);
|
|
2138
|
+
const maxRefinements = options.maxRefinements ?? count - 4;
|
|
2139
|
+
if (!Number.isFinite(options.maxError) || options.maxError < 0)
|
|
2140
|
+
throw new Error("Delatin terrain maxError must be finite and nonnegative");
|
|
2141
|
+
for (const limit of [maxSamples, maxTriangles, maxRefinements])
|
|
2142
|
+
if (!Number.isSafeInteger(limit) || limit < 0)
|
|
2143
|
+
throw new Error("Invalid Delatin terrain capacity");
|
|
2144
|
+
if (count > maxSamples || count > 4294967295)
|
|
2145
|
+
throw new Error("Delatin terrain sample capacity exceeded");
|
|
2146
|
+
if (field.validCount !== count)
|
|
2147
|
+
throw new Error("Delatin terrain requires complete source data; use a regular mesh for holes");
|
|
2148
|
+
if (maxTriangles < 2)
|
|
2149
|
+
throw new Error("Delatin terrain triangle capacity exceeded");
|
|
2150
|
+
if (options.fullEdges !== void 0)
|
|
2151
|
+
throw new Error("Delatin does not support fullEdges; use MARTINI for forced boundary refinement");
|
|
2152
|
+
const { heights } = field.copyData();
|
|
2153
|
+
const tin = new Delatin(heights, field.width, field.height);
|
|
2154
|
+
let threshold = options.maxError, refinements = 0;
|
|
2155
|
+
for (let pass = 0; pass <= 8; pass++) {
|
|
2156
|
+
if (pass < 8) {
|
|
2157
|
+
while (true) {
|
|
2158
|
+
const error2 = tin.getMaxError();
|
|
2159
|
+
if (!Number.isFinite(error2))
|
|
2160
|
+
throw new Error("Delatin error arithmetic overflow");
|
|
2161
|
+
if (error2 <= threshold)
|
|
2162
|
+
break;
|
|
2163
|
+
if (refinements >= maxRefinements)
|
|
2164
|
+
throw new Error("Delatin terrain refinement budget exceeded");
|
|
2165
|
+
tin.refine();
|
|
2166
|
+
refinements++;
|
|
2167
|
+
if (tin.triangles.length / 3 > maxTriangles)
|
|
2168
|
+
throw new Error("Delatin terrain triangle capacity exceeded");
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
if (pass === 8 && 2 * (field.width - 1) * (field.height - 1) > maxTriangles)
|
|
2172
|
+
throw new Error("Delatin terrain fallback triangle capacity exceeded");
|
|
2173
|
+
const indices = Uint32Array.from(tin.triangles);
|
|
2174
|
+
for (let i = 0; i < indices.length; i += 3)
|
|
2175
|
+
[indices[i + 1], indices[i + 2]] = [indices[i + 2], indices[i + 1]];
|
|
2176
|
+
const mesh = pass === 8 ? createTerrainMesh(field, options) : assembleTerrainMesh(field, Uint32Array.from(tin.coords), indices, options);
|
|
2177
|
+
const error = measureTerrainMeshError(field, mesh, { maxSampleTests: options.maxSampleTests });
|
|
2178
|
+
if (!error.uncoveredSampleCount && error.maxSampleError <= options.maxError)
|
|
2179
|
+
return {
|
|
2180
|
+
...mesh,
|
|
2181
|
+
error,
|
|
2182
|
+
requestedMaxError: options.maxError,
|
|
2183
|
+
refinementPasses: pass + 1,
|
|
2184
|
+
tessellator: pass === 8 ? "regular" : "delatin"
|
|
2185
|
+
};
|
|
2186
|
+
threshold /= 2;
|
|
2187
|
+
}
|
|
2188
|
+
throw new Error("Delatin terrain could not meet the requested sample error");
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
// dist/terrain/derivatives.js
|
|
2192
|
+
function createTerrainGradientGrid(field, options = {}) {
|
|
2193
|
+
const method = options.method ?? "horn";
|
|
2194
|
+
if (method !== "horn" && method !== "zevenbergen-thorne")
|
|
2195
|
+
throw new Error("Unknown terrain gradient method");
|
|
2196
|
+
const count = field.width * field.height, limit = options.maxSamples ?? 11e5;
|
|
2197
|
+
if (!Number.isSafeInteger(limit) || limit < 0 || count > limit)
|
|
2198
|
+
throw new Error("Terrain gradient sample capacity exceeded");
|
|
2199
|
+
const gradients = new Float64Array(count * 2), statuses = new Uint8Array(count).fill(TerrainSampleStatus.OUTSIDE_DOMAIN);
|
|
2200
|
+
const [a, c] = field.columnStep, [b, d] = field.rowStep;
|
|
2201
|
+
const determinant = a * d - b * c;
|
|
2202
|
+
const ix = d / determinant, iy = -c / determinant, jx = -b / determinant, jy = a / determinant;
|
|
2203
|
+
const window = new Float64Array(9);
|
|
2204
|
+
for (let row = 1; row < field.height - 1; row++)
|
|
2205
|
+
for (let column = 1; column < field.width - 1; column++) {
|
|
2206
|
+
const index = row * field.width + column;
|
|
2207
|
+
let valid = true;
|
|
2208
|
+
for (let y = -1; y <= 1; y++)
|
|
2209
|
+
for (let x = -1; x <= 1; x++) {
|
|
2210
|
+
const value = field.getHeight(column + x, row + y);
|
|
2211
|
+
if (value === void 0)
|
|
2212
|
+
valid = false;
|
|
2213
|
+
window[(y + 1) * 3 + x + 1] = value ?? 0;
|
|
2214
|
+
}
|
|
2215
|
+
if (!valid) {
|
|
2216
|
+
statuses[index] = TerrainSampleStatus.NO_DATA;
|
|
2217
|
+
continue;
|
|
2218
|
+
}
|
|
2219
|
+
const dc = method === "horn" ? difference(window[2], window[0], 8) + difference(window[5], window[3], 4) + difference(window[8], window[6], 8) : difference(window[5], window[3], 2);
|
|
2220
|
+
const dr = method === "horn" ? difference(window[6], window[0], 8) + difference(window[7], window[1], 4) + difference(window[8], window[2], 8) : difference(window[7], window[1], 2);
|
|
2221
|
+
const gx = dc * ix + dr * iy, gy = dc * jx + dr * jy;
|
|
2222
|
+
if (!Number.isFinite(gx) || !Number.isFinite(gy)) {
|
|
2223
|
+
statuses[index] = TerrainSampleStatus.NUMERIC_ERROR;
|
|
2224
|
+
continue;
|
|
2225
|
+
}
|
|
2226
|
+
gradients[2 * index] = gx;
|
|
2227
|
+
gradients[2 * index + 1] = gy;
|
|
2228
|
+
statuses[index] = TerrainSampleStatus.VALID;
|
|
2229
|
+
}
|
|
2230
|
+
return {
|
|
2231
|
+
width: field.width,
|
|
2232
|
+
height: field.height,
|
|
2233
|
+
gradients,
|
|
2234
|
+
statuses,
|
|
2235
|
+
method,
|
|
2236
|
+
origin: field.origin,
|
|
2237
|
+
columnStep: field.columnStep,
|
|
2238
|
+
rowStep: field.rowStep,
|
|
2239
|
+
registration: field.registration,
|
|
2240
|
+
heightReference: field.heightReference
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2243
|
+
function difference(a, b, divisor) {
|
|
2244
|
+
const delta = a - b;
|
|
2245
|
+
return Number.isFinite(delta) ? delta / divisor : a / divisor - b / divisor;
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
// dist/terrain/slope-aspect.js
|
|
2249
|
+
function getTerrainSlopeAspect(gradientX, gradientY) {
|
|
2250
|
+
if (!Number.isFinite(gradientX) || !Number.isFinite(gradientY))
|
|
2251
|
+
throw new Error("Terrain gradient must be finite");
|
|
2252
|
+
const slope = Math.atan(Math.hypot(gradientX, gradientY));
|
|
2253
|
+
const angle = Math.atan2(-gradientX, -gradientY);
|
|
2254
|
+
return {
|
|
2255
|
+
slope,
|
|
2256
|
+
aspect: gradientX === 0 && gradientY === 0 ? void 0 : (angle < 0 ? angle + 2 * Math.PI : angle || 0) % (2 * Math.PI)
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
function createTerrainSlopeAspectGrid(grid, options = {}) {
|
|
2260
|
+
const count = grid.width * grid.height, limit = options.maxSamples ?? 11e5;
|
|
2261
|
+
if (!Number.isSafeInteger(grid.width) || grid.width < 2 || !Number.isSafeInteger(grid.height) || grid.height < 2 || !Number.isSafeInteger(limit) || limit < 0 || count > limit)
|
|
2262
|
+
throw new Error("Invalid terrain slope grid dimensions or capacity");
|
|
2263
|
+
if (!(grid.gradients instanceof Float64Array) || grid.gradients.length !== 2 * count || !(grid.statuses instanceof Uint8Array) || grid.statuses.length !== count)
|
|
2264
|
+
throw new Error("Invalid terrain slope grid buffers");
|
|
2265
|
+
const slopes = new Float64Array(count), aspects = new Float64Array(count);
|
|
2266
|
+
const statuses = grid.statuses.slice(), aspectStatuses = grid.statuses.slice();
|
|
2267
|
+
for (let i = 0; i < count; i++) {
|
|
2268
|
+
if (statuses[i] > TerrainSampleStatus.NOT_RESIDENT)
|
|
2269
|
+
throw new Error("Invalid terrain gradient status");
|
|
2270
|
+
if (statuses[i] !== TerrainSampleStatus.VALID)
|
|
2271
|
+
continue;
|
|
2272
|
+
const value = getTerrainSlopeAspect(grid.gradients[2 * i], grid.gradients[2 * i + 1]);
|
|
2273
|
+
slopes[i] = value.slope;
|
|
2274
|
+
if (value.aspect === void 0)
|
|
2275
|
+
aspectStatuses[i] = TerrainSampleStatus.NO_DATA;
|
|
2276
|
+
else
|
|
2277
|
+
aspects[i] = value.aspect;
|
|
2278
|
+
}
|
|
2279
|
+
return { width: grid.width, height: grid.height, slopes, aspects, statuses, aspectStatuses };
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
// dist/terrain/profile.js
|
|
2283
|
+
function sampleTerrainProfile(sample, path, options) {
|
|
2284
|
+
const limit = options.maxSamples ?? 1e6;
|
|
2285
|
+
if (!Number.isFinite(options.spacing) || options.spacing <= 0 || !Number.isSafeInteger(limit) || limit < 1)
|
|
2286
|
+
throw new Error("Invalid terrain profile spacing or capacity");
|
|
2287
|
+
if (!Number.isSafeInteger(path.length) || path.length < 2 || path.length % 2 || path.length / 2 > limit)
|
|
2288
|
+
throw new Error("Invalid terrain profile path or vertex capacity");
|
|
2289
|
+
for (let i = 0; i < path.length; i++)
|
|
2290
|
+
if (!Number.isFinite(path[i]))
|
|
2291
|
+
throw new Error("Terrain profile coordinates must be finite");
|
|
2292
|
+
const points = Float64Array.from(path), lengths = new Float64Array(points.length / 2 - 1), divisions = new Float64Array(lengths.length);
|
|
2293
|
+
let count = 1, length = 0;
|
|
2294
|
+
for (let i = 0; i < lengths.length; i++) {
|
|
2295
|
+
const distance = Math.hypot(points[2 * i + 2] - points[2 * i], points[2 * i + 3] - points[2 * i + 1]);
|
|
2296
|
+
const nextLength = length + distance;
|
|
2297
|
+
if (!Number.isFinite(nextLength) || distance > 0 && nextLength <= length)
|
|
2298
|
+
throw new Error("Terrain profile distance overflow or loss of precision");
|
|
2299
|
+
const steps = distance === 0 ? 0 : Math.max(1, Math.ceil(distance / options.spacing));
|
|
2300
|
+
if (!Number.isSafeInteger(steps) || count + steps > limit)
|
|
2301
|
+
throw new Error("Terrain profile sample capacity exceeded");
|
|
2302
|
+
lengths[i] = distance;
|
|
2303
|
+
divisions[i] = steps;
|
|
2304
|
+
count += steps;
|
|
2305
|
+
length = nextLength;
|
|
2306
|
+
}
|
|
2307
|
+
const positions = new Float64Array(count * 2), distances = new Float64Array(count), heights = new Float64Array(count), statuses = new Uint8Array(count);
|
|
2308
|
+
let index = 0;
|
|
2309
|
+
const emit = (x, y, distance) => {
|
|
2310
|
+
if (index > 0 && (distance <= distances[index - 1] || x === positions[2 * index - 2] && y === positions[2 * index - 1]))
|
|
2311
|
+
throw new Error("Terrain profile samples lose coordinate or distance precision");
|
|
2312
|
+
positions[2 * index] = x;
|
|
2313
|
+
positions[2 * index + 1] = y;
|
|
2314
|
+
distances[index] = distance;
|
|
2315
|
+
const value = sample(x, y);
|
|
2316
|
+
if (!Number.isInteger(value.status) || value.status < 0 || value.status > TerrainSampleStatus.NOT_RESIDENT)
|
|
2317
|
+
throw new Error("Invalid terrain profile sample status");
|
|
2318
|
+
statuses[index] = value.status;
|
|
2319
|
+
if (value.status === TerrainSampleStatus.VALID) {
|
|
2320
|
+
if (Number.isFinite(value.height))
|
|
2321
|
+
heights[index] = value.height;
|
|
2322
|
+
else
|
|
2323
|
+
statuses[index] = TerrainSampleStatus.NUMERIC_ERROR;
|
|
2324
|
+
}
|
|
2325
|
+
index++;
|
|
2326
|
+
};
|
|
2327
|
+
emit(points[0], points[1], 0);
|
|
2328
|
+
let start = 0;
|
|
2329
|
+
for (let i = 0; i < lengths.length; i++) {
|
|
2330
|
+
const steps = divisions[i];
|
|
2331
|
+
for (let j = 1; j <= steps; j++) {
|
|
2332
|
+
const fraction = j / steps;
|
|
2333
|
+
emit(j === steps ? points[2 * i + 2] : points[2 * i] + (points[2 * i + 2] - points[2 * i]) * fraction, j === steps ? points[2 * i + 3] : points[2 * i + 1] + (points[2 * i + 3] - points[2 * i + 1]) * fraction, start + lengths[i] * fraction);
|
|
2334
|
+
}
|
|
2335
|
+
start += lengths[i];
|
|
2336
|
+
}
|
|
2337
|
+
return { positions, distances, heights, statuses, length };
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
// dist/terrain/contours.js
|
|
2341
|
+
function createTerrainContours(field, levels, options = {}) {
|
|
2342
|
+
const maxSamples = options.maxSamples ?? 11e5, maxLevels = options.maxLevels ?? 256;
|
|
2343
|
+
const maxVertices = options.maxVertices ?? 2e6, maxSegments = options.maxSegments ?? 1e6;
|
|
2344
|
+
const maxTriangleTests = options.maxTriangleTests ?? 1e7;
|
|
2345
|
+
for (const limit of [maxSamples, maxLevels, maxVertices, maxSegments, maxTriangleTests])
|
|
2346
|
+
if (!Number.isSafeInteger(limit) || limit < 0)
|
|
2347
|
+
throw new Error("Invalid terrain contour capacity");
|
|
2348
|
+
const count = field.width * field.height;
|
|
2349
|
+
if (count > maxSamples || count > 4294967295 || maxVertices > 4294967295 || maxSegments > 4294967295)
|
|
2350
|
+
throw new Error("Terrain contour sample or index capacity exceeded");
|
|
2351
|
+
if (!Number.isSafeInteger(levels.length) || levels.length < 0 || levels.length > maxLevels)
|
|
2352
|
+
throw new Error("Terrain contour level capacity exceeded");
|
|
2353
|
+
for (let i = 0; i < levels.length; i++)
|
|
2354
|
+
if (!Number.isFinite(levels[i]) || i > 0 && levels[i] <= levels[i - 1])
|
|
2355
|
+
throw new Error("Terrain contour levels must be finite and strictly increasing");
|
|
2356
|
+
if (levels.length * 2 * (field.width - 1) * (field.height - 1) > maxTriangleTests)
|
|
2357
|
+
throw new Error("Terrain contour triangle-test budget exceeded");
|
|
2358
|
+
const origin = options.origin ?? [field.origin[0], field.origin[1], 0];
|
|
2359
|
+
if (origin.length !== 3 || !Number.isFinite(origin[0]) || !Number.isFinite(origin[1]) || !Number.isFinite(origin[2]))
|
|
2360
|
+
throw new Error("Terrain contour origin must be finite XYZ");
|
|
2361
|
+
const outputLevels = Float64Array.from(levels), positions = [], coordinates = [], segments = [], levelIndices = [];
|
|
2362
|
+
const shift = field.registration === "cell" ? 0.5 : 0;
|
|
2363
|
+
for (let levelIndex = 0; levelIndex < outputLevels.length; levelIndex++) {
|
|
2364
|
+
const level = outputLevels[levelIndex], vertices = /* @__PURE__ */ new Map(), edges = /* @__PURE__ */ new Set();
|
|
2365
|
+
const height = (i) => field.getHeight(i % field.width, Math.floor(i / field.width));
|
|
2366
|
+
const intersection = (a, b) => {
|
|
2367
|
+
if (a > b)
|
|
2368
|
+
[a, b] = [b, a];
|
|
2369
|
+
const exact = height(a) === level ? a : height(b) === level ? b : void 0;
|
|
2370
|
+
return exact === void 0 ? { a, b, key: `e${a}/${b}` } : { a: exact, b: exact, key: `v${exact}` };
|
|
2371
|
+
};
|
|
2372
|
+
const vertex = ({ a, b, key }) => {
|
|
2373
|
+
const existing = vertices.get(key);
|
|
2374
|
+
if (existing !== void 0)
|
|
2375
|
+
return existing;
|
|
2376
|
+
if (positions.length / 3 >= maxVertices)
|
|
2377
|
+
throw new Error("Terrain contour vertex capacity exceeded");
|
|
2378
|
+
let fraction = 0;
|
|
2379
|
+
if (a !== b) {
|
|
2380
|
+
const ha = height(a), hb = height(b), delta = hb - ha, offset = level - ha;
|
|
2381
|
+
if (Number.isFinite(delta) && Number.isFinite(offset))
|
|
2382
|
+
fraction = offset / delta;
|
|
2383
|
+
else {
|
|
2384
|
+
const scale = Math.max(Math.abs(ha), Math.abs(hb), Math.abs(level));
|
|
2385
|
+
fraction = (level / scale - ha / scale) / (hb / scale - ha / scale);
|
|
2386
|
+
}
|
|
2387
|
+
if (!Number.isFinite(fraction) || fraction <= 0 || fraction >= 1)
|
|
2388
|
+
throw new Error("Terrain contour intersection loses precision");
|
|
2389
|
+
}
|
|
2390
|
+
const ax = a % field.width, ay = Math.floor(a / field.width);
|
|
2391
|
+
const x = ax + (b % field.width - ax) * fraction, y = ay + (Math.floor(b / field.width) - ay) * fraction;
|
|
2392
|
+
const px = field.origin[0] - origin[0] + (x + shift) * field.columnStep[0] + (y + shift) * field.rowStep[0];
|
|
2393
|
+
const py = field.origin[1] - origin[1] + (x + shift) * field.columnStep[1] + (y + shift) * field.rowStep[1];
|
|
2394
|
+
const pz = level - origin[2];
|
|
2395
|
+
if (!Number.isFinite(px) || !Number.isFinite(py) || !Number.isFinite(pz))
|
|
2396
|
+
throw new Error("Terrain contour coordinate overflow");
|
|
2397
|
+
const index = positions.length / 3;
|
|
2398
|
+
positions.push(px, py, pz);
|
|
2399
|
+
coordinates.push(x, y);
|
|
2400
|
+
vertices.set(key, index);
|
|
2401
|
+
return index;
|
|
2402
|
+
};
|
|
2403
|
+
const triangle = (a, b, c) => {
|
|
2404
|
+
const ha = height(a), hb = height(b), hc = height(c);
|
|
2405
|
+
if (ha === void 0 || hb === void 0 || hc === void 0)
|
|
2406
|
+
return;
|
|
2407
|
+
const hits = [];
|
|
2408
|
+
if (ha < level !== hb < level)
|
|
2409
|
+
hits.push(intersection(a, b));
|
|
2410
|
+
if (hb < level !== hc < level)
|
|
2411
|
+
hits.push(intersection(b, c));
|
|
2412
|
+
if (hc < level !== ha < level)
|
|
2413
|
+
hits.push(intersection(c, a));
|
|
2414
|
+
if (hits.length !== 2 || hits[0].key === hits[1].key)
|
|
2415
|
+
return;
|
|
2416
|
+
const va = vertex(hits[0]), vb = vertex(hits[1]);
|
|
2417
|
+
const key = va < vb ? `${va}/${vb}` : `${vb}/${va}`;
|
|
2418
|
+
if (edges.has(key))
|
|
2419
|
+
return;
|
|
2420
|
+
if (segments.length / 2 >= maxSegments)
|
|
2421
|
+
throw new Error("Terrain contour segment capacity exceeded");
|
|
2422
|
+
if (positions[3 * va] === positions[3 * vb] && positions[3 * va + 1] === positions[3 * vb + 1])
|
|
2423
|
+
throw new Error("Terrain contour segment collapses; use a local origin");
|
|
2424
|
+
edges.add(key);
|
|
2425
|
+
segments.push(va, vb);
|
|
2426
|
+
levelIndices.push(levelIndex);
|
|
2427
|
+
};
|
|
2428
|
+
for (let row = 0; row < field.height - 1; row++)
|
|
2429
|
+
for (let column = 0; column < field.width - 1; column++) {
|
|
2430
|
+
const a = row * field.width + column, b = a + 1, c = a + field.width, d = c + 1;
|
|
2431
|
+
if (field.diagonal === "00-11") {
|
|
2432
|
+
triangle(a, b, d);
|
|
2433
|
+
triangle(a, d, c);
|
|
2434
|
+
} else {
|
|
2435
|
+
triangle(a, b, c);
|
|
2436
|
+
triangle(b, d, c);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
return {
|
|
2441
|
+
positions: Float64Array.from(positions),
|
|
2442
|
+
gridCoordinates: Float64Array.from(coordinates),
|
|
2443
|
+
segments: Uint32Array.from(segments),
|
|
2444
|
+
levelIndices: Uint32Array.from(levelIndices),
|
|
2445
|
+
levels: outputLevels,
|
|
2446
|
+
origin: Object.freeze([...origin]),
|
|
2447
|
+
heightReference: field.heightReference
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
// dist/terrain/contour-path-data.js
|
|
2452
|
+
function contourPathLimits(options) {
|
|
2453
|
+
const limits = {
|
|
2454
|
+
maxVertices: options.maxVertices ?? 2e6,
|
|
2455
|
+
maxSegments: options.maxSegments ?? 1e6,
|
|
2456
|
+
maxPaths: options.maxPaths ?? 1e6,
|
|
2457
|
+
maxIndices: options.maxIndices ?? 2e6,
|
|
2458
|
+
maxLevels: options.maxLevels ?? 256
|
|
2459
|
+
};
|
|
2460
|
+
for (const value of Object.values(limits))
|
|
2461
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > 4294967294)
|
|
2462
|
+
throw new Error("Invalid terrain contour path capacity");
|
|
2463
|
+
return limits;
|
|
2464
|
+
}
|
|
2465
|
+
function validateContourData(data, limits) {
|
|
2466
|
+
if (!(data.positions instanceof Float64Array) || data.positions.length % 3 || data.positions.length / 3 > limits.maxVertices || !data.positions.every(Number.isFinite))
|
|
2467
|
+
throw new Error("Invalid terrain contour positions or capacity");
|
|
2468
|
+
const count = data.positions.length / 3;
|
|
2469
|
+
if (!(data.gridCoordinates instanceof Float64Array) || data.gridCoordinates.length !== count * 2 || !data.gridCoordinates.every(Number.isFinite))
|
|
2470
|
+
throw new Error("Invalid terrain contour grid coordinates");
|
|
2471
|
+
if (!(data.levels instanceof Float64Array) || data.levels.length > limits.maxLevels)
|
|
2472
|
+
throw new Error("Invalid terrain contour levels or capacity");
|
|
2473
|
+
for (let i = 0; i < data.levels.length; i++)
|
|
2474
|
+
if (!Number.isFinite(data.levels[i]) || i > 0 && data.levels[i] <= data.levels[i - 1])
|
|
2475
|
+
throw new Error("Invalid terrain contour levels");
|
|
2476
|
+
if (data.origin.length !== 3 || !Number.isFinite(data.origin[0]) || !Number.isFinite(data.origin[1]) || !Number.isFinite(data.origin[2]) || typeof data.heightReference !== "string")
|
|
2477
|
+
throw new Error("Invalid terrain contour frame");
|
|
2478
|
+
return count;
|
|
2479
|
+
}
|
|
2480
|
+
function validateContourVertex(data, vertex, level, assignments) {
|
|
2481
|
+
if (vertex >= assignments.length || level >= data.levels.length)
|
|
2482
|
+
throw new Error("Terrain contour index out of range");
|
|
2483
|
+
if (assignments[vertex] !== 4294967295 && assignments[vertex] !== level)
|
|
2484
|
+
throw new Error("Terrain contour vertex belongs to multiple levels");
|
|
2485
|
+
if (data.positions[vertex * 3 + 2] !== data.levels[level] - data.origin[2])
|
|
2486
|
+
throw new Error("Terrain contour vertex height does not match its level");
|
|
2487
|
+
assignments[vertex] = level;
|
|
2488
|
+
}
|
|
2489
|
+
function copyContourData(data) {
|
|
2490
|
+
return {
|
|
2491
|
+
positions: data.positions.slice(),
|
|
2492
|
+
gridCoordinates: data.gridCoordinates.slice(),
|
|
2493
|
+
levels: data.levels.slice(),
|
|
2494
|
+
origin: Object.freeze([...data.origin]),
|
|
2495
|
+
heightReference: data.heightReference
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
// dist/terrain/contour-paths.js
|
|
2500
|
+
function stitchTerrainContours(contours, options = {}) {
|
|
2501
|
+
const limits = contourPathLimits(options), count = validateContourData(contours, limits);
|
|
2502
|
+
if (!(contours.segments instanceof Uint32Array) || contours.segments.length % 2 || contours.segments.length > 4294967294 || contours.segments.length / 2 > limits.maxSegments || !(contours.levelIndices instanceof Uint32Array) || contours.levelIndices.length !== contours.segments.length / 2)
|
|
2503
|
+
throw new Error("Invalid terrain contour segments or capacity");
|
|
2504
|
+
const edgeCount = contours.segments.length / 2, degrees = new Uint32Array(count), assignments = new Uint32Array(count).fill(4294967295), unique = /* @__PURE__ */ new Set();
|
|
2505
|
+
for (let i = 0; i < edgeCount; i++) {
|
|
2506
|
+
const a = contours.segments[2 * i], b = contours.segments[2 * i + 1], level = contours.levelIndices[i];
|
|
2507
|
+
validateContourVertex(contours, a, level, assignments);
|
|
2508
|
+
validateContourVertex(contours, b, level, assignments);
|
|
2509
|
+
if (a === b || contours.positions[3 * a] === contours.positions[3 * b] && contours.positions[3 * a + 1] === contours.positions[3 * b + 1])
|
|
2510
|
+
throw new Error("Degenerate terrain contour segment");
|
|
2511
|
+
const key = a < b ? `${a}/${b}` : `${b}/${a}`;
|
|
2512
|
+
if (unique.has(key))
|
|
2513
|
+
throw new Error("Duplicate terrain contour segment");
|
|
2514
|
+
unique.add(key);
|
|
2515
|
+
degrees[a]++;
|
|
2516
|
+
degrees[b]++;
|
|
2517
|
+
}
|
|
2518
|
+
const starts = new Uint32Array(count + 1);
|
|
2519
|
+
for (let i = 0; i < count; i++)
|
|
2520
|
+
starts[i + 1] = starts[i] + degrees[i];
|
|
2521
|
+
const cursor = starts.slice(), adjacency = new Uint32Array(edgeCount * 2);
|
|
2522
|
+
for (let i = 0; i < edgeCount; i++)
|
|
2523
|
+
for (let j = 0; j < 2; j++)
|
|
2524
|
+
adjacency[cursor[contours.segments[2 * i + j]]++] = i;
|
|
2525
|
+
const visited = new Uint8Array(edgeCount), indices = [], offsets = [0], levels = [], closed = [];
|
|
2526
|
+
const append = (vertex) => {
|
|
2527
|
+
if (indices.length >= limits.maxIndices)
|
|
2528
|
+
throw new Error("Terrain contour path index capacity exceeded");
|
|
2529
|
+
indices.push(vertex);
|
|
2530
|
+
};
|
|
2531
|
+
const trace = (start, firstEdge) => {
|
|
2532
|
+
if (levels.length >= limits.maxPaths)
|
|
2533
|
+
throw new Error("Terrain contour path capacity exceeded");
|
|
2534
|
+
levels.push(assignments[start]);
|
|
2535
|
+
append(start);
|
|
2536
|
+
let vertex = start, edge = firstEdge;
|
|
2537
|
+
while (!visited[edge]) {
|
|
2538
|
+
visited[edge] = 1;
|
|
2539
|
+
const a = contours.segments[2 * edge], b = contours.segments[2 * edge + 1];
|
|
2540
|
+
vertex = vertex === a ? b : a;
|
|
2541
|
+
append(vertex);
|
|
2542
|
+
if (vertex === start || degrees[vertex] !== 2)
|
|
2543
|
+
break;
|
|
2544
|
+
const e0 = adjacency[starts[vertex]], e1 = adjacency[starts[vertex] + 1];
|
|
2545
|
+
edge = visited[e0] ? e1 : e0;
|
|
2546
|
+
}
|
|
2547
|
+
closed.push(vertex === start ? 1 : 0);
|
|
2548
|
+
offsets.push(indices.length);
|
|
2549
|
+
};
|
|
2550
|
+
for (let vertex = 0; vertex < count; vertex++)
|
|
2551
|
+
if (degrees[vertex] !== 2) {
|
|
2552
|
+
for (let j = starts[vertex]; j < starts[vertex + 1]; j++)
|
|
2553
|
+
if (!visited[adjacency[j]])
|
|
2554
|
+
trace(vertex, adjacency[j]);
|
|
2555
|
+
}
|
|
2556
|
+
for (let vertex = 0; vertex < count; vertex++)
|
|
2557
|
+
for (let j = starts[vertex]; j < starts[vertex + 1]; j++)
|
|
2558
|
+
if (!visited[adjacency[j]])
|
|
2559
|
+
trace(vertex, adjacency[j]);
|
|
2560
|
+
return {
|
|
2561
|
+
...copyContourData(contours),
|
|
2562
|
+
indices: Uint32Array.from(indices),
|
|
2563
|
+
offsets: Uint32Array.from(offsets),
|
|
2564
|
+
levelIndices: Uint32Array.from(levels),
|
|
2565
|
+
closed: Uint8Array.from(closed)
|
|
2566
|
+
};
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
// dist/terrain/contour-simplify.js
|
|
2570
|
+
function simplifyTerrainContourPaths(paths, options) {
|
|
2571
|
+
const limits = contourPathLimits(options), count = validateContourData(paths, limits);
|
|
2572
|
+
const budget = options.maxDistanceTests ?? 1e7;
|
|
2573
|
+
if (!Number.isFinite(options.maxError) || options.maxError < 0 || !Number.isSafeInteger(budget) || budget < 0)
|
|
2574
|
+
throw new Error("Invalid contour simplification error or work limit");
|
|
2575
|
+
if (!(paths.indices instanceof Uint32Array) || paths.indices.length > limits.maxIndices || !(paths.offsets instanceof Uint32Array) || paths.offsets.length < 1 || paths.offsets.length - 1 > limits.maxPaths || paths.offsets[0] !== 0 || paths.offsets[paths.offsets.length - 1] !== paths.indices.length)
|
|
2576
|
+
throw new Error("Invalid terrain contour path indices or offsets");
|
|
2577
|
+
const pathCount = paths.offsets.length - 1;
|
|
2578
|
+
if (paths.indices.length - pathCount > limits.maxSegments || !(paths.levelIndices instanceof Uint32Array) || paths.levelIndices.length !== pathCount || !(paths.closed instanceof Uint8Array) || paths.closed.length !== pathCount)
|
|
2579
|
+
throw new Error("Invalid terrain contour path metadata or segment capacity");
|
|
2580
|
+
const uses = new Uint32Array(count), assignments = new Uint32Array(count).fill(4294967295);
|
|
2581
|
+
for (let p = 0; p < pathCount; p++) {
|
|
2582
|
+
const start = paths.offsets[p], end = paths.offsets[p + 1], closed = paths.closed[p];
|
|
2583
|
+
if (end > paths.indices.length || end < start || closed > 1 || end - start < (closed ? 4 : 2) || Boolean(closed) !== (paths.indices[start] === paths.indices[end - 1]))
|
|
2584
|
+
throw new Error("Invalid terrain contour path closure");
|
|
2585
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2586
|
+
for (let i = start; i < end; i++) {
|
|
2587
|
+
const vertex = paths.indices[i];
|
|
2588
|
+
validateContourVertex(paths, vertex, paths.levelIndices[p], assignments);
|
|
2589
|
+
if (i > start) {
|
|
2590
|
+
const previous = paths.indices[i - 1];
|
|
2591
|
+
if (paths.positions[3 * previous] === paths.positions[3 * vertex] && paths.positions[3 * previous + 1] === paths.positions[3 * vertex + 1])
|
|
2592
|
+
throw new Error("Degenerate terrain contour path edge");
|
|
2593
|
+
}
|
|
2594
|
+
if (closed && i === end - 1)
|
|
2595
|
+
continue;
|
|
2596
|
+
if (seen.has(vertex))
|
|
2597
|
+
throw new Error("Repeated interior terrain contour path vertex");
|
|
2598
|
+
seen.add(vertex);
|
|
2599
|
+
uses[vertex]++;
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
const keep = new Uint8Array(paths.indices.length);
|
|
2603
|
+
let distanceTests = 0, maxDeviation = 0;
|
|
2604
|
+
for (let p = 0; p < pathCount; p++) {
|
|
2605
|
+
const start = paths.offsets[p], end = paths.offsets[p + 1] - 1;
|
|
2606
|
+
keep[start] = keep[end] = 1;
|
|
2607
|
+
if (paths.closed[p]) {
|
|
2608
|
+
keep[start + Math.floor((end - start) / 3)] = 1;
|
|
2609
|
+
keep[start + Math.floor(2 * (end - start) / 3)] = 1;
|
|
2610
|
+
}
|
|
2611
|
+
for (let i = start; i <= end; i++)
|
|
2612
|
+
if (uses[paths.indices[i]] > 1)
|
|
2613
|
+
keep[i] = 1;
|
|
2614
|
+
const stack = [];
|
|
2615
|
+
let previous = start;
|
|
2616
|
+
for (let i = start + 1; i <= end; i++)
|
|
2617
|
+
if (keep[i]) {
|
|
2618
|
+
stack.push(previous, i);
|
|
2619
|
+
previous = i;
|
|
2620
|
+
}
|
|
2621
|
+
while (stack.length) {
|
|
2622
|
+
const b = stack.pop(), a = stack.pop();
|
|
2623
|
+
let farthest = -1, maximum = 0;
|
|
2624
|
+
for (let i = a + 1; i < b; i++) {
|
|
2625
|
+
if (distanceTests++ === budget)
|
|
2626
|
+
throw new Error("Terrain contour simplification work budget exceeded");
|
|
2627
|
+
const distance = pointSegmentDistance(paths.positions, paths.indices[i], paths.indices[a], paths.indices[b]);
|
|
2628
|
+
if (distance > maximum) {
|
|
2629
|
+
maximum = distance;
|
|
2630
|
+
farthest = i;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
const va = paths.indices[a], vb = paths.indices[b];
|
|
2634
|
+
const collapsed = paths.positions[3 * va] === paths.positions[3 * vb] && paths.positions[3 * va + 1] === paths.positions[3 * vb + 1];
|
|
2635
|
+
if (maximum > options.maxError || collapsed && farthest >= 0) {
|
|
2636
|
+
keep[farthest] = 1;
|
|
2637
|
+
stack.push(a, farthest, farthest, b);
|
|
2638
|
+
} else
|
|
2639
|
+
maxDeviation = Math.max(maxDeviation, maximum);
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
const selected = new Uint8Array(count);
|
|
2643
|
+
for (let i = 0; i < keep.length; i++)
|
|
2644
|
+
if (keep[i])
|
|
2645
|
+
selected[paths.indices[i]] = 1;
|
|
2646
|
+
const vertices = [];
|
|
2647
|
+
for (let i = 0; i < count; i++)
|
|
2648
|
+
if (selected[i])
|
|
2649
|
+
vertices.push(i);
|
|
2650
|
+
const mapping = new Uint32Array(count), positions = new Float64Array(vertices.length * 3), gridCoordinates = new Float64Array(vertices.length * 2);
|
|
2651
|
+
for (let i = 0; i < vertices.length; i++) {
|
|
2652
|
+
const source = vertices[i];
|
|
2653
|
+
mapping[source] = i;
|
|
2654
|
+
positions.set(paths.positions.subarray(3 * source, 3 * source + 3), 3 * i);
|
|
2655
|
+
gridCoordinates.set(paths.gridCoordinates.subarray(2 * source, 2 * source + 2), 2 * i);
|
|
2656
|
+
}
|
|
2657
|
+
const indices = [], offsets = [0];
|
|
2658
|
+
for (let p = 0; p < pathCount; p++) {
|
|
2659
|
+
for (let i = paths.offsets[p]; i < paths.offsets[p + 1]; i++)
|
|
2660
|
+
if (keep[i])
|
|
2661
|
+
indices.push(mapping[paths.indices[i]]);
|
|
2662
|
+
offsets.push(indices.length);
|
|
2663
|
+
}
|
|
2664
|
+
return {
|
|
2665
|
+
positions,
|
|
2666
|
+
gridCoordinates,
|
|
2667
|
+
indices: Uint32Array.from(indices),
|
|
2668
|
+
offsets: Uint32Array.from(offsets),
|
|
2669
|
+
levelIndices: paths.levelIndices.slice(),
|
|
2670
|
+
closed: paths.closed.slice(),
|
|
2671
|
+
levels: paths.levels.slice(),
|
|
2672
|
+
origin: Object.freeze([...paths.origin]),
|
|
2673
|
+
heightReference: paths.heightReference,
|
|
2674
|
+
sourceVertexIndices: Uint32Array.from(vertices),
|
|
2675
|
+
requestedMaxError: options.maxError,
|
|
2676
|
+
maxDeviation,
|
|
2677
|
+
distanceTests
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
function pointSegmentDistance(positions, p, a, b) {
|
|
2681
|
+
const dx = positions[3 * b] - positions[3 * a], dy = positions[3 * b + 1] - positions[3 * a + 1];
|
|
2682
|
+
const px = positions[3 * p] - positions[3 * a], py = positions[3 * p + 1] - positions[3 * a + 1];
|
|
2683
|
+
const length = Math.hypot(dx, dy);
|
|
2684
|
+
if (!Number.isFinite(length) || !Number.isFinite(px) || !Number.isFinite(py))
|
|
2685
|
+
throw new Error("Terrain contour distance arithmetic overflow");
|
|
2686
|
+
const projection = length ? px * (dx / length) + py * (dy / length) : 0;
|
|
2687
|
+
const t = length ? Math.max(0, Math.min(1, projection / length)) : 0;
|
|
2688
|
+
const distance = Math.hypot(px - dx * t, py - dy * t);
|
|
2689
|
+
if (!Number.isFinite(distance))
|
|
2690
|
+
throw new Error("Terrain contour distance arithmetic overflow");
|
|
2691
|
+
return distance;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
// dist/terrain/profile-measure.js
|
|
2695
|
+
function measureTerrainProfile(profile, options = {}) {
|
|
2696
|
+
const limit = options.maxSamples ?? 1e6;
|
|
2697
|
+
if (!Number.isSafeInteger(limit) || limit < 0 || !(profile.distances instanceof Float64Array) || profile.distances.length < 1 || profile.distances.length > limit)
|
|
2698
|
+
throw new Error("Invalid terrain profile sample capacity");
|
|
2699
|
+
const count = profile.distances.length;
|
|
2700
|
+
if (!(profile.positions instanceof Float64Array) || profile.positions.length !== 2 * count || !profile.positions.every(Number.isFinite) || !(profile.heights instanceof Float64Array) || profile.heights.length !== count || !(profile.statuses instanceof Uint8Array) || profile.statuses.length !== count)
|
|
2701
|
+
throw new Error("Invalid terrain profile buffers");
|
|
2702
|
+
if (!Number.isFinite(profile.length) || profile.length < 0 || profile.distances[0] !== 0 || profile.distances[count - 1] !== profile.length)
|
|
2703
|
+
throw new Error("Invalid terrain profile stationing");
|
|
2704
|
+
let validSampleCount = 0, minimum = Infinity, maximum = -Infinity, coveredSegmentCount = 0, missingSegmentCount = 0;
|
|
2705
|
+
let meanHeight = 0;
|
|
2706
|
+
const sums = new Float64Array(6), corrections = new Float64Array(6);
|
|
2707
|
+
const add = (index, value) => {
|
|
2708
|
+
const y = value - corrections[index], next = sums[index] + y;
|
|
2709
|
+
if (!Number.isFinite(value) || !Number.isFinite(next))
|
|
2710
|
+
throw new Error("Terrain profile measurement arithmetic overflow");
|
|
2711
|
+
corrections[index] = next - sums[index] - y;
|
|
2712
|
+
sums[index] = next;
|
|
2713
|
+
};
|
|
2714
|
+
for (let i = 0; i < count; i++) {
|
|
2715
|
+
const distance = profile.distances[i], status = profile.statuses[i], height = profile.heights[i];
|
|
2716
|
+
if (!Number.isFinite(distance) || i > 0 && distance <= profile.distances[i - 1])
|
|
2717
|
+
throw new Error("Invalid terrain profile stationing");
|
|
2718
|
+
if (status > TerrainSampleStatus.NOT_RESIDENT)
|
|
2719
|
+
throw new Error("Invalid terrain profile status");
|
|
2720
|
+
if (status === TerrainSampleStatus.VALID) {
|
|
2721
|
+
if (!Number.isFinite(height))
|
|
2722
|
+
throw new Error("Invalid terrain profile height");
|
|
2723
|
+
validSampleCount++;
|
|
2724
|
+
minimum = Math.min(minimum, height);
|
|
2725
|
+
maximum = Math.max(maximum, height);
|
|
2726
|
+
}
|
|
2727
|
+
if (i === 0)
|
|
2728
|
+
continue;
|
|
2729
|
+
const ds = distance - profile.distances[i - 1];
|
|
2730
|
+
if (status !== TerrainSampleStatus.VALID || profile.statuses[i - 1] !== TerrainSampleStatus.VALID) {
|
|
2731
|
+
missingSegmentCount++;
|
|
2732
|
+
add(1, ds);
|
|
2733
|
+
continue;
|
|
2734
|
+
}
|
|
2735
|
+
coveredSegmentCount++;
|
|
2736
|
+
const previousCovered = sums[0];
|
|
2737
|
+
add(0, ds);
|
|
2738
|
+
const previous = profile.heights[i - 1], dh = height - previous;
|
|
2739
|
+
add(dh >= 0 ? 2 : 3, Math.abs(dh));
|
|
2740
|
+
add(4, Math.hypot(ds, dh));
|
|
2741
|
+
const average = previous + dh / 2;
|
|
2742
|
+
add(5, average * ds);
|
|
2743
|
+
if (previousCovered === 0)
|
|
2744
|
+
meanHeight = average;
|
|
2745
|
+
else {
|
|
2746
|
+
const newWeight = ds / sums[0];
|
|
2747
|
+
const delta = average - meanHeight;
|
|
2748
|
+
meanHeight = Number.isFinite(delta) ? newWeight <= 0.5 ? meanHeight + weighted(delta, ds, sums[0]) : average - weighted(delta, previousCovered, sums[0]) : weighted(meanHeight, previousCovered, sums[0]) + weighted(average, ds, sums[0]);
|
|
2749
|
+
if (!Number.isFinite(meanHeight))
|
|
2750
|
+
throw new Error("Terrain profile measurement arithmetic overflow");
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
return {
|
|
2754
|
+
length: profile.length,
|
|
2755
|
+
coveredLength: sums[0],
|
|
2756
|
+
missingLength: sums[1],
|
|
2757
|
+
coveredSegmentCount,
|
|
2758
|
+
missingSegmentCount,
|
|
2759
|
+
validSampleCount,
|
|
2760
|
+
minimumHeight: validSampleCount ? minimum : void 0,
|
|
2761
|
+
maximumHeight: validSampleCount ? maximum : void 0,
|
|
2762
|
+
ascent: sums[2],
|
|
2763
|
+
descent: sums[3],
|
|
2764
|
+
surfaceLength: sums[4],
|
|
2765
|
+
heightIntegral: sums[5],
|
|
2766
|
+
meanHeight: sums[0] ? meanHeight : void 0,
|
|
2767
|
+
complete: validSampleCount === count
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
function weighted(value, part, total) {
|
|
2771
|
+
const ratio = part / total;
|
|
2772
|
+
if (ratio < Number.MIN_VALUE / Number.EPSILON) {
|
|
2773
|
+
const product = value * part;
|
|
2774
|
+
if (Number.isFinite(product) && product !== 0)
|
|
2775
|
+
return product / total;
|
|
2776
|
+
}
|
|
2777
|
+
return value * ratio;
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
// dist/terrain/vertex-tiles.js
|
|
2781
|
+
function reconcileTerrainVertexTiles(tiles, options) {
|
|
2782
|
+
const { width, height } = options;
|
|
2783
|
+
const maxTiles = options.maxTiles ?? 4096, maxSamples = options.maxSamples ?? 4e6;
|
|
2784
|
+
const tolerance = options.maxHeightDifference ?? 0;
|
|
2785
|
+
if (![width, height, maxTiles, maxSamples].every(Number.isSafeInteger) || width < 2 || height < 2 || maxTiles < 0 || maxSamples < 0 || tiles.length > maxTiles || !Number.isSafeInteger(width * height * tiles.length) || width * height * tiles.length > maxSamples || !Number.isFinite(tolerance) || tolerance < 0)
|
|
2786
|
+
throw new Error("Invalid vertex tile dimensions, capacity or height tolerance");
|
|
2787
|
+
const origin = options.origin ?? [0, 0], columnStep = options.columnStep ?? [1, 0], rowStep = options.rowStep ?? [0, 1];
|
|
2788
|
+
for (const vector of [origin, columnStep, rowStep])
|
|
2789
|
+
if (vector.length !== 2 || !vector.every(Number.isFinite))
|
|
2790
|
+
throw new Error("Invalid vertex tile transform");
|
|
2791
|
+
const determinant = columnStep[0] * rowStep[1] - columnStep[1] * rowStep[0];
|
|
2792
|
+
if (!Number.isFinite(determinant) || Math.abs(determinant) <= Number.EPSILON * Math.hypot(...columnStep) * Math.hypot(...rowStep))
|
|
2793
|
+
throw new Error("Singular vertex tile transform");
|
|
2794
|
+
const heightReference = options.heightReference ?? "unknown";
|
|
2795
|
+
if (typeof heightReference !== "string")
|
|
2796
|
+
throw new Error("Invalid vertex tile height reference");
|
|
2797
|
+
const sorted = [...tiles].sort((a, b) => a.column - b.column || a.row - b.row);
|
|
2798
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2799
|
+
const shared = /* @__PURE__ */ new Map();
|
|
2800
|
+
const result = [];
|
|
2801
|
+
for (const tile of sorted) {
|
|
2802
|
+
const key = `${tile.column},${tile.row}`;
|
|
2803
|
+
if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row) || seen.has(key))
|
|
2804
|
+
throw new Error("Invalid or duplicate vertex tile address");
|
|
2805
|
+
seen.add(key);
|
|
2806
|
+
const x = tile.column * (width - 1), y = tile.row * (height - 1);
|
|
2807
|
+
if (![x, y, x + width - 1, y + height - 1].every(Number.isSafeInteger))
|
|
2808
|
+
throw new Error("Vertex tile lattice overflow");
|
|
2809
|
+
if (!(tile.heights instanceof Float32Array || tile.heights instanceof Float64Array) || tile.heights.length !== width * height || tile.validity !== void 0 && (!(tile.validity instanceof Uint8Array) || tile.validity.length !== width * height))
|
|
2810
|
+
throw new Error("Invalid vertex tile buffers");
|
|
2811
|
+
const heights = Float64Array.from(tile.heights), validity = new Uint8Array(heights.length);
|
|
2812
|
+
const tileOrigin = [
|
|
2813
|
+
origin[0] + x * columnStep[0] + y * rowStep[0],
|
|
2814
|
+
origin[1] + x * columnStep[1] + y * rowStep[1]
|
|
2815
|
+
];
|
|
2816
|
+
if (!tileOrigin.every(Number.isFinite))
|
|
2817
|
+
throw new Error("Vertex tile coordinate overflow");
|
|
2818
|
+
const index = result.length;
|
|
2819
|
+
result.push({
|
|
2820
|
+
column: tile.column,
|
|
2821
|
+
row: tile.row,
|
|
2822
|
+
field: {
|
|
2823
|
+
width,
|
|
2824
|
+
height,
|
|
2825
|
+
heights,
|
|
2826
|
+
validity,
|
|
2827
|
+
origin: tileOrigin,
|
|
2828
|
+
columnStep: [...columnStep],
|
|
2829
|
+
rowStep: [...rowStep],
|
|
2830
|
+
registration: "vertex",
|
|
2831
|
+
heightReference
|
|
2832
|
+
}
|
|
2833
|
+
});
|
|
2834
|
+
for (let r = 0; r < height; r++)
|
|
2835
|
+
for (let c = 0; c < width; c++) {
|
|
2836
|
+
const i = r * width + c, valid = Number.isFinite(heights[i]) && (!tile.validity || tile.validity[i] !== 0);
|
|
2837
|
+
validity[i] = Number(valid);
|
|
2838
|
+
if (!valid)
|
|
2839
|
+
heights[i] = 0;
|
|
2840
|
+
if (r !== 0 && c !== 0 && r !== height - 1 && c !== width - 1)
|
|
2841
|
+
continue;
|
|
2842
|
+
const address = `${x + c},${y + r}`;
|
|
2843
|
+
let vertex = shared.get(address);
|
|
2844
|
+
if (!vertex) {
|
|
2845
|
+
vertex = {
|
|
2846
|
+
height: heights[i],
|
|
2847
|
+
valid,
|
|
2848
|
+
min: valid ? heights[i] : Infinity,
|
|
2849
|
+
max: valid ? heights[i] : -Infinity,
|
|
2850
|
+
copies: []
|
|
2851
|
+
};
|
|
2852
|
+
shared.set(address, vertex);
|
|
2853
|
+
} else {
|
|
2854
|
+
vertex.valid && (vertex.valid = valid);
|
|
2855
|
+
if (valid) {
|
|
2856
|
+
vertex.min = Math.min(vertex.min, heights[i]);
|
|
2857
|
+
vertex.max = Math.max(vertex.max, heights[i]);
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
vertex.copies.push([index, i]);
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
let sharedVertices = 0, maxHeightDifference = 0;
|
|
2864
|
+
for (const vertex of shared.values()) {
|
|
2865
|
+
if (vertex.copies.length < 2)
|
|
2866
|
+
continue;
|
|
2867
|
+
sharedVertices++;
|
|
2868
|
+
const difference2 = vertex.min === Infinity ? 0 : vertex.max - vertex.min;
|
|
2869
|
+
if (!Number.isFinite(difference2) || difference2 > tolerance)
|
|
2870
|
+
throw new Error("Shared vertex height disagreement exceeds tolerance");
|
|
2871
|
+
maxHeightDifference = Math.max(maxHeightDifference, difference2);
|
|
2872
|
+
for (const [tile, i] of vertex.copies) {
|
|
2873
|
+
result[tile].field.heights[i] = vertex.valid ? vertex.height : 0;
|
|
2874
|
+
result[tile].field.validity[i] = Number(vertex.valid);
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
return { tiles: result, sharedVertices, maxHeightDifference };
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
// dist/terrain/mesh-stitch.js
|
|
2881
|
+
function stitchTerrainMeshEdges(a, edgeA, b, edgeB, options = {}) {
|
|
2882
|
+
const maxVertices = options.maxVertices ?? 2e6, maxTriangles = options.maxTriangles ?? 4e6, maxBoundary = options.maxBoundaryVertices ?? 1e5;
|
|
2883
|
+
const tolerance = options.coordinateTolerance ?? 1e-8, heightLimit = options.maxHeightAdjustment ?? 0;
|
|
2884
|
+
if (![maxVertices, maxTriangles, maxBoundary].every((n) => Number.isSafeInteger(n) && n >= 0 && n <= 4294967294) || !Number.isFinite(tolerance) || tolerance < 0 || !Number.isFinite(heightLimit) || heightLimit < 0)
|
|
2885
|
+
throw new Error("Invalid terrain stitching limits");
|
|
2886
|
+
const prepare = (mesh, side, range) => {
|
|
2887
|
+
if (range.length !== 2 || !range.every(Number.isFinite) || range[0] < 0 || range[1] > 1 || range[1] <= range[0])
|
|
2888
|
+
throw new Error("Invalid stitching side range");
|
|
2889
|
+
if (!["minColumn", "maxColumn", "minRow", "maxRow"].includes(side) || !Number.isSafeInteger(mesh.width) || !Number.isSafeInteger(mesh.height) || mesh.width < 2 || mesh.height < 2 || !(mesh.positions instanceof Float64Array) || mesh.positions.length % 3 || mesh.positions.length / 3 > maxVertices || !(mesh.indices instanceof Uint32Array) || mesh.indices.length % 3 || mesh.indices.length / 3 > maxTriangles || !(mesh.gridCoordinates instanceof Float64Array || mesh.gridCoordinates instanceof Uint32Array) || mesh.gridCoordinates.length !== mesh.positions.length / 3 * 2 || mesh.origin.length !== 3 || !mesh.origin.every(Number.isFinite) || !mesh.positions.every(Number.isFinite) || typeof mesh.heightReference !== "string")
|
|
2890
|
+
throw new Error("Invalid terrain stitching mesh");
|
|
2891
|
+
const positions = mesh.positions.slice();
|
|
2892
|
+
for (let i = 0; i < positions.length; i++)
|
|
2893
|
+
positions[i] += mesh.origin[i % 3] - a.origin[i % 3];
|
|
2894
|
+
if (!positions.every(Number.isFinite))
|
|
2895
|
+
throw new Error("Terrain stitching coordinate overflow");
|
|
2896
|
+
const axis = side.endsWith("Column") ? 0 : 1, extent = axis ? mesh.height - 1 : mesh.width - 1, along = axis ? mesh.width - 1 : mesh.height - 1;
|
|
2897
|
+
const value = side.startsWith("min") ? 0 : extent;
|
|
2898
|
+
const used = /* @__PURE__ */ new Set();
|
|
2899
|
+
for (let i = 0; i < mesh.gridCoordinates.length; i += 2)
|
|
2900
|
+
if (!Number.isFinite(mesh.gridCoordinates[i]) || !Number.isFinite(mesh.gridCoordinates[i + 1]) || mesh.gridCoordinates[i] < 0 || mesh.gridCoordinates[i] > mesh.width - 1 || mesh.gridCoordinates[i + 1] < 0 || mesh.gridCoordinates[i + 1] > mesh.height - 1)
|
|
2901
|
+
throw new Error("Invalid stitching grid coordinates");
|
|
2902
|
+
for (let i = 0; i < mesh.indices.length; i += 3) {
|
|
2903
|
+
const ids2 = [mesh.indices[i], mesh.indices[i + 1], mesh.indices[i + 2]];
|
|
2904
|
+
for (const id of ids2) {
|
|
2905
|
+
if (id >= positions.length / 3)
|
|
2906
|
+
throw new Error("Stitching index out of range");
|
|
2907
|
+
if (mesh.gridCoordinates[2 * id + axis] === value)
|
|
2908
|
+
used.add(id);
|
|
2909
|
+
}
|
|
2910
|
+
const [p, q, r] = ids2.map((id) => id * 3);
|
|
2911
|
+
const area = (positions[q] - positions[p]) * (positions[r + 1] - positions[p + 1]) - (positions[q + 1] - positions[p + 1]) * (positions[r] - positions[p]);
|
|
2912
|
+
if (!Number.isFinite(area) || area <= 0)
|
|
2913
|
+
throw new Error("Stitching requires positive nondegenerate XY triangles");
|
|
2914
|
+
}
|
|
2915
|
+
if (used.size < 2 || used.size > maxBoundary)
|
|
2916
|
+
throw new Error("Invalid stitching boundary capacity");
|
|
2917
|
+
const ids = [...used].sort((u, v) => mesh.gridCoordinates[2 * u + 1 - axis] - mesh.gridCoordinates[2 * v + 1 - axis]);
|
|
2918
|
+
const ts2 = ids.map((id) => mesh.gridCoordinates[2 * id + 1 - axis] / along);
|
|
2919
|
+
if (ts2[0] !== 0 || ts2[ts2.length - 1] !== 1 || ts2.some((t, i) => i > 0 && t <= ts2[i - 1]))
|
|
2920
|
+
throw new Error("Stitching requires a complete unique side");
|
|
2921
|
+
const pairs = /* @__PURE__ */ new Map();
|
|
2922
|
+
for (let i = 1; i < ids.length; i++)
|
|
2923
|
+
pairs.set(pair(ids[i - 1], ids[i]), 0);
|
|
2924
|
+
let direction = 0;
|
|
2925
|
+
for (let i = 0; i < mesh.indices.length; i += 3)
|
|
2926
|
+
for (let j = 0; j < 3; j++) {
|
|
2927
|
+
const u = mesh.indices[i + j], v = mesh.indices[i + (j + 1) % 3], key = pair(u, v);
|
|
2928
|
+
if (pairs.has(key)) {
|
|
2929
|
+
pairs.set(key, pairs.get(key) + 1);
|
|
2930
|
+
const nextDirection = Math.sign(mesh.gridCoordinates[2 * v + 1 - axis] - mesh.gridCoordinates[2 * u + 1 - axis]);
|
|
2931
|
+
if (direction && direction !== nextDirection)
|
|
2932
|
+
throw new Error("Inconsistent stitching boundary orientation");
|
|
2933
|
+
direction = nextDirection;
|
|
2934
|
+
} else if (used.has(u) && used.has(v))
|
|
2935
|
+
throw new Error("Nonconforming input boundary");
|
|
2936
|
+
}
|
|
2937
|
+
if ([...pairs.values()].some((count) => count !== 1))
|
|
2938
|
+
throw new Error("Stitching boundary has holes or nonmanifold edges");
|
|
2939
|
+
return {
|
|
2940
|
+
mesh,
|
|
2941
|
+
positions,
|
|
2942
|
+
ids,
|
|
2943
|
+
ts: ts2.map((t) => (t - range[0]) / (range[1] - range[0])),
|
|
2944
|
+
axis,
|
|
2945
|
+
along,
|
|
2946
|
+
value,
|
|
2947
|
+
direction,
|
|
2948
|
+
range
|
|
2949
|
+
};
|
|
2950
|
+
};
|
|
2951
|
+
const pa = prepare(a, edgeA, options.rangeA ?? [0, 1]), pb = prepare(b, edgeB, options.rangeB ?? [0, 1]);
|
|
2952
|
+
if (a.heightReference !== b.heightReference)
|
|
2953
|
+
throw new Error("Stitching height references differ");
|
|
2954
|
+
const endpoint = (p, t) => {
|
|
2955
|
+
let i = 0;
|
|
2956
|
+
while (i + 1 < p.ts.length - 1 && t > p.ts[i + 1])
|
|
2957
|
+
i++;
|
|
2958
|
+
const f = (t - p.ts[i]) / (p.ts[i + 1] - p.ts[i]);
|
|
2959
|
+
return [0, 1, 2].map((k) => {
|
|
2960
|
+
const z0 = p.positions[3 * p.ids[i] + k], z1 = p.positions[3 * p.ids[i + 1] + k];
|
|
2961
|
+
return f === 0 ? z0 : f === 1 ? z1 : z0 + (z1 - z0) * f;
|
|
2962
|
+
});
|
|
2963
|
+
};
|
|
2964
|
+
const first = endpoint(pa, 0), last = endpoint(pa, 1);
|
|
2965
|
+
const xyDistance = (p, q) => Math.hypot(p[0] - q[0], p[1] - q[1]);
|
|
2966
|
+
const reversed = xyDistance(first, endpoint(pb, 0)) > tolerance;
|
|
2967
|
+
if (reversed) {
|
|
2968
|
+
pb.ids.reverse();
|
|
2969
|
+
pb.ts = pb.ts.reverse().map((t) => 1 - t);
|
|
2970
|
+
pb.direction *= -1;
|
|
2971
|
+
}
|
|
2972
|
+
const canonicalize = (values, anchors) => {
|
|
2973
|
+
let cursor = 0;
|
|
2974
|
+
const result = values.map((t) => {
|
|
2975
|
+
while (cursor + 1 < anchors.length && anchors[cursor + 1] <= t)
|
|
2976
|
+
cursor++;
|
|
2977
|
+
let nearest = anchors[cursor];
|
|
2978
|
+
if (cursor + 1 < anchors.length && Math.abs(anchors[cursor + 1] - t) < Math.abs(nearest - t))
|
|
2979
|
+
nearest = anchors[cursor + 1];
|
|
2980
|
+
return Math.abs(t - nearest) <= 8 * Number.EPSILON * Math.max(1, Math.abs(t)) ? nearest : t;
|
|
2981
|
+
});
|
|
2982
|
+
if (result.some((t, i) => i > 0 && t <= result[i - 1]))
|
|
2983
|
+
throw new Error("Stitching knots are numerically indistinguishable");
|
|
2984
|
+
return result;
|
|
2985
|
+
};
|
|
2986
|
+
pa.ts = canonicalize(pa.ts, [0, 1]);
|
|
2987
|
+
pb.ts = canonicalize(pb.ts, [.../* @__PURE__ */ new Set([0, 1, ...pa.ts])].sort((x, y) => x - y));
|
|
2988
|
+
if (xyDistance(first, endpoint(pb, 0)) > tolerance || xyDistance(last, endpoint(pb, 1)) > tolerance || pa.direction === pb.direction)
|
|
2989
|
+
throw new Error("Stitching sides must coincide and have opposite interiors");
|
|
2990
|
+
const startX = first[0], startY = first[1], dx = last[0] - startX, dy = last[1] - startY;
|
|
2991
|
+
if (!Number.isFinite(Math.hypot(dx, dy)) || Math.hypot(dx, dy) === 0)
|
|
2992
|
+
throw new Error("Invalid stitching side length");
|
|
2993
|
+
for (const p of [pa, pb])
|
|
2994
|
+
for (let i = 0; i < p.ids.length; i++)
|
|
2995
|
+
if (Math.hypot(p.positions[3 * p.ids[i]] - (startX + dx * p.ts[i]), p.positions[3 * p.ids[i] + 1] - (startY + dy * p.ts[i])) > tolerance)
|
|
2996
|
+
throw new Error("Stitching requires straight affine sides");
|
|
2997
|
+
const ts = [...new Set([0, 1, ...pa.ts, ...pb.ts].filter((t) => t >= 0 && t <= 1))].sort((u, v) => u - v);
|
|
2998
|
+
if (ts.length > maxBoundary)
|
|
2999
|
+
throw new Error("Stitching boundary capacity exceeded");
|
|
3000
|
+
const xyz = new Float64Array(ts.length * 3);
|
|
3001
|
+
let segment = 0, maxHeightAdjustment = 0;
|
|
3002
|
+
for (let i = 0; i < ts.length; i++) {
|
|
3003
|
+
while (segment + 1 < pa.ts.length - 1 && ts[i] > pa.ts[segment + 1])
|
|
3004
|
+
segment++;
|
|
3005
|
+
const fraction = (ts[i] - pa.ts[segment]) / (pa.ts[segment + 1] - pa.ts[segment]);
|
|
3006
|
+
for (let k = 0; k < 3; k++) {
|
|
3007
|
+
const v0 = pa.positions[3 * pa.ids[segment] + k], v1 = pa.positions[3 * pa.ids[segment + 1] + k];
|
|
3008
|
+
xyz[3 * i + k] = fraction === 0 ? v0 : fraction === 1 ? v1 : v0 + (v1 - v0) * fraction;
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
if (!xyz.every(Number.isFinite))
|
|
3012
|
+
throw new Error("Stitching interpolation overflow");
|
|
3013
|
+
segment = 0;
|
|
3014
|
+
for (let i = 0; i < ts.length; i++) {
|
|
3015
|
+
while (segment + 1 < pb.ts.length - 1 && ts[i] > pb.ts[segment + 1])
|
|
3016
|
+
segment++;
|
|
3017
|
+
const t = (ts[i] - pb.ts[segment]) / (pb.ts[segment + 1] - pb.ts[segment]);
|
|
3018
|
+
const z0 = pb.positions[3 * pb.ids[segment] + 2], z1 = pb.positions[3 * pb.ids[segment + 1] + 2];
|
|
3019
|
+
const z = t === 0 ? z0 : t === 1 ? z1 : z0 + (z1 - z0) * t;
|
|
3020
|
+
const adjustment = Math.abs(z - xyz[3 * i + 2]);
|
|
3021
|
+
if (!Number.isFinite(adjustment) || adjustment > heightLimit)
|
|
3022
|
+
throw new Error("Stitching height adjustment exceeds limit");
|
|
3023
|
+
maxHeightAdjustment = Math.max(maxHeightAdjustment, adjustment);
|
|
3024
|
+
}
|
|
3025
|
+
const rebuild = (p, reverse) => {
|
|
3026
|
+
const lookup = new Map(p.ts.map((t, i) => [t, p.ids[i]]));
|
|
3027
|
+
const added = ts.filter((t) => !lookup.has(t)).length;
|
|
3028
|
+
if (p.ids.length + added > maxBoundary)
|
|
3029
|
+
throw new Error("Stitching output boundary capacity exceeded");
|
|
3030
|
+
if (p.positions.length / 3 + added > maxVertices || p.mesh.indices.length / 3 + added > maxTriangles)
|
|
3031
|
+
throw new Error("Stitching output capacity exceeded");
|
|
3032
|
+
const positions = new Float64Array(p.positions.length + 3 * added), gridCoordinates = new Float64Array(p.mesh.gridCoordinates.length + 2 * added);
|
|
3033
|
+
positions.set(p.positions);
|
|
3034
|
+
gridCoordinates.set(p.mesh.gridCoordinates);
|
|
3035
|
+
const seam = new Uint32Array(ts.length);
|
|
3036
|
+
let next = p.positions.length / 3;
|
|
3037
|
+
for (let i = 0; i < ts.length; i++) {
|
|
3038
|
+
const existing = lookup.get(ts[i]), id = existing ?? next++;
|
|
3039
|
+
positions.set(xyz.subarray(3 * i, 3 * i + 3), 3 * id);
|
|
3040
|
+
if (existing === void 0) {
|
|
3041
|
+
gridCoordinates[2 * id + p.axis] = p.value;
|
|
3042
|
+
gridCoordinates[2 * id + 1 - p.axis] = (p.range[0] + (reverse ? 1 - ts[i] : ts[i]) * (p.range[1] - p.range[0])) * p.along;
|
|
3043
|
+
}
|
|
3044
|
+
seam[i] = id;
|
|
3045
|
+
lookup.set(ts[i], id);
|
|
3046
|
+
}
|
|
3047
|
+
const splits = /* @__PURE__ */ new Map();
|
|
3048
|
+
const allTs = [...lookup.keys()].sort((x, y) => x - y);
|
|
3049
|
+
let cursor = 0;
|
|
3050
|
+
for (let i = 1; i < p.ids.length; i++) {
|
|
3051
|
+
const list = [lookup.get(allTs[cursor++])];
|
|
3052
|
+
while (cursor < allTs.length && allTs[cursor] <= p.ts[i])
|
|
3053
|
+
list.push(lookup.get(allTs[cursor++]));
|
|
3054
|
+
cursor--;
|
|
3055
|
+
splits.set(pair(p.ids[i - 1], p.ids[i]), list);
|
|
3056
|
+
}
|
|
3057
|
+
const indices = [];
|
|
3058
|
+
for (let i = 0; i < p.mesh.indices.length; i += 3) {
|
|
3059
|
+
let split = false;
|
|
3060
|
+
for (let j = 0; j < 3; j++) {
|
|
3061
|
+
const u = p.mesh.indices[i + j], v = p.mesh.indices[i + (j + 1) % 3], w = p.mesh.indices[i + (j + 2) % 3];
|
|
3062
|
+
const list = splits.get(pair(u, v));
|
|
3063
|
+
if (!list || list.length === 2)
|
|
3064
|
+
continue;
|
|
3065
|
+
const ordered = list[0] === u ? list : [...list].reverse();
|
|
3066
|
+
for (let k = 1; k < ordered.length; k++)
|
|
3067
|
+
indices.push(ordered[k - 1], ordered[k], w);
|
|
3068
|
+
split = true;
|
|
3069
|
+
break;
|
|
3070
|
+
}
|
|
3071
|
+
if (!split)
|
|
3072
|
+
indices.push(p.mesh.indices[i], p.mesh.indices[i + 1], p.mesh.indices[i + 2]);
|
|
3073
|
+
}
|
|
3074
|
+
for (let i = 0; i < indices.length; i += 3) {
|
|
3075
|
+
const [u, v, w] = indices.slice(i, i + 3).map((id) => id * 3);
|
|
3076
|
+
const area = (positions[v] - positions[u]) * (positions[w + 1] - positions[u + 1]) - (positions[v + 1] - positions[u + 1]) * (positions[w] - positions[u]);
|
|
3077
|
+
if (!Number.isFinite(area) || area <= 0)
|
|
3078
|
+
throw new Error("Stitching produced a degenerate or inverted triangle");
|
|
3079
|
+
}
|
|
3080
|
+
return {
|
|
3081
|
+
mesh: {
|
|
3082
|
+
positions,
|
|
3083
|
+
gridCoordinates,
|
|
3084
|
+
indices: Uint32Array.from(indices),
|
|
3085
|
+
width: p.mesh.width,
|
|
3086
|
+
height: p.mesh.height,
|
|
3087
|
+
origin: Object.freeze([...a.origin]),
|
|
3088
|
+
heightReference: a.heightReference
|
|
3089
|
+
},
|
|
3090
|
+
seam
|
|
3091
|
+
};
|
|
3092
|
+
};
|
|
3093
|
+
const ra = rebuild(pa, false), rb = rebuild(pb, reversed);
|
|
3094
|
+
return { a: ra.mesh, b: rb.mesh, seamA: ra.seam, seamB: rb.seam, maxHeightAdjustment };
|
|
3095
|
+
}
|
|
3096
|
+
function pair(a, b) {
|
|
3097
|
+
return a < b ? `${a},${b}` : `${b},${a}`;
|
|
3098
|
+
}
|
|
3099
|
+
//# sourceMappingURL=index.cjs.map
|