2

I am trying to geocode a list of objects (mostly road names) to their coordinates from python wth osmnx.geocode_to_gdf. The problem is that I often get returned with the following error message (example of query "Jln Kuang, Singapore"):

ValueError: Nominatim could not geocode query "Jln Kuang, Singapore" to polygonal boundaries

While using the same exact query in the web version of Open Street Map (https://www.openstreetmap.org/) I do get the correct result, in this case pointing me to the right road.

mccoy89
  • 21
  • 6

1 Answers1

1

Without passing which_result geocode_to_gdf() will look for a polygon. In this case it is a way (road) hence it's a line string

import osmnx as ox

ox.geocode_to_gdf("Jln Kuang, Singapore", which_result=1)
Rob Raymond
  • 29,118
  • 3
  • 14
  • 30