[openstreetmap/openstreetmap-website] Simplify and test downloaded changeset element sorting (PR #4612)

Anton Khorev notifications at github.com
Thu Mar 21 17:10:11 UTC 2024


To find out which element order makes sense for #4571, I looked at how elements are sorted in changeset downloads. They are sorted by timestamp, then by version. Then I decided to simplify the code by replacing `sort`+ifs with `sort_by`, and I noticed that there are no tests for sort order.

Cgimap actually sorts further by type and id too: https://github.com/zerebubuth/openstreetmap-cgimap/blob/ea3e59543116fa97fd68e6d97813b1ee46e54290/src/osmchange_responder.cpp#L32. With `sort_by` it's easy to add this to osm-website if required.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4612

-- Commit Summary --

  * Simplify and test downloaded changeset element sorting

-- File Changes --

    M app/controllers/api/changesets_controller.rb (8)
    M test/controllers/api/changesets_controller_test.rb (34)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4612.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4612.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4612
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4612 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240321/37cd6f16/attachment.htm>


More information about the rails-dev mailing list