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

    Function pointToLineDistance

    • Check to see how far away the point is from the line

      Type Parameters

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

      Parameters

      • line:
            | VectorLineString<D>
            | VectorLineStringGeometry<D>
            | VectorFeature<M, D, P, VectorLineStringGeometry<D>>

        the line to check against

      • point: VectorPoint

        the point to check against the line

      • method: "euclidean" | "haversine" = 'euclidean'

        the method to use, either 'euclidean' or 'haversine'. Defaults to 'euclidean'

      Returns number

      The shortest distance between the point and a line. Returns -1 if line is empty