Self-hosted OpenRouteService (Python) geocoding error

37 views Asked by At

I am using Docker to host openrouteservice. I am trying to get from the string representation of this address to a set of coordinates. For this I found out you need pelias_search, but for some reason it throws an error and I can't find what's wrong. The only thing I found that's off is that in the openrouteservice folder (git clone to compose for Docker) the folder docker/data is empty, which I think shouldn't be.

The address you see below is just some random Belgian address and I have the Belgian map downloaded.

import openrouteservice as ors

ors_client = ors.Client(base_url='http://localhost:8080/ors')

# just to show that this works
coordinates_var = [(3.4369783, 51.1306368), (3.4860564, 51.0838975)]
# random Belgian coordinates
route = ors_client.directions(coordinates=coordinates_var, profile='driving-car', format='json')
print(route)

address = 'Tienbergen, Asse, VB, Belgium'
# I have tried other formats. This is from their own map website.

# This throws the error
response = ors_client.pelias_search(text=address)

# error: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
# openrouteservice.exceptions.HTTPError: HTTP Error: 404
0

There are 0 answers