OpenStreetMap: An Open Source Alternate to GoogleMaps

Map with magnifying glass

This article introduces OpenStreetMap, which is bound to interest students, engineers, trekkers, cartographers, government officials, law enforcement authorities and anyone who makes use of maps.

It doesn’t matter whether you are a trekker, a cyclist, from a government planning agency, a traffic controller, a cop, a geo-cacher or a survivalist, there will most certainly be an instance where you would need a good map. People used to buy print maps or used the maps that came with travel guides. But those maps became outdated quickly, and it often took years to update changes that happened as a result of development, settlements and construction of infrastructure. After GoogleMaps was launched, the scenario changed.

People rely on it extensively today. But there’s a catch — you are only allowed to view the maps in the browser or the Google Earth software. You are not allowed to share them in any way, to extrapolate data out of the maps, or even print parts of the map. That’s a problem when you want to use the map to create a paper-based cycling map, or if you want to extract data for research. So, are there any online map providers who have opened up their maps? Enter OpenStreetMap (OSM for short).
OSM is a freely (as in freedom) editable world map. All the map (geographical) data contained in it is open-sourced (Open Data) and licensed under the Open Data Commons Open Database License (ODbL). The map cartography and tiles are licensed under a Creative Commons-Attribution-Sharealike licence. OSM is analogous to Google Maps. The map is rendered using Mapnik, an open source toolkit (LGPL). Mapnik renders the Slippy Map for OSM in the browser.
Mapnik can read from several formats like OSM’s native XML, PostGIS, GeoJSON, ESRI Shape files, etc. Mapnik can be used independent of OSM, but how to do that is out of the scope of this article. Let’s focus on OSM for now.

There are a number of reasons for using OSM:

  • Everything in OSM is free, as in freedom.
  • OSM is crowd-sourced.
  • It has very detailed map data.
  • Customised tiles are available.
  • It’s very easy to embed and/or customise according to requirements.
  • You can access and edit OSM via API calls (REST-based, Yay!)
  • See https://help.openstreetmap.org/

Using OSM
There are several ways of using OSM to simply view the map or to view the data contained within. You can use OSM irrespective of the device or the operating system that you have.

In the browser: Simply visit http://openstreetmap.org (or osm.org). You can change the base map by clicking on the little drop-down box at the top right-hand side of the map, and choosing a map (from Cycle Map, Transport Map or the Mapquest Open Map). When viewing the map, aerial imagery is not available, due to licence restrictions (or it won’t be free, so get over it).

After you zoom into the map to a reasonable level, you can view the map data by clicking on the drop-down arrow adjacent to the Edit link above the map. It is also possible to export the map data as XML, or an image, by clicking on Export. This way, you can download parts of the map to make roughly printed-out paper maps.

 On your Android device:For Android, there’s an excellent application called OSMAnd. You can download it either from the Play Store or from the F-Droid application for Android.

Contributing to OSM
Remember that using OSM and letting your friends know about it is in itself a contribution. That said, you might want to enhance the data for your town or area. OSM provides incredibly detailed maps with several features. On a sufficiently populated map, you should be able to find the location of the nearest ATM of a particular bank, an eatery of your preference, or just about anything else you might want just by looking at the map. But that’s a result of hundreds of contributions by people like you, driven by necessity and interest. I myself started out by mapping my hometown, and I have been mapping since then.

Editing the map
There are several things that can be edited. One can either correct something that’s askew, or add something that should be present on the map, but isn’t. Most entities can be represented using one of the following:

  • A node/point of interest
  • A path/way
  • A shape/area/polygon

There are no curves or circles that you can add. You have to add more points to represent a curve.
Map editors have tools that you can use to draw details on the map. The primary tool is a node editor, which can be used to draw nodes. Two or more nodes make a path. If the path loops in on itself, it’s an area or a polygon. A node represents a point of interest (POI) or any entity that can be simply represented using a single node. Examples are post-boxes, public telephone booths, ATM kiosks, etc. Paths represent ways or roads. For example, a highway, a cycling path or a trekking trail can be represented using paths. Railway lines are paths too. Large enclosed areas are shapes or polygons. Even large buildings, islands, parks, playgrounds, etc, can be represented as polygons.
The actual properties of a node, path or a polygon can be given from within the editor itself. Properties for a highway, for instance, are width, number of lanes, surface type, whether or not the road is a one-way, etc.
You can do mapping using GPS coordinates, uploading GPS tracks/traces, or tracing over satellite imagery.

GPS co-ordinates
The GPS or geographical coordinates of a particular entity on the ground that is denoted by a latitude-longitude number (latlong) can be noted down, and then manually added on the map.

GPS traces
These are continuous traces of the paths you have travelled on with the GPS device on, continuously monitoring your position. This creates trace files that can be uploaded to OSM and integrated into the base map. The GPS coordinates and traces can be obtained by any GPS-enabled phone with the necessary software, or a GPS device that has a USB interface that you can use to transfer trace files to your computer. If you are planning to buy one, check out the OSM Wiki page for GPS device reviews.

Tracing over aerial imagery
This method is for crude mapping in places where accuracy is not an immediate concern. You can simply bring up the aerial map from Bing (yes, Microsoft Bing!) as a background image to trace structures onto the OSM layer.

Important: Tracing over aerial imagery is very error-prone. Never attempt to correct existing map data to match with aerial imagery. Satellite images have parallax errors, and are far from accurate. So unless absolutely necessary (like when trying to map a very remote rural place), do not attempt to trace. GPS-based methods are the most accurate.

Once you have zoomed in to the location that you want to edit, click the Edit link on the top, and enter your credentials to log in to OSM. (You have registered by now, haven’t you?)
Once you are logged in, Bing’ss aerial imagery shows up in the background; you can choose from the drop-downs to either sharpen the background, or do away with it. Now, add nodes by double-clicking at a single point. You can add paths by clicking a trace path and double-clicking at the last node. To create a closed polygon, simply click on the first node after you have created all the other nodes.
After creating a node or a path, you can add properties to it by choosing an appropriate one from the panel on the left-hand side. You can also drag the points into the map to directly place a particular entity on the map. Try clicking the tabs to see the various properties that you can give to the nodes. As mentioned earlier, nodes are often called Points of Interest (POI) in OSM lingo.
To undo something, hit Backspace or Delete; Backspace removes nodes one by one, in the reverse order. Or simply click on the final node, path or shape, and hit Delete to remove it. Maps can be dragged using click-drag even while editing the map.
Once you are done editing the map, click on Save and give an appropriate comment to describe the changes that you made. Subsequent changes in the same session do not require any new comments.

Editing OSM using Potlatch
Potlatch is an in-browser Flash-based map editor for OSM. You can use it to add data to the map without the need for any special software. The only requirement is to have the Adobe Flash plug-in for your browser.
Note: The Gnash plug-in does not seem to work. If you are particular about not installing Flash/proprietary software, just skip to the JOSM section below.

Running JOSM
Go to the directory in which the JAR file has been downloaded, then run java -jar josm-tested.jar or on Ubuntu, run /usr/bin/josm.

Using JOSM
Before you do any editing, you could download a base map to start working on. Go to File-> Download From OSM (Ctrl+shift+down arrow key) and select a small area you want to work on. This area could be your town or city. After that, you would be able to see the features of the map that have already been done. You are now ready to start mapping.

To pan over the map, right-click and drag. You would create nodes by double-clicking, and paths by clicking along the path (ending in a double-click), and polygons by clicking along the sides of the polygon ending by clicking again on the start node. You can switch between drawing mode and select mode by pressing a for drawing mode and s for select mode. In the select mode, you can click on points, delete them, move them around, or rotate them.
After drawing the nodes, you can add properties to them by clicking on the preset menu. To add more attributes, locate the Properties/Memberships window (Alt + Shift + P to toggle) and click the Add button. You can choose from a plethora of available keys and values. When necessary, you can also add custom values. For a road, a key may be surface type and a value may be Gravel or Asphalt.

Become a Ninja
Exploration and discovery is the best way to learn. You can learn a great deal about JOSM by exploring the various tools and options. Check out the various windows that JOSM has, and find out what each one of them is for. Experiment a lot before you do an actual data commit. This way, you get to become familiar with the basics of OSM and mapping. Once you get comfortable with the interface and the concepts, you will be ready to go ahead and do the advanced stuff on the path to becoming a mapping Ninja (like a black belt for mappers; and in case you are wondering, I flaunt a white belt!)
Once you are done, upload the data to the OSM servers by clicking File -> Upload data (Ctrl+Shift+Up arrow). You can go to osm.org and find out if your changes have come into effect. You should make it a habit to review the changes that you make before you upload them to the servers.

Editing OSM using Vespucci
You can edit OSM from within Android using Vespucci, which can be installed using F-Droid. If Vespucci sounds familiar, it’s only because you learnt about Amerigo Vespucci in your history classes. That guy got an entire continent (the Americas) named after him.
Usage of Vespucci is quite straightforward, as images on page 97 demonstrate:

The Walking Papers method
Walking Papers is a site that lets you print aerial maps of your locality, and you can draw features on them using a pencil, relying on your knowledge of the place, and then scan them back to Walking Papers—eventually, you upload the changes to OSM. This is very helpful in mapping village areas.
How do I get help?
General help can be found at help.openstreetmap.org while if you are the IRC type, hit irc.openstreetmap.org (#osm and #osm-dev). The FAQs are at wiki.openstreetmap.org/wiki/FAQ while the developer FAQs are at wiki.openstreetmap.org/wiki/Developer_FAQ. Mailing lists are at lists.openstreetmap.org.
Switch2OSM is an excellent place to begin. To learn about editing, head straight to learnosm. There are several publications, books and online tutorials available to get you started. Trust me, it’s fun and addictive.
How do I help OSM?
There are many ways you can contribute to OSM itself, and the guys running the servers. Here are some possibilities:
Use OSM (duh!)
Advocate: Write about OSM, blog, speak, etc. Start online radio on Icecast and spread the word (or is that a bit too radical?)
Teach: Create tutorials and video-logs, publish them on YouTube or Vimeo.
Edit the maps: The more data the map has, the more useful it becomes. The more accurate the data gets, the more reliable it becomes. So go ahead and hack the map.
The OSM foundation is a non-profit organisation; so how about giving them some of your money?
Lead by example: Use OSM in place of proprietary maps when you embed, or send directions to people.

Use cases and case studies
OSM can be used in various scenarios. To give you a couple of known examples, Wikipedia and Flickr use OSM for their mapping needs. Flickr uses OSM to put geo-tagged pictures on maps. Some articles of Wikipedia use OSM to represent areas of the world.
Lesser-known is the use of maps in humanitarian relief projects. The Humanitarian OSM Team (HOT) comprises a number of cartographers who coordinate the creation and distribution of mapping resources to support humanitarian relief efforts in several parts of the world. Haiti benefited by this project during the earthquake that ravaged the place not too long ago.
These maps can also be used to plan routes during treks or even emergencies. Rescue workers can use the maps to plan escape routes. The data can be used by governments to decide on resource allocation and city planning. The possibilities are endless.

OSM on paper

Apart from the obvious way of exporting the map as an image from the browser for printing, there are better ways to put OSM on paper. One is FieldPapers that lets you print maps and make notes on them, and put them back on the server for later use. Check it out for more features. The project is open source, and you can view the source code on GitHub.
So, the next time you go on a trek, take a print map from OSM with you. Upload the data back to OSM. Click a few geo-tagged photos of awesomeness. We should even organise a mapping marathon, or an OSM Day featuring a day-long map-hacking session and a few talks—and have fun at the same time. There are several mapping projects that you can get involved in.  If a zombie apocalypse breaks out tomorrow, I have my maps ready. Do you?

All published articles are released under Creative Commons Attribution-NonCommercial 3.0 Unported License, unless otherwise noted.
Open Source For You is powered by WordPress, which gladly sits on top of a CentOS-based LEMP stack.

Creative Commons License.