@math.gl/geospatial 5.0.0-beta.4 → 5.0.0-beta.6
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 +6953 -10021
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +40 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -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/bounds-regions.d.ts +15 -0
- package/dist/terrain/bounds-regions.d.ts.map +1 -0
- package/dist/terrain/bounds-regions.js +84 -0
- package/dist/terrain/bounds-regions.js.map +1 -0
- package/dist/terrain/bounds-update.d.ts +11 -0
- package/dist/terrain/bounds-update.d.ts.map +1 -0
- package/dist/terrain/bounds-update.js +10 -0
- package/dist/terrain/bounds-update.js.map +1 -0
- package/dist/terrain/box-index.d.ts +9 -0
- package/dist/terrain/box-index.d.ts.map +1 -0
- package/dist/terrain/box-index.js +43 -0
- package/dist/terrain/box-index.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-simplify.d.ts +1 -0
- package/dist/terrain/contour-simplify.d.ts.map +1 -1
- package/dist/terrain/contour-simplify.js +5 -1
- package/dist/terrain/contour-simplify.js.map +1 -1
- package/dist/terrain/contour-topology.d.ts +30 -0
- package/dist/terrain/contour-topology.d.ts.map +1 -0
- package/dist/terrain/contour-topology.js +236 -0
- package/dist/terrain/contour-topology.js.map +1 -0
- package/dist/terrain/delatin-regions.d.ts +14 -0
- package/dist/terrain/delatin-regions.d.ts.map +1 -0
- package/dist/terrain/delatin-regions.js +15 -0
- package/dist/terrain/delatin-regions.js.map +1 -0
- package/dist/terrain/dirty-regions.d.ts +11 -0
- package/dist/terrain/dirty-regions.d.ts.map +1 -0
- package/dist/terrain/dirty-regions.js +34 -0
- package/dist/terrain/dirty-regions.js.map +1 -0
- package/dist/terrain/gradient-pyramid-regions.d.ts +15 -0
- package/dist/terrain/gradient-pyramid-regions.d.ts.map +1 -0
- package/dist/terrain/gradient-pyramid-regions.js +112 -0
- package/dist/terrain/gradient-pyramid-regions.js.map +1 -0
- package/dist/terrain/gradient-pyramid-update.d.ts +11 -0
- package/dist/terrain/gradient-pyramid-update.d.ts.map +1 -0
- package/dist/terrain/gradient-pyramid-update.js +17 -0
- package/dist/terrain/gradient-pyramid-update.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 +1613 -79
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +40 -0
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +20 -0
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/isobands.d.ts +24 -0
- package/dist/terrain/isobands.d.ts.map +1 -0
- package/dist/terrain/isobands.js +281 -0
- package/dist/terrain/isobands.js.map +1 -0
- package/dist/terrain/lod-morph-evaluate.d.ts +8 -0
- package/dist/terrain/lod-morph-evaluate.d.ts.map +1 -0
- package/dist/terrain/lod-morph-evaluate.js +30 -0
- package/dist/terrain/lod-morph-evaluate.js.map +1 -0
- package/dist/terrain/lod-morph.d.ts +35 -0
- package/dist/terrain/lod-morph.d.ts.map +1 -0
- package/dist/terrain/lod-morph.js +87 -0
- package/dist/terrain/lod-morph.js.map +1 -0
- package/dist/terrain/martini-regions.d.ts +14 -0
- package/dist/terrain/martini-regions.d.ts.map +1 -0
- package/dist/terrain/martini-regions.js +26 -0
- package/dist/terrain/martini-regions.js.map +1 -0
- package/dist/terrain/mesh-error.d.ts.map +1 -1
- package/dist/terrain/mesh-error.js +9 -1
- package/dist/terrain/mesh-error.js.map +1 -1
- package/dist/terrain/mesh-regions-data.d.ts +24 -0
- package/dist/terrain/mesh-regions-data.d.ts.map +1 -0
- package/dist/terrain/mesh-regions-data.js +80 -0
- package/dist/terrain/mesh-regions-data.js.map +1 -0
- package/dist/terrain/mesh-regions.d.ts +12 -0
- package/dist/terrain/mesh-regions.d.ts.map +1 -0
- package/dist/terrain/mesh-regions.js +10 -0
- package/dist/terrain/mesh-regions.js.map +1 -0
- package/dist/terrain/mesh-update.d.ts +11 -0
- package/dist/terrain/mesh-update.d.ts.map +1 -0
- package/dist/terrain/mesh-update.js +10 -0
- package/dist/terrain/mesh-update.js.map +1 -0
- package/dist/terrain/mixed-gradient-update.d.ts +15 -0
- package/dist/terrain/mixed-gradient-update.d.ts.map +1 -0
- package/dist/terrain/mixed-gradient-update.js +24 -0
- package/dist/terrain/mixed-gradient-update.js.map +1 -0
- package/dist/terrain/mixed-halo-update.d.ts +16 -0
- package/dist/terrain/mixed-halo-update.d.ts.map +1 -0
- package/dist/terrain/mixed-halo-update.js +46 -0
- package/dist/terrain/mixed-halo-update.js.map +1 -0
- package/dist/terrain/mixed-vertex-halos.d.ts +32 -0
- package/dist/terrain/mixed-vertex-halos.d.ts.map +1 -0
- package/dist/terrain/mixed-vertex-halos.js +125 -0
- package/dist/terrain/mixed-vertex-halos.js.map +1 -0
- package/dist/terrain/persistent-bounds.d.ts +16 -0
- package/dist/terrain/persistent-bounds.d.ts.map +1 -0
- package/dist/terrain/persistent-bounds.js +51 -0
- package/dist/terrain/persistent-bounds.js.map +1 -0
- package/dist/terrain/persistent-gradients.d.ts +16 -0
- package/dist/terrain/persistent-gradients.d.ts.map +1 -0
- package/dist/terrain/persistent-gradients.js +69 -0
- package/dist/terrain/persistent-gradients.js.map +1 -0
- package/dist/terrain/persistent-hierarchy-data.d.ts +41 -0
- package/dist/terrain/persistent-hierarchy-data.d.ts.map +1 -0
- package/dist/terrain/persistent-hierarchy-data.js +130 -0
- package/dist/terrain/persistent-hierarchy-data.js.map +1 -0
- package/dist/terrain/sample-triangle-height.d.ts +4 -0
- package/dist/terrain/sample-triangle-height.d.ts.map +1 -0
- package/dist/terrain/sample-triangle-height.js +46 -0
- package/dist/terrain/sample-triangle-height.js.map +1 -0
- package/dist/terrain/tile-update-data.d.ts +14 -0
- package/dist/terrain/tile-update-data.d.ts.map +1 -0
- package/dist/terrain/tile-update-data.js +23 -0
- package/dist/terrain/tile-update-data.js.map +1 -0
- 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 +64 -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/bounds-regions.ts +106 -0
- package/src/terrain/bounds-update.ts +19 -0
- package/src/terrain/box-index.ts +47 -0
- package/src/terrain/contour-mixed-weld.ts +254 -0
- package/src/terrain/contour-simplify.ts +10 -2
- package/src/terrain/contour-topology.ts +263 -0
- package/src/terrain/delatin-regions.ts +25 -0
- package/src/terrain/dirty-regions.ts +61 -0
- package/src/terrain/gradient-pyramid-regions.ts +140 -0
- package/src/terrain/gradient-pyramid-update.ts +25 -0
- package/src/terrain/height-field.ts +45 -5
- package/src/terrain/index.ts +58 -0
- package/src/terrain/isobands.ts +348 -0
- package/src/terrain/lod-morph-evaluate.ts +36 -0
- package/src/terrain/lod-morph.ts +138 -0
- package/src/terrain/martini-regions.ts +38 -0
- package/src/terrain/mesh-error.ts +14 -1
- package/src/terrain/mesh-regions-data.ts +113 -0
- package/src/terrain/mesh-regions.ts +18 -0
- package/src/terrain/mesh-update.ts +15 -0
- package/src/terrain/mixed-gradient-update.ts +40 -0
- package/src/terrain/mixed-halo-update.ts +56 -0
- package/src/terrain/mixed-vertex-halos.ts +170 -0
- package/src/terrain/persistent-bounds.ts +95 -0
- package/src/terrain/persistent-gradients.ts +117 -0
- package/src/terrain/persistent-hierarchy-data.ts +196 -0
- package/src/terrain/sample-triangle-height.ts +50 -0
- package/src/terrain/tile-update-data.ts +32 -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
package/dist/turf.cjs
CHANGED
|
@@ -58,654 +58,8 @@ __export(turf_exports, {
|
|
|
58
58
|
truncate: () => truncate
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(turf_exports);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function getGeoArrowDimensionSize(dimension) {
|
|
64
|
-
switch (dimension) {
|
|
65
|
-
case "xy":
|
|
66
|
-
return 2;
|
|
67
|
-
case "xyz":
|
|
68
|
-
case "xym":
|
|
69
|
-
return 3;
|
|
70
|
-
case "xyzm":
|
|
71
|
-
return 4;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// dist/geoarrow/layout.js
|
|
76
|
-
function isGeoArrowValueValid(validity, index) {
|
|
77
|
-
if (!validity)
|
|
78
|
-
return true;
|
|
79
|
-
const bitIndex = (validity.bitOffset || 0) + index;
|
|
80
|
-
return Boolean(validity.values[bitIndex >> 3] & 1 << (bitIndex & 7));
|
|
81
|
-
}
|
|
82
|
-
function getGeoArrowRowCount(column) {
|
|
83
|
-
return column.chunks.reduce((count, chunk) => count + chunk.length, 0);
|
|
84
|
-
}
|
|
85
|
-
function visitGeoArrowCoordinates(column, visitor) {
|
|
86
|
-
let rowOffset = 0;
|
|
87
|
-
for (const chunk of column.chunks) {
|
|
88
|
-
visitChunkCoordinates(chunk, column.encoding, rowOffset, visitor);
|
|
89
|
-
rowOffset += chunk.length;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function getGeoArrowVertexCount(column) {
|
|
93
|
-
if (column.encoding === "geoarrow.wkb" || column.encoding === "geoarrow.wkt" || column.encoding === "geoarrow.box") {
|
|
94
|
-
return 0;
|
|
95
|
-
}
|
|
96
|
-
let count = 0;
|
|
97
|
-
visitGeoArrowCoordinates(column, (coordinate) => {
|
|
98
|
-
count++;
|
|
99
|
-
return coordinate;
|
|
100
|
-
});
|
|
101
|
-
return count;
|
|
102
|
-
}
|
|
103
|
-
function getGeoArrowOffset(offsets, index) {
|
|
104
|
-
const value = offsets[index];
|
|
105
|
-
const numericValue = typeof value === "bigint" ? Number(value) : value;
|
|
106
|
-
if (!Number.isSafeInteger(numericValue)) {
|
|
107
|
-
throw new Error(`GeoArrow offset ${String(value)} exceeds JavaScript's safe integer range`);
|
|
108
|
-
}
|
|
109
|
-
return numericValue;
|
|
110
|
-
}
|
|
111
|
-
function getListRange(list, rowIndex) {
|
|
112
|
-
const offsetIndex = (list.offset || 0) + rowIndex;
|
|
113
|
-
const baseValue = list.offsetBase ?? 0;
|
|
114
|
-
const base = typeof baseValue === "bigint" ? Number(baseValue) : baseValue;
|
|
115
|
-
return [
|
|
116
|
-
getGeoArrowOffset(list.offsets, offsetIndex) - base,
|
|
117
|
-
getGeoArrowOffset(list.offsets, offsetIndex + 1) - base
|
|
118
|
-
];
|
|
119
|
-
}
|
|
120
|
-
function visitChunkCoordinates(array, encoding, rowOffset, visitor) {
|
|
121
|
-
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
122
|
-
if (!isGeoArrowValueValid(array.validity, rowIndex))
|
|
123
|
-
continue;
|
|
124
|
-
if (encoding === "geoarrow.geometry" && array.kind === "dense-union") {
|
|
125
|
-
visitUnionRowCoordinates(array, rowIndex, rowOffset + rowIndex, visitor);
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (encoding === "geoarrow.geometrycollection" && array.kind === "list") {
|
|
129
|
-
const [first, last] = getListRange(array, rowIndex);
|
|
130
|
-
if (array.child.kind === "dense-union") {
|
|
131
|
-
for (let index = first; index < last; index++) {
|
|
132
|
-
visitUnionRowCoordinates(array.child, index, rowOffset + rowIndex, visitor);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
const depth = getEncodingDepth(encoding);
|
|
138
|
-
visitNestedCoordinates(array, rowIndex, depth, rowOffset + rowIndex, visitor);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function visitUnionRowCoordinates(union, rowIndex, sourceRowIndex, visitor) {
|
|
142
|
-
if (!isGeoArrowValueValid(union.validity, rowIndex))
|
|
143
|
-
return;
|
|
144
|
-
const physicalIndex = (union.offset || 0) + rowIndex;
|
|
145
|
-
const typeId = union.typeIds[physicalIndex];
|
|
146
|
-
const valueOffset = union.valueOffsets[physicalIndex];
|
|
147
|
-
const child = union.children.find((candidate) => candidate.typeId === typeId);
|
|
148
|
-
if (!child)
|
|
149
|
-
return;
|
|
150
|
-
const encoding = child.encoding || getEncodingFromChildName(child.name);
|
|
151
|
-
if (encoding === "geoarrow.geometrycollection" && child.data.kind === "list") {
|
|
152
|
-
const [first, last] = getListRange(child.data, valueOffset);
|
|
153
|
-
if (child.data.child.kind === "dense-union") {
|
|
154
|
-
for (let index = first; index < last; index++) {
|
|
155
|
-
visitUnionRowCoordinates(child.data.child, index, sourceRowIndex, visitor);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
visitNestedCoordinates(child.data, valueOffset, getEncodingDepth(encoding), sourceRowIndex, visitor);
|
|
161
|
-
}
|
|
162
|
-
function visitNestedCoordinates(array, index, depth, rowIndex, visitor) {
|
|
163
|
-
if (depth === 0) {
|
|
164
|
-
const coordinate = readCoordinate(array, index);
|
|
165
|
-
if (coordinate)
|
|
166
|
-
visitor(coordinate, rowIndex);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
if (array.kind !== "list" || !isGeoArrowValueValid(array.validity, index))
|
|
170
|
-
return;
|
|
171
|
-
const [first, last] = getListRange(array, index);
|
|
172
|
-
for (let childIndex = first; childIndex < last; childIndex++) {
|
|
173
|
-
visitNestedCoordinates(array.child, childIndex, depth - 1, rowIndex, visitor);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function readCoordinate(array, index) {
|
|
177
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
178
|
-
return null;
|
|
179
|
-
if (array.kind === "fixed-size-list") {
|
|
180
|
-
const listIndex = (array.offset || 0) + index;
|
|
181
|
-
const coordinate = [];
|
|
182
|
-
for (let component = 0; component < array.size; component++) {
|
|
183
|
-
coordinate.push(readPrimitive(array.child, listIndex * array.size + component));
|
|
184
|
-
}
|
|
185
|
-
return coordinate;
|
|
186
|
-
}
|
|
187
|
-
if (array.kind === "struct") {
|
|
188
|
-
const structIndex = (array.offset || 0) + index;
|
|
189
|
-
const coordinate = [];
|
|
190
|
-
for (const name of ["x", "y", "z", "m"]) {
|
|
191
|
-
const child = array.children[name];
|
|
192
|
-
if (child)
|
|
193
|
-
coordinate.push(readPrimitive(child, structIndex));
|
|
194
|
-
}
|
|
195
|
-
return coordinate.length >= 2 ? coordinate : null;
|
|
196
|
-
}
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
199
|
-
function readPrimitive(array, index) {
|
|
200
|
-
if (array.kind !== "primitive")
|
|
201
|
-
throw new Error("GeoArrow coordinate child must be primitive");
|
|
202
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
203
|
-
return Number.NaN;
|
|
204
|
-
const valueIndex = (array.offset || 0) + index * (array.stride || 1);
|
|
205
|
-
return Number(array.values[valueIndex]);
|
|
206
|
-
}
|
|
207
|
-
function getEncodingFromChildName(name) {
|
|
208
|
-
const normalized = name.replace(/[^a-z]/gi, "").toLowerCase();
|
|
209
|
-
switch (normalized) {
|
|
210
|
-
case "point":
|
|
211
|
-
return "geoarrow.point";
|
|
212
|
-
case "linestring":
|
|
213
|
-
return "geoarrow.linestring";
|
|
214
|
-
case "polygon":
|
|
215
|
-
return "geoarrow.polygon";
|
|
216
|
-
case "multipoint":
|
|
217
|
-
return "geoarrow.multipoint";
|
|
218
|
-
case "multilinestring":
|
|
219
|
-
return "geoarrow.multilinestring";
|
|
220
|
-
case "multipolygon":
|
|
221
|
-
return "geoarrow.multipolygon";
|
|
222
|
-
case "geometrycollection":
|
|
223
|
-
return "geoarrow.geometrycollection";
|
|
224
|
-
default:
|
|
225
|
-
throw new Error(`Unknown GeoArrow dense-union child ${name}`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function getEncodingDepth(encoding) {
|
|
229
|
-
switch (encoding) {
|
|
230
|
-
case "geoarrow.point":
|
|
231
|
-
return 0;
|
|
232
|
-
case "geoarrow.linestring":
|
|
233
|
-
case "geoarrow.multipoint":
|
|
234
|
-
return 1;
|
|
235
|
-
case "geoarrow.polygon":
|
|
236
|
-
case "geoarrow.multilinestring":
|
|
237
|
-
return 2;
|
|
238
|
-
case "geoarrow.multipolygon":
|
|
239
|
-
return 3;
|
|
240
|
-
default:
|
|
241
|
-
return 0;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// dist/geoarrow/kernels.js
|
|
246
|
-
function getGeoArrowRowBounds(column) {
|
|
247
|
-
const rowCount = getGeoArrowRowCount(column);
|
|
248
|
-
if (column.encoding === "geoarrow.box") {
|
|
249
|
-
const result2 = [];
|
|
250
|
-
for (const chunk of column.chunks) {
|
|
251
|
-
for (let rowIndex = 0; rowIndex < chunk.length; rowIndex++) {
|
|
252
|
-
if (chunk.kind !== "struct" || !isGeoArrowValueValid(chunk.validity, rowIndex)) {
|
|
253
|
-
result2.push(null);
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
const index = (chunk.offset || 0) + rowIndex;
|
|
257
|
-
const xmin = readPrimitiveNumber(chunk.children["xmin"], index);
|
|
258
|
-
const ymin = readPrimitiveNumber(chunk.children["ymin"], index);
|
|
259
|
-
const xmax = readPrimitiveNumber(chunk.children["xmax"], index);
|
|
260
|
-
const ymax = readPrimitiveNumber(chunk.children["ymax"], index);
|
|
261
|
-
result2.push([xmin, ymin, xmax, ymax].every(Number.isFinite) ? [xmin, ymin, xmax, ymax] : null);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return result2;
|
|
265
|
-
}
|
|
266
|
-
const minimumX = new Float64Array(rowCount).fill(Number.POSITIVE_INFINITY);
|
|
267
|
-
const minimumY = new Float64Array(rowCount).fill(Number.POSITIVE_INFINITY);
|
|
268
|
-
const maximumX = new Float64Array(rowCount).fill(Number.NEGATIVE_INFINITY);
|
|
269
|
-
const maximumY = new Float64Array(rowCount).fill(Number.NEGATIVE_INFINITY);
|
|
270
|
-
visitGeoArrowCoordinates(column, (coordinate, sourceRowIndex) => {
|
|
271
|
-
const [x, y] = coordinate;
|
|
272
|
-
if (Number.isFinite(x) && Number.isFinite(y)) {
|
|
273
|
-
minimumX[sourceRowIndex] = Math.min(minimumX[sourceRowIndex], x);
|
|
274
|
-
minimumY[sourceRowIndex] = Math.min(minimumY[sourceRowIndex], y);
|
|
275
|
-
maximumX[sourceRowIndex] = Math.max(maximumX[sourceRowIndex], x);
|
|
276
|
-
maximumY[sourceRowIndex] = Math.max(maximumY[sourceRowIndex], y);
|
|
277
|
-
}
|
|
278
|
-
return coordinate;
|
|
279
|
-
});
|
|
280
|
-
const bounds = [];
|
|
281
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
282
|
-
bounds.push(Number.isFinite(minimumX[rowIndex]) ? [minimumX[rowIndex], minimumY[rowIndex], maximumX[rowIndex], maximumY[rowIndex]] : null);
|
|
283
|
-
}
|
|
284
|
-
return bounds;
|
|
285
|
-
}
|
|
286
|
-
function readPrimitiveNumber(array, index) {
|
|
287
|
-
if (array.kind !== "primitive" || !isGeoArrowValueValid(array.validity, index))
|
|
288
|
-
return Number.NaN;
|
|
289
|
-
const valueIndex = (array.offset || 0) + index * (array.stride || 1);
|
|
290
|
-
return Number(array.values[valueIndex]);
|
|
291
|
-
}
|
|
292
|
-
function mapGeoArrowCoordinates(column, mapper, options = {}, sourceDimension) {
|
|
293
|
-
assertGeoArrowResourceLimits(column, options.limits);
|
|
294
|
-
if (column.encoding === "geoarrow.wkb" || column.encoding === "geoarrow.wkt") {
|
|
295
|
-
throw new Error("Coordinate mapping requires native GeoArrow storage");
|
|
296
|
-
}
|
|
297
|
-
const dimension = options.dimension || column.dimension;
|
|
298
|
-
const layout = options.coordinateLayout || column.coordinateLayout || "interleaved";
|
|
299
|
-
let rowOffset = 0;
|
|
300
|
-
const chunks = column.chunks.map((chunk) => {
|
|
301
|
-
const mapped = mapArrayCoordinates(chunk, column.encoding, rowOffset, dimension, layout, mapper, options.coordinateType || "preserve", options.dimension !== void 0, options.coordinateLayout !== void 0, sourceDimension);
|
|
302
|
-
rowOffset += chunk.length;
|
|
303
|
-
return mapped;
|
|
304
|
-
});
|
|
305
|
-
return { ...column, dimension, coordinateLayout: layout, chunks };
|
|
306
|
-
}
|
|
307
|
-
function resizeCoordinate(coordinate, sourceDimension, targetDimension) {
|
|
308
|
-
const sourceNames = getDimensionNames(sourceDimension);
|
|
309
|
-
return getDimensionNames(targetDimension).map((name) => {
|
|
310
|
-
const sourceIndex = sourceNames.indexOf(name);
|
|
311
|
-
return sourceIndex >= 0 ? coordinate[sourceIndex] ?? 0 : 0;
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
function rewindGeoArrow(column, options = {}) {
|
|
315
|
-
assertGeoArrowResourceLimits(column, options.limits);
|
|
316
|
-
if (column.encoding === "geoarrow.wkb" || column.encoding === "geoarrow.wkt") {
|
|
317
|
-
throw new Error("Rewinding requires native GeoArrow storage");
|
|
318
|
-
}
|
|
319
|
-
const outerClockwise = (options.outer || "counter-clockwise") === "clockwise";
|
|
320
|
-
let changed = false;
|
|
321
|
-
const chunks = column.chunks.map((chunk) => {
|
|
322
|
-
const clone2 = mapArrayCoordinates(chunk, column.encoding, 0, column.dimension, column.coordinateLayout || "interleaved", (coordinate) => coordinate, "preserve");
|
|
323
|
-
changed || (changed = rewindArrayRings(clone2, column.encoding, outerClockwise));
|
|
324
|
-
return clone2;
|
|
325
|
-
});
|
|
326
|
-
return changed ? { ...column, chunks } : column;
|
|
327
|
-
}
|
|
328
|
-
function assertGeoArrowResourceLimits(column, options = {}) {
|
|
329
|
-
const rows2 = getGeoArrowRowCount(column);
|
|
330
|
-
if (rows2 > (options.maximumRows ?? Number.POSITIVE_INFINITY)) {
|
|
331
|
-
throw new Error(`GeoArrow row count ${rows2} exceeds maximumRows`);
|
|
332
|
-
}
|
|
333
|
-
if (column.chunks.length > (options.maximumChunks ?? Number.POSITIVE_INFINITY)) {
|
|
334
|
-
throw new Error(`GeoArrow chunk count ${column.chunks.length} exceeds maximumChunks`);
|
|
335
|
-
}
|
|
336
|
-
const coordinates = getGeoArrowVertexCount(column);
|
|
337
|
-
if (coordinates > (options.maximumCoordinates ?? Number.POSITIVE_INFINITY)) {
|
|
338
|
-
throw new Error(`GeoArrow coordinate count ${coordinates} exceeds maximumCoordinates`);
|
|
339
|
-
}
|
|
340
|
-
if (options.maximumNestingDepth !== void 0) {
|
|
341
|
-
const depth = Math.max(0, ...column.chunks.map(getArrayDepth));
|
|
342
|
-
if (depth > options.maximumNestingDepth) {
|
|
343
|
-
throw new Error(`GeoArrow nesting depth ${depth} exceeds maximumNestingDepth`);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
if (options.maximumOutputBytes !== void 0) {
|
|
347
|
-
const estimatedBytes = coordinates * getGeoArrowDimensionSize(column.dimension) * 8;
|
|
348
|
-
if (estimatedBytes > options.maximumOutputBytes) {
|
|
349
|
-
throw new Error(`GeoArrow estimated output ${estimatedBytes} exceeds maximumOutputBytes`);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
function mapArrayCoordinates(array, encoding, rowOffset, targetDimension, targetLayout, mapper, coordinateType, forceDimension = false, forceLayout = false, sourceDimension, rowIndicesOverride) {
|
|
354
|
-
if (encoding === "geoarrow.geometry" && array.kind === "dense-union") {
|
|
355
|
-
const childRowIndices = collectUnionRowIndices(array, rowOffset);
|
|
356
|
-
return {
|
|
357
|
-
...array,
|
|
358
|
-
children: array.children.map((child, childIndex) => {
|
|
359
|
-
const childEncoding = child.encoding || getEncodingFromChildName2(child.name);
|
|
360
|
-
const childDimension = forceDimension ? targetDimension : child.dimension || targetDimension;
|
|
361
|
-
const childLayout = forceLayout ? targetLayout : child.coordinateLayout || targetLayout;
|
|
362
|
-
return {
|
|
363
|
-
...child,
|
|
364
|
-
data: mapArrayCoordinates(child.data, childEncoding, rowOffset, childDimension, childLayout, mapper, coordinateType, forceDimension, forceLayout, childDimension, childRowIndices[childIndex]),
|
|
365
|
-
dimension: childDimension,
|
|
366
|
-
coordinateLayout: childLayout,
|
|
367
|
-
encoding: childEncoding
|
|
368
|
-
};
|
|
369
|
-
})
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
if (encoding === "geoarrow.geometrycollection" && array.kind === "list") {
|
|
373
|
-
return {
|
|
374
|
-
...array,
|
|
375
|
-
child: mapArrayCoordinates(array.child, "geoarrow.geometry", rowOffset, targetDimension, targetLayout, mapper, coordinateType, forceDimension, forceLayout, sourceDimension, rowIndicesOverride)
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
const depth = getEncodingDepth2(encoding);
|
|
379
|
-
const rowIndices = rowIndicesOverride || collectLeafRowIndices(array, depth, rowOffset);
|
|
380
|
-
return mapNestedArray(array, depth, rowOffset, targetDimension, targetLayout, mapper, coordinateType, rowIndices, sourceDimension);
|
|
381
|
-
}
|
|
382
|
-
function mapNestedArray(array, depth, rowOffset, targetDimension, targetLayout, mapper, coordinateType, rowIndices, sourceDimension) {
|
|
383
|
-
if (depth === 0) {
|
|
384
|
-
return mapCoordinateLeaf(array, rowOffset, targetDimension, targetLayout, mapper, coordinateType, rowIndices, sourceDimension);
|
|
385
|
-
}
|
|
386
|
-
if (array.kind !== "list")
|
|
387
|
-
return array;
|
|
388
|
-
return {
|
|
389
|
-
...array,
|
|
390
|
-
child: mapNestedArray(array.child, depth - 1, rowOffset, targetDimension, targetLayout, mapper, coordinateType, rowIndices, sourceDimension)
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
function mapCoordinateLeaf(array, rowOffset, targetDimension, targetLayout, mapper, coordinateType, rowIndices, sourceDimension) {
|
|
394
|
-
const count = array.length;
|
|
395
|
-
const targetSize = getGeoArrowDimensionSize(targetDimension);
|
|
396
|
-
const sourceValues = new Array(count);
|
|
397
|
-
for (let index = 0; index < count; index++) {
|
|
398
|
-
const coordinate = readCoordinateAt(array, index);
|
|
399
|
-
const mapped = coordinate ? mapper(sourceDimension ? resizeCoordinate(coordinate, sourceDimension, targetDimension) : coordinate, (rowIndices == null ? void 0 : rowIndices[index]) ?? rowOffset) : new Array(targetSize).fill(0);
|
|
400
|
-
if (mapped.length !== targetSize) {
|
|
401
|
-
throw new Error(`Coordinate mapper returned ${mapped.length} values; expected ${targetSize}`);
|
|
402
|
-
}
|
|
403
|
-
sourceValues[index] = [...mapped];
|
|
404
|
-
}
|
|
405
|
-
const FloatArray = resolveCoordinateConstructor(array, coordinateType);
|
|
406
|
-
return makeCoordinateLeaf(sourceValues, targetDimension, targetLayout, FloatArray, array.validity);
|
|
407
|
-
}
|
|
408
|
-
function collectLeafRowIndices(array, depth, rowOffset) {
|
|
409
|
-
const output = new Array(getLeafLength(array, depth)).fill(rowOffset);
|
|
410
|
-
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
411
|
-
if (isGeoArrowValueValid(array.validity, rowIndex)) {
|
|
412
|
-
assignNestedRowIndices(array, rowIndex, depth, rowOffset + rowIndex, output);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
return output;
|
|
416
|
-
}
|
|
417
|
-
function assignNestedRowIndices(array, index, depth, rowIndex, output) {
|
|
418
|
-
if (depth === 0) {
|
|
419
|
-
if (index >= 0 && index < output.length)
|
|
420
|
-
output[index] = rowIndex;
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
if (array.kind !== "list")
|
|
424
|
-
return;
|
|
425
|
-
const [first, last] = getListRange(array, index);
|
|
426
|
-
for (let childIndex = first; childIndex < last; childIndex++) {
|
|
427
|
-
assignNestedRowIndices(array.child, childIndex, depth - 1, rowIndex, output);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
function collectUnionRowIndices(union, rowOffset) {
|
|
431
|
-
if (union.kind !== "dense-union")
|
|
432
|
-
return [];
|
|
433
|
-
const output = union.children.map((child) => {
|
|
434
|
-
const encoding = child.encoding || getEncodingFromChildName2(child.name);
|
|
435
|
-
return new Array(getLeafLength(child.data, getEncodingDepth2(encoding))).fill(rowOffset);
|
|
436
|
-
});
|
|
437
|
-
for (let rowIndex = 0; rowIndex < union.length; rowIndex++) {
|
|
438
|
-
if (!isGeoArrowValueValid(union.validity, rowIndex))
|
|
439
|
-
continue;
|
|
440
|
-
const physical = (union.offset || 0) + rowIndex;
|
|
441
|
-
const childIndex = union.children.findIndex((child2) => child2.typeId === union.typeIds[physical]);
|
|
442
|
-
if (childIndex < 0)
|
|
443
|
-
continue;
|
|
444
|
-
const child = union.children[childIndex];
|
|
445
|
-
assignUnionRowIndices(child.data, child.encoding || getEncodingFromChildName2(child.name), union.valueOffsets[physical], rowOffset + rowIndex, output[childIndex]);
|
|
446
|
-
}
|
|
447
|
-
return output;
|
|
448
|
-
}
|
|
449
|
-
function assignUnionRowIndices(array, encoding, index, rowIndex, output) {
|
|
450
|
-
if (encoding === "geoarrow.geometry" && array.kind === "dense-union") {
|
|
451
|
-
const physical = (array.offset || 0) + index;
|
|
452
|
-
const childIndex = array.children.findIndex((child) => child.typeId === array.typeIds[physical]);
|
|
453
|
-
if (childIndex >= 0) {
|
|
454
|
-
const child = array.children[childIndex];
|
|
455
|
-
assignUnionRowIndices(child.data, child.encoding || getEncodingFromChildName2(child.name), array.valueOffsets[physical], rowIndex, output);
|
|
456
|
-
}
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
if (encoding === "geoarrow.geometrycollection" && array.kind === "list") {
|
|
460
|
-
const [first, last] = getListRange(array, index);
|
|
461
|
-
if (array.child.kind === "dense-union") {
|
|
462
|
-
for (let childIndex = first; childIndex < last; childIndex++) {
|
|
463
|
-
assignUnionRowIndices(array.child, "geoarrow.geometry", childIndex, rowIndex, output);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
assignNestedRowIndices(array, index, getEncodingDepth2(encoding), rowIndex, output);
|
|
469
|
-
}
|
|
470
|
-
function getLeafLength(array, depth) {
|
|
471
|
-
let current = array;
|
|
472
|
-
for (let level = 0; level < depth; level++) {
|
|
473
|
-
if (current.kind !== "list")
|
|
474
|
-
return 0;
|
|
475
|
-
current = current.child;
|
|
476
|
-
}
|
|
477
|
-
return current.length;
|
|
478
|
-
}
|
|
479
|
-
function resolveCoordinateConstructor(array, coordinateType) {
|
|
480
|
-
if (coordinateType === "float32")
|
|
481
|
-
return Float32Array;
|
|
482
|
-
if (coordinateType === "float64")
|
|
483
|
-
return Float64Array;
|
|
484
|
-
if (array.kind === "fixed-size-list" && array.child.kind === "primitive") {
|
|
485
|
-
return array.child.values instanceof Float32Array ? Float32Array : Float64Array;
|
|
486
|
-
}
|
|
487
|
-
if (array.kind === "struct") {
|
|
488
|
-
const child = array.children["x"];
|
|
489
|
-
if ((child == null ? void 0 : child.kind) === "primitive" && child.values instanceof Float32Array)
|
|
490
|
-
return Float32Array;
|
|
491
|
-
}
|
|
492
|
-
return Float64Array;
|
|
493
|
-
}
|
|
494
|
-
function makeCoordinateLeaf(coordinates, dimension, layout, FloatArray, validity) {
|
|
495
|
-
const size = getGeoArrowDimensionSize(dimension);
|
|
496
|
-
if (layout === "interleaved") {
|
|
497
|
-
const values = new FloatArray(coordinates.length * size);
|
|
498
|
-
for (let index = 0; index < coordinates.length; index++) {
|
|
499
|
-
values.set(coordinates[index], index * size);
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
kind: "fixed-size-list",
|
|
503
|
-
length: coordinates.length,
|
|
504
|
-
size,
|
|
505
|
-
child: { kind: "primitive", length: values.length, values },
|
|
506
|
-
validity
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
const children = {
|
|
510
|
-
x: { kind: "primitive", length: coordinates.length, values: new FloatArray(coordinates.length) },
|
|
511
|
-
y: { kind: "primitive", length: coordinates.length, values: new FloatArray(coordinates.length) }
|
|
512
|
-
};
|
|
513
|
-
const names = getDimensionNames(dimension);
|
|
514
|
-
for (let component = 2; component < names.length; component++) {
|
|
515
|
-
children[names[component]] = {
|
|
516
|
-
kind: "primitive",
|
|
517
|
-
length: coordinates.length,
|
|
518
|
-
values: new FloatArray(coordinates.length)
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
for (let index = 0; index < coordinates.length; index++) {
|
|
522
|
-
const coordinate = coordinates[index];
|
|
523
|
-
for (let component = 0; component < names.length; component++) {
|
|
524
|
-
const child = children[names[component]];
|
|
525
|
-
if (child.kind === "primitive")
|
|
526
|
-
child.values[index] = coordinate[component];
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
return { kind: "struct", length: coordinates.length, children, validity };
|
|
530
|
-
}
|
|
531
|
-
function readCoordinateAt(array, index) {
|
|
532
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
533
|
-
return null;
|
|
534
|
-
if (array.kind === "fixed-size-list") {
|
|
535
|
-
const logicalIndex = (array.offset || 0) + index;
|
|
536
|
-
if (array.child.kind !== "primitive")
|
|
537
|
-
return null;
|
|
538
|
-
const values = [];
|
|
539
|
-
for (let component = 0; component < array.size; component++) {
|
|
540
|
-
const scalarIndex = logicalIndex * array.size + component;
|
|
541
|
-
values.push(Number(array.child.values[(array.child.offset || 0) + scalarIndex * (array.child.stride || 1)]));
|
|
542
|
-
}
|
|
543
|
-
return values;
|
|
544
|
-
}
|
|
545
|
-
if (array.kind === "struct") {
|
|
546
|
-
const logicalIndex = (array.offset || 0) + index;
|
|
547
|
-
const values = [];
|
|
548
|
-
for (const name of ["x", "y", "z", "m"]) {
|
|
549
|
-
const child = array.children[name];
|
|
550
|
-
if ((child == null ? void 0 : child.kind) === "primitive") {
|
|
551
|
-
values.push(Number(child.values[(child.offset || 0) + logicalIndex * (child.stride || 1)]));
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
return values.length >= 2 ? values : null;
|
|
555
|
-
}
|
|
556
|
-
return null;
|
|
557
|
-
}
|
|
558
|
-
function getDimensionNames(dimension) {
|
|
559
|
-
switch (dimension) {
|
|
560
|
-
case "xy":
|
|
561
|
-
return ["x", "y"];
|
|
562
|
-
case "xyz":
|
|
563
|
-
return ["x", "y", "z"];
|
|
564
|
-
case "xym":
|
|
565
|
-
return ["x", "y", "m"];
|
|
566
|
-
case "xyzm":
|
|
567
|
-
return ["x", "y", "z", "m"];
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
function getEncodingFromChildName2(name) {
|
|
571
|
-
const normalized = name.replace(/[^a-z]/gi, "").toLowerCase();
|
|
572
|
-
const encoding = `geoarrow.${normalized}`;
|
|
573
|
-
if (encoding === "geoarrow.point" || encoding === "geoarrow.linestring" || encoding === "geoarrow.polygon" || encoding === "geoarrow.multipoint" || encoding === "geoarrow.multilinestring" || encoding === "geoarrow.multipolygon" || encoding === "geoarrow.geometrycollection") {
|
|
574
|
-
return encoding;
|
|
575
|
-
}
|
|
576
|
-
throw new Error(`Unknown GeoArrow dense-union child ${name}`);
|
|
577
|
-
}
|
|
578
|
-
function getEncodingDepth2(encoding) {
|
|
579
|
-
switch (encoding) {
|
|
580
|
-
case "geoarrow.point":
|
|
581
|
-
return 0;
|
|
582
|
-
case "geoarrow.linestring":
|
|
583
|
-
case "geoarrow.multipoint":
|
|
584
|
-
return 1;
|
|
585
|
-
case "geoarrow.polygon":
|
|
586
|
-
case "geoarrow.multilinestring":
|
|
587
|
-
return 2;
|
|
588
|
-
case "geoarrow.multipolygon":
|
|
589
|
-
return 3;
|
|
590
|
-
default:
|
|
591
|
-
return 0;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
function rewindArrayRings(array, encoding, outerClockwise) {
|
|
595
|
-
if (encoding === "geoarrow.geometry" && array.kind === "dense-union") {
|
|
596
|
-
let changed2 = false;
|
|
597
|
-
for (const child of array.children) {
|
|
598
|
-
if (rewindArrayRings(child.data, child.encoding || getEncodingFromChildName2(child.name), outerClockwise))
|
|
599
|
-
changed2 = true;
|
|
600
|
-
}
|
|
601
|
-
return changed2;
|
|
602
|
-
}
|
|
603
|
-
if (encoding === "geoarrow.geometrycollection" && array.kind === "list") {
|
|
604
|
-
if (array.child.kind !== "dense-union")
|
|
605
|
-
return false;
|
|
606
|
-
let changed2 = false;
|
|
607
|
-
for (const child of array.child.children) {
|
|
608
|
-
if (rewindArrayRings(child.data, child.encoding || getEncodingFromChildName2(child.name), outerClockwise))
|
|
609
|
-
changed2 = true;
|
|
610
|
-
}
|
|
611
|
-
return changed2;
|
|
612
|
-
}
|
|
613
|
-
if (encoding !== "geoarrow.polygon" && encoding !== "geoarrow.multipolygon")
|
|
614
|
-
return false;
|
|
615
|
-
if (array.kind !== "list" || array.child.kind !== "list")
|
|
616
|
-
return false;
|
|
617
|
-
let changed = false;
|
|
618
|
-
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
619
|
-
if (!isGeoArrowValueValid(array.validity, rowIndex))
|
|
620
|
-
continue;
|
|
621
|
-
const [, rowEnd] = getListRange(array, rowIndex);
|
|
622
|
-
const rowStart = getListRange(array, rowIndex)[0];
|
|
623
|
-
if (encoding === "geoarrow.polygon") {
|
|
624
|
-
const rings = array.child;
|
|
625
|
-
if (rewindRingGroup(rings, rowStart, rowEnd, outerClockwise))
|
|
626
|
-
changed = true;
|
|
627
|
-
} else {
|
|
628
|
-
const polygons2 = array.child;
|
|
629
|
-
for (let polygonIndex = rowStart; polygonIndex < rowEnd; polygonIndex++) {
|
|
630
|
-
const [ringStart, ringEnd] = getListRange(polygons2, polygonIndex);
|
|
631
|
-
if (rewindRingGroup(polygons2.child, ringStart, ringEnd, outerClockwise))
|
|
632
|
-
changed = true;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
return changed;
|
|
637
|
-
}
|
|
638
|
-
function rewindRingGroup(rings, firstRing, lastRing, outerClockwise) {
|
|
639
|
-
if (rings.kind !== "list")
|
|
640
|
-
return false;
|
|
641
|
-
const leaf = rings.child;
|
|
642
|
-
if (leaf.kind !== "fixed-size-list" && leaf.kind !== "struct")
|
|
643
|
-
return false;
|
|
644
|
-
let changed = false;
|
|
645
|
-
for (let ringIndex = firstRing; ringIndex < lastRing; ringIndex++) {
|
|
646
|
-
const [first, last] = getListRange(rings, ringIndex);
|
|
647
|
-
const area2 = getRingArea(leaf, first, last);
|
|
648
|
-
if (!Number.isFinite(area2) || area2 === 0)
|
|
649
|
-
continue;
|
|
650
|
-
const shouldClockwise = ringIndex === firstRing ? outerClockwise : !outerClockwise;
|
|
651
|
-
if (area2 < 0 !== shouldClockwise) {
|
|
652
|
-
reverseCoordinateRange(leaf, first, last);
|
|
653
|
-
changed = true;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
return changed;
|
|
657
|
-
}
|
|
658
|
-
function getRingArea(leaf, first, last) {
|
|
659
|
-
let area2 = 0;
|
|
660
|
-
for (let index = first; index < last; index++) {
|
|
661
|
-
const current = readCoordinateAt(leaf, index);
|
|
662
|
-
const next = readCoordinateAt(leaf, index + 1 < last ? index + 1 : first);
|
|
663
|
-
if (!current || !next)
|
|
664
|
-
return Number.NaN;
|
|
665
|
-
area2 += current[0] * next[1] - next[0] * current[1];
|
|
666
|
-
}
|
|
667
|
-
return area2 / 2;
|
|
668
|
-
}
|
|
669
|
-
function reverseCoordinateRange(leaf, first, last) {
|
|
670
|
-
const values = [];
|
|
671
|
-
for (let index = first; index < last; index++)
|
|
672
|
-
values.push(readCoordinateAt(leaf, index));
|
|
673
|
-
values.reverse();
|
|
674
|
-
for (let index = first; index < last; index++)
|
|
675
|
-
writeCoordinateAt(leaf, index, values[index - first]);
|
|
676
|
-
}
|
|
677
|
-
function writeCoordinateAt(array, index, coordinate) {
|
|
678
|
-
if (array.kind === "fixed-size-list" && array.child.kind === "primitive") {
|
|
679
|
-
const logical = (array.offset || 0) + index;
|
|
680
|
-
for (let component = 0; component < array.size; component++) {
|
|
681
|
-
const scalar2 = (array.child.offset || 0) + logical * array.size + component;
|
|
682
|
-
array.child.values[scalar2] = coordinate[component];
|
|
683
|
-
}
|
|
684
|
-
} else if (array.kind === "struct") {
|
|
685
|
-
const logical = (array.offset || 0) + index;
|
|
686
|
-
const names = ["x", "y", "z", "m"];
|
|
687
|
-
for (let component = 0; component < names.length; component++) {
|
|
688
|
-
const child = array.children[names[component]];
|
|
689
|
-
if ((child == null ? void 0 : child.kind) === "primitive")
|
|
690
|
-
child.values[(child.offset || 0) + logical * (child.stride || 1)] = coordinate[component];
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
function getArrayDepth(array) {
|
|
695
|
-
switch (array.kind) {
|
|
696
|
-
case "list":
|
|
697
|
-
case "fixed-size-list":
|
|
698
|
-
return 1 + getArrayDepth(array.child);
|
|
699
|
-
case "struct":
|
|
700
|
-
return 1 + Math.max(0, ...Object.values(array.children).map(getArrayDepth));
|
|
701
|
-
case "dense-union":
|
|
702
|
-
return 1 + Math.max(0, ...array.children.map((child) => getArrayDepth(child.data)));
|
|
703
|
-
default:
|
|
704
|
-
return 1;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
// dist/turf.js
|
|
61
|
+
var import_geoarrow_utils = require("@math.gl/arrow/geoarrow-utils");
|
|
62
|
+
var import_geoarrow_utils2 = require("@math.gl/arrow/geoarrow-utils");
|
|
709
63
|
var RADIUS = 63710088e-1;
|
|
710
64
|
var RAD = Math.PI / 180;
|
|
711
65
|
var depths = {
|
|
@@ -722,7 +76,7 @@ function rows(column, allowed) {
|
|
|
722
76
|
const result2 = [];
|
|
723
77
|
for (const array of column.chunks)
|
|
724
78
|
for (let index = 0; index < array.length; index++)
|
|
725
|
-
result2.push({ array, index, valid: isGeoArrowValueValid(array.validity, index) });
|
|
79
|
+
result2.push({ array, index, valid: (0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index) });
|
|
726
80
|
return result2;
|
|
727
81
|
}
|
|
728
82
|
function range(array, index) {
|
|
@@ -738,12 +92,12 @@ function range(array, index) {
|
|
|
738
92
|
function scalar(array, index) {
|
|
739
93
|
if (array.kind !== "primitive")
|
|
740
94
|
throw new Error("Invalid GeoArrow coordinate");
|
|
741
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
95
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
|
|
742
96
|
return NaN;
|
|
743
97
|
return Number(array.values[(array.offset || 0) + index * (array.stride || 1)]);
|
|
744
98
|
}
|
|
745
99
|
function point(array, index) {
|
|
746
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
100
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
|
|
747
101
|
return null;
|
|
748
102
|
if (array.kind === "fixed-size-list") {
|
|
749
103
|
const i = ((array.offset || 0) + index) * array.size;
|
|
@@ -758,7 +112,7 @@ function point(array, index) {
|
|
|
758
112
|
throw new Error("Invalid GeoArrow coordinate storage");
|
|
759
113
|
}
|
|
760
114
|
function walk(array, index, depth, visit) {
|
|
761
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
115
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
|
|
762
116
|
return;
|
|
763
117
|
if (!depth) {
|
|
764
118
|
const p = point(array, index);
|
|
@@ -773,7 +127,7 @@ function walk(array, index, depth, visit) {
|
|
|
773
127
|
walk(array.child, i, depth - 1, visit);
|
|
774
128
|
}
|
|
775
129
|
function lines(array, index, depth, visit) {
|
|
776
|
-
if (!isGeoArrowValueValid(array.validity, index))
|
|
130
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
|
|
777
131
|
return;
|
|
778
132
|
const [a, b] = range(array, index);
|
|
779
133
|
if (array.kind !== "list")
|
|
@@ -830,7 +184,7 @@ var points = ["geoarrow.point"];
|
|
|
830
184
|
var polygons = ["geoarrow.polygon", "geoarrow.multipolygon"];
|
|
831
185
|
function bbox(column) {
|
|
832
186
|
rows(column, native);
|
|
833
|
-
const bounds = getGeoArrowRowBounds(column), out = {
|
|
187
|
+
const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column), out = {
|
|
834
188
|
values: new Float64Array(bounds.length * 4),
|
|
835
189
|
validity: new Uint8Array(Math.ceil(bounds.length / 8))
|
|
836
190
|
};
|
|
@@ -901,11 +255,11 @@ function polygonArea(array, index) {
|
|
|
901
255
|
const [a, b] = range(array, index);
|
|
902
256
|
if (array.kind !== "list")
|
|
903
257
|
throw new Error("Invalid polygon");
|
|
904
|
-
if (a === b || !isGeoArrowValueValid(array.child.validity, a))
|
|
258
|
+
if (a === b || !(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, a))
|
|
905
259
|
return 0;
|
|
906
260
|
let sum = 0;
|
|
907
261
|
for (let i = a; i < b; i++) {
|
|
908
|
-
if (!isGeoArrowValueValid(array.child.validity, i))
|
|
262
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, i))
|
|
909
263
|
continue;
|
|
910
264
|
const [x, y] = range(array.child, i);
|
|
911
265
|
if (array.child.kind !== "list")
|
|
@@ -928,7 +282,7 @@ function area(column) {
|
|
|
928
282
|
if (row.array.kind !== "list")
|
|
929
283
|
throw new Error("Invalid multipolygon");
|
|
930
284
|
for (let j = a; j < b; j++)
|
|
931
|
-
if (isGeoArrowValueValid(row.array.child.validity, j))
|
|
285
|
+
if ((0, import_geoarrow_utils.isGeoArrowValueValid)(row.array.child.validity, j))
|
|
932
286
|
sum += polygonArea(row.array.child, j);
|
|
933
287
|
}
|
|
934
288
|
out.values[i] = sum;
|
|
@@ -999,10 +353,10 @@ function polygonContains(array, index, p) {
|
|
|
999
353
|
const [a, b] = range(array, index);
|
|
1000
354
|
if (array.kind !== "list")
|
|
1001
355
|
throw new Error("Invalid polygon");
|
|
1002
|
-
if (a === b || !isGeoArrowValueValid(array.child.validity, a))
|
|
356
|
+
if (a === b || !(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, a))
|
|
1003
357
|
return -1;
|
|
1004
358
|
for (let i = a; i < b; i++) {
|
|
1005
|
-
if (!isGeoArrowValueValid(array.child.validity, i))
|
|
359
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, i))
|
|
1006
360
|
continue;
|
|
1007
361
|
const [x, y] = range(array.child, i);
|
|
1008
362
|
if (array.child.kind !== "list")
|
|
@@ -1033,7 +387,7 @@ function booleanPointInPolygon(pointColumn, polygonColumn, options = {}) {
|
|
|
1033
387
|
if (y.array.kind !== "list")
|
|
1034
388
|
throw new Error("Invalid multipolygon");
|
|
1035
389
|
for (let j = start; j < end; j++) {
|
|
1036
|
-
if (!isGeoArrowValueValid(y.array.child.validity, j))
|
|
390
|
+
if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(y.array.child.validity, j))
|
|
1037
391
|
continue;
|
|
1038
392
|
const c = polygonContains(y.array.child, j, p);
|
|
1039
393
|
if (c > 0 || c === 0 && !options.ignoreBoundary) {
|
|
@@ -1049,7 +403,7 @@ function booleanPointInPolygon(pointColumn, polygonColumn, options = {}) {
|
|
|
1049
403
|
}
|
|
1050
404
|
function clone(column) {
|
|
1051
405
|
rows(column, native);
|
|
1052
|
-
return mapGeoArrowCoordinates(column, (coordinate) => coordinate);
|
|
406
|
+
return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate);
|
|
1053
407
|
}
|
|
1054
408
|
function truncate(column, options = {}) {
|
|
1055
409
|
rows(column, native);
|
|
@@ -1058,14 +412,14 @@ function truncate(column, options = {}) {
|
|
|
1058
412
|
throw new RangeError("precision must be an integer between 0 and 15");
|
|
1059
413
|
}
|
|
1060
414
|
const factor = 10 ** precision;
|
|
1061
|
-
return mapGeoArrowCoordinates(column, (coordinate) => coordinate.map((value) => Math.round(value * factor) / factor));
|
|
415
|
+
return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate.map((value) => Math.round(value * factor) / factor));
|
|
1062
416
|
}
|
|
1063
417
|
function toMercator(column) {
|
|
1064
418
|
rows(column, native);
|
|
1065
419
|
const radius = 6378137;
|
|
1066
420
|
const maximum = 20037508342789244e-9;
|
|
1067
421
|
return {
|
|
1068
|
-
...mapGeoArrowCoordinates(column, (coordinate) => {
|
|
422
|
+
...(0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => {
|
|
1069
423
|
const longitude = Math.abs(coordinate[0]) <= 180 ? coordinate[0] : coordinate[0] - Math.sign(coordinate[0]) * 360;
|
|
1070
424
|
const x = radius * longitude * RAD;
|
|
1071
425
|
const y = radius * Math.log(Math.tan(Math.PI / 4 + coordinate[1] * RAD / 2));
|
|
@@ -1081,7 +435,7 @@ function toMercator(column) {
|
|
|
1081
435
|
function toWgs84(column) {
|
|
1082
436
|
rows(column, native);
|
|
1083
437
|
return {
|
|
1084
|
-
...mapGeoArrowCoordinates(column, (coordinate) => [
|
|
438
|
+
...(0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => [
|
|
1085
439
|
coordinate[0] / 6378137 / RAD,
|
|
1086
440
|
(2 * Math.atan(Math.exp(coordinate[1] / 6378137)) - Math.PI / 2) / RAD,
|
|
1087
441
|
...coordinate.slice(2)
|
|
@@ -1119,7 +473,7 @@ function pointOutput(source, count, calculate) {
|
|
|
1119
473
|
}
|
|
1120
474
|
function center(column) {
|
|
1121
475
|
rows(column, native);
|
|
1122
|
-
const bounds = getGeoArrowRowBounds(column);
|
|
476
|
+
const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column);
|
|
1123
477
|
return pointOutput(column, bounds.length, (i) => bounds[i] ? [(bounds[i][0] + bounds[i][2]) / 2, (bounds[i][1] + bounds[i][3]) / 2] : null);
|
|
1124
478
|
}
|
|
1125
479
|
function destinationPoint(p, radians, bearingDegrees) {
|
|
@@ -1202,7 +556,7 @@ function transformTranslate(column, distanceValue, direction, options = {}) {
|
|
|
1202
556
|
if (!Number.isFinite(distanceValue) || !Number.isFinite(direction))
|
|
1203
557
|
throw new RangeError("Distance and direction must be finite");
|
|
1204
558
|
const radians = distanceValue / units(1, options.units);
|
|
1205
|
-
return mapGeoArrowCoordinates(column, (p) => [
|
|
559
|
+
return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => [
|
|
1206
560
|
...rhumbDestinationPoint([p[0], p[1]], radians, direction),
|
|
1207
561
|
...p.slice(2)
|
|
1208
562
|
]);
|
|
@@ -1212,7 +566,7 @@ function transformRotate(column, angle2, options) {
|
|
|
1212
566
|
if (!Number.isFinite(angle2) || !options.pivot.every(Number.isFinite))
|
|
1213
567
|
throw new RangeError("Angle and pivot must be finite");
|
|
1214
568
|
const pivot = [options.pivot[0], options.pivot[1]];
|
|
1215
|
-
return mapGeoArrowCoordinates(column, (p) => {
|
|
569
|
+
return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => {
|
|
1216
570
|
const phi = (p[1] - pivot[1]) * RAD;
|
|
1217
571
|
const psi = Math.log(Math.tan(p[1] * RAD / 2 + Math.PI / 4) / Math.tan(pivot[1] * RAD / 2 + Math.PI / 4));
|
|
1218
572
|
const q = Math.abs(psi) > 1e-11 ? phi / psi : Math.cos(pivot[1] * RAD);
|
|
@@ -1283,7 +637,7 @@ function circle(column, radius, options = {}) {
|
|
|
1283
637
|
}
|
|
1284
638
|
function bboxPolygon(column) {
|
|
1285
639
|
rows(column, native);
|
|
1286
|
-
const bounds = getGeoArrowRowBounds(column);
|
|
640
|
+
const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column);
|
|
1287
641
|
return generatedPaths(column, bounds.length, 5, true, (i, j) => {
|
|
1288
642
|
const b = bounds[i];
|
|
1289
643
|
if (!b)
|
|
@@ -1387,14 +741,14 @@ function booleanClockwise(column) {
|
|
|
1387
741
|
}
|
|
1388
742
|
function rewind(column, options = {}) {
|
|
1389
743
|
rows(column, polygons);
|
|
1390
|
-
return rewindGeoArrow(column, { outer: options.reverse ? "clockwise" : "counter-clockwise" });
|
|
744
|
+
return (0, import_geoarrow_utils2.rewindGeoArrow)(column, { outer: options.reverse ? "clockwise" : "counter-clockwise" });
|
|
1391
745
|
}
|
|
1392
746
|
function transformScale(column, factor, options) {
|
|
1393
747
|
rows(column, native);
|
|
1394
748
|
if (!Number.isFinite(factor) || factor <= 0 || !options.origin.every(Number.isFinite))
|
|
1395
749
|
throw new RangeError("factor must be positive and origin must be finite");
|
|
1396
750
|
const origin = [options.origin[0], options.origin[1]];
|
|
1397
|
-
return mapGeoArrowCoordinates(column, (p) => {
|
|
751
|
+
return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => {
|
|
1398
752
|
const delta = (p[1] - origin[1]) * RAD;
|
|
1399
753
|
const psi = Math.log(Math.tan(p[1] * RAD / 2 + Math.PI / 4) / Math.tan(origin[1] * RAD / 2 + Math.PI / 4));
|
|
1400
754
|
const q = Math.abs(psi) > 1e-11 ? delta / psi : Math.cos(origin[1] * RAD);
|
|
@@ -1518,7 +872,7 @@ function booleanConcave(column) {
|
|
|
1518
872
|
valid(out.validity, i);
|
|
1519
873
|
const [firstRing, lastRing] = range(row.array, row.index);
|
|
1520
874
|
const rings = row.array.child;
|
|
1521
|
-
if (firstRing === lastRing || rings.kind !== "list" || !isGeoArrowValueValid(rings.validity, firstRing))
|
|
875
|
+
if (firstRing === lastRing || rings.kind !== "list" || !(0, import_geoarrow_utils.isGeoArrowValueValid)(rings.validity, firstRing))
|
|
1522
876
|
return;
|
|
1523
877
|
const [a, b] = range(rings, firstRing), n = b - a - 1;
|
|
1524
878
|
if (n < 3)
|