seanerice / clt-bicycle-map

0 stars 0 forks source link

Fetch OSM data #2

Closed seanerice closed 1 year ago

seanerice commented 1 year ago

Need

Need a python script to fetch data from Overpass API.

Requirements

seanerice commented 1 year ago

Here's the overpass query I have been using. Tweak as required.

[out:json][timeout:25];
{{geocodeArea:charlotte}}->.searchArea;
(
    // query part for "cycleway:*=*"
    way[~"^cycleway:.*$"~"."](area.searchArea);
    way["highway"="cycleway"](area.searcharea);

    // query part for "route=bicycle"
    relation["route"="bicycle"](area.searchArea);
);

out body;
>;
out skel qt;
seanerice commented 1 year ago

Turns out there's some templating going on. Here's the updated query

[out:json][timeout:25];
area(id:3600177415)->.searchArea;
(
    // query part for "cycleway:*=*"
    way[~"^cycleway:.*$"~"."](area.searchArea);
    way["highway"="cycleway"](area.searcharea);

    // query part for "route=bicycle"
    relation["route"="bicycle"](area.searchArea);
);

out body;
>;
out skel qt;