ABAPlan / abaplan-core

Core ABAPlan project
MIT License
4 stars 2 forks source link

extrems positions provided when looking for nearest transport stops #101

Closed Ettapp closed 6 years ago

Ettapp commented 6 years ago

Location

In the touchpad-voice app.

Description

This issue appears if the #99 is solved When searching for transport stops near to the last selected (by touch) location with the vocal command "transport stop" (whitout transport line name at the end of the vocal command), every indications that aim to help the user to find the nearest transport stop tells things like "9'000km below".

Reproduction procedure

  1. Open the map 370 in the touchpad-voice
  2. Normaly calibrate the tactile dalle
  3. Select an address in the "Rue de Saint-Jean" between the transport stops "Jean-Jacques" and "Miléant" by pressing on the dalle
  4. Tell "transport stop" in any supported language
  5. Press anywhere on the tactile dalle

Possible origins

When looking at the Chrome DevTools we can see that the near transport stop search request's answer contains many results, ordered by proximity. Each results but the first folow this structure:

{
  coordinate: {
    type
    x
    y
  }
  distance
  id
  name
  score
}

The first result looks different than the others as it has null as value for both x & y properties, and it's id is null too.

After trying others address near to others transport stops, it seems that the first result is the "exact" address of the selected point (the address of the nearest street number, that is used to look for nearests transport stops).

Possible ways to fix the issue

Look for the first address (if any) in the request's response that has coordinates.

Comment

That would not happend if ArcGIS JS API where using TypeScript with non-null types ;-)

Ettapp commented 6 years ago

I filtered the stations to use the first one with valid coordinates instead of "just the first one" and it solved the issue.

Pull request: #102

I'm now wondering if this could happend in the "Search for transport stops by stop name / line" feature... Should investigate.