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

    Function cleanLineString

    • Removes duplicates and superfluous/collinear points from a linestring

      Type Parameters

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

      Parameters

      • linestring:
            | VectorLineString<D>
            | VectorLineStringGeometry<D>
            | VectorFeatures<M, D, P, VectorLineStringGeometry<D>>

        the linestring to clean

      • isPoly: boolean = false

        true if the linestring is from a polygon ring

      • eps: number = 1e-12

        the toleranc to check if the segments are superfluous/collinear. Defaults to 1e-12

      • cleanWGS84: boolean = false

        if true, clean WGS84 points to be in bounds

      Returns VectorLineString<D> | undefined

      A new cleaned lines (points are duplicated)