openstreetmap-website
https://github.com/openstreetmap/openstreetmap-website
Ruby
The Rails application that powers OpenStreetMap
ApiController#map
This is probably the most common call of all. It is used for getting the OSM data for a specified bounding box, usually for editing. First the bounding box (bbox) is checked to make sure that it is sane. All nodes are searched, then all the ways that reference those nodes are found. All Nodes that are referenced by those ways are fetched and added to the list of nodes. Then all the relations that reference the already found nodes and ways are fetched. All the nodes and ways that are referenced by those ways are then fetched. Finally all the xml is returned.
Edit
git clone [email protected]:openstreetmap/openstreetmap-website.git
cd openstreetmap-website
open app/controllers/api_controller.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-ApiController-map-for-pr
# Commit to gitgit add app/controllers/api_controller.rbgit commit -m "better docs for ApiController#map"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-ApiController-map-for-pr
hub pull-request
# Celebrate!