User:Polarbear/overpass examples

From OpenStreetMap Wiki
Jump to navigation Jump to search

Surveillance cameras within a specified named way

From the example over at surveillance:type=ALPR

try it yourself in overpass-turbo
try it yourself in overpass-turbo
// @name surveillance-tarrant-county

[out:json][timeout:25];
  area[admin_level=6]["name"="Rockwall County"]->.area1; 
out body;

(
  node
  ["man_made"="surveillance"]["surveillance:type"="ALPR"]
  (area.area1);
  node
  ["man_made"="surveillance"]["surveillance:type"="gunshot_detector"]
  (area.area1);
  node
  ["man_made"="surveillance"]["surveillance:type"="camera"]
  (area.area1);
);
out body qt meta;

{{style:
  node[surveillance:type=gunshot_detector] { 
    fill-color: blue; color: blue, fill-opacity 1;
  }
  node[surveillance:type=ALPR] { 
    fill-color: red; fill-opacity 1; color: red, fill-opacity 1; 
  }
}}

Ways touched by me

try it yourself in overpass-turbo
try it yourself in overpass-turbo
[out:json][timeout:25];
way(user_touched:"CraigPe")(bbox);
out geom;

Different housing tags

try it yourself in overpass-turbo
try it yourself in overpass-turbo
// this is a test
[out:json][timeout:25];
(
  way[building=yes]({{bbox}});
  way[building=apartments]({{bbox}});
  way[building=semidetached_house]({{bbox}});
  way[building=house]({{bbox}});
  way[building=detached]({{bbox}});
);
out geom;

{{style:
*[building=yes],*[building=apartments],*[building=semidetached_house]
{ color:red; fill-color:red; fill-opacity:.4;}
*[building=detached]
{ color:brown; fill-color:brown; fill-opacity:.4;}
*[building=house]
{ fill-color:green; fill-opacity:.4;}
*[building=house][house=detached]
{ color:green;}
}}