I have a query for Overpass API.
mybbox = '8.9281,48.4379,9.1794,48.5827'
overpass_url = "http://overpass-api.de/api/interpreter"
overpass_query = """
[out:json];
// gather results
(
// query part for: "highway=*"
node["highway"]("""+mybbox+""");
way["highway"]("""+mybbox+""");
relation["highway"]("""+mybbox+""");
);
// print results
out center;
>;
out skel qt;
"""
I save result to a .json file. And the type is way. But I want to define a road width and export road data as polygon. For example if highway == motorway the road must be a polygon type and its width must be 4 meters. Is it possible?
As the others say, it is not possible to get the road width via Overpass API; you have to calculate it yourself. The API only serves to look up various objects of interest and to download them. You may filter the results using a tag, eg [width]
or similar: there are alternatives like est_width
or width_street
. To find out how frequently each tag is used and which variant fits your needs, see this page with stats on usage (use the search box on right).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.