-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notes multi fetch API call #3707
base: master
Are you sure you want to change the base?
Conversation
Just an idea: The benefit of this would be that you could also directly filter notes. For example because you are only interested in notes that are still open. |
If you look at I'm fine with any of these:
|
Although there is a bit of difference between extending the existing note search entry points and adding a new one. The existing ones always sort the notes by date. The new one may can be added without sorting or with sorting in whatever order the ids are passed. The latter seems to be the case with the most straightforward implementation using |
سلام، چگونه باید این مشکل را برطرف کنم؟ |
8be6e44
to
0e83338
Compare
0e83338
to
ea4f7c5
Compare
ea4f7c5
to
003a665
Compare
I changed it to a search parameter like suggested in #3707 (comment) but named |
Updated reasoning about entry points:
|
An API call to fetch several notes at once by their ids, similar to changesets query
changesets
parameter(prevously to
the elements multi fetch call):/api/0.6/notes/search?notes=1,2,3
I named itfetch
here. If I was to follow a naming convention similar to the elements' call, it should have been named/api/0.6/notes?notes
. Howevernotes
path is already in use, even twice: for bbox queries with GET and for new notes with POST.What is it useful for?
If you receive notes from some source other than OSM API they may contain incomplete information or be out of date. That source may be some search engine or some feed for an area. For example, resultmaps.neis-one.org/osm-notes has feeds for countries. Unfortunately they don't have coordinates, so if you want to see the notes on the map, you have to get them from the API. The only way to do that is download the notes one by one by their ids. That's a lot of requests because the feeds may contain hundreds of notes. But there are API calls already that can send hundreds of notes in one response: bbox and search queries. And bbox calls are routinely made when notes layer is turned on. So there's nothing in principle that prevents fetching multiple notes in one request. If you are already committed to downloading a bunch of notes by their ids, it will be faster and less taxing for the API to get all of the notes in one call. Of course there's a limit to the url length, in this case you'd have to make several calls to get really many notes, but that's still better than making really many calls.
Another possible use is if you have a set of notes selected in some app to work on. Maybe other people also work on these notes. In this case you may want to know if any of these notes was updated. Again, the only way to do this is to download them one by one.