четверг, 4 декабря 2014 г.

Overpass QL Union example

Example of Union query in new Overpass QL language
Пример запроса с Union на новом языке Overpass QL.



[maxsize:1073741824]
[out:xml]
[timeout:900]
;

(way
  ["railway"~"rail"]
    ["service"!="spur"]
["service"!="yard"]
  ["service"!="siding"]
  ({{bbox}});>;
)->.a;

(node
  ["railway"="station"]
  ({{bbox}});>;
)->.b;

(.a;  .b;) ->.c;

.c out meta qt;

{{style: /* this is the MapCSS stylesheet */

node
{  fill-color:gray;  }

node[railway=station]
{ color:black; fill-color:gray; text: name; }
way
{ color:brown; fill-color:brown; }


}}

http://overpass-turbo.eu/s/6o1

среда, 3 декабря 2014 г.

Overpass queries: villages without buildings, villages without highways, villages without residential areas.

Overpass queries: villages without buildings, villages without highways, villages without residential areas made by Xmypblu



Villages without buildings

overpass-turbo.eu/s/6lv


[maxsize:1073741824] [out:xml] [timeout:900] ; ( node ["place"~"hamlet|village"] ({{bbox}}); way ["place"~"hamlet|village"] ({{bbox}});>; relation ["place"~"hamlet|village"] ({{bbox}});>; )->.b; ( way ["building"~"."] ({{bbox}});>; )->.c; ( node (around.c:500.0) ["place"~"hamlet|village"]; way (around.c:500.0) ["place"~"hamlet|village"];>; relation (around.c:500.0) ["place"~"hamlet|village"];>; ) ->.d; (.b; - .d;) ->.e; .e out meta qt;


Villages without highways

Each village should have a highway, at least a highway=unclassified, on higher. Not highway=track.
overpass-turbo.eu/s/6lC


[maxsize:1073741824]
[out:json]
[timeout:900]
;

(
  node
  ({{bbox}})
  ["place"~"hamlet|village"];
  way
  ({{bbox}})
  ["place"~"hamlet|village"];>;
  relation
  ({{bbox}})
  ["place"~"hamlet|village"];>;
)->.b;

(
  way({{bbox}})["highway"~"motorway|trunk|primary|secondary|tertiary|unclassified"];>;
)->.c;

(
  node
  (around.c:1000.0)
  ["place"~"hamlet|village"];
  way
  (around.c:1000.0)
  ["place"~"hamlet|village"];>;
  relation
  (around.c:1000.0)
  ["place"~"hamlet|village"];>;
) ->.d;

(.b; - .d;) ->.e;

.e out meta qt;


Villages without landuse=residential

http://overpass-turbo.eu/s/6mg

[maxsize:1073741824]
[out:xml]
[timeout:900]
;

(
  node
  ["place"~"hamlet|village"]
  ({{bbox}});
  way
  ["place"~"hamlet|village"]
  ({{bbox}});>;
  relation
  ["place"~"hamlet|village"]
  ({{bbox}});>;
)->.b;

(
  way
  ["landuse"~"residential"]
  ({{bbox}});
  relation
  ["landuse"~"residential"]
  ({{bbox}});>;
)->.c;

(
  node
  (around.c:500.0)
  ["place"~"hamlet|village"];
  way
  (around.c:500.0)
  ["place"~"hamlet|village"];>;
  relation
  (around.c:500.0)
  ["place"~"hamlet|village"];>;
) ->.d;

(.b; - .d;) ->.e;

.e out meta qt;

среда, 26 ноября 2014 г.

Test of embded umap.openstreetmap.fr with openstreetmap geodata into blogspot.com


This is a map of Moscow trolleybus line #75, witch closed in 2014.

Moscow trolleybus line 75, closed in 2014

Overpass API query for trolleybus routes geodata from openstreetmap

/*
Get trolleybus routes OSM data (streets and may be stops), intersects the bbox.
Запрос к Overpass API, выдающий геометрию троллейбусных маршрутов из openstreetmap, проходящих через зону охвата.
*/
[out:json];
(
  relation[route=trolleybus]({{bbox}})->.cr;
);
out body;
>;
out skel qt;

http://overpass-turbo.eu/s/6fB


Overpass API query for railway tunnels geodata from openstreetmap

Запрос Overpass API для получения геоданных по железнодорожным тоннелям из Openstreetmap

<!-- Railway tunnels -->
<query type="way">
  <has-kv k="tunnel" v="yes"/>
  <has-kv k="railway" /><!--only railway tunnel, not highway or water-->
  <bbox-query {{bbox}}/>
</query>

<union>
  <item/>
  <recurse type="down"/>
</union>

{{style:
  node, way relation {
    text: name;
  }
}}

<print/>


http://overpass-turbo.eu/s/6fv