@math.gl/geospatial 5.0.0-beta.4 → 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 +212 -4614
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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-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/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 +204 -4
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +2 -0
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +1 -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 +5 -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-mixed-weld.ts +254 -0
- package/src/terrain/height-field.ts +45 -5
- package/src/terrain/index.ts +2 -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
|
@@ -27,6 +27,14 @@ import {createGeographicProfile} from './rendering-profile/geographic-rendering-
|
|
|
27
27
|
import {compileVerticalGrid} from './vertical-datum';
|
|
28
28
|
import type {DatumGridCollection, VerticalGridCollection} from './grids/types';
|
|
29
29
|
|
|
30
|
+
import type {
|
|
31
|
+
ProjectionTransformDescription,
|
|
32
|
+
ProjectionDirectionDescription,
|
|
33
|
+
ProjectionTransformStage,
|
|
34
|
+
ProjectionAlgorithmIdentity
|
|
35
|
+
} from '../transform-description';
|
|
36
|
+
import {describeCRS, describeTransform} from './transform-description';
|
|
37
|
+
|
|
30
38
|
type ProjectionRegistration = ProjectionPlugin | ProjectionDescriptor;
|
|
31
39
|
type ProjectionResult<P, Result> =
|
|
32
40
|
Extract<P, ProjectionDescriptor> extends never ? Result : Promise<Result>;
|
|
@@ -46,12 +54,14 @@ export type ProjectionTransformOptions<P extends ProjectionRegistration = Projec
|
|
|
46
54
|
export type ProjectionTransformCreateOptions = ProjectionTransformOptions<ProjectionRegistration>;
|
|
47
55
|
export type ProjectionArray = Float32Array | Float64Array;
|
|
48
56
|
type CoordinateTransform = {
|
|
57
|
+
description: ProjectionDirectionDescription;
|
|
49
58
|
flat?: ProjectionFlatOperation;
|
|
50
59
|
run(point: ProjectionPoint): void;
|
|
51
60
|
requiresInputZ: boolean;
|
|
52
61
|
geocentricOutput: boolean;
|
|
53
62
|
};
|
|
54
63
|
type CompiledCRS = NormalizedCRS & {
|
|
64
|
+
algorithm?: ProjectionAlgorithmIdentity;
|
|
55
65
|
implementation?: ProjectionImplementation;
|
|
56
66
|
verticalGrid?: (longitude: number, latitude: number) => number;
|
|
57
67
|
};
|
|
@@ -89,6 +99,11 @@ export class ProjectionTransform<P extends ProjectionRegistration = ProjectionPl
|
|
|
89
99
|
}
|
|
90
100
|
/** Effective target central meridian in native radians. @internal */
|
|
91
101
|
readonly targetLongitudeOrigin: number = 0;
|
|
102
|
+
private readonly resolvedDescription?: ProjectionTransformDescription;
|
|
103
|
+
/** Deferred transforms expose metadata only once their implementations are prepared. */
|
|
104
|
+
get description(): ProjectionTransformDescription | undefined {
|
|
105
|
+
return this.deferred?.implementation?.description ?? this.resolvedDescription;
|
|
106
|
+
}
|
|
92
107
|
readonly lossy: boolean;
|
|
93
108
|
constructor(options: ProjectionTransformOptions<P> = {}) {
|
|
94
109
|
const registrations = options.projections || [];
|
|
@@ -125,6 +140,12 @@ export class ProjectionTransform<P extends ProjectionRegistration = ProjectionPl
|
|
|
125
140
|
unsupportedStage('Horizontal extraction cannot be combined with vertical grids');
|
|
126
141
|
this.forwardTransform = compileTransform(from, to, Boolean(options.enforceAxis));
|
|
127
142
|
this.inverseTransform = compileTransform(to, from, Boolean(options.enforceAxis));
|
|
143
|
+
this.resolvedDescription = describeTransform(
|
|
144
|
+
describeCRS(from),
|
|
145
|
+
describeCRS(to),
|
|
146
|
+
this.forwardTransform.description,
|
|
147
|
+
this.inverseTransform.description
|
|
148
|
+
);
|
|
128
149
|
}
|
|
129
150
|
this.project = this.project.bind(this);
|
|
130
151
|
this.unproject = this.unproject.bind(this);
|
|
@@ -393,7 +414,8 @@ function compileCRS(
|
|
|
393
414
|
const verticalGrid = compileVerticalGrid(crs.parameters['geoidgrids'], options.verticalGrids);
|
|
394
415
|
if (verticalGrid && (crs.kind === 'geocentric' || crs.kind === 'identity' || crs.lossy))
|
|
395
416
|
unsupportedStage('Vertical grids require a non-lossy geographic or projected CRS');
|
|
396
|
-
|
|
417
|
+
const algorithm = plugin ? plugin.semantics : {id: '@math.gl/geospatial/' + crs.kind, version: 1};
|
|
418
|
+
return {...crs, datum, implementation, verticalGrid, algorithm};
|
|
397
419
|
}
|
|
398
420
|
|
|
399
421
|
function finite(point: ProjectionPoint): boolean {
|
|
@@ -466,13 +488,39 @@ function compileTransform(
|
|
|
466
488
|
if (from.kind === 'projected' && to.kind === 'geographic')
|
|
467
489
|
flat = from.implementation?.createInverseFlat?.(context);
|
|
468
490
|
}
|
|
491
|
+
const requiresInputZ =
|
|
492
|
+
Boolean(from.verticalGrid || to.verticalGrid) ||
|
|
493
|
+
from.kind === 'geocentric' ||
|
|
494
|
+
/[ud]/.test(fromAxis.slice(0, 2)) ||
|
|
495
|
+
/[ud]/.test(toAxis.slice(0, 2));
|
|
496
|
+
const stages: ProjectionTransformStage[] = [];
|
|
497
|
+
if (inputAxis) stages.push('input-axis');
|
|
498
|
+
if (horizontalOnly) stages.push('discard-height');
|
|
499
|
+
if (inputScale !== 1) stages.push('input-scale');
|
|
500
|
+
if (source) stages.push('source-inverse');
|
|
501
|
+
if (inputVerticalScale !== 1) stages.push('input-height-scale');
|
|
502
|
+
stages.push('geographic-domain-check');
|
|
503
|
+
if (fromPrime) stages.push('source-prime-meridian');
|
|
504
|
+
if (from.verticalGrid) stages.push('source-vertical-grid');
|
|
505
|
+
if (datum) stages.push('datum');
|
|
506
|
+
if (to.verticalGrid) stages.push('target-vertical-grid');
|
|
507
|
+
if (toPrime) stages.push('target-prime-meridian');
|
|
508
|
+
if (longitudeWrap !== undefined) stages.push('longitude-wrap');
|
|
509
|
+
if (target) stages.push('target-forward');
|
|
510
|
+
if (outputScale !== 1) stages.push('output-scale');
|
|
511
|
+
if (outputVerticalScale !== 1) stages.push('output-height-scale');
|
|
512
|
+
if (horizontalOnly) stages.push('restore-height');
|
|
513
|
+
if (outputAxis) stages.push('output-axis');
|
|
469
514
|
return {
|
|
515
|
+
description: Object.freeze({
|
|
516
|
+
inputAxis: fromAxis,
|
|
517
|
+
outputAxis: toAxis,
|
|
518
|
+
requiresInputZ,
|
|
519
|
+
geocentricOutput: to.kind === 'geocentric',
|
|
520
|
+
stages: Object.freeze(stages)
|
|
521
|
+
}),
|
|
470
522
|
flat,
|
|
471
|
-
requiresInputZ
|
|
472
|
-
Boolean(from.verticalGrid || to.verticalGrid) ||
|
|
473
|
-
from.kind === 'geocentric' ||
|
|
474
|
-
/[ud]/.test(fromAxis.slice(0, 2)) ||
|
|
475
|
-
/[ud]/.test(toAxis.slice(0, 2)),
|
|
523
|
+
requiresInputZ,
|
|
476
524
|
geocentricOutput: to.kind === 'geocentric',
|
|
477
525
|
run(point) {
|
|
478
526
|
if (!finite(point))
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {NormalizedCRS} from './experimental/crs/types';
|
|
6
|
+
|
|
7
|
+
/** Publisher-owned identity for an algorithm's coordinate semantics, not its display name. */
|
|
8
|
+
export type ProjectionAlgorithmIdentity = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
/** Increment when equations, defaults, wrapping, domain or height behavior change. */
|
|
11
|
+
readonly version: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Resolved execution metadata without callbacks or borrowed grid payloads. */
|
|
15
|
+
export type ProjectionCRSDescription = Omit<NormalizedCRS, 'datum' | 'parameters'> & {
|
|
16
|
+
/** PROJ flags have null values, preserving presence through JSON serialization. */
|
|
17
|
+
readonly parameters: Readonly<Record<string, string | null>>;
|
|
18
|
+
readonly algorithm?: ProjectionAlgorithmIdentity;
|
|
19
|
+
readonly datum: {
|
|
20
|
+
readonly ellipsoid: NormalizedCRS['ellipsoid'];
|
|
21
|
+
readonly towgs84?: readonly number[];
|
|
22
|
+
readonly grids?: readonly {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly optional: boolean;
|
|
25
|
+
readonly loaded: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** Ordered scalar stages. Parameters and units are resolved in source/target CRS metadata. */
|
|
31
|
+
export type ProjectionTransformStage =
|
|
32
|
+
| 'input-axis'
|
|
33
|
+
| 'discard-height'
|
|
34
|
+
| 'input-scale'
|
|
35
|
+
| 'source-inverse'
|
|
36
|
+
| 'input-height-scale'
|
|
37
|
+
| 'geographic-domain-check'
|
|
38
|
+
| 'source-prime-meridian'
|
|
39
|
+
| 'source-vertical-grid'
|
|
40
|
+
| 'datum'
|
|
41
|
+
| 'target-vertical-grid'
|
|
42
|
+
| 'target-prime-meridian'
|
|
43
|
+
| 'longitude-wrap'
|
|
44
|
+
| 'target-forward'
|
|
45
|
+
| 'output-scale'
|
|
46
|
+
| 'output-height-scale'
|
|
47
|
+
| 'restore-height'
|
|
48
|
+
| 'output-axis';
|
|
49
|
+
|
|
50
|
+
export type ProjectionDirectionDescription = {
|
|
51
|
+
readonly inputAxis: string;
|
|
52
|
+
readonly outputAxis: string;
|
|
53
|
+
readonly requiresInputZ: boolean;
|
|
54
|
+
readonly geocentricOutput: boolean;
|
|
55
|
+
readonly stages: readonly ProjectionTransformStage[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Versioned math.gl pipeline semantics; a capability description, not an accuracy guarantee. */
|
|
59
|
+
export type ProjectionTransformDescription = {
|
|
60
|
+
readonly version: 1;
|
|
61
|
+
readonly source: ProjectionCRSDescription;
|
|
62
|
+
readonly target: ProjectionCRSDescription;
|
|
63
|
+
readonly forward: ProjectionDirectionDescription;
|
|
64
|
+
readonly inverse: ProjectionDirectionDescription;
|
|
65
|
+
readonly lossy: boolean;
|
|
66
|
+
/** False when algorithm or resource semantics are not fully identified. */
|
|
67
|
+
readonly complete: boolean;
|
|
68
|
+
readonly opaqueReasons: readonly ('source-algorithm' | 'target-algorithm' | 'grid-resource')[];
|
|
69
|
+
};
|
package/src/projection/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type {ProjectionDescriptor} from './experimental/projection-descriptor';
|
|
|
8
8
|
import type {ProjectionCoordinate, ProjectionOutput} from './experimental/scalar-output';
|
|
9
9
|
import type {ProjectionArray} from './experimental/typescript-projection';
|
|
10
10
|
import type {CRSResolver} from '../crs/resolver';
|
|
11
|
+
import type {ProjectionTransformDescription} from './transform-description';
|
|
11
12
|
|
|
12
13
|
type Registration = ProjectionPlugin | ProjectionDescriptor;
|
|
13
14
|
|
|
@@ -35,6 +36,8 @@ export interface ProjectionEngine {
|
|
|
35
36
|
/** A CRS-pair transform. Sync methods never load algorithms; preload deferred transforms first. */
|
|
36
37
|
export interface Projection {
|
|
37
38
|
readonly lossy?: boolean;
|
|
39
|
+
/** Available after preparation when the backend can describe its resolved execution. */
|
|
40
|
+
readonly description?: ProjectionTransformDescription;
|
|
38
41
|
preload(): Promise<unknown>;
|
|
39
42
|
project(coordinate: readonly number[]): number[] | Promise<number[]>;
|
|
40
43
|
unproject(coordinate: readonly number[]): number[] | Promise<number[]>;
|
|
@@ -81,3 +84,11 @@ export type {
|
|
|
81
84
|
CRSRenderingScaleCallback,
|
|
82
85
|
GetCRSOptions
|
|
83
86
|
} from './experimental/types';
|
|
87
|
+
|
|
88
|
+
export type {
|
|
89
|
+
ProjectionAlgorithmIdentity,
|
|
90
|
+
ProjectionCRSDescription,
|
|
91
|
+
ProjectionTransformStage,
|
|
92
|
+
ProjectionDirectionDescription,
|
|
93
|
+
ProjectionTransformDescription
|
|
94
|
+
} from './transform-description';
|
package/src/tasks/definitions.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
import type {Task} from '@math.gl/
|
|
4
|
+
import type {Task} from '@math.gl/tasks';
|
|
5
5
|
import type {CreateProjectionOptions, Projection, ProjectionArray} from '../projection/types';
|
|
6
6
|
import type {MapDescription, PreparedMap} from '../discontinuous/map-engine';
|
|
7
7
|
export type ProjectCoordinatesTypes = {
|
package/src/tasks/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
import type {TaskWorker} from '@math.gl/
|
|
4
|
+
import type {TaskWorker} from '@math.gl/tasks';
|
|
5
5
|
import {ProjectCoordinatesTask as projectionTask, PrepareMapTask as mapTask} from './definitions';
|
|
6
6
|
export type {ProjectCoordinatesTypes, PrepareMapTypes} from './definitions';
|
|
7
7
|
declare const __filename: string;
|
package/src/tasks/map-worker.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
import {initializeTaskWorker} from '@math.gl/
|
|
4
|
+
import {initializeTaskWorker} from '@math.gl/tasks';
|
|
5
5
|
import {PrepareMapTask} from './definitions';
|
|
6
6
|
void initializeTaskWorker(PrepareMapTask);
|
package/src/tasks/operations.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
import {MapEngine, type MapDescription, type MapEngineOptions} from '../discontinuous/map-engine';
|
|
5
5
|
import type {CreateProjectionOptions, ProjectionArray, Projection} from '../projection/types';
|
|
6
|
-
import type {TaskContext} from '@math.gl/
|
|
6
|
+
import type {TaskContext} from '@math.gl/tasks';
|
|
7
7
|
type OperationContext = Partial<Omit<TaskContext<unknown>, 'state'>>;
|
|
8
8
|
|
|
9
9
|
export type BulkProjectionTask = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
import {initializeTaskWorker} from '@math.gl/
|
|
4
|
+
import {initializeTaskWorker} from '@math.gl/tasks';
|
|
5
5
|
import {ProjectCoordinatesTask} from './definitions';
|
|
6
6
|
void initializeTaskWorker(ProjectCoordinatesTask);
|
|
@@ -0,0 +1,254 @@
|
|
|
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 TerrainMixedContourTile = {
|
|
14
|
+
contours: TerrainContours;
|
|
15
|
+
/** Tile minimum in the common finest lattice; integer coordinates. */
|
|
16
|
+
column: number;
|
|
17
|
+
row: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
/** Positive power-of-two spacing in the common lattice. */
|
|
21
|
+
spacing: number;
|
|
22
|
+
};
|
|
23
|
+
export type TerrainMixedContourWeldOptions = TerrainContourPathLimits & {
|
|
24
|
+
maxTiles?: number;
|
|
25
|
+
maxBoundaryTests?: number;
|
|
26
|
+
maxPositionDifference?: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Weld contour graphs from nonoverlapping vertex tiles in a shared affine lattice.
|
|
30
|
+
* Subdivides coincident axis-aligned boundary segments at finer boundary vertices.
|
|
31
|
+
* Only exact lattice intersections at the same level are joined. Differing source
|
|
32
|
+
* surfaces remain open; callers must reconcile elevations before contouring.
|
|
33
|
+
* Coordinates must retain their fractional precision in the common lattice.
|
|
34
|
+
*/
|
|
35
|
+
export function weldTerrainMixedContourTiles(
|
|
36
|
+
tiles: readonly TerrainMixedContourTile[],
|
|
37
|
+
options: TerrainMixedContourWeldOptions = {}
|
|
38
|
+
): TerrainContours {
|
|
39
|
+
const limits = contourPathLimits(options);
|
|
40
|
+
const maxTiles = options.maxTiles ?? 4096;
|
|
41
|
+
const budget = options.maxBoundaryTests ?? 10_000_000;
|
|
42
|
+
const tolerance = options.maxPositionDifference ?? 0;
|
|
43
|
+
if (
|
|
44
|
+
!Number.isSafeInteger(maxTiles) ||
|
|
45
|
+
maxTiles < 1 ||
|
|
46
|
+
!tiles.length ||
|
|
47
|
+
tiles.length > maxTiles ||
|
|
48
|
+
!Number.isSafeInteger(budget) ||
|
|
49
|
+
budget < 0 ||
|
|
50
|
+
!Number.isFinite(tolerance) ||
|
|
51
|
+
tolerance < 0
|
|
52
|
+
)
|
|
53
|
+
throw new Error('Invalid mixed contour capacity or tolerance');
|
|
54
|
+
let tests = 0;
|
|
55
|
+
const charge = () => {
|
|
56
|
+
if (++tests > budget) throw new Error('Mixed contour boundary-test budget exceeded');
|
|
57
|
+
};
|
|
58
|
+
const sorted = [...tiles].sort(
|
|
59
|
+
(a, b) => a.column - b.column || a.row - b.row || a.spacing - b.spacing
|
|
60
|
+
);
|
|
61
|
+
const bounds = sorted.map(t => {
|
|
62
|
+
if (
|
|
63
|
+
![t.column, t.row, t.width, t.height, t.spacing].every(Number.isSafeInteger) ||
|
|
64
|
+
t.width < 2 ||
|
|
65
|
+
t.height < 2 ||
|
|
66
|
+
t.spacing < 1 ||
|
|
67
|
+
2 ** Math.round(Math.log2(t.spacing)) !== t.spacing
|
|
68
|
+
)
|
|
69
|
+
throw new Error('Invalid mixed contour tile lattice');
|
|
70
|
+
const x1 = t.column + (t.width - 1) * t.spacing,
|
|
71
|
+
y1 = t.row + (t.height - 1) * t.spacing;
|
|
72
|
+
if (
|
|
73
|
+
![(t.width - 1) * t.spacing, (t.height - 1) * t.spacing, x1, y1].every(Number.isSafeInteger)
|
|
74
|
+
)
|
|
75
|
+
throw new Error('Mixed contour lattice overflow');
|
|
76
|
+
return [t.column, t.row, x1, y1];
|
|
77
|
+
});
|
|
78
|
+
for (let i = 0; i < bounds.length; i++)
|
|
79
|
+
for (let j = 0; j < i; j++) {
|
|
80
|
+
charge();
|
|
81
|
+
const a = bounds[i],
|
|
82
|
+
b = bounds[j];
|
|
83
|
+
if (
|
|
84
|
+
Math.max(a[0], b[0]) < Math.min(a[2], b[2]) &&
|
|
85
|
+
Math.max(a[1], b[1]) < Math.min(a[3], b[3])
|
|
86
|
+
)
|
|
87
|
+
throw new Error('Mixed contour tile interiors overlap');
|
|
88
|
+
}
|
|
89
|
+
const first = sorted[0].contours,
|
|
90
|
+
origin: [number, number, number] = [...first.origin];
|
|
91
|
+
const positions: number[] = [],
|
|
92
|
+
grid: number[] = [],
|
|
93
|
+
vertexLevels: number[] = [];
|
|
94
|
+
const roundedBoundary = new Map<string, string>();
|
|
95
|
+
const boundary = new Set<number>(),
|
|
96
|
+
shared = new Map<string, number>();
|
|
97
|
+
const edges: {a: number; b: number; level: number; tile: number; seam: boolean}[] = [];
|
|
98
|
+
let inputVertices = 0,
|
|
99
|
+
inputSegments = 0;
|
|
100
|
+
for (let ti = 0; ti < sorted.length; ti++) {
|
|
101
|
+
const tile = sorted[ti],
|
|
102
|
+
data = tile.contours;
|
|
103
|
+
const count = validateContourData(data, limits);
|
|
104
|
+
inputVertices += count;
|
|
105
|
+
if (inputVertices > limits.maxVertices)
|
|
106
|
+
throw new Error('Mixed contour input vertex capacity exceeded');
|
|
107
|
+
if (
|
|
108
|
+
data.heightReference !== first.heightReference ||
|
|
109
|
+
data.levels.length !== first.levels.length ||
|
|
110
|
+
!data.levels.every((v, i) => v === first.levels[i])
|
|
111
|
+
)
|
|
112
|
+
throw new Error('Mixed contour levels or height reference differ');
|
|
113
|
+
if (
|
|
114
|
+
!(data.segments instanceof Uint32Array) ||
|
|
115
|
+
data.segments.length % 2 ||
|
|
116
|
+
!(data.levelIndices instanceof Uint32Array) ||
|
|
117
|
+
data.levelIndices.length !== data.segments.length / 2
|
|
118
|
+
)
|
|
119
|
+
throw new Error('Invalid mixed contour segments');
|
|
120
|
+
inputSegments += data.levelIndices.length;
|
|
121
|
+
if (inputSegments > limits.maxSegments)
|
|
122
|
+
throw new Error('Mixed contour input segment capacity exceeded');
|
|
123
|
+
const assigned = new Uint32Array(count).fill(0xffffffff),
|
|
124
|
+
remap = new Map<number, number>();
|
|
125
|
+
const local = new Set<string>();
|
|
126
|
+
const vertex = (v: number, level: number) => {
|
|
127
|
+
validateContourVertex(data, v, level, assigned);
|
|
128
|
+
const existing = remap.get(v);
|
|
129
|
+
if (existing !== undefined) return existing;
|
|
130
|
+
const x = data.gridCoordinates[2 * v],
|
|
131
|
+
y = data.gridCoordinates[2 * v + 1];
|
|
132
|
+
if (x < 0 || x > tile.width - 1 || y < 0 || y > tile.height - 1)
|
|
133
|
+
throw new Error('Mixed contour vertex outside tile');
|
|
134
|
+
const sx = x * tile.spacing,
|
|
135
|
+
sy = y * tile.spacing;
|
|
136
|
+
const gx = tile.column + sx,
|
|
137
|
+
gy = tile.row + sy;
|
|
138
|
+
// Reject coordinates whose local fraction cannot survive common-frame rebasing.
|
|
139
|
+
if (
|
|
140
|
+
Math.abs(gx - tile.column - sx) > 8 * Number.EPSILON * Math.max(1, Math.abs(sx)) ||
|
|
141
|
+
Math.abs(gy - tile.row - sy) > 8 * Number.EPSILON * Math.max(1, Math.abs(sy))
|
|
142
|
+
)
|
|
143
|
+
throw new Error('Mixed contour lattice loses precision');
|
|
144
|
+
const px = data.positions[3 * v] + (data.origin[0] - origin[0]),
|
|
145
|
+
py = data.positions[3 * v + 1] + (data.origin[1] - origin[1]);
|
|
146
|
+
const pz = data.levels[level] - origin[2];
|
|
147
|
+
if (![gx, gy, px, py, pz].every(Number.isFinite))
|
|
148
|
+
throw new Error('Mixed contour frame overflow');
|
|
149
|
+
const onEdge = x === 0 || y === 0 || x === tile.width - 1 || y === tile.height - 1;
|
|
150
|
+
const xi = Math.floor(sx),
|
|
151
|
+
yi = Math.floor(sy);
|
|
152
|
+
const key = `${level}/${tile.column + xi}/${sx - xi}/${tile.row + yi}/${sy - yi}`;
|
|
153
|
+
if (onEdge) {
|
|
154
|
+
const rounded = `${level}/${gx}/${gy}`;
|
|
155
|
+
const identity = roundedBoundary.get(rounded);
|
|
156
|
+
if (identity !== undefined && identity !== key)
|
|
157
|
+
throw new Error('Mixed contour lattice loses precision');
|
|
158
|
+
roundedBoundary.set(rounded, key);
|
|
159
|
+
}
|
|
160
|
+
if (onEdge && local.has(key)) throw new Error('Duplicate mixed contour boundary vertex');
|
|
161
|
+
if (onEdge) local.add(key);
|
|
162
|
+
let id = onEdge ? shared.get(key) : undefined;
|
|
163
|
+
if (id !== undefined) {
|
|
164
|
+
if (Math.hypot(px - positions[3 * id], py - positions[3 * id + 1]) > tolerance)
|
|
165
|
+
throw new Error('Mixed contour boundary positions disagree');
|
|
166
|
+
} else {
|
|
167
|
+
id = positions.length / 3;
|
|
168
|
+
if (id >= limits.maxVertices) throw new Error('Mixed contour vertex capacity exceeded');
|
|
169
|
+
positions.push(px, py, pz);
|
|
170
|
+
grid.push(gx, gy);
|
|
171
|
+
vertexLevels.push(level);
|
|
172
|
+
if (onEdge) {
|
|
173
|
+
shared.set(key, id);
|
|
174
|
+
boundary.add(id);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
remap.set(v, id);
|
|
178
|
+
return id;
|
|
179
|
+
};
|
|
180
|
+
const localEdges = new Set<string>();
|
|
181
|
+
for (let i = 0; i < data.levelIndices.length; i++) {
|
|
182
|
+
const level = data.levelIndices[i],
|
|
183
|
+
a = vertex(data.segments[2 * i], level),
|
|
184
|
+
b = vertex(data.segments[2 * i + 1], level);
|
|
185
|
+
if (
|
|
186
|
+
a === b ||
|
|
187
|
+
(positions[3 * a] === positions[3 * b] && positions[3 * a + 1] === positions[3 * b + 1])
|
|
188
|
+
)
|
|
189
|
+
throw new Error('Degenerate mixed contour segment');
|
|
190
|
+
const key = a < b ? `${a}/${b}` : `${b}/${a}`;
|
|
191
|
+
if (localEdges.has(key)) throw new Error('Duplicate mixed contour segment');
|
|
192
|
+
localEdges.add(key);
|
|
193
|
+
const box = bounds[ti];
|
|
194
|
+
const seam =
|
|
195
|
+
(grid[2 * a] === grid[2 * b] && (grid[2 * a] === box[0] || grid[2 * a] === box[2])) ||
|
|
196
|
+
(grid[2 * a + 1] === grid[2 * b + 1] &&
|
|
197
|
+
(grid[2 * a + 1] === box[1] || grid[2 * a + 1] === box[3]));
|
|
198
|
+
edges.push({a, b, level, tile: ti, seam});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const segments: number[] = [],
|
|
202
|
+
levels: number[] = [],
|
|
203
|
+
emitted = new Map<string, number>();
|
|
204
|
+
for (const edge of edges) {
|
|
205
|
+
const {a, b, level} = edge;
|
|
206
|
+
const axis = grid[2 * a] === grid[2 * b] ? 1 : 0;
|
|
207
|
+
const start = grid[2 * a + axis],
|
|
208
|
+
end = grid[2 * b + axis];
|
|
209
|
+
const cuts = [a, b];
|
|
210
|
+
if (edge.seam)
|
|
211
|
+
for (const v of boundary) {
|
|
212
|
+
charge();
|
|
213
|
+
const value = grid[2 * v + axis];
|
|
214
|
+
if (
|
|
215
|
+
vertexLevels[v] !== level ||
|
|
216
|
+
grid[2 * v + 1 - axis] !== grid[2 * a + 1 - axis] ||
|
|
217
|
+
value <= Math.min(start, end) ||
|
|
218
|
+
value >= Math.max(start, end)
|
|
219
|
+
)
|
|
220
|
+
continue;
|
|
221
|
+
const f = (value - start) / (end - start);
|
|
222
|
+
const px = positions[3 * a] + f * (positions[3 * b] - positions[3 * a]);
|
|
223
|
+
const py = positions[3 * a + 1] + f * (positions[3 * b + 1] - positions[3 * a + 1]);
|
|
224
|
+
if (Math.hypot(px - positions[3 * v], py - positions[3 * v + 1]) > tolerance)
|
|
225
|
+
throw new Error('Mixed contour boundary positions disagree');
|
|
226
|
+
cuts.push(v);
|
|
227
|
+
}
|
|
228
|
+
cuts.sort((u, v) => grid[2 * u + axis] - grid[2 * v + axis]);
|
|
229
|
+
for (let i = 1; i < cuts.length; i++) {
|
|
230
|
+
const u = cuts[i - 1],
|
|
231
|
+
v = cuts[i],
|
|
232
|
+
key = u < v ? `${u}/${v}` : `${v}/${u}`;
|
|
233
|
+
const prior = emitted.get(key);
|
|
234
|
+
if (prior !== undefined) {
|
|
235
|
+
if (prior === edge.tile) throw new Error('Overlapping mixed contour segments within tile');
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (levels.length >= limits.maxSegments)
|
|
239
|
+
throw new Error('Mixed contour output segment capacity exceeded');
|
|
240
|
+
emitted.set(key, edge.tile);
|
|
241
|
+
segments.push(u, v);
|
|
242
|
+
levels.push(level);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
positions: Float64Array.from(positions),
|
|
247
|
+
gridCoordinates: Float64Array.from(grid),
|
|
248
|
+
segments: Uint32Array.from(segments),
|
|
249
|
+
levelIndices: Uint32Array.from(levels),
|
|
250
|
+
levels: first.levels.slice(),
|
|
251
|
+
origin,
|
|
252
|
+
heightReference: first.heightReference
|
|
253
|
+
};
|
|
254
|
+
}
|
|
@@ -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
|
@@ -102,3 +102,5 @@ export type {
|
|
|
102
102
|
} from './vertex-tiles';
|
|
103
103
|
export {stitchTerrainMeshEdges} from './mesh-stitch';
|
|
104
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> = {
|