Closed MaRaSu closed 3 years ago
Dear MaRaSu, you are right, make stats
is currently not supported by the overpassQueryBuilder
. There is some functionality of Overpass
that is only used rarely, and this command is among them. I might extend OSMPythonTools
somewhen but have currently no time to do so. Due to the special type of request, I anyway would recommend to provide the query as a string. I hope that this is fine and works well.
Dear @MaRaSu,
Thank you again for your patience. I have check this issue again and come to the conclusion that it would not be a good idea to add such functionality. OSMPythonTools
should be as simple as possible, and implementing such statistical functionality would mean to make (1) the code much harder to read and maintain, (2) makes it harder to understand the possibilities this package offers for the standard user, and (3) would eventually lead to creating a language that is equally powerful than the one used by Overpass. I would advise to build your queries manually and use the toJSON
function in the way you do it. I understand that you might not feel happy about this decision, but it seems impossible to always be en par with the options offered by the Overpass language. Sorry.
Best
I would like to query for specific areas & time periods ways meeting a certain criteria and for those ways get count and total length. As an example:
[timeout:60][date:"2020-01-01T00:00:00Z"][out:json];area(3603579531)->.searchArea;(way["mtb:scale"](area.searchArea););make stat number=count(ways),length=sum(length()); out;
I can manually build the query and use .toJSON() on query response to access the desired stats values, however preferred way would be to use overpassQueryBuilder and Data class. Looking at the code it looks like this is not supported?