HSLdevcom / digitransit-ui

Digitransit UI ("Reittiopas.fi")
https://www.reittiopas.fi/
Other
239 stars 131 forks source link

How-to keep using digitransit-ui without Pelias? #1690

Closed kalon33 closed 7 years ago

kalon33 commented 7 years ago

I used to use digitransit-ui with Mapzen geocoder (with help from @tuukka and @hannesj ), but since Pelias related commits, I can't get it working anymore. Could you give instructions to be able to use it again without having to setup the whole Pelias stack?

Thanks for your help.

siren commented 7 years ago

Can you please add here a snippet of your config that used to work.

kalon33 commented 7 years ago

@siren relevant config part that used to work before is:

export default {
  PIWIK_ADDRESS,
  PIWIK_ID,
  SENTRY_DSN,
  PORT,
  CONFIG,

  URL: {
    API_URL,
    OTP: `https://paris.acolytesanonymes.org/otp/routers/paris/`,
    MAP: {
      default: `https://{s}.tile.thunderforest.com/transport/`,
    },
    STOP_MAP: ``,
    CITYBIKE_MAP: ``,
    MQTT: '',
    ALERTS: ``,
    FONT: 'https://fonts.googleapis.com/css?family=Lato:300,400,900%7CPT+Sans+Narrow:400,700',
    REALTIME: ``,
    PELIAS: `https://search.mapzen.com/v1/search?boundary.country=fr&api_key=xxxxxx`,
    PELIAS_REVERSE_GEOCODER: `https://search.mapzen.com/v1/reverse?api_key=xxxxxx`,
  },

Do you need whole config or that snippet is enough?

With newer digitransit-ui, ui works but I can't get any result from the search bar.

siren commented 7 years ago

I see. We recently changed the way search is working and it also seems to have borked your setup.

Couple of things:

  1. You need to override the search sources in your config by adding:

searchSources: ['oa', 'osm'],

This should get the search working again but it will still generate single failing geocoding request per search. This is because we also currently query pelias for gtfs stops (the source was OTP before).

  1. You need to edit the following line: https://github.com/HSLdevcom/digitransit-ui/blob/851e951ad75b57dff4809b7622201606a3180ae0/app/util/searchUtils.js#L245

and remove the 'Stops' from the array to get rid of the remaining failing request.

Now the search does not allow you to find any (GTFS-) stops nor link to them but searching in general should work again.

kalon33 commented 7 years ago

Thanks @siren, I will test that as soon I'm back home.

If I want to benefit from these changes when I will have more time to setup it, is there an easy way to setup Pelias geocoder for my zone? Any docs to do this?

----- Mail original -----

De: "Sami Siren" notifications@github.com À: "HSLdevcom/digitransit-ui" digitransit-ui@noreply.github.com Cc: "Nicolas Derive" kalon33@ubuntu.com, "Author" author@noreply.github.com Envoyé: Lundi 10 Juillet 2017 14:01:37 Objet: Re: [HSLdevcom/digitransit-ui] How-to keep using digitransit-ui without Pelias? (#1690)

I see. We recently changed the way search is working and it also seems to have borked your setup.

Couple of things:

1. You need to override the search sources in your config by adding: 

searchSources: ['oa', 'osm'],

This should get the search working again but it will still generate single failing geocoding request per search. This is because we also currently query pelias for gtfs stops (the source was OTP before).

1. You need to edit the following line: https://github.com/HSLdevcom/digitransit-ui/blob/851e951ad75b57dff4809b7622201606a3180ae0/app/util/searchUtils.js#L245 

and remove the 'Stops' from the array to get rid of the remaining failing request.

Now the search does not allow you to find any (GTFS-) stops nor link to them but searching in general should work again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

laidig commented 7 years ago

@kalon33 HSL has their Pelias data (Elasticsearch and loaders) setup environment here: https://github.com/HSLdevcom/pelias-data-container/ Note that it is very FI-specific.

I've set up a Pelias environment for the New York area, using more generic data here: https://github.com/laidig/pelias-data-container . You also need pelias-api, from which we removed some of the FI specific code: https://github.com/AlexLoyko/pelias-api/

kalon33 commented 7 years ago

Thanks @laidig I will have a look at this during the next months and ask if I need more info.

@siren that now works OK with modifications you suggested.

kalon33 commented 6 years ago

@laidig I used your data-container as mapzen is closing now, but I got the following error.

/mnt/tools/dbclient/node_modules/elasticsearch/src/lib/utils.js:358
      throw new TypeError(err);
      ^

TypeError: Invalid apiVersion "2.3", expected a function or one of _default, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0, 2.4, 1.7, 0.90, 5.6, 6.0, 6.x, master
    at Object._.funcEnum (/mnt/tools/dbclient/node_modules/elasticsearch/src/lib/utils.js:358:13)
    at new Client (/mnt/tools/dbclient/node_modules/elasticsearch/src/lib/client.js:69:29)
    at /mnt/tools/dbclient/src/configValidation.js:29:24
    at _validateWithOptions (/mnt/tools/dbclient/node_modules/joi/lib/types/any/index.js:654:20)
    at root.validate (/mnt/tools/dbclient/node_modules/joi/lib/index.js:121:23)
    at Object.validate (/mnt/tools/dbclient/src/configValidation.js:23:9)
    at Object.<anonymous> (/mnt/tools/dbclient/index.js:2:37)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

Do you know how to fix it?

laidig commented 6 years ago

@kalon33 Sorry I didn't reply earlier as I was traveling away from network access.

That appears to reference the version of ElasticSearch. The HSL fork of Pelias used 2.3, but that was deprecated by Elastic. 2.4 should work without hassle, and HSL has updated their pelias.json to do so:

https://github.com/HSLdevcom/pelias-data-container/blob/master/pelias.json

hbruch commented 4 years ago

For those who might be interested: The city of Ulm created a photon-pelias-adapter service to use a photon geocode instead of pelias. Photon does not yet support stops, but might in future.