Add order parameter to changeset query API call #4158
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you want to get an unknown number of changesets matching some criteria, you use
/api/0.6/changesets
with the corresponding parameters. If you receive a number of changesets that is equal to the limit, you know there might be more matching changesets. To get the next page of changesets you set the upper limit of thetime
parameter to the last received changeset.* The lower limit is usually set to some date before osm existed. Then you run the query again and receive the next page of results. That next page should consist of changesets created earlier than the ones received previously.But what if you want a previous page? You can't set the upper time limit to the first received changeset because you'll get the same result again.* You can set the lower limit, but then you'll still need to decide on the upper limit. If you don't set the upper limit, you'll receive the first page with the latest changesets, not the previous one. You'll have to guess the upper time limit of the previous page, and guessing it correctly may take several requests.
If you could get changesets in ascending order, specifying lower limit would be enough to get the previous page.*
This pull request adds the
order
parameter to/api/0.6/changesets
, similar to/api/0.6/notes/search
.order=oldest
returns changesets in ascending order.* some details about same-second and overlapping changesets omitted