Skip to main content

difference

The part of first that second does not cover, or null when nothing is left. A second inside first leaves a hole.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { difference } from "@mapcairn/core";

function difference(first: GeometryInput, second: GeometryInput): PolygonalGeometry | null;

Parameters​

  • first (GeometryInput)
  • second (GeometryInput)

Returns​

PolygonalGeometry | null

Throws​

  • GeometryError of kind invalid for a malformed geometry, empty for an empty polygon, unsupported for anything but a Polygon or MultiPolygon.

See also​

Source: packages/core/src/geometry/operations.ts:210