NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

The Nominatim docs say that "Free-form queries are processed first left-to-right and then right-to-left if that fails.". My understanding is that if query="part1, part2, part3" fails, it then searches for query="part3, part2, part1". What I'm trying to achieve is if that fails, the database then tries to return a less specific result so that we get some data.

I've seen multiple cases where query="house number street name, town, city, country" returns no results, but query="street name, town, city, country" or query="town, city, country" returns results. I'd like to get this less specific result without having to do multiple queries.

asked 16 Feb '20, 12:10

ryaner's gravatar image

ryaner
16223
accept rate: 0%


Nominatim doesn't support this (yet), it looks for all part of the query. Like spellcheck it's a long requested feature, as old as Nominatim itself (10 years). The next best option is doing multiple queries. If you administer your own Nominatim server you can enable CONST_Search_BatchMode (see search.php) where you can run multiple queries in one request. It's disabled on nominatim.openstreetmap.org

permanent link

answered 16 Feb '20, 12:55

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

Is there any way to make the result set fields returned from batch queries match that of a single query? Specifically when querying an address with get back a field called 'class' and via batch that field seems to be called 'category'. The lack of documentation around batch mode means I'm not sure if this is intentional or a bug somewhere?

(19 Feb '20, 14:28) ryaner

It's an undocumented and unsupported feature. There is probably a way if you change the PHP source code.

(19 Feb '20, 14:35) mtmail

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689

question asked: 16 Feb '20, 12:10

question was seen: 1,054 times

last updated: 19 Feb '20, 14:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum