User Tools

Site Tools


using_overlay_to_extract_data_from_openstreetmap

This is an old revision of the document!


Using Overpass to extract data from OpenStreetMap

I used the following Overpass files to measure the amount of cycle lanes in cities:

Total length of highways in Westminster

[out:csv(number,length)];
area[name="Westminster"]->.searchArea;
way["highway"](area.searchArea);
make stat number=count(ways),length=sum(length());
out;

Total length of segregated cycleways in Westminster

[out:csv(number,length)];
area[name="Westminster"]->.searchArea;
way["highway"="cycleway"](area.searchArea);
make stat number=count(ways),length=sum(length());
out;

Show segregated cycle routes on current viewed map

[bbox:{{bbox}}];
( 
  way["highway"="cycleway"];
);
out geom;

Other things I didn't write details for

[out:csv(length,value)];
area[name="London"]->.a;
way[highway](area.a);
for (t["highway"])
{
  make stat value=_.val,length=sum(length());
  out;
}
[out:csv(length,value)];
area[name="London"];
way[highway="cycleway"];
out
for (t["highway"])
{
  make stat value=_.val,length=sum(length());
  out;
}
[out:csv(length,value)];
area[name="Isle of Man"]->.a;
way[highway="cycleway"](area.a);
for (t["highway"])
{
  make stat value=_.val,length=sum(length());
  out;
}
[out:csv(length,value)];
area[name="Isle of Man"]->.a;
way[highway="cycleway"](area.a);
make stats length=sum(length());
out;
[out:csv(length,value)];
area[name="London"]
.way[highway="cycleway"]
.way[cycleway="sidewalk"];
make stats length=sum(length());
out;
[out:csv(length,value)];
area[name="London"];
way[highway="cycleway"](area)->.a;
way[highway="cycleway"](area)->.b;
way.a.b;
make stats length=sum(length());
out;
[out:csv(length,value)];
area[name="London"];
way[highway="cycleway"](area)->.a;
way[cycleway!="sidewalk"](area)->.b;
way[foot!="yes"](area)->.c;
way.a.b.c;
make stats length=sum(length());
out;
using_overlay_to_extract_data_from_openstreetmap.1655315211.txt.gz · Last modified: 2022/06/15 18:46 by abeverley