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

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 http://www.openstreetmap.org/.

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

http://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

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;
permanent link

answered 08 Jan '15, 06:31

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 08 Jan '15, 06:33

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

permanent link

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
Your answer
toggle preview

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
×290
×85
×71
×28

question asked: 07 Jan '15, 22:52

question was seen: 4,161 times

last updated: 08 Jan '15, 13:19

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