Skip to content

Add method to divide LineString into equal chunks #183

Open
@1ec5

Description

@1ec5

The lineChunk method should be ported to this library:

Divides a LineString into chunks of a specified length. If the line is shorter than the segment length then the original line is returned.

This method would be useful for sampling a geometry before passing the simplified geometry into a map matching algorithm: mapbox/mapbox-directions-swift#661 (comment).

Suggested LineString method signatures:

func dividedIntoChunks(of length: LocationDistance, reversed: Bool) -> MultiLineString

/cc @danpat @Guardiola31337

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions