since the road named I5 is segmented in OSM, you have to query the ref
value instead of the id of a segment:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“ref="I 5"”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “ref="I 5"”
node["ref"="I 5"];
way["ref"="I 5"];
relation["ref"="I 5"];
);
// print results
out body;
>;
out skel qt;
You will get some data from Europe as well, which you can filter out by setting a bbox or area selection.
If your road has no reference number, but a name
, you can search for that too:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“name="Eastshore Freeway"”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “name="Eastshore Freeway"”
node["name"="Eastshore Freeway"];
way["name"="Eastshore Freeway"];
relation["name"="Eastshore Freeway"];
);
// print results
out body;
>;
out skel qt;