User:Hvidstue
About Me | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Overpass Turbo
My own home made "Osmose". The queries are finding errors I often stumble upon.
Syntax
OverpassQL - Recurse (n, w, r, bn, bw, br)
Queries
Public Transport
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// Nodes with highway=bus_stop and public_transport=platform within 5 meters from a way with public_transport=platform
way[public_transport=platform](area.searchArea)->.platforms;
node(around.platforms:5)[highway=bus_stop][public_transport=platform]->.busstops;
way(around.busstops:5)[public_transport=platform]->.platforms_nearbusstops;
(.busstops; .platforms_nearbusstops;);
out body;
>;
out skel qt;
This is double tagging.
The public_transport=platform should probably be removed from the bus_stop node.
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// public_transport=platform without highway=* and/or bus=yes within 5 meters from a node with highway=bus_stop
way[public_transport=platform][!highway][railway!=platform](area.searchArea)->.platforms;
node(around.platforms:5)[highway=bus_stop]->.busstops;
way(around.busstops:5)[public_transport=platform][!highway]->.platforms_nohighway;
way(around.busstops:5)[public_transport=platform][bus!=yes]->.platforms_nobus;
(.platforms_nohighway; .platforms_nobus;);
out body;
>;
out skel qt;
The way public_transport=platform should probably have highway=footway and bus=yes also.
Note: highway=platform should not be used where public_transport=platform is present. You probably want to use highway=footway.
highway=platform should not be used where public_transport=platform is present. You probably want to use highway=footway.
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// Closed-way '''platforms''' without <tt dir="ltr" class="mw-content-ltr" style="background:#EEF;font-size:1em;line-height:1.6"><bdi style="white-space:nowrap">[[Key:area|area]]</bdi>=[[Tag:area=yes|<bdi>yes</bdi>]]</tt>
(
way[public_transport=platform][!area](if:is_closed())(area.searchArea)->.platforms;
way[highway=platform][!area](if:is_closed())(area.searchArea)->.platforms;
way[railway=platform][!area](if:is_closed())(area.searchArea)->.platforms;
);
out body;
>;
out skel qt;
You should probably add area=yes to all these platforms
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// a bus stop is placed on a highway
// a station is placed on a railway
node[highway=bus_stop](area.searchArea)->.busstops;
way(bn.busstops)[highway]->.highways;
(
node[railway=station](area.searchArea);
node[railway=halt](area.searchArea);
)->.stations;
(
way(bn.stations)[railway=rail];
way(bn.stations)[railway=light_rail];
way(bn.stations)[railway=tram];
)->.railways;
(
node(w.highways)[highway=bus_stop];
node(w.railways)[railway=station];
node(w.railways)[railway=halt];
);
out body;
>;
out skel qt;
Station nodes should be separate from railways.
highway=bus_stop should be disconnected from way highway=*.
A public_transport=stop_position can be placed there instead.
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// public_transport=stop_position without railway=stop or railway=tram_stop and vice versa.
(
way[railway=rail](area.searchArea);
way[railway=light_rail](area.searchArea);
)->.rails;
(
way[railway=tram](area.searchArea);
)->.lightrails;
(
node(w.rails)[railway=stop][public_transport!=stop_position];
node(w.rails)[railway!=stop][public_transport=stop_position];
node(w.lightrails)[railway=tram_stop][public_transport!=stop_position];
node(w.lightrails)[railway!=tram_stop][public_transport=stop_position];
);
out body;
>;
out skel qt;
railway=stop without public_transport=stop_position can be valid e.g. on a cargo-only station.
public_transport=stop_position without railway=stop is never valid.
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// railway=stop or public_transport=stop_position with name
(
way[railway=rail](area.searchArea);
way[railway=light_rail](area.searchArea);
)->.rails;
(
way[railway=tram](area.searchArea);
)->.lightrails;
(
node(w.rails)[railway=stop][railway!=tram_stop][name];
node(w.rails)[public_transport=stop_position][railway!=tram_stop][name];
);
out body;
>;
out skel qt;
Stop nodes on railways should rarely be named. Use the public_transport=stop_area or railway=station or -halt for that.
[out:json][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// public_transport elements not part of a public_transport=stop_area
(
node[public_transport=stop_position](area.searchArea);
node[public_transport=platform](area.searchArea);
way[public_transport=platform](area.searchArea);
)->.public_transport_elements;
(
rel[public_transport=stop_area](bn.public_transport_elements);
rel[public_transport=stop_area](bw.public_transport_elements);
)->.stop_areas;
(
node(r.stop_areas);
way(r.stop_areas);
)->.relation_elements;
( .public_transport_elements; - .relation_elements; );
out body;
>;
out skel qt;
Railways cleanup project
[out:xml][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// a station is placed on a railway
(
way(area.searchArea)[railway=rail];
way(area.searchArea)[railway=light_rail];
way(area.searchArea)[railway=tram];
)->.railways;
(
node(w.railways)[railway=station];
node(w.railways)[railway=halt];
);
out meta;
>;
out meta qt;
[out:xml][timeout:200];
{{geocodeArea:Danmark}}->.searchArea;
// railway=stop or public_transport=stop_position with name
(
way(area.searchArea)[railway=rail];
way(area.searchArea)[railway=light_rail];
)->.rails;
(
node(w.rails)[railway=stop][name];
node(w.rails)[public_transport=stop_position][railway!=tram_stop][name];
);
out meta;
>;
out meta qt;
Interesting places
More links at the user page for Hjart (in Danish).
- User da
- User da-N
- User en
- User en-4
- Users in Aalborg
- Users in Denmark
- Garmin Nüvi 3597 users
- Users that prefer Chrome
- JOSM users
- ID users
- Linux users
- Windows 10 users
- Android users
- MAPS.ME users
- Advanced Overpass Turbo users
- Users who go outside and map
- Users who map by bicycle
- Users who map by car
- Users who map railways