Tom
Tom

Reputation: 210

Nominatim boundingbox limit?

I'm trying to search for example for fuel (Tankstelle) in an area.

this is a boundingbox of 50km and it gives only little results:

http://nominatim.openstreetmap.org/search?q=Tankstelle&format=xml&limit=50&viewbox=7.98435,49.40889,8.95440,48.77371&bounded=1

It contains a "more_url" link to get more data. Although I'm using the limit-parameter I only get few results. Is it somehow possible at least to get as much results as specified with limit instead of this more_url?

Tom

Upvotes: 2

Views: 4218

Answers (2)

MKer
MKer

Reputation: 3450

EDIT (trying to be more explicit)

If you want to search OSM "features" with Nominatim, you should use the dedicated - even if undocumented! - Nominatim syntax, using Special Phrases inside brackets:

http://nominatim.openstreetmap.org/search?q=[Tankstelle]&format=xml&limit=50&viewbox=7.98435,49.40889,8.95440,48.77371&bounded=1

Restrictions to use this syntax:

  • You MUST set a viewbox, and bounded=1.
  • The maximum value for limit is 50.

You can see that your query retrieves 4 results (with "Tankstelle" in the address), when my query retrieves the max = 50 (50 fuel stations, even without "Tankstelle" in the address).

I have no idea why Nominatim proposes more_url to your search example.

Now, if you search for regular addresses ("q=50 Mozart street, Denver"), then Nominatim normally sticks to the limit you set (50). If Nominatim finds more than 50 answers, then more_url allows to get the next "page" of 50 results (and so on).

Upvotes: 2

scai
scai

Reputation: 21469

For retrieving all fuel stations in a given area it is better to use a different API, for example Overpass API. Nominatim is mainly a (reverse) geocoder and not designed for such queries.

See this example query showing all fuel stations in your bounding box, visualized using overpass turbo:

<osm-script output="json" timeout="25">
  <union>
    <query type="node">
      <has-kv k="amenity" v="fuel"/>
      <bbox-query e="8.95440" n="49.40889" s="48.77371" w="7.98435"/>
    </query>
    <query type="way">
      <has-kv k="amenity" v="fuel"/>
      <bbox-query e="8.95440" n="49.40889" s="48.77371" w="7.98435"/>
    </query>
    <query type="relation">
      <has-kv k="amenity" v="fuel"/>
      <bbox-query e="8.95440" n="49.40889" s="48.77371" w="7.98435"/>
    </query>
  </union>
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Upvotes: 1

Related Questions