This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

OpenStreetMap.org data not corresponding with Overpass API data

0

Hi,

I am trying to query parking using JSON via the Overpass API but what is returned by the JSON feed doesn't seem to correspond with what can be found on the map at https://www.openstreetmap.org/.

An example below is a small town I know, on inspection of the map here

https://www.openstreetmap.org/node/52263804#map=15/52.9902/-6.9821 you can see there are a number of car parks showing up,

more than 2 at least. When I query the same location, an actual larger location using this link

http://overpass-api.de/api/interpreter?data=[out:json];node(52.9780,-7.0110,53.0066,-6.9581)[amenity=parking];out;

only 2 results appear. Does anybody know why this is?

asked 07 Jan '15, 22:52

spudatron's gravatar image

spudatron
11112
accept rate: 0%

edited 08 Jan '15, 01:10

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866

1

Cheers for the replies guys, I have a better understanding how it all works now. I wasn't aware of the wizard feature until now.

(08 Jan '15, 12:53) spudatron

2 Answers:

4

just using amenity=parking in the wizard creates a query that searches for nodes, ways and relations. The query would be similar to the one in https://help.openstreetmap.org/questions/39872/can-i-create-my-own-layer Note that that query was asking for schools in a particular area and needed some additional formatting

[out:json][timeout:25];
// gather results
(
  // query part for: “amenity=parking”
  node["amenity"="parking"]({{bbox}});
  way["amenity"="parking"]({{bbox}});
  relation["amenity"="parking"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

answered 08 Jan '15, 06:31

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 08 Jan '15, 06:33

3

You are only querying for nodes but some car parks are mapped as ways.

answered 07 Jan '15, 22:57

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks for the quick response Frederik.

Would you be able to give me an example of what the query should look like, very new to OSM.

Regards

(07 Jan '15, 23:02) spudatron

I just found it there now, replaced the word 'node' with 'way'. Do you know if there is a way to query both at the same time?

(07 Jan '15, 23:06) spudatron

Why don't you use the Wizard? Its syntax is much more forgiving.

Something like amenity=parking and (type:closedway or type:node) should give you what you need.

(08 Jan '15, 00:52) AlaskaDave

Source code available on GitHub .