gis-tools-ts - v0.6.0
    Preparing search index...

    Function pointInPolygon

    • A robust method to see if a point is in a polygon or not. Be sure the point and polygon are in the same projection space.

      Type Parameters

      • M = Record<string, unknown>
      • D extends Properties = Properties
      • P extends Properties = Properties

      Parameters

      • point: VectorPoint

        the point to check

      • polygon:
            | VectorPolygon<D>
            | VectorPolygonGeometry<D>
            | VectorFeature<M, D, P, VectorPolygonGeometry<D>>
            | S2Feature<M, D, P, VectorPolygonGeometry<D>>

        the polygon

      • ignoreBoundary: boolean = false

        if true, ignore when the point is on the boundary

      Returns boolean

      • true if the point is in the polygon