@math.gl/geospatial 5.0.0-rc.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/coordinates.cjs +2523 -0
- package/dist/coordinates.cjs.map +6 -0
- package/dist/coordinates.d.ts +4 -0
- package/dist/coordinates.d.ts.map +1 -1
- package/dist/coordinates.js +2 -0
- package/dist/coordinates.js.map +1 -1
- package/dist/entries/ellipsoid.cjs +1209 -0
- package/dist/entries/ellipsoid.cjs.map +6 -0
- package/dist/entries/ellipsoid.d.ts +3 -19
- package/dist/entries/ellipsoid.d.ts.map +1 -1
- package/dist/entries/ellipsoid.js +1 -9
- package/dist/entries/ellipsoid.js.map +1 -1
- package/dist/expressions.cjs +726 -0
- package/dist/expressions.cjs.map +6 -0
- package/dist/geodesics.cjs +3195 -0
- package/dist/geodesics.cjs.map +6 -0
- package/dist/geodesics.d.ts +18 -0
- package/dist/geodesics.d.ts.map +1 -0
- package/dist/geodesics.js +13 -0
- package/dist/geodesics.js.map +1 -0
- package/dist/geographic-atlas/sampling.d.ts +1 -1
- package/dist/geographic-atlas/sampling.d.ts.map +1 -1
- package/dist/geographic-atlas/sampling.js +1 -1
- package/dist/geographic-atlas/sampling.js.map +1 -1
- package/dist/geographic-cuts.cjs +4160 -0
- package/dist/geographic-cuts.cjs.map +6 -0
- package/dist/geographic-cuts.d.ts +2 -0
- package/dist/geographic-cuts.d.ts.map +1 -1
- package/dist/geographic-cuts.js +1 -0
- package/dist/geographic-cuts.js.map +1 -1
- package/dist/geographic-seams/subdivide-cut.d.ts +1 -1
- package/dist/geographic-seams/subdivide-cut.d.ts.map +1 -1
- package/dist/geographic-seams/subdivide-cut.js +1 -1
- package/dist/geographic-seams/subdivide-cut.js.map +1 -1
- package/dist/geographic-seams/types.shared.cjs +32 -0
- package/dist/geographic-seams/types.shared.cjs.map +6 -0
- package/dist/globe.cjs +4223 -0
- package/dist/globe.cjs.map +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/line-simplification.d.ts +7 -0
- package/dist/line-simplification.d.ts.map +1 -1
- package/dist/line-simplification.js +4 -13
- package/dist/line-simplification.js.map +1 -1
- package/dist/linear-referencing.d.ts +13 -1
- package/dist/linear-referencing.d.ts.map +1 -1
- package/dist/linear-referencing.js +29 -9
- package/dist/linear-referencing.js.map +1 -1
- package/dist/maps/map-transition.shared.cjs +364 -0
- package/dist/maps/map-transition.shared.cjs.map +6 -0
- package/dist/maps/myriahedral/unfold.d.ts +1 -1
- package/dist/maps/myriahedral/unfold.d.ts.map +1 -1
- package/dist/maps/myriahedral/unfold.js +1 -1
- package/dist/maps/myriahedral/unfold.js.map +1 -1
- package/dist/maps/presets.cjs +2 -2
- package/dist/maps/presets.cjs.map +2 -2
- package/dist/maps/transitions.cjs +3 -342
- package/dist/maps/transitions.cjs.map +3 -3
- package/dist/maps.cjs +15 -319
- package/dist/maps.cjs.map +3 -3
- package/dist/measure-referencing.d.ts +16 -0
- package/dist/measure-referencing.d.ts.map +1 -0
- package/dist/measure-referencing.js +143 -0
- package/dist/measure-referencing.js.map +1 -0
- package/dist/polygon-simplification.d.ts +6 -0
- package/dist/polygon-simplification.d.ts.map +1 -0
- package/dist/polygon-simplification.js +141 -0
- package/dist/polygon-simplification.js.map +1 -0
- package/dist/projection/experimental/core.cjs +63 -1317
- package/dist/projection/experimental/core.cjs.map +3 -3
- package/dist/projection/experimental/core.d.ts +1 -1
- package/dist/projection/experimental/core.d.ts.map +1 -1
- package/dist/projection/experimental/crs/projjson.cjs +26 -45
- package/dist/projection/experimental/crs/projjson.cjs.map +3 -3
- package/dist/projection/experimental/crs/types.shared.cjs +44 -0
- package/dist/projection/experimental/crs/types.shared.cjs.map +6 -0
- package/dist/projection/experimental/crs/wkt.cjs +36 -52
- package/dist/projection/experimental/crs/wkt.cjs.map +3 -3
- package/dist/projection/experimental/entries/projections/ob_tran.cjs +9 -23
- package/dist/projection/experimental/entries/projections/ob_tran.cjs.map +3 -3
- package/dist/projection/experimental/lazy-projections/aea.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/aea.js +1 -1
- package/dist/projection/experimental/lazy-projections/aeqd.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/aeqd.js +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.js +1 -1
- package/dist/projection/experimental/lazy-projections/cass.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/cass.js +1 -1
- package/dist/projection/experimental/lazy-projections/cea.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/cea.js +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.js +1 -1
- package/dist/projection/experimental/lazy-projections/eqc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/eqc.js +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.js +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.js +1 -1
- package/dist/projection/experimental/lazy-projections/equi.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/equi.js +1 -1
- package/dist/projection/experimental/lazy-projections/etmerc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/etmerc.js +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.js +1 -1
- package/dist/projection/experimental/lazy-projections/geos.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/geos.js +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.js +1 -1
- package/dist/projection/experimental/lazy-projections/gstmerc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/gstmerc.js +1 -1
- package/dist/projection/experimental/lazy-projections/index.cjs +60 -903
- package/dist/projection/experimental/lazy-projections/index.cjs.map +3 -3
- package/dist/projection/experimental/lazy-projections/krovak.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.js +1 -1
- package/dist/projection/experimental/lazy-projections/laea.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/laea.js +1 -1
- package/dist/projection/experimental/lazy-projections/lcc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/lcc.js +1 -1
- package/dist/projection/experimental/lazy-projections/merc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/merc.js +1 -1
- package/dist/projection/experimental/lazy-projections/mill.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/mill.js +1 -1
- package/dist/projection/experimental/lazy-projections/moll.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/moll.js +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.js +1 -1
- package/dist/projection/experimental/lazy-projections/ob_tran.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/ob_tran.js +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.js +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.js +1 -1
- package/dist/projection/experimental/lazy-projections/poly.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/poly.js +1 -1
- package/dist/projection/experimental/lazy-projections/qsc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/qsc.js +1 -1
- package/dist/projection/experimental/lazy-projections/robin.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/robin.js +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.js +1 -1
- package/dist/projection/experimental/lazy-projections/somerc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/somerc.js +1 -1
- package/dist/projection/experimental/lazy-projections/stere.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/stere.js +1 -1
- package/dist/projection/experimental/lazy-projections/sterea.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/sterea.js +1 -1
- package/dist/projection/experimental/lazy-projections/tmerc.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/tmerc.js +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.js +1 -1
- package/dist/projection/experimental/lazy-projections/utm.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/utm.js +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.cjs +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.js +1 -1
- package/dist/projection/experimental/projection-engine.shared.cjs +1184 -0
- package/dist/projection/experimental/projection-engine.shared.cjs.map +6 -0
- package/dist/projection/experimental/typescript-projection.shared.cjs +1703 -0
- package/dist/projection/experimental/typescript-projection.shared.cjs.map +6 -0
- package/dist/projection/index.cjs +622 -1535
- package/dist/projection/index.cjs.map +3 -3
- package/dist/projection/pipeline.cjs +44 -58
- package/dist/projection/pipeline.cjs.map +3 -3
- package/dist/projection/transform-analysis.cjs +20 -936
- package/dist/projection/transform-analysis.cjs.map +3 -3
- package/dist/spatial-box-clipping.d.ts +9 -0
- package/dist/spatial-box-clipping.d.ts.map +1 -0
- package/dist/spatial-box-clipping.js +123 -0
- package/dist/spatial-box-clipping.js.map +1 -0
- package/dist/spatial-dwithin.d.ts +19 -0
- package/dist/spatial-dwithin.d.ts.map +1 -0
- package/dist/spatial-dwithin.js +107 -0
- package/dist/spatial-dwithin.js.map +1 -0
- package/dist/spatial-hulls.d.ts +6 -0
- package/dist/spatial-hulls.d.ts.map +1 -0
- package/dist/spatial-hulls.js +176 -0
- package/dist/spatial-hulls.js.map +1 -0
- package/dist/spatial-line-intersection-result.d.ts +4 -0
- package/dist/spatial-line-intersection-result.d.ts.map +1 -0
- package/dist/spatial-line-intersection-result.js +79 -0
- package/dist/spatial-line-intersection-result.js.map +1 -0
- package/dist/spatial-line-polygon-intersection.d.ts +4 -0
- package/dist/spatial-line-polygon-intersection.d.ts.map +1 -0
- package/dist/spatial-line-polygon-intersection.js +130 -0
- package/dist/spatial-line-polygon-intersection.js.map +1 -0
- package/dist/spatial-planar-intersects.d.ts +11 -0
- package/dist/spatial-planar-intersects.d.ts.map +1 -1
- package/dist/spatial-planar-intersects.js +20 -12
- package/dist/spatial-planar-intersects.js.map +1 -1
- package/dist/spatial-planar.d.ts +9 -0
- package/dist/spatial-planar.d.ts.map +1 -1
- package/dist/spatial-planar.js +13 -1
- package/dist/spatial-planar.js.map +1 -1
- package/dist/spatial-polygon-overlay.d.ts +5 -0
- package/dist/spatial-polygon-overlay.d.ts.map +1 -0
- package/dist/spatial-polygon-overlay.js +23 -0
- package/dist/spatial-polygon-overlay.js.map +1 -0
- package/dist/spatial-sql.d.ts +13 -2
- package/dist/spatial-sql.d.ts.map +1 -1
- package/dist/spatial-sql.js +30 -12
- package/dist/spatial-sql.js.map +1 -1
- package/dist/spatial-subdivision.d.ts +9 -0
- package/dist/spatial-subdivision.d.ts.map +1 -0
- package/dist/spatial-subdivision.js +61 -0
- package/dist/spatial-subdivision.js.map +1 -0
- package/dist/spatial-touches.d.ts +13 -0
- package/dist/spatial-touches.d.ts.map +1 -0
- package/dist/spatial-touches.js +192 -0
- package/dist/spatial-touches.js.map +1 -0
- package/dist/st-functions.cjs +2411 -112
- package/dist/st-functions.cjs.map +3 -3
- package/dist/st-functions.d.ts +67 -2
- package/dist/st-functions.d.ts.map +1 -1
- package/dist/st-functions.js +195 -12
- package/dist/st-functions.js.map +1 -1
- package/dist/st-geodesic-functions.d.ts +33 -0
- package/dist/st-geodesic-functions.d.ts.map +1 -0
- package/dist/st-geodesic-functions.js +84 -0
- package/dist/st-geodesic-functions.js.map +1 -0
- package/dist/st-hull-functions.cjs +386 -0
- package/dist/st-hull-functions.cjs.map +6 -0
- package/dist/st-hull-functions.d.ts +17 -0
- package/dist/st-hull-functions.d.ts.map +1 -0
- package/dist/st-hull-functions.js +14 -0
- package/dist/st-hull-functions.js.map +1 -0
- package/dist/st-overlay-functions.cjs +621 -0
- package/dist/st-overlay-functions.cjs.map +6 -0
- package/dist/st-overlay-functions.d.ts +36 -0
- package/dist/st-overlay-functions.d.ts.map +1 -0
- package/dist/st-overlay-functions.js +183 -0
- package/dist/st-overlay-functions.js.map +1 -0
- package/dist/st-viewport-functions.cjs +481 -0
- package/dist/st-viewport-functions.cjs.map +6 -0
- package/dist/st-viewport-functions.d.ts +13 -0
- package/dist/st-viewport-functions.d.ts.map +1 -0
- package/dist/st-viewport-functions.js +81 -0
- package/dist/st-viewport-functions.js.map +1 -0
- package/dist/subdivide-geodesic-polyline.d.ts +1 -1
- package/dist/subdivide-geodesic-polyline.d.ts.map +1 -1
- package/dist/subdivide-geodesic-polyline.js +1 -1
- package/dist/subdivide-geodesic-polyline.js.map +1 -1
- package/dist/subdivide-globe-mesh.d.ts +1 -1
- package/dist/subdivide-globe-mesh.d.ts.map +1 -1
- package/dist/subdivide-globe-mesh.js +1 -1
- package/dist/subdivide-globe-mesh.js.map +1 -1
- package/dist/subdivide-rhumb-polyline.d.ts +1 -1
- package/dist/subdivide-rhumb-polyline.d.ts.map +1 -1
- package/dist/subdivide-rhumb-polyline.js +1 -1
- package/dist/subdivide-rhumb-polyline.js.map +1 -1
- package/dist/tasks/index.cjs +808 -2993
- package/dist/tasks/index.cjs.map +3 -3
- package/dist/terrain/geometry.d.ts +1 -1
- package/dist/terrain/geometry.d.ts.map +1 -1
- package/dist/terrain/geometry.js +1 -1
- package/dist/terrain/geometry.js.map +1 -1
- package/dist/terrain/index.cjs +95 -22
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +1 -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/regional-watersheds.d.ts +44 -0
- package/dist/terrain/regional-watersheds.d.ts.map +1 -0
- package/dist/terrain/regional-watersheds.js +108 -0
- package/dist/terrain/regional-watersheds.js.map +1 -0
- package/dist/terrain/tile-cutout-update.d.ts.map +1 -1
- package/dist/terrain/tile-cutout-update.js +28 -22
- package/dist/terrain/tile-cutout-update.js.map +1 -1
- package/dist/tiles.cjs +354 -0
- package/dist/tiles.cjs.map +6 -0
- package/dist/turf-functions.cjs +16 -9
- package/dist/turf-functions.cjs.map +1 -1
- package/package.json +154 -117
- package/src/coordinates.ts +5 -0
- package/src/entries/ellipsoid.ts +7 -32
- package/src/geodesics.ts +40 -0
- package/src/geographic-atlas/sampling.ts +1 -1
- package/src/geographic-cuts.ts +21 -0
- package/src/geographic-seams/subdivide-cut.ts +1 -1
- package/src/index.ts +2 -0
- package/src/line-simplification.ts +4 -16
- package/src/linear-referencing.ts +44 -16
- package/src/maps/myriahedral/unfold.ts +1 -1
- package/src/measure-referencing.ts +165 -0
- package/src/polygon-simplification.ts +185 -0
- package/src/projection/experimental/core.ts +1 -1
- package/src/projection/experimental/lazy-projections/aea.ts +1 -1
- package/src/projection/experimental/lazy-projections/aeqd.ts +1 -1
- package/src/projection/experimental/lazy-projections/bonne.ts +1 -1
- package/src/projection/experimental/lazy-projections/cass.ts +1 -1
- package/src/projection/experimental/lazy-projections/cea.ts +1 -1
- package/src/projection/experimental/lazy-projections/eck6.ts +1 -1
- package/src/projection/experimental/lazy-projections/eqc.ts +1 -1
- package/src/projection/experimental/lazy-projections/eqdc.ts +1 -1
- package/src/projection/experimental/lazy-projections/eqearth.ts +1 -1
- package/src/projection/experimental/lazy-projections/equi.ts +1 -1
- package/src/projection/experimental/lazy-projections/etmerc.ts +1 -1
- package/src/projection/experimental/lazy-projections/geocent.ts +1 -1
- package/src/projection/experimental/lazy-projections/geos.ts +1 -1
- package/src/projection/experimental/lazy-projections/gnom.ts +1 -1
- package/src/projection/experimental/lazy-projections/gstmerc.ts +1 -1
- package/src/projection/experimental/lazy-projections/krovak.ts +1 -1
- package/src/projection/experimental/lazy-projections/laea.ts +1 -1
- package/src/projection/experimental/lazy-projections/lcc.ts +1 -1
- package/src/projection/experimental/lazy-projections/merc.ts +1 -1
- package/src/projection/experimental/lazy-projections/mill.ts +1 -1
- package/src/projection/experimental/lazy-projections/moll.ts +1 -1
- package/src/projection/experimental/lazy-projections/nzmg.ts +1 -1
- package/src/projection/experimental/lazy-projections/ob_tran.ts +1 -1
- package/src/projection/experimental/lazy-projections/omerc.ts +1 -1
- package/src/projection/experimental/lazy-projections/ortho.ts +1 -1
- package/src/projection/experimental/lazy-projections/poly.ts +1 -1
- package/src/projection/experimental/lazy-projections/qsc.ts +1 -1
- package/src/projection/experimental/lazy-projections/robin.ts +1 -1
- package/src/projection/experimental/lazy-projections/sinu.ts +1 -1
- package/src/projection/experimental/lazy-projections/somerc.ts +1 -1
- package/src/projection/experimental/lazy-projections/stere.ts +1 -1
- package/src/projection/experimental/lazy-projections/sterea.ts +1 -1
- package/src/projection/experimental/lazy-projections/tmerc.ts +1 -1
- package/src/projection/experimental/lazy-projections/tpers.ts +1 -1
- package/src/projection/experimental/lazy-projections/utm.ts +1 -1
- package/src/projection/experimental/lazy-projections/vandg.ts +1 -1
- package/src/spatial-box-clipping.ts +140 -0
- package/src/spatial-dwithin.ts +135 -0
- package/src/spatial-hulls.ts +203 -0
- package/src/spatial-line-intersection-result.ts +93 -0
- package/src/spatial-line-polygon-intersection.ts +147 -0
- package/src/spatial-planar-intersects.ts +21 -15
- package/src/spatial-planar.ts +20 -1
- package/src/spatial-polygon-overlay.ts +30 -0
- package/src/spatial-sql.ts +47 -12
- package/src/spatial-subdivision.ts +75 -0
- package/src/spatial-touches.ts +218 -0
- package/src/st-functions.ts +283 -15
- package/src/st-geodesic-functions.ts +121 -0
- package/src/st-hull-functions.ts +25 -0
- package/src/st-overlay-functions.ts +244 -0
- package/src/st-viewport-functions.ts +98 -0
- package/src/subdivide-geodesic-polyline.ts +2 -2
- package/src/subdivide-globe-mesh.ts +2 -2
- package/src/subdivide-rhumb-polyline.ts +2 -2
- package/src/terrain/geometry.ts +1 -1
- package/src/terrain/index.ts +7 -0
- package/src/terrain/regional-watersheds.ts +153 -0
- package/src/terrain/tile-cutout-update.ts +32 -26
- package/dist/index.cjs +0 -18674
- package/dist/index.cjs.map +0 -6
- package/dist/turf-expressions.cjs +0 -1997
- package/dist/turf-expressions.cjs.map +0 -6
- package/dist/turf-expressions.d.ts +0 -3
- package/dist/turf-expressions.d.ts.map +0 -1
- package/dist/turf-expressions.js +0 -7
- package/dist/turf-expressions.js.map +0 -1
- package/src/turf-expressions.ts +0 -7
package/src/spatial-sql.ts
CHANGED
|
@@ -16,7 +16,9 @@ import {
|
|
|
16
16
|
} from 'apache-arrow';
|
|
17
17
|
import type {ScalarFunction} from '@math.gl/sql/arrow';
|
|
18
18
|
import {
|
|
19
|
+
GeoArrowBuilder,
|
|
19
20
|
getGeoArrowFieldInfo,
|
|
21
|
+
makeArrowVectorFromGeoArrowColumn,
|
|
20
22
|
isGeoArrowValueValid,
|
|
21
23
|
makeGeoArrowColumnFromArrowVector,
|
|
22
24
|
makeGeoArrowColumnFromGeometryRows,
|
|
@@ -53,6 +55,27 @@ export const polygonKinds = ['Polygon', 'MultiPolygon'] as const;
|
|
|
53
55
|
|
|
54
56
|
/** Supported Arrow result storage for a spatial function. */
|
|
55
57
|
type SpatialResult = Int32 | Float64 | Bool | Binary | FixedSizeList<Float64> | Utf8;
|
|
58
|
+
/** Native geometry result storage and its row-aligned Arrow vector builder. */
|
|
59
|
+
export type NativeSpatialResult = {
|
|
60
|
+
/** Extension encoding declared on the bound result field. */
|
|
61
|
+
encoding: 'geoarrow.polygon' | 'geoarrow.multipolygon' | 'geoarrow.geometry';
|
|
62
|
+
/** Fixed physical Arrow schema for all batches. */
|
|
63
|
+
type: DataType;
|
|
64
|
+
/** Packs decoded geometry rows into native coordinate buffers. */
|
|
65
|
+
build: (rows: readonly (WellKnownGeometry | null)[]) => Vector;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** Declares a fixed native polygon layout, including for empty or all-null batches. */
|
|
69
|
+
export function nativePolygonResult(
|
|
70
|
+
encoding: Exclude<NativeSpatialResult['encoding'], 'geoarrow.geometry'>
|
|
71
|
+
): NativeSpatialResult {
|
|
72
|
+
const options = {encoding, dimension: 'xy', coordinateLayout: 'interleaved'} as const;
|
|
73
|
+
/** Packs the output rings into GeoArrow list offsets and interleaved XY coordinates. */
|
|
74
|
+
const build: NativeSpatialResult['build'] = rows =>
|
|
75
|
+
makeArrowVectorFromGeoArrowColumn(GeoArrowBuilder.build(rows, options));
|
|
76
|
+
return {encoding, type: build([]).type, build};
|
|
77
|
+
}
|
|
78
|
+
|
|
56
79
|
/** A nullable result value passed to the Arrow vector builder. */
|
|
57
80
|
type SpatialValue = string | number | boolean | number[] | Uint8Array | null;
|
|
58
81
|
|
|
@@ -135,15 +158,17 @@ export function planarGeometry(
|
|
|
135
158
|
}
|
|
136
159
|
|
|
137
160
|
/** Declares a row-preserving spatial overload using the input columns' GeoArrow types. */
|
|
138
|
-
export function spatialFunction(
|
|
161
|
+
export function spatialFunction<Value extends SpatialValue | WellKnownGeometry>(
|
|
139
162
|
name: string,
|
|
140
163
|
signatures: readonly (readonly GeometryKind[])[],
|
|
141
|
-
|
|
142
|
-
evaluate: (geometries: readonly GeometryRow[], ...numbers: number[]) =>
|
|
164
|
+
output: SpatialResult | NativeSpatialResult,
|
|
165
|
+
evaluate: (geometries: readonly GeometryRow[], ...numbers: number[]) => Value,
|
|
143
166
|
numericArguments = 0,
|
|
144
167
|
allDimensions = false,
|
|
145
|
-
skipNullGeometries = false
|
|
168
|
+
skipNullGeometries = false,
|
|
169
|
+
validateCRS?: (crs: unknown, name: string) => void
|
|
146
170
|
): ScalarFunction {
|
|
171
|
+
const type = 'encoding' in output ? output.type : output;
|
|
147
172
|
return {
|
|
148
173
|
kind: 'scalar',
|
|
149
174
|
name,
|
|
@@ -167,13 +192,17 @@ export function spatialFunction(
|
|
|
167
192
|
(DataType.isBinary(field.type) || DataType.isLargeBinary(field.type))
|
|
168
193
|
) {
|
|
169
194
|
// WKB reveals its geometry kind and dimensionality per row.
|
|
195
|
+
} else if (encoding === 'geoarrow.geometry' && extension.dimension === 'xy') {
|
|
196
|
+
// Native XY union rows are checked against the input signature during evaluation.
|
|
170
197
|
} else if (kinds.some(kind => encoding === 'geoarrow.' + kind.toLowerCase())) {
|
|
171
198
|
if (!allDimensions && extension?.dimension !== 'xy')
|
|
172
199
|
throw new Error(`${name} requires 2D geometry`);
|
|
173
200
|
} else {
|
|
174
201
|
throw new Error(`${name} argument ${index + 1} requires GeoArrow ${kinds.join(' or ')}`);
|
|
175
202
|
}
|
|
203
|
+
validateCRS?.(extension?.metadata['crs'], name);
|
|
176
204
|
if (
|
|
205
|
+
!validateCRS &&
|
|
177
206
|
name.startsWith('ST_') &&
|
|
178
207
|
name !== 'ST_SRID' &&
|
|
179
208
|
name !== 'ST_SetSRID' &&
|
|
@@ -186,18 +215,22 @@ export function spatialFunction(
|
|
|
186
215
|
.map(extension => extension?.metadata['crs'])
|
|
187
216
|
.filter(crs => crs !== undefined && crs !== null);
|
|
188
217
|
if (
|
|
218
|
+
!validateCRS &&
|
|
189
219
|
name.startsWith('ST_') &&
|
|
190
220
|
crsValues.some(crs => JSON.stringify(crs) !== JSON.stringify(crsValues[0]))
|
|
191
221
|
) {
|
|
192
222
|
throw new Error(`${name} requires arguments in the same CRS`);
|
|
193
223
|
}
|
|
194
224
|
const metadata = new Map<string, string>();
|
|
195
|
-
if (DataType.isBinary(type)) {
|
|
196
|
-
metadata.set(EXTENSION_NAME, 'geoarrow.wkb');
|
|
197
|
-
const inputMetadata =
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
225
|
+
if ('encoding' in output || DataType.isBinary(type)) {
|
|
226
|
+
metadata.set(EXTENSION_NAME, 'encoding' in output ? output.encoding : 'geoarrow.wkb');
|
|
227
|
+
const inputMetadata = extensions[0]?.metadata;
|
|
228
|
+
const crs = inputMetadata?.['crs'];
|
|
229
|
+
const crsType = crs === undefined ? undefined : inputMetadata?.['crs_type'];
|
|
230
|
+
const edges = inputMetadata?.['edges'];
|
|
231
|
+
if (crs !== undefined || edges !== undefined) {
|
|
232
|
+
metadata.set(EXTENSION_METADATA, JSON.stringify({crs, crs_type: crsType, edges}));
|
|
233
|
+
}
|
|
201
234
|
}
|
|
202
235
|
const arguments_ = [
|
|
203
236
|
...geometryFields.map(field => field ?? new Field('geometry', new Binary(), true)),
|
|
@@ -223,7 +256,7 @@ export function spatialFunction(
|
|
|
223
256
|
name === 'ST_GeometryN'
|
|
224
257
|
)
|
|
225
258
|
);
|
|
226
|
-
const values = new Array<
|
|
259
|
+
const values = new Array<Value | null>(rowCount).fill(null);
|
|
227
260
|
for (let row = 0; row < rowCount; row++) {
|
|
228
261
|
if (!activeRows[row]) continue;
|
|
229
262
|
const geometries: WellKnownGeometry[] = [];
|
|
@@ -238,7 +271,9 @@ export function spatialFunction(
|
|
|
238
271
|
}
|
|
239
272
|
values[row] = evaluate(geometries, ...numbers.map(vector => Number(vector.get(row))));
|
|
240
273
|
}
|
|
241
|
-
return
|
|
274
|
+
return 'encoding' in output
|
|
275
|
+
? output.build(values as (WellKnownGeometry | null)[])
|
|
276
|
+
: vectorFromArray(values as SpatialValue[], output);
|
|
242
277
|
}
|
|
243
278
|
};
|
|
244
279
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {WellKnownGeometry} from '@math.gl/core/arrow';
|
|
6
|
+
import {vertexCount} from './geometry-inspection';
|
|
7
|
+
import {clipPolygons, type Box} from './spatial-box-clipping';
|
|
8
|
+
import {planarBounds} from './spatial-planar';
|
|
9
|
+
|
|
10
|
+
/** Default vertex ceiling for ST_Subdivide, including polygon closures. */
|
|
11
|
+
const MAX_VERTICES = 256;
|
|
12
|
+
|
|
13
|
+
/** Maximum bisection depth before reporting an unrepresentable split. */
|
|
14
|
+
const MAX_DEPTH = 64;
|
|
15
|
+
|
|
16
|
+
/** Individual polygon produced by rectilinear subdivision. */
|
|
17
|
+
type Polygon = Extract<WellKnownGeometry, {type: 'Polygon'}>;
|
|
18
|
+
|
|
19
|
+
/** Splits a rectangle at the midpoint of its wider axis. */
|
|
20
|
+
function splitBox(box: Box): [Box, Box] {
|
|
21
|
+
const [minX, minY, maxX, maxY] = box;
|
|
22
|
+
if (maxX - minX >= maxY - minY) {
|
|
23
|
+
const mid = minX / 2 + maxX / 2;
|
|
24
|
+
if (mid > minX && mid < maxX)
|
|
25
|
+
return [
|
|
26
|
+
[minX, minY, mid, maxY],
|
|
27
|
+
[mid, minY, maxX, maxY]
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
const mid = minY / 2 + maxY / 2;
|
|
31
|
+
if (mid > minY && mid < maxY)
|
|
32
|
+
return [
|
|
33
|
+
[minX, minY, maxX, mid],
|
|
34
|
+
[minX, mid, maxX, maxY]
|
|
35
|
+
];
|
|
36
|
+
throw new Error('ST_Subdivide cannot bisect the polygon at the available coordinate precision');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Emits bounded polygon parts with rectilinear cuts, retaining holes through each split. */
|
|
40
|
+
export function* subdividePolygons(
|
|
41
|
+
geometry: WellKnownGeometry,
|
|
42
|
+
signal?: AbortSignal
|
|
43
|
+
): Generator<Polygon> {
|
|
44
|
+
if (geometry.type !== 'Polygon' && geometry.type !== 'MultiPolygon') {
|
|
45
|
+
throw new Error('ST_Subdivide requires a Polygon or MultiPolygon');
|
|
46
|
+
}
|
|
47
|
+
const polygons = geometry.type === 'Polygon' ? [geometry.coordinates] : geometry.coordinates;
|
|
48
|
+
for (const coordinates of polygons) {
|
|
49
|
+
yield* subdividePolygon({type: 'Polygon', coordinates}, 0, signal);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Recursively subdivides a single polygon until each piece fits the vertex budget. */
|
|
54
|
+
function* subdividePolygon(
|
|
55
|
+
polygon: Polygon,
|
|
56
|
+
depth: number,
|
|
57
|
+
signal?: AbortSignal
|
|
58
|
+
): Generator<Polygon> {
|
|
59
|
+
signal?.throwIfAborted();
|
|
60
|
+
const count = vertexCount(polygon);
|
|
61
|
+
if (!count) return;
|
|
62
|
+
if (count <= MAX_VERTICES) {
|
|
63
|
+
yield polygon;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (depth >= MAX_DEPTH) throw new Error('ST_Subdivide could not reach the vertex limit');
|
|
67
|
+
const bounds = planarBounds(polygon);
|
|
68
|
+
if (!bounds?.every(Number.isFinite))
|
|
69
|
+
throw new Error('ST_Subdivide requires finite polygon bounds');
|
|
70
|
+
for (const box of splitBox(bounds as Box)) {
|
|
71
|
+
for (const coordinates of clipPolygons([polygon.coordinates], box)) {
|
|
72
|
+
yield* subdividePolygon({type: 'Polygon', coordinates}, depth + 1, signal);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {WellKnownGeometry} from '@math.gl/core/arrow';
|
|
6
|
+
import polygonClipping from 'polygon-clipping';
|
|
7
|
+
import {
|
|
8
|
+
locatePointInPolygon,
|
|
9
|
+
planarIntersects,
|
|
10
|
+
pointOnSegment,
|
|
11
|
+
segmentsMeet
|
|
12
|
+
} from './spatial-planar-intersects';
|
|
13
|
+
import {polygonSet} from './spatial-polygon-overlay';
|
|
14
|
+
|
|
15
|
+
/** XY position and ordered path. */
|
|
16
|
+
type Position = readonly number[];
|
|
17
|
+
/** Ordered vertices of a line component or ring. */
|
|
18
|
+
type Path = readonly Position[];
|
|
19
|
+
/** Endpoints of one planar segment. */
|
|
20
|
+
type Edge = readonly [Position, Position];
|
|
21
|
+
/** Point and multipoint geometry. */
|
|
22
|
+
type Points = Extract<WellKnownGeometry, {type: 'Point' | 'MultiPoint'}>;
|
|
23
|
+
/** Line and multiline geometry. */
|
|
24
|
+
type Lines = Extract<WellKnownGeometry, {type: 'LineString' | 'MultiLineString'}>;
|
|
25
|
+
/** Polygon and multipolygon geometry. */
|
|
26
|
+
type Area = Extract<WellKnownGeometry, {type: 'Polygon' | 'MultiPolygon'}>;
|
|
27
|
+
|
|
28
|
+
/** Narrows the geometry types containing only points. */
|
|
29
|
+
function isPointLike(geometry: WellKnownGeometry): geometry is Points {
|
|
30
|
+
return geometry.type === 'Point' || geometry.type === 'MultiPoint';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Narrows line and multiline geometries. */
|
|
34
|
+
function isLinear(geometry: WellKnownGeometry): geometry is Lines {
|
|
35
|
+
return geometry.type === 'LineString' || geometry.type === 'MultiLineString';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Narrows polygon and multipolygon geometries. */
|
|
39
|
+
function isAreal(geometry: WellKnownGeometry): geometry is Area {
|
|
40
|
+
return geometry.type === 'Polygon' || geometry.type === 'MultiPolygon';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Returns independent line components. */
|
|
44
|
+
function paths(geometry: Lines): readonly Path[] {
|
|
45
|
+
return geometry.type === 'LineString' ? [geometry.coordinates] : geometry.coordinates;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Returns independent areal components with their interior rings. */
|
|
49
|
+
function polygons(geometry: Area): readonly (readonly Path[])[] {
|
|
50
|
+
return geometry.type === 'Polygon' ? [geometry.coordinates] : geometry.coordinates;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Compares planar coordinates without imposing a distance tolerance. */
|
|
54
|
+
function samePoint(a: Position, b: Position): boolean {
|
|
55
|
+
return a[0] === b[0] && a[1] === b[1];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Keys an XY location, including equivalent positive and negative zero. */
|
|
59
|
+
function pointKey(point: Position): string {
|
|
60
|
+
return `${point[0]}/${point[1]}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Iterates nonzero segments and implicitly closes rings. */
|
|
64
|
+
function* edges(components: readonly Path[], closed = false): Generator<Edge> {
|
|
65
|
+
for (const path of components) {
|
|
66
|
+
for (let i = closed ? 0 : 1; i < path.length; i++) {
|
|
67
|
+
const a = path[i ? i - 1 : path.length - 1]!;
|
|
68
|
+
const b = path[i]!;
|
|
69
|
+
if (!samePoint(a, b)) yield [a, b];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Computes the line boundary using odd endpoint incidence across all components. */
|
|
75
|
+
function lineBoundary(components: readonly Path[]): ReadonlyMap<string, Position> {
|
|
76
|
+
const boundary = new Map<string, Position>();
|
|
77
|
+
for (const component of components) {
|
|
78
|
+
if (!component.length) continue;
|
|
79
|
+
for (const point of [component[0]!, component[component.length - 1]!]) {
|
|
80
|
+
const key = pointKey(point);
|
|
81
|
+
if (!boundary.delete(key)) boundary.set(key, point);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return boundary;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Finds shared endpoints, including an endpoint lying in the other segment's interior. */
|
|
88
|
+
export function endpointContacts(a: Edge, b: Edge): Position[] {
|
|
89
|
+
const contacts: Position[] = [];
|
|
90
|
+
for (const [endpoints, other] of [
|
|
91
|
+
[a, b],
|
|
92
|
+
[b, a]
|
|
93
|
+
] as const) {
|
|
94
|
+
for (const point of endpoints) {
|
|
95
|
+
if (pointOnSegment(point, ...other) && !contacts.some(value => samePoint(value, point)))
|
|
96
|
+
contacts.push(point);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return contacts;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Tests whether any odd endpoint is also on both segments of a proper crossing. */
|
|
103
|
+
function hasBoundaryCrossing(boundary: ReadonlyMap<string, Position>, a: Edge, b: Edge): boolean {
|
|
104
|
+
for (const point of boundary.values()) {
|
|
105
|
+
if (pointOnSegment(point, ...a) && pointOnSegment(point, ...b)) return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Detects line interior overlap, accounting for the whole multiline boundary. */
|
|
111
|
+
function lineInteriorsMeet(a: Lines, b: Lines): boolean {
|
|
112
|
+
const aPaths = paths(a);
|
|
113
|
+
const bPaths = paths(b);
|
|
114
|
+
const aBoundary = lineBoundary(aPaths);
|
|
115
|
+
const bBoundary = lineBoundary(bPaths);
|
|
116
|
+
const bEdges = [...edges(bPaths)];
|
|
117
|
+
for (const left of edges(aPaths)) {
|
|
118
|
+
for (const right of bEdges) {
|
|
119
|
+
if (!segmentsMeet(...left, ...right)) continue;
|
|
120
|
+
const contacts = endpointContacts(left, right);
|
|
121
|
+
if (contacts.length > 1) return true;
|
|
122
|
+
if (contacts.length) {
|
|
123
|
+
const key = pointKey(contacts[0]!);
|
|
124
|
+
if (!aBoundary.has(key) && !bBoundary.has(key)) return true;
|
|
125
|
+
} else if (
|
|
126
|
+
!hasBoundaryCrossing(aBoundary, left, right) &&
|
|
127
|
+
!hasBoundaryCrossing(bBoundary, left, right)
|
|
128
|
+
) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Tests a point against the interior of any areal component. */
|
|
137
|
+
function insideArea(point: Position, areas: readonly (readonly Path[])[]): boolean {
|
|
138
|
+
return areas.some(rings => locatePointInPolygon(point, rings) === 1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Finds a segment parameter on its axis with the least relative rounding error. */
|
|
142
|
+
export function parameter(point: Position, [a, b]: Edge): number {
|
|
143
|
+
const dx = b[0]! - a[0]!;
|
|
144
|
+
const dy = b[1]! - a[1]!;
|
|
145
|
+
return Math.abs(dx) >= Math.abs(dy) ? (point[0]! - a[0]!) / dx : (point[1]! - a[1]!) / dy;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Tests intervals between area boundary contacts, excluding coincident boundary segments. */
|
|
149
|
+
function segmentEntersArea(
|
|
150
|
+
edge: Edge,
|
|
151
|
+
boundaries: readonly Edge[],
|
|
152
|
+
areas: readonly (readonly Path[])[]
|
|
153
|
+
): boolean {
|
|
154
|
+
const [a, b] = edge;
|
|
155
|
+
if (insideArea(a, areas) || insideArea(b, areas)) return true;
|
|
156
|
+
const cuts = new Set([0, 1]);
|
|
157
|
+
const coincident: [number, number][] = [];
|
|
158
|
+
for (const boundary of boundaries) {
|
|
159
|
+
if (!segmentsMeet(...edge, ...boundary)) continue;
|
|
160
|
+
const contacts = endpointContacts(edge, boundary).map(point => parameter(point, edge));
|
|
161
|
+
if (!contacts.length) return true;
|
|
162
|
+
for (const contact of contacts) cuts.add(contact);
|
|
163
|
+
if (contacts.length === 2) coincident.push([Math.min(...contacts), Math.max(...contacts)]);
|
|
164
|
+
}
|
|
165
|
+
const sorted = [...cuts].sort((left, right) => left - right);
|
|
166
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
167
|
+
const from = sorted[i - 1]!;
|
|
168
|
+
const to = sorted[i]!;
|
|
169
|
+
if (coincident.some(([start, end]) => start <= from && to <= end)) continue;
|
|
170
|
+
const t = (from + to) / 2;
|
|
171
|
+
if (insideArea([(1 - t) * a[0]! + t * b[0]!, (1 - t) * a[1]! + t * b[1]!], areas)) return true;
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Finds any line segment that enters an areal interior. */
|
|
177
|
+
function lineEntersArea(line: Lines, area: Area): boolean {
|
|
178
|
+
const areas = polygons(area);
|
|
179
|
+
const boundaries = [...edges(areas.flat(), true)];
|
|
180
|
+
for (const edge of edges(paths(line))) {
|
|
181
|
+
if (segmentEntersArea(edge, boundaries, areas)) return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Checks point locations against the other geometry's interior. */
|
|
187
|
+
function pointsMeetInterior(points: Points, other: Lines | Area): boolean {
|
|
188
|
+
const positions = points.type === 'Point' ? [points.coordinates] : points.coordinates;
|
|
189
|
+
if (isAreal(other)) {
|
|
190
|
+
const areas = polygons(other);
|
|
191
|
+
return positions.some(
|
|
192
|
+
point => Number.isFinite(point[0]) && Number.isFinite(point[1]) && insideArea(point, areas)
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
const linePaths = paths(other);
|
|
196
|
+
const boundary = lineBoundary(linePaths);
|
|
197
|
+
const segments = [...edges(linePaths)];
|
|
198
|
+
return positions.some(
|
|
199
|
+
point => !boundary.has(pointKey(point)) && segments.some(edge => pointOnSegment(point, ...edge))
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** Reports any geometric contact without intersection between the two interiors. */
|
|
204
|
+
export function planarTouches(a: WellKnownGeometry, b: WellKnownGeometry): boolean {
|
|
205
|
+
if (
|
|
206
|
+
(!isPointLike(a) && !isLinear(a) && !isAreal(a)) ||
|
|
207
|
+
(!isPointLike(b) && !isLinear(b) && !isAreal(b))
|
|
208
|
+
)
|
|
209
|
+
throw new Error('ST_Touches requires point, line or polygon geometry');
|
|
210
|
+
if (isPointLike(a) && isPointLike(b)) return false;
|
|
211
|
+
if (!planarIntersects(a, b)) return false;
|
|
212
|
+
if (isPointLike(a) && !isPointLike(b)) return !pointsMeetInterior(a, b);
|
|
213
|
+
if (isPointLike(b) && !isPointLike(a)) return !pointsMeetInterior(b, a);
|
|
214
|
+
if (isLinear(a) && isLinear(b)) return !lineInteriorsMeet(a, b);
|
|
215
|
+
if (isLinear(a) && isAreal(b)) return !lineEntersArea(a, b);
|
|
216
|
+
if (isAreal(a) && isLinear(b)) return !lineEntersArea(b, a);
|
|
217
|
+
return !polygonClipping.intersection(polygonSet(a), polygonSet(b)).length;
|
|
218
|
+
}
|