openstreetmap-website
openstreetmap-website copied to clipboard
Multi fetch for objects histories
Problem
Currently, there is no way to request the history of multiple objects in a single request.
Description
Let's say you want to get the full history of changes to the line geometry. To do this, you need to get the history of the line + the history of all points that have ever entered the line. There seem to be only two ways to do this right now:
- Call in the worst case 2000 /history for nodes (in one of the line versions)
- Make a Multi fetch of the current state of points, and then generate queries like: nodes?nodes=1v1,1v2,...2v1,....
In theory, if the nodes versions are small (1-5), then loading with Multi fetch (~600 versions at a time), the second method will only need 4-17 requests
In practice, most likely you will not be able to get a boost due to https://github.com/openstreetmap/openstreetmap-website/issues/5005
But why all these difficulties? Why not have multi fetch for /history?
Something like: /nodes_histories?nodes=1,2,3
p.s. judging by, most likely, this method would also be useful for undo edits tools
Screenshots
No response