@squawk
    Preparing search index...

    Function pointInPolygon

    • Tests whether a point is inside a polygon using the ray casting algorithm. The polygon is represented as an array of [lon, lat] coordinate pairs forming a closed ring (first and last points are identical).

      Parameters

      • x: number

        Longitude of the test point in decimal degrees.

      • y: number

        Latitude of the test point in decimal degrees.

      • ring: number[][]

        Polygon exterior ring as [lon, lat] coordinate pairs.

      Returns boolean

      True if the point is inside or on the boundary of the polygon.