Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/routers/finland endpoint still returns duplicate stops #104

Open
PasiSalenius opened this issue Dec 26, 2016 · 6 comments
Open

/routers/finland endpoint still returns duplicate stops #104

PasiSalenius opened this issue Dec 26, 2016 · 6 comments

Comments

@PasiSalenius
Copy link

The following example query to http://api.digitransit.fi/routing/v1/routers/finland/index/graphql returns duplicate stops (one with MATKA and another with JOLI prefix). The MATKA prefixed stops don't seem to contain any route information, whereas JOLI stops return the correct data. The same seems to happen in other Finnish cities where city transport information is available.

Could the MATKA stops just be removed in those areas where region specific data is more accurate / correct? At least give examples and instruct in documentation how to work around the current situation.

{
  stopsByRadius(lat: 61.50138320723181, lon: 23.71766633588276, radius: 500) {
    edges {
      node {
        stop {
          gtfsId
          name
          lat
          lon
          vehicleType
          routes {
            gtfsId
          }
          desc
          code
        }
      }
    }
  }
}
@tuukka
Copy link
Contributor

tuukka commented Dec 27, 2016

If you want to display what's nearby, you can do what digitransit-ui does and fetch departures using the nearby query.

If you want to display stops on the map, you could use our vector tiles for the stop layer, or query patterns { route { mode } } for each stop to find out which modes use the stop if any.

@PasiSalenius
Copy link
Author

PasiSalenius commented Dec 27, 2016

I'm showing stops on a map here, so departures query will not do. Also, the stopsByRadius query works fine with the /hsl endpoint, giving me stops and routes for each stop.

But /finland endpoint mixes data from regional (HSL:, JOLI:, etc.) and MATKA: prefixed data, often duplicating stops. And only the MATKA: stops don't contain routes. The HSL: duplicates have the correct data.

@PasiSalenius
Copy link
Author

PasiSalenius commented Dec 27, 2016

Just checked, and the vector tiles at the following example URL seem to also return MATKA copies of HSL stops
https://api.digitransit.fi/map/v1/finland-stop-map/15/18655/9484.pbf

Also here the MATKA prefixed stops are missing all data which, I assume, makes digitransit-ui hide them from the map altogether.

I guess I'll resort to the same method of hiding stops without routes in them. Don't know if this is a reliable way to do this across Finland, though.

I could also add that it seems very impractical to fetch all routes for every stop, just to know whether to show the stop or not, especially in cases where tens or hundreds of stops are queried to show on map. This is another, quite common, case in Digitransit where a long list of data must be queried in order to know a single often needed value (departure/arrival time) or a boolean (valid/invalid stop).

@PasiSalenius
Copy link
Author

FWIW, also beta.matka.fi currently shows duplicated stops on the map
screen shot 2017-02-02 at 13 13 51

@tuukka
Copy link
Contributor

tuukka commented Feb 2, 2017

I think in your example, also the duplicate stops serve some lines, so we cannot hide them. We could and should merge them, I think, but we would need an ID to join across the datasets. Such an ID could be the stop ID or the Digiroad ID.

@Temetias
Copy link

Temetias commented Jan 7, 2019

What's the status of this? I just hit the same issue myself. I guess for now there's no workaround other than to merge stops "by hand" after the query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants