User:M!dgard/Overpass queries

From OpenStreetMap Wiki
Jump to: navigation, search

Use the steering wheel icon to the right of the code to load it in Overpass turbo at https://overpass-turbo.eu/.

Map of post code areas

You can build a basic map of post codes in Belgium with this query. Postal code areas are complete in Flanders and Brussels.

Run query immediately and set recommended map state: [1]

try it yourself in overpass-turbo
[timeout:20];
area["name:en"="Belgium"]->.boundaryarea;

relation["boundary"="postal_code"](area.boundaryarea);
out body;
>;
out skel qt;

{{style:
  relation         { text: postal_code; fill-color: #A8EA8D; fill-opacity: 0.05; color: #000; width: 1; opacity: 1; }
  relation:active  { color: #50BD23; fill-opacity: 0;   width: 3; }
  relation:tainted { color: #F00;    fill-opacity: 0.5; fill-color: #F00; }
}}

QA: wrong tagging

These export to XML, ready to load in JOSM.

Stuff tagged with tel=* instead of phone=*

try it yourself in overpass-turbo
[out:xml][timeout:10];
(
  node["tel"~"[0-9]{2}"];
  way["tel"~"[0-9]{2}"];
  relation["tel"~"[0-9]{2}"];
);
out meta qt;
>;
out meta qt;

Stuff incorrectly mapped with postal_code=* in Flanders

Anything that isn't a postal code boundary is not allowed to have the tag postal_code=*. Postal code boundaries in Flanders are complete, so it's safe to remove postal_code=* from other objects (after checking that they match with the value of the postal code area they're in).

try it yourself in overpass-turbo
[out:xml][timeout:25];
area["name"="Vlaanderen"]->.boundaryarea;
(
  (
    node["postal_code"](area.boundaryarea);
    way["postal_code"](area.boundaryarea);
    relation["postal_code"](area.boundaryarea);
  )
  - relation["boundary"="postal_code"];
);
out meta qt;
>;
out meta qt;