I have read Overpass API by example, but still I am unable to adapt convert
statement examples to my need. What I would like to do is to get all marked routes in the area using Overpass Turbo, drop some tags and synthesize some new tags.
My query looks like this:
relation[route][route!="power"][route!="road"]({{bbox}});
out body;
>;
out skel qt;
I would like to:
- add tag
color=green
whenosmc:symbol
contains green or when tagkct_green
exists - add tag
color=blue
whenosmc:symbol
contains blue or when tagkct_blue
exists - add tag
kind
as a value of any tags ofkct_green
,kct_blue
,kct_red
,kct_green
- remove some tags I no longer need to reduce output file size (like
kct_green
)
My initial naive attempt is:
relation[route][route!="power"][route!="road"]({{bbox}});
foreach (
convert rel ::=::,
::id = id(),
color=t["osmc:symbol"]
;
out;
);
out body;
>;
out skel qt;
This kind of works, but lists relations without including their nodes. Moreover, I would like to perform a bit more processing on the color value:
- I want the
color
to be created onlyosmc:symbol
is present - I want to extract some information from
osmc:symbol
tocolor
- I have no idea how to create the combined value from those
kct_green
... tags.
I guess I need something more complex, however I have found almost no documentation or examples about convert
. Can someone point me in the right direction?
::geom()
) and are not yet documented (will follow soon). Otherwise, it's not quite clear what you mean by "osmc:symbol contains green". Is this meant as substring?::geom = geom()
is when I export such data as GeoJSON, they are empty. I was able to include relation ways and nodes by using>
or its building blocks (way(r)
,node(r)
,node(w)
), however only when not usingconvert
. As soon as I useconvert
,way(r)
stops working.