Turfjs / Turfjs/turf

`lineIntersect` missing intersects at vertex

Open
#2,899 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Image

Only the marked vertex is reported.

Fn:

lineIntersect(
    lineString([position, target, projectLine(position, bearing(position, target), distance)]),
    barriers
)

Source file:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            -79.4056013351301,
            43.65523546203666
          ],
          [
            -79.329185,
            43.676066
          ],
          [
            -79.17276455012302,
            43.718501460959246
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -79.441452,
              43.688977
            ],
            [
              -79.30172,
              43.688729
            ],
            [
              -79.415016,
              43.598544
            ],
            [
              -79.329185,
              43.676066
            ],
            [
              -79.441452,
              43.688977
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          -79.31165287949992,
          43.68082230658011
        ]
      }
    }
  ]
}

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 at the lineIntersect entry point and reproduce the issue with the supplied GeoJSON FeatureCollection and lineString call. Trace how intersections at shared vertices are collected, then verify that the result reports the expected intersections rather than only the marked vertex.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.