@math.gl/geospatial 5.0.0-beta.9 → 5.0.0-rc.2
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/README.md +3 -3
- package/dist/crs/crs-descriptor-types.d.ts +2 -1
- package/dist/crs/crs-descriptor-types.d.ts.map +1 -1
- package/dist/crs/index.cjs +54 -0
- package/dist/crs/index.cjs.map +2 -2
- package/dist/crs/index.d.ts +1 -0
- package/dist/crs/index.d.ts.map +1 -1
- package/dist/crs/index.js +1 -0
- package/dist/crs/index.js.map +1 -1
- package/dist/crs/spatial-reference-metadata.d.ts +20 -0
- package/dist/crs/spatial-reference-metadata.d.ts.map +1 -0
- package/dist/crs/spatial-reference-metadata.js +86 -0
- package/dist/crs/spatial-reference-metadata.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 +2 -2
- package/dist/ellipsoid-helpers/ellipsoid-transform.js.map +1 -1
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js +1 -1
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js.map +1 -1
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts +1 -1
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.d.ts +2 -2
- package/dist/ellipsoid-tangent-plane.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.js +1 -1
- package/dist/ellipsoid-tangent-plane.js.map +1 -1
- package/dist/ellipsoid-transforms.d.ts +2 -2
- package/dist/ellipsoid-transforms.d.ts.map +1 -1
- package/dist/ellipsoid-transforms.js +1 -1
- package/dist/ellipsoid-transforms.js.map +1 -1
- package/dist/ellipsoid.d.ts +2 -2
- package/dist/ellipsoid.d.ts.map +1 -1
- package/dist/ellipsoid.js +2 -2
- package/dist/ellipsoid.js.map +1 -1
- package/dist/expressions.d.ts +1 -1
- package/dist/expressions.d.ts.map +1 -1
- package/dist/expressions.js +1 -1
- package/dist/expressions.js.map +1 -1
- package/dist/geodesic-buffer.d.ts +1 -1
- package/dist/geodesic-buffer.d.ts.map +1 -1
- package/dist/geodesic-path.d.ts +1 -1
- package/dist/geodesic-path.d.ts.map +1 -1
- package/dist/geometry-constructors.d.ts +6 -0
- package/dist/geometry-constructors.d.ts.map +1 -0
- package/dist/geometry-constructors.js +37 -0
- package/dist/geometry-constructors.js.map +1 -0
- package/dist/geometry-inspection.d.ts +8 -0
- package/dist/geometry-inspection.d.ts.map +1 -0
- package/dist/geometry-inspection.js +61 -0
- package/dist/geometry-inspection.js.map +1 -0
- package/dist/index.cjs +2514 -558
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +164 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -1
- package/dist/line-simplification.d.ts +4 -0
- package/dist/line-simplification.d.ts.map +1 -0
- package/dist/line-simplification.js +83 -0
- package/dist/line-simplification.js.map +1 -0
- package/dist/linear-referencing.d.ts +6 -0
- package/dist/linear-referencing.d.ts.map +1 -0
- package/dist/linear-referencing.js +74 -0
- package/dist/linear-referencing.js.map +1 -0
- package/dist/lng-lat-rectangle.d.ts +1 -1
- package/dist/lng-lat-rectangle.d.ts.map +1 -1
- package/dist/lng-lat-rectangle.js +1 -1
- package/dist/lng-lat-rectangle.js.map +1 -1
- package/dist/local-reference-frame.d.ts +3 -3
- package/dist/local-reference-frame.d.ts.map +1 -1
- package/dist/local-reference-frame.js +2 -2
- package/dist/local-reference-frame.js.map +1 -1
- 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 +1 -1
- package/dist/make-obb-from-region.js.map +1 -1
- package/dist/maps/air-ocean-mesh.js +1 -1
- package/dist/maps/air-ocean-mesh.js.map +1 -1
- package/dist/maps/myriahedral/unfold.d.ts +1 -1
- package/dist/maps/myriahedral/unfold.d.ts.map +1 -1
- package/dist/maps/myriahedral/unfold.js +1 -1
- package/dist/maps/myriahedral/unfold.js.map +1 -1
- package/dist/maps/presets.cjs +6 -6
- package/dist/maps/presets.cjs.map +2 -2
- package/dist/maps.cjs +6 -6
- package/dist/maps.cjs.map +2 -2
- package/dist/projection/deformation.cjs +5 -5
- package/dist/projection/deformation.cjs.map +2 -2
- package/dist/projection/experimental/core.cjs +8 -4
- package/dist/projection/experimental/core.cjs.map +1 -1
- package/dist/projection/experimental/crs/spatial-reference.d.ts.map +1 -1
- package/dist/projection/experimental/crs/spatial-reference.js.map +1 -1
- package/dist/projection/experimental/crs/types.d.ts +1 -1
- package/dist/projection/experimental/crs/types.d.ts.map +1 -1
- package/dist/projection/experimental/crs-rendering-scale.d.ts.map +1 -1
- package/dist/projection/experimental/crs-rendering-scale.js +13 -2
- package/dist/projection/experimental/crs-rendering-scale.js.map +1 -1
- package/dist/projection/experimental/datum.js +1 -1
- package/dist/projection/experimental/datum.js.map +1 -1
- package/dist/projection/experimental/entries/projections/geocent.cjs +3 -3
- package/dist/projection/experimental/entries/projections/geocent.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/aea.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.js +4 -1
- package/dist/projection/experimental/lazy-projections/aea.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/bonne.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.js +4 -1
- package/dist/projection/experimental/lazy-projections/bonne.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/cass.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.js +4 -1
- package/dist/projection/experimental/lazy-projections/cass.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eck6.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.js +4 -1
- package/dist/projection/experimental/lazy-projections/eck6.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eqdc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.js +4 -1
- package/dist/projection/experimental/lazy-projections/eqdc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eqearth.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.js +4 -1
- package/dist/projection/experimental/lazy-projections/eqearth.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/equi.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.js +4 -1
- package/dist/projection/experimental/lazy-projections/equi.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/geocent.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.js +4 -1
- package/dist/projection/experimental/lazy-projections/geocent.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/geos.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.js +4 -1
- package/dist/projection/experimental/lazy-projections/geos.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/gnom.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.js +4 -1
- package/dist/projection/experimental/lazy-projections/gnom.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/index.cjs +100 -27
- package/dist/projection/experimental/lazy-projections/index.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/krovak.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.js +4 -1
- package/dist/projection/experimental/lazy-projections/krovak.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/merc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.js +4 -1
- package/dist/projection/experimental/lazy-projections/merc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/mill.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.js +4 -1
- package/dist/projection/experimental/lazy-projections/mill.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/moll.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.js +4 -1
- package/dist/projection/experimental/lazy-projections/moll.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/nzmg.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.js +4 -1
- package/dist/projection/experimental/lazy-projections/nzmg.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/omerc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.js +4 -1
- package/dist/projection/experimental/lazy-projections/omerc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/ortho.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.js +4 -1
- package/dist/projection/experimental/lazy-projections/ortho.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/poly.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.js +4 -1
- package/dist/projection/experimental/lazy-projections/poly.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/robin.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.js +4 -1
- package/dist/projection/experimental/lazy-projections/robin.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/sinu.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.js +4 -1
- package/dist/projection/experimental/lazy-projections/sinu.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/stere.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.js +4 -1
- package/dist/projection/experimental/lazy-projections/stere.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/tpers.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.js +4 -1
- package/dist/projection/experimental/lazy-projections/tpers.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/vandg.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.js +4 -1
- package/dist/projection/experimental/lazy-projections/vandg.js.map +1 -1
- package/dist/projection/experimental/spatial-deformation.js +1 -1
- package/dist/projection/experimental/spatial-deformation.js.map +1 -1
- package/dist/projection/index.cjs +8 -4
- package/dist/projection/index.cjs.map +1 -1
- package/dist/projection/index.d.ts.map +1 -1
- package/dist/projection/index.js.map +1 -1
- package/dist/projection/lib/projection.js.map +1 -1
- package/dist/projection/pipeline.cjs +3 -3
- package/dist/projection/pipeline.cjs.map +1 -1
- package/dist/projection/temporal.cjs +5 -5
- package/dist/projection/temporal.cjs.map +2 -2
- package/dist/projection/transform-analysis.cjs +3 -3
- package/dist/projection/transform-analysis.cjs.map +1 -1
- package/dist/rhumb-path.d.ts +1 -1
- package/dist/rhumb-path.d.ts.map +1 -1
- package/dist/spatial-planar-intersects.d.ts +4 -0
- package/dist/spatial-planar-intersects.d.ts.map +1 -0
- package/dist/spatial-planar-intersects.js +108 -0
- package/dist/spatial-planar-intersects.js.map +1 -0
- package/dist/spatial-planar.d.ts +16 -0
- package/dist/spatial-planar.d.ts.map +1 -0
- package/dist/spatial-planar.js +240 -0
- package/dist/spatial-planar.js.map +1 -0
- package/dist/spatial-sql.d.ts +45 -0
- package/dist/spatial-sql.d.ts.map +1 -0
- package/dist/spatial-sql.js +192 -0
- package/dist/spatial-sql.js.map +1 -0
- package/dist/st-functions.cjs +1616 -0
- package/dist/st-functions.cjs.map +6 -0
- package/dist/st-functions.d.ts +307 -0
- package/dist/st-functions.d.ts.map +1 -0
- package/dist/st-functions.js +593 -0
- package/dist/st-functions.js.map +1 -0
- package/dist/subdivide-globe-mesh.js +1 -1
- package/dist/subdivide-globe-mesh.js.map +1 -1
- package/dist/tasks/index.cjs +216 -98
- package/dist/tasks/index.cjs.map +2 -2
- package/dist/tasks/terrain-residency.d.ts +9 -0
- package/dist/tasks/terrain-residency.d.ts.map +1 -1
- package/dist/tasks/terrain-residency.js +98 -19
- package/dist/tasks/terrain-residency.js.map +1 -1
- package/dist/terrain/cutout-polygons.d.ts +21 -0
- package/dist/terrain/cutout-polygons.d.ts.map +1 -0
- package/dist/terrain/cutout-polygons.js +172 -0
- package/dist/terrain/cutout-polygons.js.map +1 -0
- package/dist/terrain/cutout-region.d.ts +34 -0
- package/dist/terrain/cutout-region.d.ts.map +1 -0
- package/dist/terrain/cutout-region.js +33 -0
- package/dist/terrain/cutout-region.js.map +1 -0
- package/dist/terrain/cutout-skirts.d.ts +34 -0
- package/dist/terrain/cutout-skirts.d.ts.map +1 -0
- package/dist/terrain/cutout-skirts.js +29 -0
- package/dist/terrain/cutout-skirts.js.map +1 -0
- package/dist/terrain/depression-fill.d.ts +25 -0
- package/dist/terrain/depression-fill.d.ts.map +1 -0
- package/dist/terrain/depression-fill.js +106 -0
- package/dist/terrain/depression-fill.js.map +1 -0
- package/dist/terrain/geographic-cutout.d.ts +38 -0
- package/dist/terrain/geographic-cutout.d.ts.map +1 -0
- package/dist/terrain/geographic-cutout.js +120 -0
- package/dist/terrain/geographic-cutout.js.map +1 -0
- package/dist/terrain/geographic-lod-seams.d.ts +10 -0
- package/dist/terrain/geographic-lod-seams.d.ts.map +1 -0
- package/dist/terrain/geographic-lod-seams.js +100 -0
- package/dist/terrain/geographic-lod-seams.js.map +1 -0
- package/dist/terrain/geographic-neighbor.d.ts +18 -0
- package/dist/terrain/geographic-neighbor.d.ts.map +1 -0
- package/dist/terrain/geographic-neighbor.js +44 -0
- package/dist/terrain/geographic-neighbor.js.map +1 -0
- package/dist/terrain/geographic-poles.d.ts +24 -0
- package/dist/terrain/geographic-poles.d.ts.map +1 -0
- package/dist/terrain/geographic-poles.js +34 -0
- package/dist/terrain/geographic-poles.js.map +1 -0
- package/dist/terrain/hydrology.d.ts +42 -0
- package/dist/terrain/hydrology.d.ts.map +1 -0
- package/dist/terrain/hydrology.js +112 -0
- package/dist/terrain/hydrology.js.map +1 -0
- package/dist/terrain/index.cjs +2135 -161
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +23 -1
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +21 -0
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/lod-screen-error.d.ts +28 -0
- package/dist/terrain/lod-screen-error.d.ts.map +1 -0
- package/dist/terrain/lod-screen-error.js +95 -0
- package/dist/terrain/lod-screen-error.js.map +1 -0
- package/dist/terrain/lod-select.d.ts +26 -10
- package/dist/terrain/lod-select.d.ts.map +1 -1
- package/dist/terrain/lod-select.js +27 -14
- package/dist/terrain/lod-select.js.map +1 -1
- package/dist/terrain/lod-stitch.d.ts +2 -0
- package/dist/terrain/lod-stitch.d.ts.map +1 -1
- package/dist/terrain/lod-stitch.js +21 -6
- package/dist/terrain/lod-stitch.js.map +1 -1
- package/dist/terrain/mesh-cutout.d.ts +45 -0
- package/dist/terrain/mesh-cutout.d.ts.map +1 -0
- package/dist/terrain/mesh-cutout.js +336 -0
- package/dist/terrain/mesh-cutout.js.map +1 -0
- package/dist/terrain/mesh-skirts.d.ts +8 -2
- package/dist/terrain/mesh-skirts.d.ts.map +1 -1
- package/dist/terrain/mesh-skirts.js +5 -4
- package/dist/terrain/mesh-skirts.js.map +1 -1
- package/dist/terrain/mixed-halo-update.d.ts.map +1 -1
- package/dist/terrain/mixed-halo-update.js +58 -23
- package/dist/terrain/mixed-halo-update.js.map +1 -1
- package/dist/terrain/mixed-vertex-halos.d.ts +24 -1
- package/dist/terrain/mixed-vertex-halos.d.ts.map +1 -1
- package/dist/terrain/mixed-vertex-halos.js +75 -58
- package/dist/terrain/mixed-vertex-halos.js.map +1 -1
- package/dist/terrain/regional-viewshed.d.ts +55 -0
- package/dist/terrain/regional-viewshed.d.ts.map +1 -0
- package/dist/terrain/regional-viewshed.js +119 -0
- package/dist/terrain/regional-viewshed.js.map +1 -0
- package/dist/terrain/surface.d.ts +1 -1
- package/dist/terrain/surface.d.ts.map +1 -1
- package/dist/terrain/surface.js +1 -1
- package/dist/terrain/surface.js.map +1 -1
- package/dist/terrain/sweep-capsule.d.ts +27 -0
- package/dist/terrain/sweep-capsule.d.ts.map +1 -0
- package/dist/terrain/sweep-capsule.js +104 -0
- package/dist/terrain/sweep-capsule.js.map +1 -0
- package/dist/terrain/sweep-cylinder.d.ts +16 -0
- package/dist/terrain/sweep-cylinder.d.ts.map +1 -0
- package/dist/terrain/sweep-cylinder.js +52 -0
- package/dist/terrain/sweep-cylinder.js.map +1 -0
- package/dist/terrain/sweep-plane.d.ts +9 -0
- package/dist/terrain/sweep-plane.d.ts.map +1 -0
- package/dist/terrain/sweep-plane.js +52 -0
- package/dist/terrain/sweep-plane.js.map +1 -0
- package/dist/terrain/sweep-polytope.d.ts +42 -0
- package/dist/terrain/sweep-polytope.d.ts.map +1 -0
- package/dist/terrain/sweep-polytope.js +189 -0
- package/dist/terrain/sweep-polytope.js.map +1 -0
- package/dist/terrain/sweep-rotating-capsule.d.ts +17 -0
- package/dist/terrain/sweep-rotating-capsule.d.ts.map +1 -0
- package/dist/terrain/sweep-rotating-capsule.js +118 -0
- package/dist/terrain/sweep-rotating-capsule.js.map +1 -0
- package/dist/terrain/sweep-rotation.d.ts +35 -0
- package/dist/terrain/sweep-rotation.d.ts.map +1 -0
- package/dist/terrain/sweep-rotation.js +114 -0
- package/dist/terrain/sweep-rotation.js.map +1 -0
- package/dist/terrain/sweep-sphere.d.ts +27 -0
- package/dist/terrain/sweep-sphere.d.ts.map +1 -0
- package/dist/terrain/sweep-sphere.js +69 -0
- package/dist/terrain/sweep-sphere.js.map +1 -0
- package/dist/terrain/tile-cutout-update.d.ts +73 -0
- package/dist/terrain/tile-cutout-update.d.ts.map +1 -0
- package/dist/terrain/tile-cutout-update.js +181 -0
- package/dist/terrain/tile-cutout-update.js.map +1 -0
- package/dist/terrain/tile-cutout.d.ts +33 -0
- package/dist/terrain/tile-cutout.d.ts.map +1 -0
- package/dist/terrain/tile-cutout.js +93 -0
- package/dist/terrain/tile-cutout.js.map +1 -0
- package/dist/terrain/watershed-accumulation.d.ts +20 -0
- package/dist/terrain/watershed-accumulation.d.ts.map +1 -0
- package/dist/terrain/watershed-accumulation.js +53 -0
- package/dist/terrain/watershed-accumulation.js.map +1 -0
- package/dist/triaxial.d.ts +1 -1
- package/dist/triaxial.d.ts.map +1 -1
- package/dist/turf-expressions.cjs +1997 -0
- package/dist/turf-expressions.cjs.map +6 -0
- package/dist/turf-expressions.d.ts +3 -0
- package/dist/turf-expressions.d.ts.map +1 -0
- package/dist/turf-expressions.js +7 -0
- package/dist/turf-expressions.js.map +1 -0
- package/dist/turf-functions.cjs +743 -0
- package/dist/turf-functions.cjs.map +6 -0
- package/dist/turf-functions.d.ts +90 -0
- package/dist/turf-functions.d.ts.map +1 -0
- package/dist/{turf/expressions.js → turf-functions.js} +51 -5
- package/dist/turf-functions.js.map +1 -0
- package/dist/turf.cjs +25 -25
- package/dist/turf.cjs.map +2 -2
- package/dist/turf.d.ts +1 -1
- package/dist/turf.d.ts.map +1 -1
- package/dist/turf.js +2 -2
- package/dist/turf.js.map +1 -1
- package/dist/type-utils.d.ts +1 -1
- package/dist/type-utils.d.ts.map +1 -1
- package/dist/type-utils.js +1 -1
- package/dist/type-utils.js.map +1 -1
- package/dist/web-mercator/assert.d.ts +2 -0
- package/dist/web-mercator/assert.d.ts.map +1 -0
- package/dist/web-mercator/assert.js +12 -0
- package/dist/web-mercator/assert.js.map +1 -0
- package/dist/web-mercator/fit-bounds.d.ts +52 -0
- package/dist/web-mercator/fit-bounds.d.ts.map +1 -0
- package/dist/web-mercator/fit-bounds.js +70 -0
- package/dist/web-mercator/fit-bounds.js.map +1 -0
- package/dist/web-mercator/fly-to-viewport.d.ts +19 -0
- package/dist/web-mercator/fly-to-viewport.d.ts.map +1 -0
- package/dist/web-mercator/fly-to-viewport.js +94 -0
- package/dist/web-mercator/fly-to-viewport.js.map +1 -0
- package/dist/web-mercator/get-bounds.d.ts +3 -0
- package/dist/web-mercator/get-bounds.d.ts.map +1 -0
- package/dist/web-mercator/get-bounds.js +56 -0
- package/dist/web-mercator/get-bounds.js.map +1 -0
- package/dist/web-mercator/index.cjs +705 -0
- package/dist/web-mercator/index.cjs.map +6 -0
- package/dist/web-mercator/index.d.ts +14 -0
- package/dist/web-mercator/index.d.ts.map +1 -0
- package/dist/web-mercator/index.js +14 -0
- package/dist/web-mercator/index.js.map +1 -0
- package/dist/web-mercator/math-utils.d.ts +7 -0
- package/dist/web-mercator/math-utils.d.ts.map +1 -0
- package/dist/web-mercator/math-utils.js +30 -0
- package/dist/web-mercator/math-utils.js.map +1 -0
- package/dist/web-mercator/mercator-meters.d.ts +29 -0
- package/dist/web-mercator/mercator-meters.d.ts.map +1 -0
- package/dist/web-mercator/mercator-meters.js +61 -0
- package/dist/web-mercator/mercator-meters.js.map +1 -0
- package/dist/web-mercator/normalize-viewport-props.d.ts +16 -0
- package/dist/web-mercator/normalize-viewport-props.d.ts.map +1 -0
- package/dist/web-mercator/normalize-viewport-props.js +45 -0
- package/dist/web-mercator/normalize-viewport-props.js.map +1 -0
- package/dist/web-mercator/web-mercator-utils.d.ts +192 -0
- package/dist/web-mercator/web-mercator-utils.d.ts.map +1 -0
- package/dist/web-mercator/web-mercator-utils.js +321 -0
- package/dist/web-mercator/web-mercator-utils.js.map +1 -0
- package/dist/web-mercator/web-mercator-viewport.d.ts +177 -0
- package/dist/web-mercator/web-mercator-viewport.d.ts.map +1 -0
- package/dist/web-mercator/web-mercator-viewport.js +276 -0
- package/dist/web-mercator/web-mercator-viewport.js.map +1 -0
- package/dist/web-mercator.d.ts +1 -1
- package/dist/web-mercator.d.ts.map +1 -1
- package/dist/web-mercator.js +1 -1
- package/dist/web-mercator.js.map +1 -1
- package/package.json +34 -462
- package/src/crs/crs-descriptor-types.ts +2 -1
- package/src/crs/index.ts +7 -0
- package/src/crs/spatial-reference-metadata.ts +118 -0
- package/src/ellipsoid-helpers/ellipsoid-transform.ts +3 -3
- package/src/ellipsoid-helpers/scale-to-geodetic-surface.ts +1 -1
- package/src/ellipsoid-helpers/tangent-plane-numerics.ts +1 -1
- package/src/ellipsoid-tangent-plane.ts +2 -2
- package/src/ellipsoid-transforms.ts +2 -2
- package/src/ellipsoid.ts +7 -3
- package/src/expressions.ts +2 -2
- package/src/geodesic-buffer.ts +1 -1
- package/src/geodesic-path.ts +1 -1
- package/src/geometry-constructors.ts +36 -0
- package/src/geometry-inspection.ts +66 -0
- package/src/index.ts +271 -4
- package/src/line-simplification.ts +97 -0
- package/src/linear-referencing.ts +94 -0
- package/src/lng-lat-rectangle.ts +1 -1
- package/src/local-reference-frame.ts +4 -4
- package/src/make-obb-from-region.ts +9 -1
- package/src/maps/air-ocean-mesh.ts +1 -1
- package/src/maps/myriahedral/unfold.ts +1 -1
- package/src/projection/experimental/crs/spatial-reference.ts +1 -6
- package/src/projection/experimental/crs/types.ts +2 -2
- package/src/projection/experimental/crs/wkt.ts +1 -1
- package/src/projection/experimental/crs-descriptor.ts +1 -1
- package/src/projection/experimental/crs-rendering-scale.ts +16 -4
- package/src/projection/experimental/datum.ts +1 -1
- package/src/projection/experimental/lazy-projections/aea.ts +4 -1
- package/src/projection/experimental/lazy-projections/bonne.ts +4 -1
- package/src/projection/experimental/lazy-projections/cass.ts +4 -1
- package/src/projection/experimental/lazy-projections/eck6.ts +4 -1
- package/src/projection/experimental/lazy-projections/eqdc.ts +4 -1
- package/src/projection/experimental/lazy-projections/eqearth.ts +4 -1
- package/src/projection/experimental/lazy-projections/equi.ts +4 -1
- package/src/projection/experimental/lazy-projections/geocent.ts +4 -1
- package/src/projection/experimental/lazy-projections/geos.ts +4 -1
- package/src/projection/experimental/lazy-projections/gnom.ts +4 -1
- package/src/projection/experimental/lazy-projections/krovak.ts +4 -1
- package/src/projection/experimental/lazy-projections/merc.ts +4 -1
- package/src/projection/experimental/lazy-projections/mill.ts +4 -1
- package/src/projection/experimental/lazy-projections/moll.ts +4 -1
- package/src/projection/experimental/lazy-projections/nzmg.ts +4 -1
- package/src/projection/experimental/lazy-projections/omerc.ts +4 -1
- package/src/projection/experimental/lazy-projections/ortho.ts +4 -1
- package/src/projection/experimental/lazy-projections/poly.ts +4 -1
- package/src/projection/experimental/lazy-projections/robin.ts +4 -1
- package/src/projection/experimental/lazy-projections/sinu.ts +4 -1
- package/src/projection/experimental/lazy-projections/stere.ts +4 -1
- package/src/projection/experimental/lazy-projections/tpers.ts +4 -1
- package/src/projection/experimental/lazy-projections/vandg.ts +4 -1
- package/src/projection/experimental/spatial-deformation.ts +1 -1
- package/src/projection/index.ts +1 -1
- package/src/projection/lib/projection.ts +1 -1
- package/src/rhumb-path.ts +1 -1
- package/src/spatial-planar-intersects.ts +134 -0
- package/src/spatial-planar.ts +266 -0
- package/src/spatial-sql.ts +276 -0
- package/src/st-functions.ts +852 -0
- package/src/subdivide-globe-mesh.ts +1 -1
- package/src/tasks/terrain-residency.ts +120 -24
- package/src/terrain/cutout-polygons.ts +202 -0
- package/src/terrain/cutout-region.ts +54 -0
- package/src/terrain/cutout-skirts.ts +52 -0
- package/src/terrain/depression-fill.ts +125 -0
- package/src/terrain/geographic-cutout.ts +154 -0
- package/src/terrain/geographic-lod-seams.ts +109 -0
- package/src/terrain/geographic-neighbor.ts +58 -0
- package/src/terrain/geographic-poles.ts +52 -0
- package/src/terrain/hydrology.ts +149 -0
- package/src/terrain/index.ts +122 -1
- package/src/terrain/lod-screen-error.ts +128 -0
- package/src/terrain/lod-select.ts +65 -31
- package/src/terrain/lod-stitch.ts +25 -7
- package/src/terrain/mesh-cutout.ts +420 -0
- package/src/terrain/mesh-skirts.ts +10 -7
- package/src/terrain/mixed-halo-update.ts +54 -20
- package/src/terrain/mixed-vertex-halos.ts +94 -78
- package/src/terrain/regional-viewshed.ts +177 -0
- package/src/terrain/surface.ts +1 -1
- package/src/terrain/sweep-capsule.ts +148 -0
- package/src/terrain/sweep-cylinder.ts +64 -0
- package/src/terrain/sweep-plane.ts +61 -0
- package/src/terrain/sweep-polytope.ts +253 -0
- package/src/terrain/sweep-rotating-capsule.ts +139 -0
- package/src/terrain/sweep-rotation.ts +149 -0
- package/src/terrain/sweep-sphere.ts +100 -0
- package/src/terrain/tile-cutout-update.ts +293 -0
- package/src/terrain/tile-cutout.ts +123 -0
- package/src/terrain/watershed-accumulation.ts +67 -0
- package/src/triaxial.ts +1 -1
- package/src/turf-expressions.ts +7 -0
- package/src/{turf/expressions.ts → turf-functions.ts} +121 -6
- package/src/turf.ts +3 -7
- package/src/type-utils.ts +2 -2
- package/src/web-mercator/assert.ts +11 -0
- package/src/web-mercator/fit-bounds.ts +132 -0
- package/src/web-mercator/fly-to-viewport.ts +157 -0
- package/src/web-mercator/get-bounds.ts +62 -0
- package/src/web-mercator/index.ts +49 -0
- package/src/web-mercator/math-utils.ts +35 -0
- package/src/web-mercator/mercator-meters.ts +83 -0
- package/src/web-mercator/normalize-viewport-props.ts +58 -0
- package/src/web-mercator/web-mercator-utils.ts +468 -0
- package/src/web-mercator/web-mercator-viewport.ts +406 -0
- package/src/web-mercator.ts +1 -1
- package/dist/projection/experimental/index.cjs +0 -11707
- package/dist/projection/experimental/index.cjs.map +0 -6
- package/dist/turf/expressions.cjs +0 -87
- package/dist/turf/expressions.cjs.map +0 -6
- package/dist/turf/expressions.d.ts +0 -24
- package/dist/turf/expressions.d.ts.map +0 -1
- package/dist/turf/expressions.js.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {TerrainCapsuleContact, TerrainSurface} from './surface';
|
|
6
|
+
|
|
7
|
+
type Point = readonly [number, number, number];
|
|
8
|
+
|
|
9
|
+
export type TerrainSphereSweepOptions = {
|
|
10
|
+
/** Maximum width of the returned impact interval, in units of motion fraction. */
|
|
11
|
+
fractionTolerance?: number;
|
|
12
|
+
/** Total spatial index work across all probes. */
|
|
13
|
+
maxWork?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TerrainSphereSweepResult =
|
|
17
|
+
| {status: 'miss' | 'incomplete'; work: number}
|
|
18
|
+
| {
|
|
19
|
+
status: 'hit';
|
|
20
|
+
work: number;
|
|
21
|
+
fraction: number;
|
|
22
|
+
lowerFraction: number;
|
|
23
|
+
contact: TerrainCapsuleContact;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Find the first impact of a translating sphere against the two-sided terrain sheet.
|
|
28
|
+
* Bisection tests entire motion prefixes, so a brief or grazing contact can be
|
|
29
|
+
* found even when neither endpoint intersects. The returned contact is a witness
|
|
30
|
+
* inside the impact interval. An exhausted work budget returns 'incomplete'.
|
|
31
|
+
*/
|
|
32
|
+
export function sweepTerrainSphere(
|
|
33
|
+
surface: Pick<TerrainSurface, 'intersectCapsule'>,
|
|
34
|
+
start: Point,
|
|
35
|
+
end: Point,
|
|
36
|
+
radius: number,
|
|
37
|
+
{fractionTolerance = 1e-6, maxWork = 100_000}: TerrainSphereSweepOptions = {}
|
|
38
|
+
): TerrainSphereSweepResult {
|
|
39
|
+
if (
|
|
40
|
+
!(fractionTolerance >= Number.EPSILON && fractionTolerance <= 1) ||
|
|
41
|
+
!Number.isSafeInteger(maxWork) ||
|
|
42
|
+
maxWork < 0
|
|
43
|
+
)
|
|
44
|
+
throw new RangeError('Invalid terrain sphere sweep limits');
|
|
45
|
+
const delta = end.map((value, axis) => value - start[axis]);
|
|
46
|
+
if (
|
|
47
|
+
start.length !== 3 ||
|
|
48
|
+
end.length !== 3 ||
|
|
49
|
+
!start.every(Number.isFinite) ||
|
|
50
|
+
!end.every(Number.isFinite) ||
|
|
51
|
+
!delta.every(Number.isFinite) ||
|
|
52
|
+
!Number.isFinite(radius) ||
|
|
53
|
+
radius < 0
|
|
54
|
+
)
|
|
55
|
+
throw new RangeError('Invalid terrain sphere sweep motion or radius');
|
|
56
|
+
let work = 0;
|
|
57
|
+
let lower = 0;
|
|
58
|
+
let upper = 1;
|
|
59
|
+
const prefix = (fraction: number) => {
|
|
60
|
+
const endPoint: Point =
|
|
61
|
+
fraction === 0
|
|
62
|
+
? start
|
|
63
|
+
: fraction === 1
|
|
64
|
+
? end
|
|
65
|
+
: [
|
|
66
|
+
start[0] + delta[0] * fraction,
|
|
67
|
+
start[1] + delta[1] * fraction,
|
|
68
|
+
start[2] + delta[2] * fraction
|
|
69
|
+
];
|
|
70
|
+
const query = surface.intersectCapsule(start, endPoint, radius, {
|
|
71
|
+
maxWork: maxWork - work,
|
|
72
|
+
maxContacts: 1
|
|
73
|
+
});
|
|
74
|
+
work += query.work;
|
|
75
|
+
return query;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const initial = prefix(0);
|
|
79
|
+
if (initial.result[0])
|
|
80
|
+
return {status: 'hit', fraction: 0, lowerFraction: 0, contact: initial.result[0], work};
|
|
81
|
+
if (!initial.complete) return {status: 'incomplete', work};
|
|
82
|
+
|
|
83
|
+
const full = prefix(1);
|
|
84
|
+
let contact = full.result[0];
|
|
85
|
+
if (!contact) return {status: full.complete ? 'miss' : 'incomplete', work};
|
|
86
|
+
|
|
87
|
+
while (upper - lower > fractionTolerance) {
|
|
88
|
+
const middle = (lower + upper) / 2;
|
|
89
|
+
const query = prefix(middle);
|
|
90
|
+
if (query.result[0]) {
|
|
91
|
+
upper = middle;
|
|
92
|
+
contact = query.result[0];
|
|
93
|
+
} else if (query.complete) {
|
|
94
|
+
lower = middle;
|
|
95
|
+
} else {
|
|
96
|
+
return {status: 'incomplete', work};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return {status: 'hit', fraction: upper, lowerFraction: lower, contact, work};
|
|
100
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
copyTerrainCutoutRegion,
|
|
7
|
+
sameTerrainCutoutRegion,
|
|
8
|
+
type TerrainCutoutRegion
|
|
9
|
+
} from './cutout-region';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
splitTerrainMesh,
|
|
13
|
+
validateTerrainCutoutTopology,
|
|
14
|
+
type TerrainCutout,
|
|
15
|
+
type TerrainCutoutInput,
|
|
16
|
+
type TerrainCutoutOptions,
|
|
17
|
+
type TerrainCutoutPiece
|
|
18
|
+
} from './mesh-cutout';
|
|
19
|
+
import {assembleTerrainCutoutTiles} from './tile-cutout';
|
|
20
|
+
|
|
21
|
+
/** Stable resident identity and an explicit revision for in-place buffer edits. */
|
|
22
|
+
export type TerrainCutoutResident = {
|
|
23
|
+
/** Unique resident tile ID. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Nonnegative safe integer; increment after changing any mesh buffer. */
|
|
26
|
+
revision: number;
|
|
27
|
+
/** Conforming terrain in one shared Cartesian frame. Treat as immutable within a revision. */
|
|
28
|
+
mesh: TerrainCutoutInput;
|
|
29
|
+
};
|
|
30
|
+
/** Per-tile clipping limits plus bounds on resident-set reconciliation. */
|
|
31
|
+
export type TerrainTileCutoutUpdateOptions = TerrainCutoutOptions & {
|
|
32
|
+
/** Maximum residents. Default 512. */
|
|
33
|
+
maxTiles?: number;
|
|
34
|
+
/** Maximum tile-pair broad-phase checks per update. Default 131072. */
|
|
35
|
+
maxPairChecks?: number;
|
|
36
|
+
/** Maximum exposed piece edges across all residents. Default 1000000. */
|
|
37
|
+
maxBoundaryEdges?: number;
|
|
38
|
+
};
|
|
39
|
+
/** Directed boundary edge with exact coordinate keys and local vertex IDs. */
|
|
40
|
+
type Boundary = {
|
|
41
|
+
/** Incident face polygon index; remainder faces use the Uint32 sentinel 0xffffffff. */
|
|
42
|
+
polygon: number;
|
|
43
|
+
key: string;
|
|
44
|
+
start: string;
|
|
45
|
+
end: string;
|
|
46
|
+
a: number;
|
|
47
|
+
b: number;
|
|
48
|
+
side: 0 | 1;
|
|
49
|
+
};
|
|
50
|
+
/** Cached clipping and boundary summaries for one immutable tile revision. */
|
|
51
|
+
type Entry = {
|
|
52
|
+
resident: TerrainCutoutResident;
|
|
53
|
+
split: TerrainCutout;
|
|
54
|
+
displayed: TerrainCutout;
|
|
55
|
+
bounds: readonly [number, number, number, number];
|
|
56
|
+
edges: Boundary[];
|
|
57
|
+
};
|
|
58
|
+
/** Private cache brand; the cache is local to this module instance. */
|
|
59
|
+
const CACHE = Symbol('terrain-cutout-cache');
|
|
60
|
+
/** Opaque reusable cache. Do not mutate cached results or resident buffers without a new revision. */
|
|
61
|
+
export type TerrainTileCutoutCache = {
|
|
62
|
+
readonly [CACHE]: {
|
|
63
|
+
polygon: TerrainCutoutRegion;
|
|
64
|
+
options: Required<TerrainTileCutoutUpdateOptions>;
|
|
65
|
+
entries: ReadonlyMap<string, Entry>;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/** Detached update result, with unchanged surface buffers retained by identity. */
|
|
69
|
+
export type TerrainTileCutoutUpdate = {
|
|
70
|
+
/** Pass to the next update; no state is committed if an update throws. */
|
|
71
|
+
cache: TerrainTileCutoutCache;
|
|
72
|
+
/** Resident cuts. Source triangle references are local to the corresponding input tile. */
|
|
73
|
+
tiles: ReadonlyMap<string, TerrainCutout>;
|
|
74
|
+
/** Tiles whose surfaces or exposed cut edges changed. */
|
|
75
|
+
changed: string[];
|
|
76
|
+
/** Tiles removed from the previous resident set. */
|
|
77
|
+
removed: string[];
|
|
78
|
+
/** Tiles actually clipped in this update; unchanged tiles are not reclipped. */
|
|
79
|
+
rebuilt: string[];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** Clip changed tiles independently and pair their exposed boundaries.
|
|
83
|
+
* Mixed-level inputs must already be reconciled. Cached source buffers and
|
|
84
|
+
* returned arrays are read-only by contract. Change revision after in-place
|
|
85
|
+
* edits; replacing the mesh object also invalidates its cache. Polygon or
|
|
86
|
+
* option changes invalidate all clips. Limits maxWork/maxVertices/maxTriangles
|
|
87
|
+
* apply per clip and per adjacent-pair validation, not to the entire update.
|
|
88
|
+
* Arrival/eviction can change a neighbor's cutEdges without rebuilding its mesh.
|
|
89
|
+
*/
|
|
90
|
+
export function updateTerrainTileCutouts(
|
|
91
|
+
residents: readonly TerrainCutoutResident[],
|
|
92
|
+
polygon: TerrainCutoutRegion,
|
|
93
|
+
previous?: TerrainTileCutoutCache,
|
|
94
|
+
options: TerrainTileCutoutUpdateOptions = {}
|
|
95
|
+
): TerrainTileCutoutUpdate {
|
|
96
|
+
const limits: Required<TerrainTileCutoutUpdateOptions> = {
|
|
97
|
+
maxTiles: options.maxTiles ?? 512,
|
|
98
|
+
maxPairChecks: options.maxPairChecks ?? 131072,
|
|
99
|
+
maxBoundaryEdges: options.maxBoundaryEdges ?? 1000000,
|
|
100
|
+
maxWork: options.maxWork ?? 4000000,
|
|
101
|
+
maxVertices: options.maxVertices ?? 500000,
|
|
102
|
+
maxTriangles: options.maxTriangles ?? 500000
|
|
103
|
+
};
|
|
104
|
+
if (
|
|
105
|
+
Object.values(limits).some(n => !Number.isSafeInteger(n) || n < 0) ||
|
|
106
|
+
limits.maxVertices > 0xffffffff ||
|
|
107
|
+
limits.maxTriangles > 0xffffffff ||
|
|
108
|
+
residents.length > limits.maxTiles
|
|
109
|
+
)
|
|
110
|
+
throw new RangeError('Invalid terrain cutout update limits');
|
|
111
|
+
const prior = previous?.[CACHE];
|
|
112
|
+
const compatible =
|
|
113
|
+
prior &&
|
|
114
|
+
sameTerrainCutoutRegion(prior.polygon, polygon) &&
|
|
115
|
+
(Object.keys(limits) as (keyof typeof limits)[]).every(
|
|
116
|
+
key => prior.options[key] === limits[key]
|
|
117
|
+
);
|
|
118
|
+
// Validate the ring even for an empty resident set.
|
|
119
|
+
if (!compatible)
|
|
120
|
+
splitTerrainMesh({positions: new Float64Array(), indices: new Uint32Array()}, polygon, limits);
|
|
121
|
+
const entries = new Map<string, Entry>();
|
|
122
|
+
const rebuilt: string[] = [];
|
|
123
|
+
let boundaryCount = 0;
|
|
124
|
+
for (const resident of residents) {
|
|
125
|
+
if (
|
|
126
|
+
!resident.id ||
|
|
127
|
+
typeof resident.id !== 'string' ||
|
|
128
|
+
entries.has(resident.id) ||
|
|
129
|
+
!Number.isSafeInteger(resident.revision) ||
|
|
130
|
+
resident.revision < 0
|
|
131
|
+
)
|
|
132
|
+
throw new RangeError('Invalid or duplicate terrain cutout resident');
|
|
133
|
+
const old = compatible ? prior.entries.get(resident.id) : undefined;
|
|
134
|
+
let entry: Entry;
|
|
135
|
+
if (old && old.resident.mesh === resident.mesh && old.resident.revision === resident.revision)
|
|
136
|
+
entry = old;
|
|
137
|
+
else {
|
|
138
|
+
const split = splitTerrainMesh(resident.mesh, polygon, limits);
|
|
139
|
+
const edges = [...boundaryEdges(split.patch, 0), ...boundaryEdges(split.remainder, 1)];
|
|
140
|
+
const bounds: [number, number, number, number] = [Infinity, Infinity, -Infinity, -Infinity];
|
|
141
|
+
for (const id of resident.mesh.indices) {
|
|
142
|
+
const x = resident.mesh.positions[id * 3],
|
|
143
|
+
y = resident.mesh.positions[id * 3 + 1];
|
|
144
|
+
bounds[0] = Math.min(bounds[0], x);
|
|
145
|
+
bounds[1] = Math.min(bounds[1], y);
|
|
146
|
+
bounds[2] = Math.max(bounds[2], x);
|
|
147
|
+
bounds[3] = Math.max(bounds[3], y);
|
|
148
|
+
}
|
|
149
|
+
entry = {resident: {...resident}, split, displayed: split, bounds, edges};
|
|
150
|
+
rebuilt.push(resident.id);
|
|
151
|
+
}
|
|
152
|
+
boundaryCount += entry.edges.length;
|
|
153
|
+
if (boundaryCount > limits.maxBoundaryEdges)
|
|
154
|
+
throw new RangeError('Terrain cutout boundary budget exceeded');
|
|
155
|
+
entries.set(resident.id, entry);
|
|
156
|
+
}
|
|
157
|
+
const values = [...entries.values()];
|
|
158
|
+
let pairs = 0;
|
|
159
|
+
for (let i = 0; i < values.length; i++)
|
|
160
|
+
for (let j = i + 1; j < values.length; j++) {
|
|
161
|
+
if (++pairs > limits.maxPairChecks)
|
|
162
|
+
throw new RangeError('Terrain cutout pair budget exceeded');
|
|
163
|
+
const a = values[i],
|
|
164
|
+
b = values[j];
|
|
165
|
+
if (
|
|
166
|
+
a.bounds[2] < b.bounds[0] ||
|
|
167
|
+
b.bounds[2] < a.bounds[0] ||
|
|
168
|
+
a.bounds[3] < b.bounds[1] ||
|
|
169
|
+
b.bounds[3] < a.bounds[1]
|
|
170
|
+
)
|
|
171
|
+
continue;
|
|
172
|
+
if (
|
|
173
|
+
compatible &&
|
|
174
|
+
prior.entries.get(a.resident.id) === a &&
|
|
175
|
+
prior.entries.get(b.resident.id) === b
|
|
176
|
+
)
|
|
177
|
+
continue;
|
|
178
|
+
const combined = assembleTerrainCutoutTiles([a.resident.mesh, b.resident.mesh], limits);
|
|
179
|
+
validateTerrainCutoutTopology(combined.mesh, combined.remainingWork);
|
|
180
|
+
}
|
|
181
|
+
const boundaries = new Map<string, {edge: Boundary; paired: boolean}>();
|
|
182
|
+
const cutKeys = new Map<string, number>();
|
|
183
|
+
for (let tile = 0; tile < values.length; tile++)
|
|
184
|
+
for (const edge of values[tile].edges) {
|
|
185
|
+
const other = boundaries.get(edge.key);
|
|
186
|
+
if (!other) {
|
|
187
|
+
boundaries.set(edge.key, {edge, paired: false});
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (other.paired || other.edge.start !== edge.end || other.edge.end !== edge.start)
|
|
191
|
+
throw new RangeError('Nonconforming terrain cutout tile boundary');
|
|
192
|
+
other.paired = true;
|
|
193
|
+
if (other.edge.side !== edge.side) {
|
|
194
|
+
cutKeys.set(edge.key, edge.side === 0 ? edge.polygon : other.edge.polygon);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const tiles = new Map<string, TerrainCutout>();
|
|
198
|
+
const changed: string[] = [];
|
|
199
|
+
for (let i = 0; i < values.length; i++) {
|
|
200
|
+
const entry = values[i];
|
|
201
|
+
const old = prior?.entries.get(entry.resident.id);
|
|
202
|
+
// Emit in cached tile-local order, independent of resident visitation order.
|
|
203
|
+
const cuts: [number[], number[]] = [[], []];
|
|
204
|
+
const polygons: [number[], number[]] = [[], []];
|
|
205
|
+
for (const edge of entry.edges) {
|
|
206
|
+
const polygonIndex = cutKeys.get(edge.key);
|
|
207
|
+
if (polygonIndex !== undefined) {
|
|
208
|
+
cuts[edge.side].push(edge.a, edge.b);
|
|
209
|
+
polygons[edge.side].push(polygonIndex);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const patch = withEdges(entry.split.patch, cuts[0], polygons[0], old?.displayed.patch);
|
|
213
|
+
const remainder = withEdges(
|
|
214
|
+
entry.split.remainder,
|
|
215
|
+
cuts[1],
|
|
216
|
+
polygons[1],
|
|
217
|
+
old?.displayed.remainder
|
|
218
|
+
);
|
|
219
|
+
const displayed =
|
|
220
|
+
old && patch === old.displayed.patch && remainder === old.displayed.remainder
|
|
221
|
+
? old.displayed
|
|
222
|
+
: {patch, remainder};
|
|
223
|
+
if (displayed !== old?.displayed) changed.push(entry.resident.id);
|
|
224
|
+
entries.set(entry.resident.id, displayed === entry.displayed ? entry : {...entry, displayed});
|
|
225
|
+
tiles.set(entry.resident.id, displayed);
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
cache: {[CACHE]: {polygon: copyTerrainCutoutRegion(polygon), options: limits, entries}},
|
|
229
|
+
tiles,
|
|
230
|
+
changed,
|
|
231
|
+
rebuilt,
|
|
232
|
+
removed: prior ? [...prior.entries.keys()].filter(id => !entries.has(id)) : []
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Reuse surface buffers and unchanged boundary descriptors. */
|
|
237
|
+
function withEdges(
|
|
238
|
+
piece: TerrainCutoutPiece,
|
|
239
|
+
edges: number[],
|
|
240
|
+
polygons: number[],
|
|
241
|
+
old?: TerrainCutoutPiece
|
|
242
|
+
) {
|
|
243
|
+
const same =
|
|
244
|
+
old &&
|
|
245
|
+
old.positions === piece.positions &&
|
|
246
|
+
old.cutEdges.length === edges.length &&
|
|
247
|
+
old.cutEdges.every((id, i) => id === edges[i]) &&
|
|
248
|
+
old.cutPolygonIndices.every((id, i) => id === polygons[i]);
|
|
249
|
+
return same
|
|
250
|
+
? old
|
|
251
|
+
: {...piece, cutEdges: Uint32Array.from(edges), cutPolygonIndices: Uint32Array.from(polygons)};
|
|
252
|
+
}
|
|
253
|
+
/** Cache only exposed edges; interior triangulation edges never become walls. */
|
|
254
|
+
function boundaryEdges(piece: TerrainCutoutPiece, side: 0 | 1): Boundary[] {
|
|
255
|
+
const edges = new Map<
|
|
256
|
+
string,
|
|
257
|
+
{
|
|
258
|
+
a: number;
|
|
259
|
+
b: number;
|
|
260
|
+
count: number;
|
|
261
|
+
/** Incident face polygon index, including the remainder sentinel 0xffffffff. */
|
|
262
|
+
polygon: number;
|
|
263
|
+
}
|
|
264
|
+
>();
|
|
265
|
+
for (let i = 0; i < piece.indices.length; i += 3)
|
|
266
|
+
for (let j = 0; j < 3; j++) {
|
|
267
|
+
const a = piece.indices[i + j],
|
|
268
|
+
b = piece.indices[i + ((j + 1) % 3)];
|
|
269
|
+
const key = a < b ? `${a},${b}` : `${b},${a}`;
|
|
270
|
+
const old = edges.get(key);
|
|
271
|
+
if (old) old.count++;
|
|
272
|
+
else edges.set(key, {a, b, count: 1, polygon: piece.polygonIndices[i / 3]});
|
|
273
|
+
}
|
|
274
|
+
const result: Boundary[] = [];
|
|
275
|
+
/** Encode exact XYZ; no snapping or tolerance-based topology decisions. */
|
|
276
|
+
const point = (id: number) =>
|
|
277
|
+
`${piece.positions[id * 3]},${piece.positions[id * 3 + 1]},${piece.positions[id * 3 + 2]}`;
|
|
278
|
+
for (const {a, b, count, polygon} of edges.values())
|
|
279
|
+
if (count === 1) {
|
|
280
|
+
const start = point(a),
|
|
281
|
+
end = point(b);
|
|
282
|
+
result.push({
|
|
283
|
+
polygon,
|
|
284
|
+
a,
|
|
285
|
+
b,
|
|
286
|
+
side,
|
|
287
|
+
start,
|
|
288
|
+
end,
|
|
289
|
+
key: start < end ? `${start}/${end}` : `${end}/${start}`
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {TerrainCutoutRegion} from './cutout-region';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
splitTerrainMesh,
|
|
9
|
+
type TerrainCutout,
|
|
10
|
+
type TerrainCutoutInput,
|
|
11
|
+
type TerrainCutoutOptions
|
|
12
|
+
} from './mesh-cutout';
|
|
13
|
+
|
|
14
|
+
/** A resident tile expressed in the same local Cartesian frame as its neighbors. */
|
|
15
|
+
export type TerrainCutoutTile = TerrainCutoutInput;
|
|
16
|
+
|
|
17
|
+
/** A resident-set cut and its input-face provenance. */
|
|
18
|
+
export type TerrainTileCutout = TerrainCutout & {
|
|
19
|
+
/** Tile-array index for each input face referenced by either piece. */
|
|
20
|
+
sourceTiles: Uint32Array;
|
|
21
|
+
/** Original tile triangle index for each input face referenced by either piece. */
|
|
22
|
+
sourceTileFaces: Uint32Array;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Split a conforming resident tile set, with paired walls only along the cut.
|
|
26
|
+
*
|
|
27
|
+
* Vertices with identical XYZ are welded before clipping. Mixed-level neighbors
|
|
28
|
+
* must first be reconciled with stitchTerrainMeshEdges or stitchTerrainLodCut;
|
|
29
|
+
* hanging vertices, overlapping tiles and conflicting elevations are rejected.
|
|
30
|
+
* No snapping, height adjustment, missing-tile filling or tile caching occurs.
|
|
31
|
+
* Recompute from the new resident set after arrival or eviction. Source triangle
|
|
32
|
+
* and barycentric references retain the original tile face's corner order.
|
|
33
|
+
* Limits apply to the total input (including duplicate vertices) and the splitter.
|
|
34
|
+
*/
|
|
35
|
+
export function splitTerrainMeshTiles(
|
|
36
|
+
tiles: readonly TerrainCutoutTile[],
|
|
37
|
+
polygon: TerrainCutoutRegion,
|
|
38
|
+
options: TerrainCutoutOptions = {}
|
|
39
|
+
): TerrainTileCutout {
|
|
40
|
+
const assembled = assembleTerrainCutoutTiles(tiles, options);
|
|
41
|
+
return {
|
|
42
|
+
...splitTerrainMesh(assembled.mesh, polygon, {...options, maxWork: assembled.remainingWork}),
|
|
43
|
+
sourceTiles: assembled.sourceTiles,
|
|
44
|
+
sourceTileFaces: assembled.sourceTileFaces
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @internal Assemble a bounded, exact-welded mesh without clipping it. */
|
|
49
|
+
export function assembleTerrainCutoutTiles(
|
|
50
|
+
tiles: readonly TerrainCutoutInput[],
|
|
51
|
+
options: TerrainCutoutOptions = {}
|
|
52
|
+
) {
|
|
53
|
+
const maxVertices = options.maxVertices ?? 500_000;
|
|
54
|
+
const maxTriangles = options.maxTriangles ?? 500_000;
|
|
55
|
+
const maxWork = options.maxWork ?? 4_000_000;
|
|
56
|
+
if (
|
|
57
|
+
![maxVertices, maxTriangles, maxWork].every(n => Number.isSafeInteger(n) && n >= 0) ||
|
|
58
|
+
maxVertices > 0xffffffff ||
|
|
59
|
+
maxTriangles > 0xffffffff
|
|
60
|
+
)
|
|
61
|
+
throw new RangeError('Invalid terrain tile cutout limits');
|
|
62
|
+
let vertexCount = 0;
|
|
63
|
+
let faceCount = 0;
|
|
64
|
+
let work = 0;
|
|
65
|
+
for (const tile of tiles) {
|
|
66
|
+
if (
|
|
67
|
+
!(tile.positions instanceof Float32Array || tile.positions instanceof Float64Array) ||
|
|
68
|
+
!(tile.indices instanceof Uint16Array || tile.indices instanceof Uint32Array) ||
|
|
69
|
+
tile.positions.length % 3 ||
|
|
70
|
+
tile.indices.length % 3
|
|
71
|
+
)
|
|
72
|
+
throw new RangeError('Invalid terrain tile cutout mesh');
|
|
73
|
+
vertexCount += tile.positions.length / 3;
|
|
74
|
+
faceCount += tile.indices.length / 3;
|
|
75
|
+
work += 1 + tile.positions.length / 3 + tile.indices.length;
|
|
76
|
+
if (vertexCount > maxVertices || faceCount > maxTriangles || work > maxWork)
|
|
77
|
+
throw new RangeError('Terrain tile cutout input budget exceeded');
|
|
78
|
+
}
|
|
79
|
+
const positions = new Float64Array(vertexCount * 3);
|
|
80
|
+
const indices = new Uint32Array(faceCount * 3);
|
|
81
|
+
const sourceTiles = new Uint32Array(faceCount);
|
|
82
|
+
const sourceTileFaces = new Uint32Array(faceCount);
|
|
83
|
+
const vertices = new Map<string, number>();
|
|
84
|
+
let vertexOffset = 0;
|
|
85
|
+
let faceOffset = 0;
|
|
86
|
+
for (let tileIndex = 0; tileIndex < tiles.length; tileIndex++) {
|
|
87
|
+
const tile = tiles[tileIndex];
|
|
88
|
+
const remap = new Uint32Array(tile.positions.length / 3);
|
|
89
|
+
for (let i = 0; i < remap.length; i++) {
|
|
90
|
+
const x = tile.positions[i * 3];
|
|
91
|
+
const y = tile.positions[i * 3 + 1];
|
|
92
|
+
const z = tile.positions[i * 3 + 2];
|
|
93
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z))
|
|
94
|
+
throw new RangeError('Invalid terrain tile cutout coordinate');
|
|
95
|
+
const key = `${x},${y},${z}`;
|
|
96
|
+
let id = vertices.get(key);
|
|
97
|
+
if (id === undefined) {
|
|
98
|
+
id = vertexOffset++;
|
|
99
|
+
vertices.set(key, id);
|
|
100
|
+
positions[id * 3] = x;
|
|
101
|
+
positions[id * 3 + 1] = y;
|
|
102
|
+
positions[id * 3 + 2] = z;
|
|
103
|
+
}
|
|
104
|
+
remap[i] = id;
|
|
105
|
+
}
|
|
106
|
+
for (let i = 0; i < tile.indices.length; i++) {
|
|
107
|
+
const id = tile.indices[i];
|
|
108
|
+
if (id >= remap.length) throw new RangeError('Invalid terrain tile cutout index');
|
|
109
|
+
indices[faceOffset * 3 + i] = remap[id];
|
|
110
|
+
}
|
|
111
|
+
for (let i = 0; i < tile.indices.length / 3; i++) {
|
|
112
|
+
sourceTiles[faceOffset + i] = tileIndex;
|
|
113
|
+
sourceTileFaces[faceOffset + i] = i;
|
|
114
|
+
}
|
|
115
|
+
faceOffset += tile.indices.length / 3;
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
mesh: {positions: positions.subarray(0, vertexOffset * 3), indices},
|
|
119
|
+
sourceTiles,
|
|
120
|
+
sourceTileFaces,
|
|
121
|
+
remainingWork: maxWork - work
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/** Outlet labels and upstream counts for a terrain receiver forest. */
|
|
6
|
+
export type TerrainWatershedAccumulation = {
|
|
7
|
+
/** Row-major outlet index, or -1 for excluded cells. */
|
|
8
|
+
terminal: Int32Array;
|
|
9
|
+
/** Number of contributing cells, including the cell itself. Excluded cells have zero. */
|
|
10
|
+
contributingCells: Uint32Array;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Controls allocation for watershed accumulation. */
|
|
14
|
+
export type TerrainWatershedAccumulationOptions = {
|
|
15
|
+
/** Limit before allocating working buffers. */
|
|
16
|
+
maxCells?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Accumulates a receiver forest such as that returned by fillTerrainDepressions.
|
|
21
|
+
* Each entry is a receiver index, -1 for an outlet, or -2 for an excluded cell.
|
|
22
|
+
* createTerrainDrainage uses -1 for nodata. Map nodata cells to -2 before calling.
|
|
23
|
+
* Rejects cycles and links to excluded cells. Time and storage are O(cell count).
|
|
24
|
+
*/
|
|
25
|
+
export function accumulateTerrainWatersheds(
|
|
26
|
+
receiver: Int32Array,
|
|
27
|
+
{maxCells = 4_194_304}: TerrainWatershedAccumulationOptions = {}
|
|
28
|
+
): TerrainWatershedAccumulation {
|
|
29
|
+
const count = receiver.length;
|
|
30
|
+
if (!Number.isSafeInteger(maxCells) || maxCells < 0 || count > maxCells || count > 0x7fffffff)
|
|
31
|
+
throw new RangeError('Terrain watershed accumulation exceeds its cell budget');
|
|
32
|
+
|
|
33
|
+
const incoming = new Uint32Array(count);
|
|
34
|
+
const contributingCells = new Uint32Array(count);
|
|
35
|
+
const terminal = new Int32Array(count).fill(-1);
|
|
36
|
+
const queue = new Int32Array(count);
|
|
37
|
+
let active = 0;
|
|
38
|
+
for (let i = 0; i < count; i++) {
|
|
39
|
+
const next = receiver[i];
|
|
40
|
+
if (next === -2) continue;
|
|
41
|
+
if (next < -1 || next >= count || (next >= 0 && receiver[next] === -2))
|
|
42
|
+
throw new RangeError('Invalid terrain watershed receiver');
|
|
43
|
+
active++;
|
|
44
|
+
contributingCells[i] = 1;
|
|
45
|
+
if (next >= 0) incoming[next]++;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let end = 0;
|
|
49
|
+
for (let i = 0; i < count; i++) {
|
|
50
|
+
if (contributingCells[i] && !incoming[i]) queue[end++] = i;
|
|
51
|
+
}
|
|
52
|
+
for (let cursor = 0; cursor < end; cursor++) {
|
|
53
|
+
const i = queue[cursor];
|
|
54
|
+
const next = receiver[i];
|
|
55
|
+
if (next < 0) continue;
|
|
56
|
+
contributingCells[next] += contributingCells[i];
|
|
57
|
+
if (--incoming[next] === 0) queue[end++] = next;
|
|
58
|
+
}
|
|
59
|
+
if (end !== active) throw new RangeError('Terrain watershed receiver graph contains a cycle');
|
|
60
|
+
|
|
61
|
+
for (let cursor = end - 1; cursor >= 0; cursor--) {
|
|
62
|
+
const i = queue[cursor];
|
|
63
|
+
const next = receiver[i];
|
|
64
|
+
terminal[i] = next < 0 ? i : terminal[next];
|
|
65
|
+
}
|
|
66
|
+
return {terminal, contributingCells};
|
|
67
|
+
}
|
package/src/triaxial.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Original normal/parametric/geocentric surface coordinates and Cartesian geodesic ODE. Qualified independently against GeographicLib 2.7 Jacobi trajectories (Charles Karney, MIT), not a port of that implementation.
|
|
5
|
-
import type {NumericArray} from '@math.gl/core';
|
|
5
|
+
import type {NumericArray} from '@math.gl/core/matrix';
|
|
6
6
|
import {integrateGeodesic} from './triaxial/integrate';
|
|
7
7
|
export type TriaxialCoordinates = 'geodetic' | 'parametric' | 'geocentric';
|
|
8
8
|
export type TriaxialParameters = {radii: readonly [number, number, number]};
|