mapbox / mapbox/nepomuk

Filter starting stops by line

Open
#107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Backend Feature Request Starter Task
Dominant language
C++
Stars
24
Forks
7
PR merge metrics
No merged PRs in 30d

Description

![station](https://cloud.githubusercontent.com/assets/12932279/25236712/cdaec63e-25e8-11e7-8230-6c523431055a.png)

When selecting a location on the map (symbolised by the black cross), appropriate starting locations are within a certain walking radius around the position (gold circle).

It is rather likely that we will have to allow for rather long walking segments (a few minutes) at origin and destination. It is possible for a line to have multiple stops in that region.
In general, we shouldn't suggest walking to a far away station of the same line. But we don't want to consider all possible locations as source/target.

In this effort, we should filter all results we can request from a coordinate to stop look-up to keep a single stop per line. I.e. the closest one.

To implement this, we can go through the set of stops and keep a set of the lines we have seen so far. For every stop we check the lines departing at it. If any line is not in the set of known lines, we consider the stop an addition to our set.
Else, we discard the stop as duplication.
In our example from the beginning, this would be the red line.

The filter would need access to the lines per stop (stop-to-line lookup) and work on the results of the coordinate-to-stop lookup.

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 tracing the coordinate-to-stop lookup and the stop-to-line lookup, then inspect how candidate stops are assembled. The change is done when results from a coordinate retain only the closest stop for each line while still supporting origin and destination lookups.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.