@math.gl/geospatial 5.0.0-beta.3 → 5.0.0-beta.5
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 +192 -2
- package/THIRD-PARTY-NOTICES.md +192 -20
- package/dist/expressions.d.ts +1 -1
- package/dist/expressions.d.ts.map +1 -1
- package/dist/index.cjs +456 -4614
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/projection/experimental/common/adjust_lat.js +1 -1
- package/dist/projection/experimental/common/adjust_lat.js.map +1 -1
- package/dist/projection/experimental/common/adjust_lon.js +1 -1
- package/dist/projection/experimental/common/adjust_lon.js.map +1 -1
- package/dist/projection/experimental/common/asinhy.js +1 -1
- package/dist/projection/experimental/common/asinhy.js.map +1 -1
- package/dist/projection/experimental/common/asinz.js +1 -1
- package/dist/projection/experimental/common/asinz.js.map +1 -1
- package/dist/projection/experimental/common/authlat.js +1 -1
- package/dist/projection/experimental/common/authlat.js.map +1 -1
- package/dist/projection/experimental/common/authset.js +1 -1
- package/dist/projection/experimental/common/authset.js.map +1 -1
- package/dist/projection/experimental/common/clens.js +1 -1
- package/dist/projection/experimental/common/clens.js.map +1 -1
- package/dist/projection/experimental/common/clens_cmplx.js +1 -1
- package/dist/projection/experimental/common/clens_cmplx.js.map +1 -1
- package/dist/projection/experimental/common/constants.js +1 -1
- package/dist/projection/experimental/common/constants.js.map +1 -1
- package/dist/projection/experimental/common/cosh.js +1 -1
- package/dist/projection/experimental/common/cosh.js.map +1 -1
- package/dist/projection/experimental/common/e0fn.js +1 -1
- package/dist/projection/experimental/common/e0fn.js.map +1 -1
- package/dist/projection/experimental/common/e1fn.js +1 -1
- package/dist/projection/experimental/common/e1fn.js.map +1 -1
- package/dist/projection/experimental/common/e2fn.js +1 -1
- package/dist/projection/experimental/common/e2fn.js.map +1 -1
- package/dist/projection/experimental/common/e3fn.js +1 -1
- package/dist/projection/experimental/common/e3fn.js.map +1 -1
- package/dist/projection/experimental/common/fL.js +1 -1
- package/dist/projection/experimental/common/fL.js.map +1 -1
- package/dist/projection/experimental/common/gN.js +1 -1
- package/dist/projection/experimental/common/gN.js.map +1 -1
- package/dist/projection/experimental/common/gatg.js +1 -1
- package/dist/projection/experimental/common/gatg.js.map +1 -1
- package/dist/projection/experimental/common/hypot.js +1 -1
- package/dist/projection/experimental/common/hypot.js.map +1 -1
- package/dist/projection/experimental/common/imlfn.js +1 -1
- package/dist/projection/experimental/common/imlfn.js.map +1 -1
- package/dist/projection/experimental/common/invlatiso.js +1 -1
- package/dist/projection/experimental/common/invlatiso.js.map +1 -1
- package/dist/projection/experimental/common/iqsfnz.js +1 -1
- package/dist/projection/experimental/common/iqsfnz.js.map +1 -1
- package/dist/projection/experimental/common/latiso.js +1 -1
- package/dist/projection/experimental/common/latiso.js.map +1 -1
- package/dist/projection/experimental/common/log1py.js +1 -1
- package/dist/projection/experimental/common/log1py.js.map +1 -1
- package/dist/projection/experimental/common/mlfn.js +1 -1
- package/dist/projection/experimental/common/mlfn.js.map +1 -1
- package/dist/projection/experimental/common/msfnz.js +1 -1
- package/dist/projection/experimental/common/msfnz.js.map +1 -1
- package/dist/projection/experimental/common/phi2z.js +1 -1
- package/dist/projection/experimental/common/phi2z.js.map +1 -1
- package/dist/projection/experimental/common/pj_enfn.js +1 -1
- package/dist/projection/experimental/common/pj_enfn.js.map +1 -1
- package/dist/projection/experimental/common/pj_inv_mlfn.js +1 -1
- package/dist/projection/experimental/common/pj_inv_mlfn.js.map +1 -1
- package/dist/projection/experimental/common/pj_mlfn.js +1 -1
- package/dist/projection/experimental/common/pj_mlfn.js.map +1 -1
- package/dist/projection/experimental/common/qsfnz.js +1 -1
- package/dist/projection/experimental/common/qsfnz.js.map +1 -1
- package/dist/projection/experimental/common/sign.js +1 -1
- package/dist/projection/experimental/common/sign.js.map +1 -1
- package/dist/projection/experimental/common/sinh.js +1 -1
- package/dist/projection/experimental/common/sinh.js.map +1 -1
- package/dist/projection/experimental/common/srat.js +1 -1
- package/dist/projection/experimental/common/srat.js.map +1 -1
- package/dist/projection/experimental/common/tsfnz.js +1 -1
- package/dist/projection/experimental/common/tsfnz.js.map +1 -1
- package/dist/projection/experimental/common/vincenty.js +1 -1
- package/dist/projection/experimental/common/vincenty.js.map +1 -1
- package/dist/projection/experimental/core.cjs +100 -2
- package/dist/projection/experimental/core.cjs.map +2 -2
- package/dist/projection/experimental/core.d.ts +1 -0
- package/dist/projection/experimental/core.d.ts.map +1 -1
- package/dist/projection/experimental/crs/datum-table.js +1 -1
- package/dist/projection/experimental/crs/datum-table.js.map +1 -1
- package/dist/projection/experimental/crs/ellipsoid-table.js +1 -1
- package/dist/projection/experimental/crs/ellipsoid-table.js.map +1 -1
- package/dist/projection/experimental/crs/primemeridian-table.js +1 -1
- package/dist/projection/experimental/crs/primemeridian-table.js.map +1 -1
- package/dist/projection/experimental/crs/structured.js +1 -1
- package/dist/projection/experimental/crs/structured.js.map +1 -1
- package/dist/projection/experimental/crs/wkt.js +1 -1
- package/dist/projection/experimental/crs/wkt.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/ellipsoidal-gnomonic.js +1 -1
- package/dist/projection/experimental/ellipsoidal-gnomonic.js.map +1 -1
- package/dist/projection/experimental/entries/projections/eqc.cjs +1 -0
- package/dist/projection/experimental/entries/projections/eqc.cjs.map +1 -1
- package/dist/projection/experimental/entries/projections/merc.cjs +1 -0
- package/dist/projection/experimental/entries/projections/merc.cjs.map +1 -1
- package/dist/projection/experimental/grids/geotiff.js +1 -1
- package/dist/projection/experimental/grids/geotiff.js.map +1 -1
- package/dist/projection/experimental/grids/ntv2.js +1 -1
- package/dist/projection/experimental/grids/ntv2.js.map +1 -1
- package/dist/projection/experimental/index.cjs +102 -2
- package/dist/projection/experimental/index.cjs.map +3 -3
- package/dist/projection/experimental/kernels/aea.js +1 -1
- package/dist/projection/experimental/kernels/aea.js.map +1 -1
- package/dist/projection/experimental/kernels/aeqd.js +1 -1
- package/dist/projection/experimental/kernels/aeqd.js.map +1 -1
- package/dist/projection/experimental/kernels/bonne.js +1 -1
- package/dist/projection/experimental/kernels/bonne.js.map +1 -1
- package/dist/projection/experimental/kernels/cass.js +1 -1
- package/dist/projection/experimental/kernels/cass.js.map +1 -1
- package/dist/projection/experimental/kernels/cea.js +1 -1
- package/dist/projection/experimental/kernels/cea.js.map +1 -1
- package/dist/projection/experimental/kernels/eck6.js +1 -1
- package/dist/projection/experimental/kernels/eck6.js.map +1 -1
- package/dist/projection/experimental/kernels/eqdc.js +1 -1
- package/dist/projection/experimental/kernels/eqdc.js.map +1 -1
- package/dist/projection/experimental/kernels/eqearth.js +1 -1
- package/dist/projection/experimental/kernels/eqearth.js.map +1 -1
- package/dist/projection/experimental/kernels/equi.js +1 -1
- package/dist/projection/experimental/kernels/equi.js.map +1 -1
- package/dist/projection/experimental/kernels/etmerc.js +1 -1
- package/dist/projection/experimental/kernels/etmerc.js.map +1 -1
- package/dist/projection/experimental/kernels/gauss.js +1 -1
- package/dist/projection/experimental/kernels/gauss.js.map +1 -1
- package/dist/projection/experimental/kernels/geos.js +1 -1
- package/dist/projection/experimental/kernels/geos.js.map +1 -1
- package/dist/projection/experimental/kernels/gnom.js +1 -1
- package/dist/projection/experimental/kernels/gnom.js.map +1 -1
- package/dist/projection/experimental/kernels/gstmerc.js +1 -1
- package/dist/projection/experimental/kernels/gstmerc.js.map +1 -1
- package/dist/projection/experimental/kernels/krovak.js +1 -1
- package/dist/projection/experimental/kernels/krovak.js.map +1 -1
- package/dist/projection/experimental/kernels/laea.js +1 -1
- package/dist/projection/experimental/kernels/laea.js.map +1 -1
- package/dist/projection/experimental/kernels/lcc.js +1 -1
- package/dist/projection/experimental/kernels/lcc.js.map +1 -1
- package/dist/projection/experimental/kernels/mill.js +1 -1
- package/dist/projection/experimental/kernels/mill.js.map +1 -1
- package/dist/projection/experimental/kernels/moll.js +1 -1
- package/dist/projection/experimental/kernels/moll.js.map +1 -1
- package/dist/projection/experimental/kernels/nzmg.js +1 -1
- package/dist/projection/experimental/kernels/nzmg.js.map +1 -1
- package/dist/projection/experimental/kernels/omerc.js +1 -1
- package/dist/projection/experimental/kernels/omerc.js.map +1 -1
- package/dist/projection/experimental/kernels/poly.js +1 -1
- package/dist/projection/experimental/kernels/poly.js.map +1 -1
- package/dist/projection/experimental/kernels/qsc.js +1 -1
- package/dist/projection/experimental/kernels/qsc.js.map +1 -1
- package/dist/projection/experimental/kernels/robin.js +1 -1
- package/dist/projection/experimental/kernels/robin.js.map +1 -1
- package/dist/projection/experimental/kernels/sinu.js +1 -1
- package/dist/projection/experimental/kernels/sinu.js.map +1 -1
- package/dist/projection/experimental/kernels/somerc.js +1 -1
- package/dist/projection/experimental/kernels/somerc.js.map +1 -1
- package/dist/projection/experimental/kernels/stere.js +1 -1
- package/dist/projection/experimental/kernels/stere.js.map +1 -1
- package/dist/projection/experimental/kernels/sterea.js +1 -1
- package/dist/projection/experimental/kernels/sterea.js.map +1 -1
- package/dist/projection/experimental/kernels/tmerc.js +1 -1
- package/dist/projection/experimental/kernels/tmerc.js.map +1 -1
- package/dist/projection/experimental/kernels/tpers.js +1 -1
- package/dist/projection/experimental/kernels/tpers.js.map +1 -1
- package/dist/projection/experimental/kernels/vandg.js +1 -1
- package/dist/projection/experimental/kernels/vandg.js.map +1 -1
- package/dist/projection/experimental/kinematic-helmert.js +1 -1
- package/dist/projection/experimental/kinematic-helmert.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/index.cjs +100 -2
- package/dist/projection/experimental/lazy-projections/index.cjs.map +2 -2
- package/dist/projection/experimental/projections/equidistant-cylindrical.d.ts.map +1 -1
- package/dist/projection/experimental/projections/equidistant-cylindrical.js +1 -0
- package/dist/projection/experimental/projections/equidistant-cylindrical.js.map +1 -1
- package/dist/projection/experimental/projections/mercator.d.ts.map +1 -1
- package/dist/projection/experimental/projections/mercator.js +1 -0
- package/dist/projection/experimental/projections/mercator.js.map +1 -1
- package/dist/projection/experimental/transform-description.d.ts +8 -0
- package/dist/projection/experimental/transform-description.d.ts.map +1 -0
- package/dist/projection/experimental/transform-description.js +57 -0
- package/dist/projection/experimental/transform-description.js.map +1 -0
- package/dist/projection/experimental/types.d.ts +5 -0
- package/dist/projection/experimental/types.d.ts.map +1 -1
- package/dist/projection/experimental/typescript-projection.d.ts +4 -0
- package/dist/projection/experimental/typescript-projection.d.ts.map +1 -1
- package/dist/projection/experimental/typescript-projection.js +54 -5
- package/dist/projection/experimental/typescript-projection.js.map +1 -1
- package/dist/projection/index.cjs +102 -2
- package/dist/projection/index.cjs.map +3 -3
- package/dist/projection/transform-analysis.cjs +100 -2
- package/dist/projection/transform-analysis.cjs.map +2 -2
- package/dist/projection/transform-description.d.ts +44 -0
- package/dist/projection/transform-description.d.ts.map +1 -0
- package/dist/projection/transform-description.js +5 -0
- package/dist/projection/transform-description.js.map +1 -0
- package/dist/projection/types.d.ts +4 -0
- package/dist/projection/types.d.ts.map +1 -1
- package/dist/tasks/definitions.d.ts +3 -3
- package/dist/tasks/index.cjs +107 -2
- package/dist/tasks/index.cjs.map +3 -3
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/map-worker.js +1 -1
- package/dist/tasks/map-worker.js.map +1 -1
- package/dist/tasks/operations.d.ts +1 -1
- package/dist/tasks/operations.d.ts.map +1 -1
- package/dist/tasks/projection-worker.js +1 -1
- package/dist/tasks/projection-worker.js.map +1 -1
- package/dist/terrain/contour-boundary-diagnostics.d.ts +23 -0
- package/dist/terrain/contour-boundary-diagnostics.d.ts.map +1 -0
- package/dist/terrain/contour-boundary-diagnostics.js +62 -0
- package/dist/terrain/contour-boundary-diagnostics.js.map +1 -0
- package/dist/terrain/contour-mixed-weld.d.ts +25 -0
- package/dist/terrain/contour-mixed-weld.d.ts.map +1 -0
- package/dist/terrain/contour-mixed-weld.js +194 -0
- package/dist/terrain/contour-mixed-weld.js.map +1 -0
- package/dist/terrain/contour-tile-paths.d.ts +7 -0
- package/dist/terrain/contour-tile-paths.d.ts.map +1 -0
- package/dist/terrain/contour-tile-paths.js +12 -0
- package/dist/terrain/contour-tile-paths.js.map +1 -0
- package/dist/terrain/contour-tile-weld.d.ts +24 -0
- package/dist/terrain/contour-tile-weld.d.ts.map +1 -0
- package/dist/terrain/contour-tile-weld.js +147 -0
- package/dist/terrain/contour-tile-weld.js.map +1 -0
- package/dist/terrain/gradient-pyramid.d.ts +29 -0
- package/dist/terrain/gradient-pyramid.d.ts.map +1 -0
- package/dist/terrain/gradient-pyramid.js +94 -0
- package/dist/terrain/gradient-pyramid.js.map +1 -0
- package/dist/terrain/height-field.d.ts.map +1 -1
- package/dist/terrain/height-field.js +48 -5
- package/dist/terrain/height-field.js.map +1 -1
- package/dist/terrain/index.cjs +448 -4
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +9 -0
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +5 -0
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/tiled.d.ts +10 -2
- package/dist/terrain/tiled.d.ts.map +1 -1
- package/dist/terrain/tiled.js +5 -1
- package/dist/terrain/tiled.js.map +1 -1
- package/dist/terrain/types.d.ts +6 -0
- package/dist/terrain/types.d.ts.map +1 -1
- package/dist/turf.cjs +25 -671
- package/dist/turf.cjs.map +3 -3
- 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/package.json +15 -19
- package/src/expressions.ts +1 -1
- package/src/index.ts +15 -123
- package/src/projection/experimental/common/adjust_lat.ts +1 -1
- package/src/projection/experimental/common/adjust_lon.ts +1 -1
- package/src/projection/experimental/common/asinhy.ts +1 -1
- package/src/projection/experimental/common/asinz.ts +1 -1
- package/src/projection/experimental/common/authlat.ts +1 -1
- package/src/projection/experimental/common/authset.ts +1 -1
- package/src/projection/experimental/common/clens.ts +1 -1
- package/src/projection/experimental/common/clens_cmplx.ts +1 -1
- package/src/projection/experimental/common/constants.ts +1 -1
- package/src/projection/experimental/common/cosh.ts +1 -1
- package/src/projection/experimental/common/e0fn.ts +1 -1
- package/src/projection/experimental/common/e1fn.ts +1 -1
- package/src/projection/experimental/common/e2fn.ts +1 -1
- package/src/projection/experimental/common/e3fn.ts +1 -1
- package/src/projection/experimental/common/fL.ts +1 -1
- package/src/projection/experimental/common/gN.ts +1 -1
- package/src/projection/experimental/common/gatg.ts +1 -1
- package/src/projection/experimental/common/hypot.ts +1 -1
- package/src/projection/experimental/common/imlfn.ts +1 -1
- package/src/projection/experimental/common/invlatiso.ts +1 -1
- package/src/projection/experimental/common/iqsfnz.ts +1 -1
- package/src/projection/experimental/common/latiso.ts +1 -1
- package/src/projection/experimental/common/log1py.ts +1 -1
- package/src/projection/experimental/common/mlfn.ts +1 -1
- package/src/projection/experimental/common/msfnz.ts +1 -1
- package/src/projection/experimental/common/phi2z.ts +1 -1
- package/src/projection/experimental/common/pj_enfn.ts +1 -1
- package/src/projection/experimental/common/pj_inv_mlfn.ts +1 -1
- package/src/projection/experimental/common/pj_mlfn.ts +1 -1
- package/src/projection/experimental/common/qsfnz.ts +1 -1
- package/src/projection/experimental/common/sign.ts +1 -1
- package/src/projection/experimental/common/sinh.ts +1 -1
- package/src/projection/experimental/common/srat.ts +1 -1
- package/src/projection/experimental/common/tsfnz.ts +1 -1
- package/src/projection/experimental/common/vincenty.ts +1 -1
- package/src/projection/experimental/core.ts +8 -0
- package/src/projection/experimental/crs/datum-table.ts +1 -1
- package/src/projection/experimental/crs/ellipsoid-table.ts +1 -1
- package/src/projection/experimental/crs/primemeridian-table.ts +1 -1
- package/src/projection/experimental/crs/structured.ts +1 -1
- package/src/projection/experimental/crs/wkt.ts +1 -1
- package/src/projection/experimental/datum.ts +1 -1
- package/src/projection/experimental/ellipsoidal-gnomonic.ts +1 -1
- package/src/projection/experimental/exact-helmert.ts +1 -1
- package/src/projection/experimental/grids/geotiff.ts +1 -1
- package/src/projection/experimental/grids/grid.ts +1 -1
- package/src/projection/experimental/grids/ntv2.ts +1 -1
- package/src/projection/experimental/helmert-flat.ts +1 -1
- package/src/projection/experimental/kernels/aea.ts +1 -1
- package/src/projection/experimental/kernels/aeqd.ts +1 -1
- package/src/projection/experimental/kernels/bonne.ts +1 -1
- package/src/projection/experimental/kernels/cass.ts +1 -1
- package/src/projection/experimental/kernels/cea.ts +1 -1
- package/src/projection/experimental/kernels/eck6.ts +1 -1
- package/src/projection/experimental/kernels/eqdc.ts +1 -1
- package/src/projection/experimental/kernels/eqearth.ts +1 -1
- package/src/projection/experimental/kernels/equi.ts +1 -1
- package/src/projection/experimental/kernels/etmerc.ts +1 -1
- package/src/projection/experimental/kernels/gauss.ts +1 -1
- package/src/projection/experimental/kernels/geos.ts +1 -1
- package/src/projection/experimental/kernels/gnom.ts +1 -1
- package/src/projection/experimental/kernels/gstmerc.ts +1 -1
- package/src/projection/experimental/kernels/krovak.ts +1 -1
- package/src/projection/experimental/kernels/laea.ts +1 -1
- package/src/projection/experimental/kernels/lcc.ts +1 -1
- package/src/projection/experimental/kernels/mill.ts +1 -1
- package/src/projection/experimental/kernels/moll.ts +1 -1
- package/src/projection/experimental/kernels/nzmg.ts +1 -1
- package/src/projection/experimental/kernels/omerc.ts +1 -1
- package/src/projection/experimental/kernels/ortho.ts +1 -1
- package/src/projection/experimental/kernels/poly.ts +1 -1
- package/src/projection/experimental/kernels/qsc.ts +1 -1
- package/src/projection/experimental/kernels/robin.ts +1 -1
- package/src/projection/experimental/kernels/sinu.ts +1 -1
- package/src/projection/experimental/kernels/somerc.ts +1 -1
- package/src/projection/experimental/kernels/stere.ts +1 -1
- package/src/projection/experimental/kernels/sterea.ts +1 -1
- package/src/projection/experimental/kernels/tmerc.ts +1 -1
- package/src/projection/experimental/kernels/tpers.ts +1 -1
- package/src/projection/experimental/kernels/vandg.ts +1 -1
- package/src/projection/experimental/kinematic-helmert-flat.ts +1 -1
- package/src/projection/experimental/kinematic-helmert.ts +1 -1
- package/src/projection/experimental/projection-pipeline.ts +1 -1
- package/src/projection/experimental/projections/equidistant-cylindrical.ts +1 -0
- package/src/projection/experimental/projections/mercator.ts +1 -0
- package/src/projection/experimental/projections/ob-tran.ts +1 -1
- package/src/projection/experimental/transform-description.ts +82 -0
- package/src/projection/experimental/types.ts +5 -0
- package/src/projection/experimental/typescript-projection.ts +54 -6
- package/src/projection/transform-description.ts +69 -0
- package/src/projection/types.ts +11 -0
- package/src/tasks/definitions.ts +1 -1
- package/src/tasks/index.ts +1 -1
- package/src/tasks/map-worker.ts +1 -1
- package/src/tasks/operations.ts +1 -1
- package/src/tasks/projection-worker.ts +1 -1
- package/src/terrain/contour-boundary-diagnostics.ts +90 -0
- package/src/terrain/contour-mixed-weld.ts +254 -0
- package/src/terrain/contour-tile-paths.ts +20 -0
- package/src/terrain/contour-tile-weld.ts +182 -0
- package/src/terrain/gradient-pyramid.ts +129 -0
- package/src/terrain/height-field.ts +45 -5
- package/src/terrain/index.ts +12 -0
- package/src/terrain/tiled.ts +16 -3
- package/src/terrain/types.ts +9 -1
- package/src/turf.ts +7 -3
- package/crs/README.md +0 -84
- package/crs/schemas/README.md +0 -9
- package/dist/geoarrow/builder-entry.d.ts +0 -4
- package/dist/geoarrow/builder-entry.d.ts.map +0 -1
- package/dist/geoarrow/builder-entry.js +0 -5
- package/dist/geoarrow/builder-entry.js.map +0 -1
- package/dist/geoarrow/builder.d.ts +0 -106
- package/dist/geoarrow/builder.d.ts.map +0 -1
- package/dist/geoarrow/builder.js +0 -668
- package/dist/geoarrow/builder.js.map +0 -1
- package/dist/geoarrow/codecs.d.ts +0 -24
- package/dist/geoarrow/codecs.d.ts.map +0 -1
- package/dist/geoarrow/codecs.js +0 -916
- package/dist/geoarrow/codecs.js.map +0 -1
- package/dist/geoarrow/index.cjs +0 -4352
- package/dist/geoarrow/index.cjs.map +0 -6
- package/dist/geoarrow/index.d.ts +0 -21
- package/dist/geoarrow/index.d.ts.map +0 -1
- package/dist/geoarrow/index.js +0 -15
- package/dist/geoarrow/index.js.map +0 -1
- package/dist/geoarrow/kernels.d.ts +0 -56
- package/dist/geoarrow/kernels.d.ts.map +0 -1
- package/dist/geoarrow/kernels.js +0 -982
- package/dist/geoarrow/kernels.js.map +0 -1
- package/dist/geoarrow/layout.d.ts +0 -66
- package/dist/geoarrow/layout.d.ts.map +0 -1
- package/dist/geoarrow/layout.js +0 -723
- package/dist/geoarrow/layout.js.map +0 -1
- package/dist/geoarrow/stream-tessellate.d.ts +0 -34
- package/dist/geoarrow/stream-tessellate.d.ts.map +0 -1
- package/dist/geoarrow/stream-tessellate.js +0 -171
- package/dist/geoarrow/stream-tessellate.js.map +0 -1
- package/dist/geoarrow/stream.d.ts +0 -29
- package/dist/geoarrow/stream.d.ts.map +0 -1
- package/dist/geoarrow/stream.js +0 -100
- package/dist/geoarrow/stream.js.map +0 -1
- package/dist/geoarrow/tessellate.d.ts +0 -31
- package/dist/geoarrow/tessellate.d.ts.map +0 -1
- package/dist/geoarrow/tessellate.js +0 -102
- package/dist/geoarrow/tessellate.js.map +0 -1
- package/dist/geoarrow/tessellation-entry.d.ts +0 -4
- package/dist/geoarrow/tessellation-entry.d.ts.map +0 -1
- package/dist/geoarrow/tessellation-entry.js +0 -5
- package/dist/geoarrow/tessellation-entry.js.map +0 -1
- package/dist/geoarrow/types.d.ts +0 -155
- package/dist/geoarrow/types.d.ts.map +0 -1
- package/dist/geoarrow/types.js +0 -71
- package/dist/geoarrow/types.js.map +0 -1
- package/dist/geoarrow/views.d.ts +0 -45
- package/dist/geoarrow/views.d.ts.map +0 -1
- package/dist/geoarrow/views.js +0 -114
- package/dist/geoarrow/views.js.map +0 -1
- package/dist/geoarrow/wkb-entry.d.ts +0 -4
- package/dist/geoarrow/wkb-entry.d.ts.map +0 -1
- package/dist/geoarrow/wkb-entry.js +0 -6
- package/dist/geoarrow/wkb-entry.js.map +0 -1
- package/dist/geoarrow/worker.d.ts +0 -11
- package/dist/geoarrow/worker.d.ts.map +0 -1
- package/dist/geoarrow/worker.js +0 -10
- package/dist/geoarrow/worker.js.map +0 -1
- package/dist/wkb/index.d.ts +0 -11
- package/dist/wkb/index.d.ts.map +0 -1
- package/dist/wkb/index.js +0 -9
- package/dist/wkb/index.js.map +0 -1
- package/dist/wkb/types.d.ts +0 -30
- package/dist/wkb/types.d.ts.map +0 -1
- package/dist/wkb/types.js +0 -34
- package/dist/wkb/types.js.map +0 -1
- package/dist/wkb/wkb-builder.d.ts +0 -91
- package/dist/wkb/wkb-builder.d.ts.map +0 -1
- package/dist/wkb/wkb-builder.js +0 -283
- package/dist/wkb/wkb-builder.js.map +0 -1
- package/dist/wkb/wkb-reader.d.ts +0 -74
- package/dist/wkb/wkb-reader.d.ts.map +0 -1
- package/dist/wkb/wkb-reader.js +0 -251
- package/dist/wkb/wkb-reader.js.map +0 -1
- package/dist/wkb/wkb.d.ts +0 -21
- package/dist/wkb/wkb.d.ts.map +0 -1
- package/dist/wkb/wkb.js +0 -204
- package/dist/wkb/wkb.js.map +0 -1
- package/dist/wkb/wkt.d.ts +0 -19
- package/dist/wkb/wkt.d.ts.map +0 -1
- package/dist/wkb/wkt.js +0 -321
- package/dist/wkb/wkt.js.map +0 -1
- package/projection/THIRD-PARTY-NOTICES.md +0 -210
- package/src/discontinuous/elastic/README.md +0 -20
- package/src/discontinuous/spherical-clip/README.md +0 -16
- package/src/discontinuous/world-kernels/README.md +0 -24
- package/src/geoarrow/builder-entry.ts +0 -18
- package/src/geoarrow/builder.ts +0 -860
- package/src/geoarrow/codecs.ts +0 -1268
- package/src/geoarrow/index.ts +0 -111
- package/src/geoarrow/kernels.ts +0 -1290
- package/src/geoarrow/layout.ts +0 -900
- package/src/geoarrow/stream-tessellate.ts +0 -205
- package/src/geoarrow/stream.ts +0 -130
- package/src/geoarrow/tessellate.ts +0 -133
- package/src/geoarrow/tessellation-entry.ts +0 -7
- package/src/geoarrow/types.ts +0 -259
- package/src/geoarrow/views.ts +0 -150
- package/src/geoarrow/wkb-entry.ts +0 -13
- package/src/geoarrow/worker.ts +0 -20
- package/src/terrain/vendor/README.md +0 -20
- package/src/vendor/geographiclib-geodesic/README.md +0 -26
- package/src/wkb/index.ts +0 -38
- package/src/wkb/types.ts +0 -54
- package/src/wkb/wkb-builder.ts +0 -395
- package/src/wkb/wkb-reader.ts +0 -401
- package/src/wkb/wkb.ts +0 -255
- package/src/wkb/wkt.ts +0 -375
- /package/{projection/APACHE-2.0-LICENSE.txt → APACHE-2.0-LICENSE.txt} +0 -0
- /package/{projection/PROJ-LICENSE.txt → PROJ-LICENSE.txt} +0 -0
- /package/{projection/PROJ4-LICENSE.md → PROJ4-LICENSE.md} +0 -0
- /package/{crs/schemas → src/crs}/projjson.schema.json +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {TerrainContours} from './contours';
|
|
6
|
+
import {
|
|
7
|
+
contourPathLimits,
|
|
8
|
+
validateContourData,
|
|
9
|
+
validateContourVertex,
|
|
10
|
+
type TerrainContourPathLimits
|
|
11
|
+
} from './contour-path-data';
|
|
12
|
+
|
|
13
|
+
export type TerrainContourTile = {column: number; row: number; contours: TerrainContours};
|
|
14
|
+
export type TerrainContourTileWeldOptions = TerrainContourPathLimits & {
|
|
15
|
+
/** Number of vertices in each vertex-registered tile. */
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
/** Maximum world-frame XY disagreement for a matching lattice point. Default zero. */
|
|
19
|
+
maxPositionDifference?: number;
|
|
20
|
+
maxTiles?: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Weld coincident contour vertices on same-level vertex-tile boundaries.
|
|
24
|
+
* Tiles share an integer lattice and identical contour levels and height reference.
|
|
25
|
+
* Boundary identity uses exact global grid coordinates, not a spatial tolerance.
|
|
26
|
+
* Missing tiles or missing source triangles remain open; no segments are invented.
|
|
27
|
+
* The output grid coordinates are global lattice coordinates, and its origin is
|
|
28
|
+
* taken from the lexicographically first tile. Equivalent inputs are order independent.
|
|
29
|
+
*/
|
|
30
|
+
export function weldTerrainContourTiles(
|
|
31
|
+
tiles: readonly TerrainContourTile[],
|
|
32
|
+
options: TerrainContourTileWeldOptions
|
|
33
|
+
): TerrainContours {
|
|
34
|
+
const {width, height} = options;
|
|
35
|
+
const limits = contourPathLimits(options);
|
|
36
|
+
const tolerance = options.maxPositionDifference ?? 0;
|
|
37
|
+
const maxTiles = options.maxTiles ?? 4096;
|
|
38
|
+
if (
|
|
39
|
+
!Number.isSafeInteger(width) ||
|
|
40
|
+
width < 2 ||
|
|
41
|
+
!Number.isSafeInteger(height) ||
|
|
42
|
+
height < 2 ||
|
|
43
|
+
!Number.isFinite(tolerance) ||
|
|
44
|
+
tolerance < 0 ||
|
|
45
|
+
!Number.isSafeInteger(maxTiles) ||
|
|
46
|
+
maxTiles < 1 ||
|
|
47
|
+
tiles.length > maxTiles ||
|
|
48
|
+
!tiles.length
|
|
49
|
+
)
|
|
50
|
+
throw new Error('Invalid terrain contour tile dimensions or tolerance');
|
|
51
|
+
const sorted = [...tiles].sort((a, b) => a.column - b.column || a.row - b.row);
|
|
52
|
+
const first = sorted[0].contours;
|
|
53
|
+
const origin: [number, number, number] = [...first.origin];
|
|
54
|
+
const levels = first.levels.slice();
|
|
55
|
+
const positions: number[] = [],
|
|
56
|
+
grid: number[] = [],
|
|
57
|
+
segments: number[] = [],
|
|
58
|
+
levelIndices: number[] = [];
|
|
59
|
+
const vertices = new Map<string, {id: number; tile: number}>();
|
|
60
|
+
const edges = new Map<string, number>();
|
|
61
|
+
const addresses = new Set<string>();
|
|
62
|
+
let inputVertices = 0;
|
|
63
|
+
let inputSegments = 0;
|
|
64
|
+
for (let tileIndex = 0; tileIndex < sorted.length; tileIndex++) {
|
|
65
|
+
const tile = sorted[tileIndex],
|
|
66
|
+
data = tile.contours;
|
|
67
|
+
const id = `${tile.column},${tile.row}`;
|
|
68
|
+
if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row) || addresses.has(id))
|
|
69
|
+
throw new Error('Invalid or duplicate terrain contour tile address');
|
|
70
|
+
addresses.add(id);
|
|
71
|
+
const x0 = tile.column * (width - 1),
|
|
72
|
+
y0 = tile.row * (height - 1);
|
|
73
|
+
if (![x0, y0, x0 + width - 1, y0 + height - 1].every(Number.isSafeInteger))
|
|
74
|
+
throw new Error('Terrain contour tile lattice overflow');
|
|
75
|
+
const count = validateContourData(data, limits);
|
|
76
|
+
inputVertices += count;
|
|
77
|
+
if (inputVertices > limits.maxVertices)
|
|
78
|
+
throw new Error('Terrain contour input vertex capacity exceeded');
|
|
79
|
+
if (
|
|
80
|
+
data.heightReference !== first.heightReference ||
|
|
81
|
+
data.levels.length !== levels.length ||
|
|
82
|
+
!data.levels.every((level, i) => level === levels[i])
|
|
83
|
+
)
|
|
84
|
+
throw new Error('Terrain contour tile levels or height reference differ');
|
|
85
|
+
if (
|
|
86
|
+
!(data.segments instanceof Uint32Array) ||
|
|
87
|
+
data.segments.length % 2 ||
|
|
88
|
+
!(data.levelIndices instanceof Uint32Array) ||
|
|
89
|
+
data.levelIndices.length !== data.segments.length / 2 ||
|
|
90
|
+
data.levelIndices.length > limits.maxSegments
|
|
91
|
+
)
|
|
92
|
+
throw new Error('Invalid terrain contour tile segments');
|
|
93
|
+
inputSegments += data.levelIndices.length;
|
|
94
|
+
if (inputSegments > limits.maxSegments)
|
|
95
|
+
throw new Error('Terrain contour input segment capacity exceeded');
|
|
96
|
+
const assigned = new Uint32Array(count).fill(0xffffffff);
|
|
97
|
+
const remap = new Uint32Array(count).fill(0xffffffff);
|
|
98
|
+
const localBoundary = new Set<string>();
|
|
99
|
+
const mapVertex = (source: number, level: number): number => {
|
|
100
|
+
validateContourVertex(data, source, level, assigned);
|
|
101
|
+
if (remap[source] !== 0xffffffff) return remap[source];
|
|
102
|
+
const x = data.gridCoordinates[2 * source],
|
|
103
|
+
y = data.gridCoordinates[2 * source + 1];
|
|
104
|
+
if (x < 0 || x > width - 1 || y < 0 || y > height - 1)
|
|
105
|
+
throw new Error('Terrain contour vertex outside tile lattice');
|
|
106
|
+
const gx = x0 + x,
|
|
107
|
+
gy = y0 + y;
|
|
108
|
+
if (
|
|
109
|
+
!Number.isFinite(gx) ||
|
|
110
|
+
!Number.isFinite(gy) ||
|
|
111
|
+
(x % 1 !== 0 && Number.isInteger(gx)) ||
|
|
112
|
+
(y % 1 !== 0 && Number.isInteger(gy))
|
|
113
|
+
)
|
|
114
|
+
throw new Error('Terrain contour tile lattice loses precision');
|
|
115
|
+
const px = data.positions[3 * source] + (data.origin[0] - origin[0]);
|
|
116
|
+
const py = data.positions[3 * source + 1] + (data.origin[1] - origin[1]);
|
|
117
|
+
if (!Number.isFinite(px) || !Number.isFinite(py))
|
|
118
|
+
throw new Error('Terrain contour frame overflow');
|
|
119
|
+
const boundary = x === 0 || y === 0 || x === width - 1 || y === height - 1;
|
|
120
|
+
// Keep the integer lattice coordinate and local fractional remainder separate.
|
|
121
|
+
// Adding a small fraction to a large tile offset can round distinct points
|
|
122
|
+
// to the same binary64 global coordinate and must not weld them together.
|
|
123
|
+
const xi = Math.floor(x),
|
|
124
|
+
yi = Math.floor(y);
|
|
125
|
+
const vertexKey = `${level}/${x0 + xi}/${x - xi}/${y0 + yi}/${y - yi}`;
|
|
126
|
+
if (boundary) {
|
|
127
|
+
if (localBoundary.has(vertexKey))
|
|
128
|
+
throw new Error('Duplicate terrain contour boundary vertex');
|
|
129
|
+
localBoundary.add(vertexKey);
|
|
130
|
+
}
|
|
131
|
+
const found = boundary ? vertices.get(vertexKey) : undefined;
|
|
132
|
+
if (found) {
|
|
133
|
+
if (found.tile === tileIndex) throw new Error('Duplicate terrain contour boundary vertex');
|
|
134
|
+
const delta = Math.hypot(px - positions[3 * found.id], py - positions[3 * found.id + 1]);
|
|
135
|
+
if (!Number.isFinite(delta) || delta > tolerance)
|
|
136
|
+
throw new Error('Terrain contour boundary positions disagree');
|
|
137
|
+
remap[source] = found.id;
|
|
138
|
+
return found.id;
|
|
139
|
+
}
|
|
140
|
+
if (positions.length / 3 >= limits.maxVertices)
|
|
141
|
+
throw new Error('Terrain contour vertex capacity exceeded');
|
|
142
|
+
const output = positions.length / 3;
|
|
143
|
+
const pz = levels[level] - origin[2];
|
|
144
|
+
if (!Number.isFinite(pz)) throw new Error('Terrain contour frame overflow');
|
|
145
|
+
positions.push(px, py, pz);
|
|
146
|
+
grid.push(gx, gy);
|
|
147
|
+
if (boundary) vertices.set(vertexKey, {id: output, tile: tileIndex});
|
|
148
|
+
remap[source] = output;
|
|
149
|
+
return output;
|
|
150
|
+
};
|
|
151
|
+
for (let i = 0; i < data.levelIndices.length; i++) {
|
|
152
|
+
const level = data.levelIndices[i],
|
|
153
|
+
a = mapVertex(data.segments[2 * i], level),
|
|
154
|
+
b = mapVertex(data.segments[2 * i + 1], level);
|
|
155
|
+
if (
|
|
156
|
+
a === b ||
|
|
157
|
+
(positions[3 * a] === positions[3 * b] && positions[3 * a + 1] === positions[3 * b + 1])
|
|
158
|
+
)
|
|
159
|
+
throw new Error('Degenerate terrain contour segment after rebasing');
|
|
160
|
+
const edge = a < b ? `${a}/${b}` : `${b}/${a}`;
|
|
161
|
+
const previous = edges.get(edge);
|
|
162
|
+
if (previous !== undefined) {
|
|
163
|
+
if (previous === tileIndex) throw new Error('Duplicate terrain contour segment');
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (levelIndices.length >= limits.maxSegments)
|
|
167
|
+
throw new Error('Terrain contour segment capacity exceeded');
|
|
168
|
+
edges.set(edge, tileIndex);
|
|
169
|
+
segments.push(a, b);
|
|
170
|
+
levelIndices.push(level);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
positions: Float64Array.from(positions),
|
|
175
|
+
gridCoordinates: Float64Array.from(grid),
|
|
176
|
+
segments: Uint32Array.from(segments),
|
|
177
|
+
levelIndices: Uint32Array.from(levelIndices),
|
|
178
|
+
levels,
|
|
179
|
+
origin,
|
|
180
|
+
heightReference: first.heightReference
|
|
181
|
+
};
|
|
182
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {TerrainGradientGrid, TerrainGradientMethod} from './derivatives';
|
|
6
|
+
import {TerrainSampleStatus} from './types';
|
|
7
|
+
|
|
8
|
+
export type TerrainGradientPyramidLevel = {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
/** Maximum side length, in source samples, of each block. Outer blocks may be smaller. */
|
|
12
|
+
blockSize: number;
|
|
13
|
+
/** Packed mean world-frame dz/dx and dz/dy; zero where validCounts is zero. */
|
|
14
|
+
gradients: Float64Array;
|
|
15
|
+
validCounts: Uint32Array;
|
|
16
|
+
sampleCounts: Uint32Array;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type TerrainGradientPyramid = {
|
|
20
|
+
levels: TerrainGradientPyramidLevel[];
|
|
21
|
+
method: TerrainGradientMethod;
|
|
22
|
+
origin: readonly [number, number];
|
|
23
|
+
columnStep: readonly [number, number];
|
|
24
|
+
rowStep: readonly [number, number];
|
|
25
|
+
registration: TerrainGradientGrid['registration'];
|
|
26
|
+
heightReference: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Average valid world-frame gradient vectors over aligned source-sample blocks.
|
|
30
|
+
* Counts include missing samples and preserve exact source weights at odd edges.
|
|
31
|
+
* Slope of a mean gradient is not mean slope, nor the gradient of filtered heights.
|
|
32
|
+
* A level's blocks refer to the source grid; partial edge blocks have smaller extents.
|
|
33
|
+
*/
|
|
34
|
+
export function createTerrainGradientPyramid(
|
|
35
|
+
grid: TerrainGradientGrid,
|
|
36
|
+
options: {maxSamples?: number} = {}
|
|
37
|
+
): TerrainGradientPyramid {
|
|
38
|
+
const {width, height, gradients, statuses} = grid;
|
|
39
|
+
const count = width * height,
|
|
40
|
+
limit = options.maxSamples ?? 4_000_000;
|
|
41
|
+
if (
|
|
42
|
+
!Number.isSafeInteger(width) ||
|
|
43
|
+
width < 1 ||
|
|
44
|
+
!Number.isSafeInteger(height) ||
|
|
45
|
+
height < 1 ||
|
|
46
|
+
!Number.isSafeInteger(count) ||
|
|
47
|
+
count > 0xffffffff ||
|
|
48
|
+
!Number.isSafeInteger(limit) ||
|
|
49
|
+
limit < count ||
|
|
50
|
+
!(gradients instanceof Float64Array) ||
|
|
51
|
+
gradients.length !== 2 * count ||
|
|
52
|
+
!(statuses instanceof Uint8Array) ||
|
|
53
|
+
statuses.length !== count ||
|
|
54
|
+
(grid.method !== 'horn' && grid.method !== 'zevenbergen-thorne') ||
|
|
55
|
+
(grid.registration !== 'cell' && grid.registration !== 'vertex') ||
|
|
56
|
+
typeof grid.heightReference !== 'string' ||
|
|
57
|
+
![grid.origin, grid.columnStep, grid.rowStep].every(
|
|
58
|
+
v => v.length === 2 && v.every(Number.isFinite)
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
throw new Error('Invalid terrain gradient pyramid input or capacity');
|
|
62
|
+
const base: TerrainGradientPyramidLevel = {
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
65
|
+
blockSize: 1,
|
|
66
|
+
gradients: new Float64Array(2 * count),
|
|
67
|
+
validCounts: new Uint32Array(count),
|
|
68
|
+
sampleCounts: new Uint32Array(count).fill(1)
|
|
69
|
+
};
|
|
70
|
+
for (let i = 0; i < count; i++) {
|
|
71
|
+
if (statuses[i] > TerrainSampleStatus.NOT_RESIDENT)
|
|
72
|
+
throw new Error('Invalid terrain gradient status');
|
|
73
|
+
if (statuses[i] === TerrainSampleStatus.VALID) {
|
|
74
|
+
if (!Number.isFinite(gradients[2 * i]) || !Number.isFinite(gradients[2 * i + 1]))
|
|
75
|
+
throw new Error('Invalid terrain gradient value');
|
|
76
|
+
base.gradients[2 * i] = gradients[2 * i];
|
|
77
|
+
base.gradients[2 * i + 1] = gradients[2 * i + 1];
|
|
78
|
+
base.validCounts[i] = 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const levels = [base];
|
|
82
|
+
let source = base;
|
|
83
|
+
while (source.width > 1 || source.height > 1) {
|
|
84
|
+
const w = Math.ceil(source.width / 2),
|
|
85
|
+
h = Math.ceil(source.height / 2);
|
|
86
|
+
const next: TerrainGradientPyramidLevel = {
|
|
87
|
+
width: w,
|
|
88
|
+
height: h,
|
|
89
|
+
blockSize: source.blockSize * 2,
|
|
90
|
+
gradients: new Float64Array(2 * w * h),
|
|
91
|
+
validCounts: new Uint32Array(w * h),
|
|
92
|
+
sampleCounts: new Uint32Array(w * h)
|
|
93
|
+
};
|
|
94
|
+
for (let y = 0; y < h; y++)
|
|
95
|
+
for (let x = 0; x < w; x++) {
|
|
96
|
+
const out = y * w + x;
|
|
97
|
+
for (let dy = 0; dy < 2; dy++)
|
|
98
|
+
for (let dx = 0; dx < 2; dx++) {
|
|
99
|
+
const sx = 2 * x + dx,
|
|
100
|
+
sy = 2 * y + dy;
|
|
101
|
+
if (sx >= source.width || sy >= source.height) continue;
|
|
102
|
+
const index = sy * source.width + sx,
|
|
103
|
+
n = source.validCounts[index],
|
|
104
|
+
old = next.validCounts[out];
|
|
105
|
+
next.sampleCounts[out] += source.sampleCounts[index];
|
|
106
|
+
if (n) {
|
|
107
|
+
const total = old + n;
|
|
108
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
109
|
+
const a = next.gradients[2 * out + axis],
|
|
110
|
+
b = source.gradients[2 * index + axis];
|
|
111
|
+
next.gradients[2 * out + axis] = old ? a * (old / total) + b * (n / total) : b;
|
|
112
|
+
}
|
|
113
|
+
next.validCounts[out] = total;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
levels.push(next);
|
|
118
|
+
source = next;
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
levels,
|
|
122
|
+
method: grid.method,
|
|
123
|
+
origin: [...grid.origin],
|
|
124
|
+
columnStep: [...grid.columnStep],
|
|
125
|
+
rowStep: [...grid.rowStep],
|
|
126
|
+
registration: grid.registration,
|
|
127
|
+
heightReference: grid.heightReference
|
|
128
|
+
};
|
|
129
|
+
}
|
|
@@ -144,6 +144,11 @@ export class HeightField {
|
|
|
144
144
|
) {
|
|
145
145
|
throw new Error('Unknown terrain interpolation');
|
|
146
146
|
}
|
|
147
|
+
const domain = options?.domain ?? 'samples';
|
|
148
|
+
const noData = options?.noData ?? 'cell';
|
|
149
|
+
if (domain !== 'samples' && domain !== 'footprint')
|
|
150
|
+
throw new Error('Unknown terrain sample domain');
|
|
151
|
+
if (noData !== 'cell' && noData !== 'support') throw new Error('Unknown terrain nodata policy');
|
|
147
152
|
if (!Number.isFinite(x) || !Number.isFinite(y)) return result;
|
|
148
153
|
const dx = x - this.origin[0];
|
|
149
154
|
const dy = y - this.origin[1];
|
|
@@ -162,16 +167,30 @@ export class HeightField {
|
|
|
162
167
|
tolerance + Math.abs(this.inverse[0]) * errorX + Math.abs(this.inverse[1]) * errorY;
|
|
163
168
|
const toleranceV =
|
|
164
169
|
tolerance + Math.abs(this.inverse[2]) * errorX + Math.abs(this.inverse[3]) * errorY;
|
|
170
|
+
const margin = domain === 'footprint' && this.registration === 'cell' ? 0.5 : 0;
|
|
165
171
|
if (
|
|
166
|
-
u < -toleranceU ||
|
|
167
|
-
v < -toleranceV ||
|
|
168
|
-
u > this.width - 1 + toleranceU ||
|
|
169
|
-
v > this.height - 1 + toleranceV
|
|
172
|
+
u < -margin - toleranceU ||
|
|
173
|
+
v < -margin - toleranceV ||
|
|
174
|
+
u > this.width - 1 + margin + toleranceU ||
|
|
175
|
+
v > this.height - 1 + margin + toleranceV
|
|
170
176
|
) {
|
|
171
177
|
return resetSample(result, Status.OUTSIDE_DOMAIN);
|
|
172
178
|
}
|
|
179
|
+
// Preserve endpoint one-sided derivatives within bounded coordinate roundoff.
|
|
180
|
+
const edgeToleranceU = Math.min(1e-6, toleranceU);
|
|
181
|
+
const edgeToleranceV = Math.min(1e-6, toleranceV);
|
|
182
|
+
const clampedColumn =
|
|
183
|
+
margin > 0 && (u < -edgeToleranceU || u > this.width - 1 + edgeToleranceU);
|
|
184
|
+
const clampedRow = margin > 0 && (v < -edgeToleranceV || v > this.height - 1 + edgeToleranceV);
|
|
173
185
|
u = Math.max(0, Math.min(this.width - 1, u));
|
|
174
186
|
v = Math.max(0, Math.min(this.height - 1, v));
|
|
187
|
+
if (noData === 'support' && interpolation === 'bilinear') {
|
|
188
|
+
// Do not let world-coordinate roundoff give an adjacent missing sample a tiny weight.
|
|
189
|
+
const column = Math.round(u),
|
|
190
|
+
row = Math.round(v);
|
|
191
|
+
if (Math.abs(u - column) <= Math.min(1e-6, toleranceU)) u = column;
|
|
192
|
+
if (Math.abs(v - row) <= Math.min(1e-6, toleranceV)) v = row;
|
|
193
|
+
}
|
|
175
194
|
if (interpolation === 'nearest') {
|
|
176
195
|
const value = this.getHeight(Math.floor(u + 0.5), Math.floor(v + 0.5));
|
|
177
196
|
if (value === undefined) return resetSample(result, Status.NO_DATA);
|
|
@@ -197,7 +216,25 @@ export class HeightField {
|
|
|
197
216
|
let dv: number;
|
|
198
217
|
if (interpolation === 'bilinear') {
|
|
199
218
|
if (!this.validity[a] || !this.validity[b] || !this.validity[c] || !this.validity[d]) {
|
|
200
|
-
return resetSample(result, Status.NO_DATA);
|
|
219
|
+
if (noData === 'cell') return resetSample(result, Status.NO_DATA);
|
|
220
|
+
const weightA = (1 - u) * (1 - v);
|
|
221
|
+
const weightB = u * (1 - v);
|
|
222
|
+
const weightC = (1 - u) * v;
|
|
223
|
+
const weightD = u * v;
|
|
224
|
+
if (
|
|
225
|
+
(weightA > 0 && !this.validity[a]) ||
|
|
226
|
+
(weightB > 0 && !this.validity[b]) ||
|
|
227
|
+
(weightC > 0 && !this.validity[c]) ||
|
|
228
|
+
(weightD > 0 && !this.validity[d])
|
|
229
|
+
)
|
|
230
|
+
return resetSample(result, Status.NO_DATA);
|
|
231
|
+
// Invalid samples are normalized to zero by construction; no temporary arrays are needed.
|
|
232
|
+
const height = weightA * za + weightB * zb + weightC * zc + weightD * zd;
|
|
233
|
+
if (!Number.isFinite(height)) return resetSample(result, Status.NUMERIC_ERROR);
|
|
234
|
+
result.status = Status.VALID;
|
|
235
|
+
result.height = height;
|
|
236
|
+
result.gradientStatus = Status.NO_DATA;
|
|
237
|
+
return result;
|
|
201
238
|
}
|
|
202
239
|
result.height = (1 - v) * ((1 - u) * za + u * zb) + v * ((1 - u) * zc + u * zd);
|
|
203
240
|
du = (1 - v) * (zb - za) + v * (zd - zc);
|
|
@@ -227,6 +264,9 @@ export class HeightField {
|
|
|
227
264
|
}
|
|
228
265
|
if (!Number.isFinite(result.height)) return resetSample(result, Status.NUMERIC_ERROR);
|
|
229
266
|
result.status = Status.VALID;
|
|
267
|
+
// Compose interpolation with the footprint clamp before mapping to world derivatives.
|
|
268
|
+
if (clampedColumn) du = 0;
|
|
269
|
+
if (clampedRow) dv = 0;
|
|
230
270
|
const gx = du * this.inverse[0] + dv * this.inverse[2];
|
|
231
271
|
const gy = du * this.inverse[1] + dv * this.inverse[3];
|
|
232
272
|
if (!Number.isFinite(gx) || !Number.isFinite(gy)) {
|
package/src/terrain/index.ts
CHANGED
|
@@ -67,6 +67,16 @@ export type {TerrainProfileSampler, TerrainProfile} from './profile';
|
|
|
67
67
|
export {createTerrainContours} from './contours';
|
|
68
68
|
export type {TerrainContours, TerrainContourOptions} from './contours';
|
|
69
69
|
export {stitchTerrainContours} from './contour-paths';
|
|
70
|
+
export {weldTerrainContourTiles} from './contour-tile-weld';
|
|
71
|
+
export {
|
|
72
|
+
diagnoseTerrainContourBoundaries,
|
|
73
|
+
TerrainContourBoundaryAxis
|
|
74
|
+
} from './contour-boundary-diagnostics';
|
|
75
|
+
export type {TerrainContourBoundaryDiagnostics} from './contour-boundary-diagnostics';
|
|
76
|
+
export {stitchTerrainContourTiles} from './contour-tile-paths';
|
|
77
|
+
export {createTerrainGradientPyramid} from './gradient-pyramid';
|
|
78
|
+
export type {TerrainGradientPyramid, TerrainGradientPyramidLevel} from './gradient-pyramid';
|
|
79
|
+
export type {TerrainContourTile, TerrainContourTileWeldOptions} from './contour-tile-weld';
|
|
70
80
|
export type {TerrainContourPaths, TerrainContourPathLimits} from './contour-paths';
|
|
71
81
|
export {simplifyTerrainContourPaths} from './contour-simplify';
|
|
72
82
|
export type {TerrainSimplifiedContourPaths} from './contour-simplify';
|
|
@@ -92,3 +102,5 @@ export type {
|
|
|
92
102
|
} from './vertex-tiles';
|
|
93
103
|
export {stitchTerrainMeshEdges} from './mesh-stitch';
|
|
94
104
|
export type {TerrainSeamMesh, TerrainMeshStitchOptions} from './mesh-stitch';
|
|
105
|
+
export {weldTerrainMixedContourTiles} from './contour-mixed-weld';
|
|
106
|
+
export type {TerrainMixedContourTile, TerrainMixedContourWeldOptions} from './contour-mixed-weld';
|
package/src/terrain/tiled.ts
CHANGED
|
@@ -218,12 +218,25 @@ export class TiledHeightField {
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
/** Queries never mix resolutions. Only absent residency permits coarser fallback.
|
|
221
|
+
/** Queries never mix resolutions. Only absent residency permits coarser fallback.
|
|
222
|
+
* Raster footprint/masked-support policies are specific to HeightField, not tiled halos.
|
|
223
|
+
*/
|
|
222
224
|
sample(
|
|
223
225
|
x: number,
|
|
224
226
|
y: number,
|
|
225
|
-
options: TerrainSampleOptions
|
|
227
|
+
options: Pick<TerrainSampleOptions, 'interpolation'> & {
|
|
228
|
+
/** Requested tile-matrix level. */
|
|
229
|
+
matrixId: string;
|
|
230
|
+
/** Only absent residency permits a coarser level. */
|
|
231
|
+
fallback?: 'none' | 'coarser';
|
|
232
|
+
/** Raster domains are not supported by the tiled halo sampler. */
|
|
233
|
+
domain?: never;
|
|
234
|
+
/** Masked raster support is not supported by the tiled halo sampler. */
|
|
235
|
+
noData?: never;
|
|
236
|
+
}
|
|
226
237
|
): TiledTerrainSample {
|
|
238
|
+
if ('domain' in options || 'noData' in options)
|
|
239
|
+
throw new Error('Raster sampling policies require a HeightField');
|
|
227
240
|
const requested = this.getMatrix(options.matrixId);
|
|
228
241
|
if (
|
|
229
242
|
options.fallback !== undefined &&
|
|
@@ -269,7 +282,7 @@ export class TiledHeightField {
|
|
|
269
282
|
matrix: TileMatrix,
|
|
270
283
|
x: number,
|
|
271
284
|
y: number,
|
|
272
|
-
options: TerrainSampleOptions
|
|
285
|
+
options: Pick<TerrainSampleOptions, 'interpolation'>
|
|
273
286
|
): TerrainSample & {matrixId: string} {
|
|
274
287
|
const invalid = (status: TerrainSample['status']) => ({
|
|
275
288
|
status,
|
package/src/terrain/types.ts
CHANGED
|
@@ -40,7 +40,15 @@ export type HeightFieldProps = {
|
|
|
40
40
|
heightReference?: string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
/** Sampling policies; defaults retain strict sample-domain and complete-cell behavior. */
|
|
44
|
+
export type TerrainSampleOptions = {
|
|
45
|
+
/** Interpolation between grid samples; defaults to bilinear. */
|
|
46
|
+
interpolation?: TerrainInterpolation;
|
|
47
|
+
/** Cell fields may clamp the outer half-cell footprint to the nearest sample. */
|
|
48
|
+
domain?: 'samples' | 'footprint';
|
|
49
|
+
/** Bilinear height may use only nonzero-weight support; gradients still require a complete cell. */
|
|
50
|
+
noData?: 'cell' | 'support';
|
|
51
|
+
};
|
|
44
52
|
|
|
45
53
|
/** Numeric values are zero when their associated status is not VALID. */
|
|
46
54
|
export type TerrainSample = {
|
package/src/turf.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {GeoArrowArray, GeoArrowColumn} from '
|
|
6
|
-
import {isGeoArrowValueValid} from '
|
|
7
|
-
import {
|
|
5
|
+
import type {GeoArrowArray, GeoArrowColumn} from '@math.gl/arrow/geoarrow-utils';
|
|
6
|
+
import {isGeoArrowValueValid} from '@math.gl/arrow/geoarrow-utils';
|
|
7
|
+
import {
|
|
8
|
+
getGeoArrowRowBounds,
|
|
9
|
+
mapGeoArrowCoordinates,
|
|
10
|
+
rewindGeoArrow
|
|
11
|
+
} from '@math.gl/arrow/geoarrow-utils';
|
|
8
12
|
|
|
9
13
|
/** A nullable, row-aligned numeric or boolean result. Validity is an Arrow bitmap. */
|
|
10
14
|
export type TurfBatchResult<T extends Float64Array | Uint8Array> = {
|
package/crs/README.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# @math.gl/geospatial/crs
|
|
2
|
-
|
|
3
|
-
Proj4-independent coordinate reference system definitions shared by math.gl integrations.
|
|
4
|
-
|
|
5
|
-
PROJJSON is an OSGeo/PROJ specification, not an independently published OGC or ISO standard. It
|
|
6
|
-
is designed as a lossless JSON encoding of OGC WKT2:2019 / ISO 19162:2019 and is referenced by OGC
|
|
7
|
-
standards. This package uses strict PROJJSON v0.7 as its semantic CRS object model. Authority codes,
|
|
8
|
-
PROJ strings, WKT2, WKT1, and vendor WKT dialects remain string serializations. WKT and PROJ
|
|
9
|
-
syntax trees preserve the serializations without claiming semantic conversion to PROJJSON.
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import {parsePROJString, parseWKTCRS} from '@math.gl/geospatial/crs';
|
|
13
|
-
import type {CRSDefinition, PROJJSONCRS} from '@math.gl/geospatial/crs';
|
|
14
|
-
|
|
15
|
-
const authorityCode: CRSDefinition = 'EPSG:4326';
|
|
16
|
-
const projString: CRSDefinition = '+proj=longlat +datum=WGS84 +no_defs';
|
|
17
|
-
const projjson: PROJJSONCRS = {
|
|
18
|
-
type: 'GeographicCRS',
|
|
19
|
-
name: 'WGS 84',
|
|
20
|
-
datum: {
|
|
21
|
-
name: 'World Geodetic System 1984',
|
|
22
|
-
ellipsoid: {
|
|
23
|
-
name: 'WGS 84',
|
|
24
|
-
semi_major_axis: 6378137,
|
|
25
|
-
inverse_flattening: 298.257223563
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const wkt = parseWKTCRS('GEOGCRS["WGS 84",ID["EPSG",4326]]');
|
|
31
|
-
const proj = parsePROJString('+proj=longlat +datum=WGS84 +no_defs');
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`SpatialReference` adds format-neutral discovery state around those definitions. It distinguishes
|
|
35
|
-
explicit definitions, specification defaults, explicitly unknown CRS values, and absent metadata;
|
|
36
|
-
it can also retain alternate representations, coordinate epoch, coordinate frame, stored
|
|
37
|
-
component order, and units.
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
import {createSpatialReference} from '@math.gl/geospatial/crs';
|
|
41
|
-
|
|
42
|
-
const spatialReference = createSpatialReference({
|
|
43
|
-
crs: {
|
|
44
|
-
state: 'explicit',
|
|
45
|
-
definition: 'EPSG:4326',
|
|
46
|
-
representation: 'identifier',
|
|
47
|
-
provenance: 'metadata'
|
|
48
|
-
},
|
|
49
|
-
coordinateFrame: 'geographic',
|
|
50
|
-
coordinateOrder: ['x', 'y']
|
|
51
|
-
});
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
The official PROJJSON v0.7 JSON Schema is vendored unchanged under its MIT license and exported as
|
|
55
|
-
`@math.gl/geospatial/crs/projjson.schema.json`. It is the source of truth for the checked-in generated
|
|
56
|
-
TypeScript declarations. This package has no runtime dependencies. Its runtime APIs parse, encode,
|
|
57
|
-
and validate serialization syntax and identify already-resolved metadata. They do not perform registry lookup, semantic equivalence,
|
|
58
|
-
coordinate transformation, or general conversion between WKT, PROJ, and PROJJSON.
|
|
59
|
-
|
|
60
|
-
The `ProjectionTransform` in `@math.gl/geospatial/projection/core` directly accepts
|
|
61
|
-
these readonly definitions, `CRSReference`, and `SpatialReference` descriptors. Its optional
|
|
62
|
-
WKT/PROJJSON adapters use this package's types and parsers; execution support is checked
|
|
63
|
-
by `checkProjectionCompatibility`. Unknown/absent metadata remains unresolved.
|
|
64
|
-
See the [projection API](https://math.gl/docs/modules/geospatial/projection/api-reference/typescript-projection)
|
|
65
|
-
for the supported transformation subset and storage-order behavior.
|
|
66
|
-
|
|
67
|
-
See the [PROJJSON specification](https://proj.org/en/stable/specifications/projjson.html).
|
|
68
|
-
See the math.gl [Coordinate Reference Systems guide](https://math.gl/docs/modules/geospatial/crs/developer-guide/coordinate-reference-systems)
|
|
69
|
-
for representations, epochs, axis order, vertical CRS, and transformation guidance.
|
|
70
|
-
|
|
71
|
-
`linearUnits` provides names and metre conversion factors keyed by PROJ unit
|
|
72
|
-
identifier. For example, `linearUnits.ft` is `{name: 'feet', metersPerUnit: 0.3048}`.
|
|
73
|
-
|
|
74
|
-
`getCRSSignature(metadata)` returns a deterministic signature for resolved
|
|
75
|
-
`CRSMetadata`. It tracks projection parameters, ellipsoid, effective axis order,
|
|
76
|
-
units, and horizontal extraction. Parameter order and object identity do not
|
|
77
|
-
matter. This is an identity of resolved execution conventions, not a semantic
|
|
78
|
-
equivalence test for arbitrary CRS definitions. Projection descriptors use this
|
|
79
|
-
result as `signature` when structured input or overrides require resolved metadata;
|
|
80
|
-
default string definitions retain the original string.
|
|
81
|
-
|
|
82
|
-
Import `getCRSSignature`, `linearUnits`, `CRSMetadata` and `CRSUnit` from
|
|
83
|
-
`@math.gl/geospatial/crs` when only resolved metadata is needed. This entry keeps
|
|
84
|
-
WKT/PROJ syntax readers out of the initial graph of code-split applications.
|
package/crs/schemas/README.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Vendored PROJJSON schema
|
|
2
|
-
|
|
3
|
-
`projjson.schema.json` is the official PROJJSON v0.7 JSON Schema from
|
|
4
|
-
[OSGeo/PROJ](https://github.com/OSGeo/PROJ/blob/master/schemas/v0.7/projjson.schema.json).
|
|
5
|
-
It is vendored unchanged under the MIT license declared in its `$comment` field.
|
|
6
|
-
|
|
7
|
-
The checked-in TypeScript declarations in `../../src/crs/projjson-types.ts` are generated
|
|
8
|
-
from `#/definitions/crs`; run `yarn generate:projjson-types` after an intentional
|
|
9
|
-
schema upgrade.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Optional builder subpath. Importing it avoids pulling codec and tessellation helpers. */
|
|
2
|
-
export type { GeoArrowBuilderEncoding, GeoArrowBuilderMeasurement, GeoArrowBuilderModeOptions, GeoArrowBuilderOptions, GeoArrowColumnFromRowsOptions, GeoArrowBuilderTarget } from "./builder.js";
|
|
3
|
-
export { allocateGeoArrowBuilderTarget, GeoArrowBuilder, makeGeoArrowColumnFromGeometryRows } from "./builder.js";
|
|
4
|
-
//# sourceMappingURL=builder-entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder-entry.d.ts","sourceRoot":"","sources":["../../src/geoarrow/builder-entry.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACtB,qBAAkB;AACnB,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,kCAAkC,EACnC,qBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder-entry.js","sourceRoot":"","sources":["../../src/geoarrow/builder-entry.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAW5D,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,kCAAkC,EACnC,qBAAkB"}
|