lat() and lon() for out:csv
Add please the lat() and lon() fieldnames.
Example: [out:csv(num,key,len,type,lat)]; way [highway]({{bbox}}); for (t["surface"]) ( make stat num=count(ways),key=_.val,len=sum(length()),type=u(type(),lat=u(lat() ); out; );
type() and furthermore id() work, but not lat() and lon()
Reason: The csv:custom method doesn't work proper. But similar output functionality is usable with out:csv. However, it lacks the very important lat() and lon() functionality.
You can use the point evaluator for this purpose:
[out:csv(num,key,len,type,::lat, ::lon)];
way [highway]({{bbox}});
for (t["surface"])
(
make stat
num=count(ways),
key=_.val,
len=sum(length()),
type=u(type()),
::geom = pt(10,20);
out;
);
lat and lon are exposed as ::lat, and ::lon in the csv output string.
My previous example was not exact. For line-by-line output, the coordinates can not be output for each element. This works:
[out:csv(_row;false)][bbox:48,13,48.5,13.5];
node[tourism=museum];
foreach(
make out _row
= "| " + u(type()) + " | " + u(id())
+ " | " + set(t["name"]) + " | " ;
out;
);
It would be very helpfull to get the coordinates for each element. But lat(), lon() does not work, for example when adding:
+ u(lat())
The feature will be added in the next version.
Commit 4ee748b9dedeb7b5832261f8945b46e12418d38d, part of 0.7.56 release.