Using Pelias with ORS

I’m running a Pelias instance (localhost:4000) with the default Portland dataset following https://github.com/pelias/docker/ and I need to integrate it with my ORS frontend but its giving me a “No address could be found” error in the frontend when I type Portland (geocoding) or right-click in a Portland street and click “What is here?” (reverse geocoding).

I can make the test queries using the browser as suggested in the Pelias repo and it returns the text.

Here follows the snippet of my Gruntfile.js which points to the Pelias service.

    // Environment targets
    local: {
        options: {
            dest: "app/js/config.js"
        },
        constants: {
            ENV: {
                name: "local",
                geocode:
                    "http://localhost:4000/v1/search",
                directions:
                    "http://localhost:8080/ors/v2/directions",
                isochrones:
                    "http://localhost:3005/ors/isochrones",
                matrix:
                    "http://localhost:3005/ors/matrix",
                pois:
                    "https://api.openrouteservice.org/pois",
                shortenlink: "https://api-ssl.bitly.com/v3/shorten",
                mapsurfer:
                    "https://api.openrouteservice.org/mapsurfer/{z}/{x}/{y}.png",
                landmarks: "https://landmarks-api.openrouteservice.org/",
                fuel: "https://api.openrouteservice.org/fuel"
            }
        }
    },

So what should I do in order to make the Pelias integrated with ORS?
Since it could be a Pelias issue I also posted it in StackExchange https://gis.stackexchange.com/questions/361243/integrating-pelias-with-openrouteservice but got no answers.

Best regards.

Hi again @caduguedess,

So you are doing the full course :smiley:!

If the request and the response are exactly the same and just the host is different, it possibly is another CORS issue :expressionless:.

Can you check the console as well as the request in the network tab on your ors frontend?
I don’t have a local pelias installation at hand to test this :sweat_smile:

I suppose the no address could be found is given you as an orange error popup by the frontend?

Best regards

Hi @amandus, sorry for the late response, I was figuring out the installation in Ubuntu 20.04.

Following your advice I noticed in Network tab that the Request URL when clicking on map was:

host_IP:4000/ors/geocode/reverse?api_key=xxx&lang=en-US&point.lat=45.520365&point.lon=-122.681665&size=1

and the request for reverse geocoding that was working in browser is:

host_IP:4000/v1/reverse?point.lon=-122.650095&point.lat=45.533467

So in Gruntfile.js at local environment target in constant geocode I put host_IP:4000/v1 and it worked.

Best regards.

By the way, is it supposed to still use my ORS API key in the request URL if I’m firing requests to my own geocoder instance?

You only need the api key for requests going to https://api.openrouteservice.org - any other endpoint (local or on your own servers) won’t have the same infrastructure that we have for API limiting, so the API key would not be needed