I try to make an Overpass API call with restricted number of tags, to achieve this I incorporated convert statement. Here is working overpass turbo example of query for data I would like to fetch:
[out:json][bbox:52.2,20.7,52.3,21.3];
node [amenity=drinking_water];
convert node
::id=id(),
id=id(),
lat=lat(),
lon=lon(),
access=t["access"],
name=t["name"];
out;
Next i tried to make an URL call using this query like this:
https://overpass-api.de/api/interpreter?[out:json][bbox:52.2,20.7,52.3,21.3];node[amenity=drinking_water];convert%20node::id=id(),id=id(),lat=lat(),lon=lon(),access=t["access"],name=t["name"];out;
Unfortunatelly it throws parse error:
Error: line 1: parse error: Element class name expected - '%' found.
Error: line 1: parse error: Operator expected, but "node"found.
Error: line 1: parse error: Operator expected, but "access"found.
Error: line 1: parse error: Operator expected, but "name"found.
Error: line 1: parse error: "%" cannot be used as binary operator
Error: line 1: parse error: t[...] needs an argument
Error: line 1: parse error: "%" cannot be used as binary operator
Error: line 1: parse error: t[...] needs an argument
Error: line 1: parse error: if special character "%" is present in property name then the property name must be in quotes
Error: line 1: parse error: "=" cannot be used as binary operator
Error: line 1: static error: The attribute type must be set to a nonempty string.
I can see, that the problem (or one many) is with dividing convert element with space, but I don't know how to workaround it. Removing space between them results in parse error:
Error: line 1: parse error: Unknown type "convertnode"