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

    Function lineLength

    • Find the length of a linestring. No projection is assumed

      Type Parameters

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

      Parameters

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

        the linestring as either a VectorFeature, VectorLineStringGeometry, or raw VectorLineString

      • haversine: boolean = false

        if set to true, uses the Haversine formula on lon-lat points. Defaults to false.

      Returns number

      • the raw length of the linestring, but if haversine is set to true the result is in radians.