Skip to main content

polygonSelfIntersects

Whether the closed ring through vertices crosses, touches or doubles back over itself. Edges are compared in the plane of longitude and latitude, which is exact for the question "do these edges meet" at the scales people draw. Two edges that share only the vertex between them are fine, unless they run back over each other.

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

Signature​

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

function polygonSelfIntersects(vertices: readonly LatLng[]): boolean;

Parameters​

  • vertices (readonly LatLng[])

Returns​

boolean

See also​

Source: packages/core/src/draw/geo.ts:162