[openstreetmap/openstreetmap-website] [WIP] XML generation: nodes, ways, relations, map controller → view; JSON output (#2221)

mmd notifications at github.com
Sun May 5 18:19:54 UTC 2019


As the issue title suggests, this is still very much WIP with the intention to gather some early feedback, go through a number of iterations to fix issues, etc.

Topics in this PR:

(1) Move the XML generation from the controller to the view for the following controllers:

* nodes_controller
* ways_controller
* relations_controller
* map_controller

(2) Adding JSON output according to the Overpass API JSON format spec for nodes, ways, relations, and the map call.

TODO:

- [ ] Remove XML generation methods in models
- [ ] Finish off remaining methods in all four controllers
- [ ] Test cases

Follow up for https://github.com/openstreetmap/iD/issues/3765
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * nodes,ways,relations xml/json prototype

-- File Changes --

    M app/controllers/api/map_controller.rb (20)
    M app/controllers/api/nodes_controller.rb (18)
    M app/controllers/api/relations_controller.rb (18)
    M app/controllers/api/ways_controller.rb (27)
    A app/views/api/map/_bounds.xml.builder (8)
    A app/views/api/map/_node.json.jsonify (19)
    A app/views/api/map/_node.xml.builder (25)
    A app/views/api/map/_relation.json.jsonify (24)
    A app/views/api/map/_relation.xml.builder (20)
    A app/views/api/map/_way.json.jsonify (17)
    A app/views/api/map/_way.xml.builder (20)
    A app/views/api/map/index.json.jsonify (22)
    A app/views/api/map/index.xml.builder (8)
    A app/views/api/nodes/index.json.jsonify (5)
    A app/views/api/nodes/index.xml.builder (5)
    A app/views/api/relations/index.json.jsonify (5)
    A app/views/api/relations/index.xml.builder (5)
    A app/views/api/ways/index.json.jsonify (5)
    A app/views/api/ways/index.xml.builder (5)
    M config/routes.rb (20)

-- Patch Links --

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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2221
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190505/3b1074fa/attachment.html>


More information about the rails-dev mailing list