Turfjs / Turfjs/turf

Along doesn't work with MultiLineString

Open
#1,699 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/along
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

Please provide the following when reporting an issue:

  • GeoJSON data as a gist file or geojson.io (filename extension must be .geojson).
  • Snippet of source code or for complex examples use jsfiddle.

Hi guys, thx for your awesome work!

I'd like to ask if you are planning to add MultiLineString support to turf.along()?

Currently, it doesn't work, I'm getting error messages like:
angular.js:14961 TypeError: Cannot read property '1' of undefined

Uncaught Error: Coordinate is not a valid Point

This would be important to implement, since currently turf.along() fails with antimeridian cases. GeoJSON standard says antimeridian geometries should be MultiLineString type:
https://tools.ietf.org/html/rfc7946#section-3.1.9

Reproduced:

https://jsfiddle.net/8h16u93j/

https://raw.githubusercontent.com/Turfjs/turf/master/packages/turf-length/test/in/multi-linestring.geojson

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the turf.along() implementation and reproduce the failure with the linked jsfiddle and packages/turf-length/test/in/multi-linestring.geojson fixture. Trace how MultiLineString coordinates reach the calculation, then add coverage showing that antimeridian MultiLineString input is accepted without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.