Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 3.21 KB

overpass.md

File metadata and controls

59 lines (41 loc) · 3.21 KB

EqualStreetNames - Scripts

Scripts

Download data from OpenStreetMap using Overpass

We used the Overpass API to query the OpenStreetMap database.

Relations associatedStreet

This is not the case everywhere in the world, but in Brussels most of the streets have an associatedStreet relation.

We queried from OpenStreetMap all the objects of type relation tagged with type=associatedStreet or type=street that are in Brussels Region (INS-NIS code 04000 & Wikidata identifier Q240).

We also queried from OpenStreetMap all the objects of type multipolygon tagged with place or highway that have a name and are in Brussels Region (INS-NIS code 04000 & Wikidata identifier Q240).

[out:json][timeout:300];
( area["admin_level"="4"]["ref:INS"="04000"]["wikidata"="Q240"]; )->.a;
(
    relation["type"="associatedStreet"](area.a);
    relation["type"="street"](area.a);
    relation["type"="multipolygon"]["place"]["name"](area.a);
    relation["type"="multipolygon"]["highway"]["name"](area.a);
);
out body;
>;
out skel qt;

Open this query in Overpass-Turbo

Ways highway + place=square

Just to be sure we have all the streets (including the streets that do not have associatedStreet relation), we also requested from OpenStreetMap all the objects of type way tagged with highway and name (except highway=bus_stop and highway=service) and place=square that are in Brussels Region (INS-NIS code 04000 & Wikidata identifier Q240).

[out:json][timeout:300];
( area["admin_level"="4"]["ref:INS"="04000"]["wikidata"="Q240"]; )->.a;
( way["highway"]["name"]["highway"!="bus_stop"]["highway"!="service"](area.a); );
out body;
>;
out skel qt;

Open this query in Overpass-Turbo

Run the script locally

composer install

php process.php overpass

The relation.json file containing all the associatedStreet relations will be stored in data/overpass directory.
The way.json file containing all the highway ways will be stored in data/overpass directory.