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

in the US, there are 88 cities named "Washington".

I want to search for bike lanes within a specific Washington by specifying a state and country.

This works and returns bike paths for ALL areas named Washington

[out:json][timeout:25];
(
  area[name="Washington"];
  way(area)[highway="cycleway"];
 );

  (._;>;);
  out;

BUT this does not . It returns BLANK.

[out:json][timeout:25];
(
  area[name="Washington, MO, USA"];
  way(area)[highway="cycleway"];
 );

  (._;>;);

out; why does the area [name=""] not support NOMINATUM convention?

asked 16 Jul '18, 18:47

Varun-ARGO's gravatar image

Varun-ARGO
1113
accept rate: 0%

edited 16 Jul '18, 19:17

1

As far as I can tell, there isn't a town/city in Washington state called "Washington", so it makes sense that nothing is returned.

(16 Jul '18, 19:08) alester

Which Nominatim convention? Querying Nominatim for "Washington, WA, USA" finds all kinds of roads, cities and counties.

(16 Jul '18, 19:15) Hjart

Try Boulder

if area[name="Boulder"]; you get results/

area[name="Boulder, CO, USA"]; you get BLANK

(16 Jul '18, 19:18) Varun-ARGO

If you try to perform that query on the OSM website, you will understand why.

(17 Jul '18, 17:26) Hjart

Can you please elaborate?

(17 Jul '18, 17:27) Varun-ARGO
showing 5 of 6 show 1 more comments

Washington franklin county Missouri should work.

The blank results are when nominatim returns something that isn't searchable as an area or returns an area that doesn't have any of what you are trying to find. I don't have an explanation for the result that it returns for Washington, MO, USA, but it is clear enough why Overpass API doesn't find anything there.

An alternative is to query by the relation id, along with an offset, like:

area(3600141263);

(read the whole section for the info about the 3600)

permanent link

answered 16 Jul '18, 21:00

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Thanks! Is there a way to retrieve relation id by city name?

(17 Jul '18, 14:06) Varun-ARGO

I actually misread your question. On the Overpass-Turbo website there is a shortcut for looking up areas that uses Nominatim directly, {{geocodeArea: Washington franklin county Missouri}}; Implementing something like that where the result from Nominatim is injected into the Overpass-API script, is a decent way to do the id lookups.

The alternative just using the Overpass-API is to first retrieve the state (or county) area and then restrict the query for the city to that state (use admin_level and name together), and then use the map_to_area statement to get an area.

The Overpass-API areas have the same tags as the OSM objects they are based on, that's why the Nominatim style lookups don't work, the area query will only return an exact match.

(18 Jul '18, 02:03) maxerickson

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:

×483
×213
×107

question asked: 16 Jul '18, 18:47

question was seen: 3,061 times

last updated: 18 Jul '18, 02:49

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