- For reusable components for developing websites or applications, see Frameworks.
This page is to give Developers a technical overview of logical system/components of OpenStreetMap.
The OSM API is a REST web service interface for reading and writing to the database i.e. XML over HTTP, with use of simple URLs for object access, and standard HTTP response codes.
Other OSM components access the database via this interface. It is also available to the outside internet.
The API logic is all part of the same Ruby on Rails application which powers the OSM front end website.
In production, a number of performance critical API endpoints are served by a separate C++ implementation (Cgimap).
OSM Front End
The web front end is a Ruby on Rails application (see The Rails Port), with views and models sitting alongside those of the XML API. As is standard for a Rails app, it uses a direct connection to the database (not calling the API - this connectivity is not shown on the diagram above).
The website's main function is to display the Slippy Map ( tab), and the online editor iD ( tab), but it also deals with logging in, registering, user pages, GPS traces, user diaries, data browser and other raw data 'browse' views, and changeset history views.
Tiles and tile rendering
There is an ongoing process of fetching map data via the API, and rendering maps as raster images known as tiles. Many new tiles need to be rendered to achieve full (global) coverage, but also updates to the underlying map data will mean that existing tiles need to be re-rendered.
Mapnik is a rendering system which powers the display which is currently the Slippy Map default. The rendering process runs on the 'tile' server, and Mapnik tile images are served from that machine. This renderer takes its data from a postgres database (also on the tile server). This database holds data in the format expected by Mapnik, using PostGIS extensions. This is an entirely different format to the database used on the core OSM database server. The mapnik database is populated by running an osm2pgsql script on minutely diffs.
As mentioned above, we use rendering software called Mapnik to create raster images for the slippy map tiles. Renderers can also be used on an ad-hoc basis for creating map images from our data. There's limitless potential to develop new ways of rendering our data. See Renderers.