<p dir="auto">When you want to get an unknown number of changesets matching some criteria, you use <code class="notranslate">/api/0.6/changesets</code> 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 the <code class="notranslate">time</code> 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.</p>
<p dir="auto">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.</p>
<p dir="auto">If you could get changesets in ascending order, specifying lower limit would be enough to get the previous page.*</p>
<p dir="auto">This pull request adds the <code class="notranslate">order</code> parameter to <code class="notranslate">/api/0.6/changesets</code>, similar to <code class="notranslate">/api/0.6/notes/search</code>. <code class="notranslate">order=oldest</code> returns changesets in ascending order.</p>
<p dir="auto">* some details about same-second and overlapping changesets omitted</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4158'>https://github.com/openstreetmap/openstreetmap-website/pull/4158</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158/commits/abdce62a0369e2613b6f613b21afb97fe7b7697e" class="commit-link">abdce62</a> Add ordered changeset test method</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158/commits/0abab48f5d56c640bf87f8a4f43b219585ddfd82" class="commit-link">0abab48</a> Add order parameter to changeset query api entry point</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158/files">2 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158/files#diff-6726f8601cd22886963fb41888b55956cae4f8124aa12c701da77c3add44d94c">app/controllers/api/changesets_controller.rb</a>
(11)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158/files#diff-e95198c7f7744be3ce9857db36d2374538ca7d64caaf0f6f85865d6752563ee9">test/controllers/api/changesets_controller_test.rb</a>
(53)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4158.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4158.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4158.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4158.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4158">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJTMB4SSAC7GCV3DPLXU3PIHANCNFSM6AAAAAA3NTN7BY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKY7ZUWJYJFWH7OPD3XU3PIHA5CNFSM6AAAAAA3NTN7B2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHG4IIBTA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4158</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4158",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4158",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>