User:Johnwhelan/How it works

From OpenStreetMap Wiki
Jump to: navigation, search

This is a 'How it works' explanation of OpenStreetMap by User:Johnwhelan


Conventional maps are drawn on paper but electronic maps have two parts the first is the electronic database that holds the data and the second is the display method.

The technical information given here is so you can better understand the advantages and limitations of an electronic map.

There are three types of information held in an OSM database or .osm file. The first is pure red tape, version and which program created it and the bounding area

<bounds minlat='45.4158045' minlon='-75.5649948' maxlat='45.423997799999995' maxlon='-75.55057529999999' origin='CGImap 0.0.2' />

Basically we can ignore this red tape.

Besides the red tape an electronic map has points or nodes, and these are connected in various ways by relationships or ways. So electronically in the database a road can be just two points and a relationship, a bus stop a single point or node.

GIS systems have their own specialized jargon so a point is always called a node, a relationship between two nodes is always called a way.

When we want to display we use a display system which will interpret the two nodes and the way as something we recognise as a road. For the bus stop we tell the rendering system to display a particular icon at the node that the user will interpret as a bus stop.

There is one special case of nodes and ways and that is a closed shape, perhaps the outline of a building but the map essentially is just a collection of nodes and ways.

In order to display the road on the map we need additional information and this information in tags is associated with the node or way. @@@@ <node id='412671014' timestamp='2009-05-30T02:35:33Z' uid='92209' user='geobase_stevens' visible='true' version='1' changeset='1355367' lat='45.4187513' lon='-75.5565248' /> @@@@

 <way id='35189983' action='modify' timestamp='2009-05-30T02:52:24Z' uid='92209' user='geobase_stevens' visible='true' version='1' changeset='1355377'>
   <nd ref='412671014' />
   <nd ref='412678338' />
   <tag k='attribution' v='GeoBase®' />
   <tag k='geobase:acquisitionTechnique' v='Vector Data' />
   <tag k='geobase:datasetName' v='NRN:Ontario' />
   <tag k='geobase:uuid' v='7d66635fca034356942958af6f6995af' />
   <tag k='highway' v='residential' />
   <tag k='is_in' v='Ontario,Canada' />
   <tag k='lanes' v='2' />
   <tag k='name' v='Riel Street' />
   <tag k='source' v='Geobase_Import_2009' />
   <tag k='statscan:rbuid' v='2039331' />
   <tag k='name:fr' v='rue Riel' />
 </way>

@@@@@@

<node id='692451549' timestamp='2010-08-29T16:38:08Z' uid='186592' user='Johnwhelan' visible='true' version='2' changeset='5627896' lat='45.4774912' lon='-75.4898991'>

   <tag k='highway' v='bus_stop' />
   <tag k='name' v='7890' />
 </node>

@@@@@

We need to give the display system or in GIS Jargon rendering system some rules on how to display a residential 2 lanes wide road and with its name. Information that is not mentioned in the rules is ignored. This is also true of nodes that are tagged shop=florist these are not normally rendered on the default web display and is one explanation of some contributions aren't visible on the web map.

Normally the information and rules I'm describing are hidden from the end user but knowing how it works can be helpful to people contributing to the map. A tag of "amenity=pub" will display a pub icon, "amenity=Pub" will be unrecognized in the rendering rules and display nothing.

When we look at the map displayed on the web www.openstreetmap.org what you actually see is a number of renders on the server. Each layer or level on the scale on the left with the plus and minus sign is prerendered in tiles, and when you zoom in you send back to the server to fetch the next tile. There are alternative ways to render, one is to use JOSM. It doesn't look pretty but if you want information from the tags such as the associated website the information is available. Another more useful one might be a PC based system such as Maperitive. Here we can load up a local .osm file saved from JOSM perhaps and zoom in and out with a much faster response than we might get from the web without an Internet connection. We can also get at the rules. So in the example above we could tell the rendering program to use the name:fr value for the street name. We are using the same nodes so we get the same map but with French street names.

We can create specialist maps, if we only put "amenity=pub" in the rules and use a really big pub icon, it will omit everything except pubs. We can choose what is displayed or not displayed on our map.

There are two types of software that run against the database to give us capabilities that are not readily available on a paper map. The first is the searches such as Nominatim and the second are the routing programs. Data quality is important here, if the street name is misspelled on the map the search engines won't find it. For the routing programs to work they need to know which streets are connected so if two streets cross but have no connecting node the routing programs won't find that route. The same if a street almost touches another. Is there a barrier at the end of one street or not? The routing algorithm doesn't know so will ignore a potential route.

Hopefully knowing a little more how it works will assist you in contributing and editing the data.