Wondering how to write an Overpass query to get only nodes with bus_stops from this query:

[out:json][timeout:25];
area[name="Radom"]->.searchArea;
( 
  relation["name"="8: Os. Wośniki => Kierzków"](area.searchArea);
);
out body;
>;
out skel qt;

in shortcut get bus stops by given area and relation.

asked 08 Jun, 09:46

macik1423's gravatar image

macik1423
163
accept rate: 0%

edited 08 Jun, 10:14

Don't know much about Overpass QL, but if the relation is according to PTv2 it should have a role of platform, platform_exit_only or platform_entry_only. In the more traditional tagging they would have no role and you would have to look for nodes nodes in the relation that have the highway=bus_stop tag.

(08 Jun, 13:29) InsertUser

OK. We should get only the nodes belonging to the relation. I think it should be better like this :

[out:json][timeout:25];
area[name="Radom"]->.searchArea;

relation["name"="8: Os. Wośniki => Kierzków"](area.searchArea);
node(r)[highway=bus_stop];
out body qt;
permanent link

answered 09 Jun, 19:03

zorglubu's gravatar image

zorglubu
154125
accept rate: 11%

Thanks a lot! This is what I have been looking for. :D

(09 Jun, 21:29) macik1423

Hello, Could you try :

[out:json][timeout:25];
area[name="Radom"]->.searchArea;

relation["name"="8: Os. Wośniki => Kierzków"](area.searchArea);

> -> .a;
node.a[highway=bus_stop];

out body qt;

This should extract the elements of the relation, and then only the nodes with the good tag.

permanent link

answered 08 Jun, 17:11

zorglubu's gravatar image

zorglubu
154125
accept rate: 11%

Thanks for respond! It's not quite what I expect. Query returns all bus stops (relation "8: Os. Wośniki => Kierzków" and reverse relation "8: Kierzków => Os. Wośniki"), I wanna bus stops from one direction.

(09 Jun, 10:14) macik1423
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:

×382
×111
×73
×7

question asked: 08 Jun, 09:46

question was seen: 168 times

last updated: 09 Jun, 21:29

powered by OSQA