OpenStreetMap: Gathering Data using GPS

Exclusive offer: get 50% off this eBook here
OpenStreetMap

OpenStreetMap — Save 50%

Be your own cartographer

$23.99    $12.00
by Jonathan Bennett | September 2010 | Open Source

OpenStreetMap is a diverse project with hundreds of thousands of people contributing data and making use of it in different ways. As a result, many of the resources that mappers have created and use are scattered around the Internet, but the project data and much of the documentation is hosted at openstreetmap.org, on servers operated by the OpenStreetMap Foundation.

As a crowdsourced project, OpenStreetMap is heavily reliant on having an active community participate in the project, and there are probably as many tools and websites aimed at allowing mappers to communicate and collaborate as there are for mapping and using the data. Mappers have created many different ways of sharing information, based on personal preference and the kind of information involved.

In this article by Jonathan Bennett, author of the book OpenStreetMap, we'll look at the tools and techniques used by the OpenStreetMap community to gather data using GPS, and upload it to the website, including:

  • What the Global Positioning System is, and how it works
  • How to set up your GPS receiver for surveying
  • How to get the best signal, and more accurate positioning
  • How to tell a good GPS trace from a bad one
  • Ways of ensuring your survey is comprehensive
  • Other ways of recording information while surveying

We'll also look at a couple of ways of gathering information without needing a GPS receiver.

 

OpenStreetMap

OpenStreetMap

Be your own cartographer

  • Collect data for the area you want to map with this OpenStreetMap book and eBook
  • Create your own custom maps to print or use online following our proven tutorials
  • Collaborate with other OpenStreetMap contributors to improve the map data
  • Learn how OpenStreetMap works and why it's different to other sources of geographical information with this professional guide

Read more about this book

(For more resources on OpenStreetMap, see here.)

OpenStreetMap is made possible by two technological advances: Relatively affordable, accurate GPS receivers, and broadband Internet access. Without either of these, the job of building an accurate map from scratch using crowdsourcing would be so difficult that it almost certainly wouldn't work.

Much of OpenStreetMap's data is based on traces gathered by volunteer mappers, either while they're going about their daily lives, or on special mapping journeys. This is the best way to collect the source data for a freely redistributable map, as each contributor is able to give their permission for their data to be used in this way.

The traces gathered by mappers are used to show where features are, but they're not usually turned directly into a map. Instead, they're used as a backdrop in an editing program, and the map data is drawn by hand on top of the traces. This means you don't have to worry about getting a perfect trace every time you go mapping, or about sticking exactly to paths or roads. Errors are canceled out over time by multiple traces of the same features.

OpenStreetMap uses other sources of data than mappers' GPS traces, but they each have their own problems: Out-of-copyright maps are out-of-date, and may be less accurate than modern surveying methods. Aerial imagery needs processing before you can trace it, and it doesn't tell you details such as street names. Eventually, someone has to visit locations in person to verify what exists in a particular place, what it's called, and other details that you can't discern from an aerial photograph

If you already own a GPS and are comfortable using it to record traces, you can skip the first section of this article and go straight to Techniques. If you want very detailed information about surveying using GPS, you can read the American Society of Civil Engineers book on the subject, part of which is available on Google Books at http://bit.ly/gpssurveying. Some of the details are out-of-date, but the general principles still hold.

If you are already familiar with the general surveying techniques, and are comfortable producing information in GPX format, you can skip most of this article and head straight for the section Adding your traces to OpenStreetMap.

What is GPS?

GPS stands for Global Positioning System, and in most cases this refers to a system run by the US Department of Defense, properly called NAVSTAR. The generic term for such a system is a Global Navigation Satellite System (GNSS), of which NAVSTAR is currently the only fully operational system. Other equivalent systems are in development by the European Union (Galileo), Russian Federation (GLONASS), and the People's Republic of China (Compass). OpenStreetMap isn't tied to any one GNSS system, and will be able to make use of the others as they become available. The principles of operation of all these systems are essentially the same, so we'll describe how NAVSTAR works at present.

NAVSTAR consists of three elements: the space segment, the control segment, and the user segment.

  • The space segment is the constellation of satellites orbiting the Earth. The design of NAVSTAR is for 24 satellites, of which 21 are active and three are on standby. However, there are currently 31 satellites in use, as replacements have been launched without taking old satellites out of commission. Each satellite has a highly accurate atomic clock on board, and all clocks in all satellites are kept synchronized. Each satellite transmits a signal containing the time and its own position in the sky.
  • The control segment is a number of ground stations, including a master control station in Colorado Springs. These stations monitor the signal from the satellites and transmit any necessary corrections back to them. The corrections are necessary because the satellites themselves can stray from their predicted paths.
  • The user segment is your GPS receiver. This receives signals from multiple satellites, and uses the information they contain to calculate your position. Your receiver doesn't transmit any information, and the satellites don't know where you are. The receiver has its own clock, which needs to be synchronized with those in the space segment to perform its calculations. This isn't the case when you first turn it on, and is one of the reasons why it can take time to get a fix.

Your GPS receiver calculates your position by receiving messages from a number of satellites, and comparing the time included in each message to its own clock. This allows it to calculate your approximate distance from each satellite, and from that, your position on the Earth. If it uses three satellites, it can calculate your position in two dimensions, giving you your latitude (lat) and longitude (long). With signals from four satellites, it can give you a 3D fix, adding altitude to lat and long. The more satellites your receiver can "see", the more accurate the calculated position will be. Some receivers are able to use signals from up to 12 satellites at once, assuming the view of the satellites isn't blocked by buildings, trees, or people. You're obviously very unlikely to get a GPS fix indoors.

Many GPS receivers can calculate the amount of error in your position due to the configuration of satellites you're using. Called the Dilution of Precision (DOP), the number produced gives you an idea of how good a fix you have given the satellites you can get a signal from, and where they are in the sky. The higher the DOP, the less accurate your calculated position is. The precision of a GPS fix improves with the distance between the satellites you're using. If they're close together, such as mostly directly overhead, the DOP will be high. Use signals from satellites spread evenly across the sky, and your position will be more accurate. Which satellites your receiver uses isn't something you can control, but more modern GPS chipsets will automatically try to use the best configuration of satellites available, rather than just those with the strongest signals. DOP only takes into account errors caused by satellite geometry, not other sources of error, so a low DOP isn't a guarantee of absolute accuracy.

The system includes the capability to introduce intentional errors into the signal, so that only limited accuracy positioning is available to non-military users. This capability, called Selective Availability (SA) was in use until 1990, when President Clinton ordered it to be disabled. Future NAVSTAR satellites will not have SA capabilities, so the disablement is effectively permanent. The error introduced by SA reduced the horizontal accuracy of a civilian receiver, typically to 10m, but the error could be as high as 100m. Had SA still been in place, it's unlikely that OpenStreetMap would have been as successful.

NAVSTAR uses a coordinate system known as WGS84, which defines a spheroid representing the Earth, and a fixed line of longitude or datum from which other longitudes are measured. This datum is very close to, but not exactly the same as the Prime Meridian at Greenwich in South East London. The equator of the spheroid is used as the datum for latitude. Other coordinate systems exist, and you should note that no printed maps use WGS84, but instead use a slightly different system that makes maps of a given area easier to use. Examples of other coordinate systems include the OSGB36 system used by British national grid references. When you create a map from raw geographic data, the latitudes and longitudes are converted to the x and y coordinates of a flat plane using an algorithm called a projection. You've probably heard of the Mercator projection, but there are many others, each of which is suitable for different areas and purposes.

What's a GPS trace?

A GPS trace or tracklog is simply a record of position over time. It shows where you traveled while you were recording the trace. This information is gathered using a GPS receiver that calculates your position and stores it every so many seconds, depending on how you have configured your receiver.

If you record a trace while you're walking along a path, what you get is a trace that shows you where that path is in the world. Plot these points on a graph, and you have the start of a map. Walk along any adjoining paths and plot these on the same graph, and you have something you can use to navigate. If many people generate overlapping traces, eventually you have a fully mapped area. This is the general principle of crowdsourcing geographic data. You can see the result of many combined traces in the following image. This is the junction of the M4 and M25 motorways, to the west of London. The motorways themselves and the slip roads joining them are clearly visible.

Traces are used in OpenStreetMap to show where geographical features are, but usually only as a source for drawing over, not directly. They're also regarded as evidence that a mapper has actually visited the area in question, and not just copied the details from another copyrighted map. Most raw GPS traces aren't suitable to be made directly into maps, because they contain too many points for a given feature, will drift relative to a feature's true position, and you'll also take an occasional detour.

Although consumer-grade GPS receivers are less accurate than those used by professional surveyors, if enough traces of the same road or path are gathered, the average of these traces will be very close to the feature's true position. OpenStreetMap allows mappers to make corrections to the data over time as more accurate information becomes available.

In addition to your movements, most GPS receivers allow you to record specific named points, often called waypoints. These are useful for recording the location of point features, such as post boxes, bus stops, and other amenities. We'll cover ways of using waypoints later in the article.

What equipment do I need?

To collect traces suitable for use in OpenStreetMap, you'll need some kind of GPS receiver that's capable of recording a log of locations over time, known as a track log, trace, or breadcrumb trail. This could be a hand-held GPS receiver, a bicycle-mounted unit, a combination of a GPS receiver and a smartphone, or in some cases a vehicle satellite navigation system. There are also some dedicated GPS logger units, which don't provide any navigation function, but merely record a track log for later processing. You'll also need some way of getting the recorded traces off your receiver and onto your PC. This could be a USB or serial cable, a removable memory card, or possibly a Bluetooth connection. There are reviews of GPS units by mappers in the OpenStreetMap wiki.

There are also GPS receivers designed specifically for surveying, which have very sensitive antennas and link directly into geographic information systems (GIS). These tend to be very expensive and less portable than consumer-grade receivers. However, they're capable of producing positioning information accurate to a few centimeters rather than meters.

You also need a computer connected to the Internet. A broadband connection is best, as once you start submitting data to OpenStreetMap, you will probably end up downloading lots of map tiles. It is possible to gather traces and create mapping data while disconnected from the Internet, but you will need to upload your data and see the results at some point. OpenStreetMap data itself is usually represented in Extensible Markup Language (XML) format, and can be compressed into small files. The computer itself can be almost any kind, as long as it has a web browser, and can run one of the editors, which Windows, Mac OS X, and Linux all can.

You'll probably need some other kit while mapping to record additional information about the features you're mapping. Along with recording the position of each feature you map, you'll need to note things such as street names, route numbers, types of shops, and any other information you think is relevant. While this information won't be included in the traces you upload on openstreetmap.org, you'll need it later on when you're editing the map. Remember that you can't look up any details you miss on another map without breaking copyright, so it's important to gather all the information you need to describe a feature yourself.

  • A paper notebook and pencil is the most obvious way of recording the extra information. They are inexpensive and simple to use, and have no batteries to run out. However, it's difficult to use on a bike, and impossible if you're driving, so using this approach can slow down mapping.
  • A voice recorder is more expensive, but easier to use while still moving. Record a waypoint on your GPS receiver, and then describe what that waypoint represents in a voice recording. If you have a digital voice recorder, you can download the notes onto your PC to make them easier to use, and JOSM—the Java desktop editing application—has a support for audio mapping built-in.
  • A digital camera is useful for capturing street names and other details, such as the layout of junctions. Some recent cameras have their own built-in GPS, and others can support an external receiver, and will add the latitude, longitude, and possibly altitude, often known as geotags, to your pictures automatically. For those that don't, you can still use the timestamp on the photo to match it to a location in your GPS traces. We'll cover this later in the article.

Some mappers have experimented with video recordings while mapping, but the results haven't been encouraging so far. Some of the problems with video mapping are:

  • It's difficult to read street signs on zoomed-out video images, and zooming in on signs is impractical.
  • If you're recording while driving or riding a bike, the camera can only point in one direction at once, while the details you want to record may be in a different direction.
  • It's difficult to index recordings when using consumer video cameras, so you need to play the recording back in real time to extract the information, a slow process.

Automatic processing of video recordings taken with multiple cameras would make the process easier, but this is currently beyond what volunteer mappers are able to afford.

Smartphones can combine several of these functions, and some include their own GPS receiver. For those that don't, or where the internal GPS isn't very good, you can use an external Bluetooth GPS module. Several applications have been developed that make the process of gathering traces and other information on a smartphone easier. Look on the Smartphones page on the OpenStreetMap wiki at http://wiki.openstreetmap.org/wiki/Smartphones.

Making your first trace

Before you set off on a long surveying trip, you should familiarize yourself with the methods involved in gathering data for OpenStreetMap. This includes the basic operation of your GPS receiver, and the accompanying note-taking.

Configuring your GPS receiver

The first thing to make sure is that your GPS is using the W GS84 coordinate system. Many receivers also include a local coordinate system in their settings to make them easier to use with printed maps. So check in your settings which system you're getting your location in. OpenStreetMap only uses WGS84, so if you record your traces in the wrong system, you could end up placing features tens or even hundreds of meters away from their true location.

Next, you should set the recording frequency as high as it will go. You need your GPS to record as much detail as possible, so setting it to record your location as often as possible will make your traces better. Some receivers can record a point once per second; if yours doesn't, it's not a problem, but use the highest setting (shortest interval) possible. Some receivers also have a "smart" mode that only records points where you've changed direction significantly, which is fine for navigation, but not for turning into a map. If your GPS has this, you'll need to disable it. One further setting on some GPSs is to only record a point every so many metres, irrespective of how much time has elapsed. Turning this on can be useful if you're on foot and taking it easy, but otherwise keep it turned off.

Another setting to check, particularly if you're using a vehicle satellite navigation system, is "snap to streets" or a similar name. When your receiver has this setting on, your position will always be shown as being on a street or a path in its database, even if your true position is some way off. This causes two problems for OpenStreetMap: if you travel down a road that isn't in your receiver's database, its position won't be recorded, and the data you do collect is effectively derived from the database, which not only breaks copyright, but also reproduces any errors in that database.

Next, you need to know how to start and stop recording. Some receivers can record constantly while they're turned on, but many will need you to start and stop the process. Smartphone-based recorder software will definitely require starting and stopping. If you're using a smartphone with an external Bluetooth GPS module, you may also need to pair the devices and configure the receiver in your software.

Once you're happy with your settings, you can have a trial run. Make a journey you have to make anyway, or take a short trip to the shops and back (or some other reasonably close landmark if you don't live near shops). It's important that you're familiar with your test area, as you'll use your local knowledge to see how accurate your results are.

Checking the quality of your traces

When you return, get the trace you've recorded off your receiver, and take a look at it on your PC using an OpenStreetMap editor or by uploading the trace. Now, look at the quality of the trace. Some things to look out for are, as follows:

  • Are lines you'd expect to be straight actually straight, or do they have curves or deviations in them? A good trace reflects the shape of the area you surveyed, even if the positioning isn't 100% accurate.
  • I f you went a particular way twice during your trip, how well do the two parts of the trace correspond? Ideally, they should be parallel and within a few meters from each other.
  • When you change direction, does the trace reflect that change straight away, or does your recorded path continue in the same direction and gradually turn to your new heading?
  • If you've recorded any waypoints, how close are they to the trace? They should ideally be directly on top of the trace, but certainly no more than a few meters away.

The previous image shows a low-quality GPS trace. If you look at the raw trace on the left, you can see a few straight lines and differences in traces of the same area. The right-hand side shows the trace with the actual map data for the area, showing how they differ.

In this image, we see a high-quality GPS trace. This trace was taken by walking along each side of the road where possible. Note that the traces are straight and parallel, reflecting the road layout. The quality of the traces makes correctly turning them into data much easier.

If you notice these problems in your test trace, you may need to alter where you keep your GPS while you're mapping. Sometimes, inaccuracy is a result of the make-up of the area you're trying to map, and nothing will change that, short of using a more sensitive GPS. For the situations where that's not the case, the following are some tips on improving accuracy.

Making your traces more accurate

You can dramatically improve the accuracy of your traces by putting your GPS where it can get a good signal. Remember that it needs to have a good signal all the time, so even if you seem to get a good signal while you're looking at your receiver, it could drop in strength when you put it away.

  • If you're walking, the best position is in the top pocket of a rucksack, or attached to the shoulder strap. Having your GPS in a pocket on your lower body will seriously reduce the accuracy of your traces, as your body will block at least half of the sky.
  • If you're cycling, a handlebar mount for your GPS will give it a good view of the sky, while still making it easy to add waypoints. A rucksack is another option.
  • In a vehicle, it's more difficult to place your GPS where it will be able to see most of the sky. External roof-mounted GPS antennas are available, but they're not cheap and involve drilling a hole in the roof of your car. The best location is as far forward on your dashboard as possible, but be aware some modern car windscreens contain metal, and may block GPS signals. In this case, you may be able to use the rear parcel shelf, or a side window providing you can secure your GPS.
  • Don't start moving until you have a good fix. Although most GPS receivers can get a fix while you're moving, it will take longer and may be less accurate. More recent receivers have a "warm start" feature where they can get a fix much faster by caching positioning data from satellites.

You also need to avoid bias in your traces. This can occur when you tend to use one side of a road more than the other, either because of the route you normally take, or because there is only a pavement on one side of the road. The result of this is that the traces you collect will be off-center of the road's true position by a few meters. This won't matter at first, and will be less of a problem in less densely-featured areas, but in high-density residential areas, this could end up distorting the map slightly.

OpenStreetMap Be your own cartographer
Published: September 2010
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

Read more about this book

(For more resources on OpenStreetMap, see here.)

Surveying techniques

You can gather traces while going about your normal business, or you can make trips specifically to do surveying for OpenStreetMap. The amount of detail you'll be able to capture on a normal journey will be far lower than during a survey, but there are still some techniques you can use to record as much detail about your surroundings as possible.

The first technique to consider is your mode of transport while mapping. For some types of features, there is only one choice: For a motorway you need to use a vehicle, and for narrow footpaths you'll need to walk.

For everything in between, you need to use some judgment. Many existing mappers have found that for suburban and residential areas, a bicycle is the most efficient way of mapping. It's faster than walking, and cheaper than a car. A bike is also easier to turn around when you reach a dead end, and you can dismount and walk along paths where cycling isn't allowed.

Making your survey comprehensive

To make sure you map an area completely, you need to be methodical about how you travel around the area. One simple rule that works well in suburban and residential areas is to "always turn left". This is a standard technique used by robots to find the layout of a maze (and thus escape from it), and it works just as well for mapping.

What "always turn left" means is that if you come across a left-hand turn you haven't previously been down, then take it. Unless the streets you're mapping have a grid pattern, you'll eventually come to a dead end. When you do, turn around and head back down the street, and start turning left again. This method isn't perfect, particularly when there are loops in the road network, so take notes of places where you pass turnings on the opposite side of the road and make sure you visit them later in your survey.

If you're mapping on a bike or in a car in a country where traffic drives on the right, then "always turn right" works better, but the choice is yours. For streets in a grid layout, a simple back-and-forth sweep of the grid should be fine.

When mapping trunk roads or motorways with grade-separated junctions, remember to map the on-and off-ramps whenever you can. While the roads themselves get mapped quite thoroughly by people on long-distance journeys, individual junctions can get missed out even if the roads they join to are mapped. If you make a regular journey along a road like this, why not try to map one junction per day, which shouldn't take much of your time, but will still increase the map coverage quite quickly.

What level of detail you map streets at is up to you, but some typical features you could gather include bridges, changes of speed limit, route reference numbers, and street names.

Along with the streets, there will be point features and areas to map. Point features include street furniture, such as postboxes, bus stops, and public telephones; while areas can be things, such as car parks, playgrounds, and pedestrianized areas. You can record the relative locations of features that you find in a notebook, like in the previous diagram. Your diagram doesn't need to be neat and precise, as your GPS receiver is recording the location of each feature you find. All your notes have to do is record the information, such as names, that don't automatically get stored in your GPS traces.

You can mark the location of point features using your GPS's waypoint feature. Simply stop right by the object you want to mark and press the waypoint button, or choose the option from the menu. You can either use the automatic name given to the waypoint and add extra notes to your notebook, or use a voice recorder. Alternatively, rename the point with a more descriptive name.

For areas, you have a choice of techniques. You can either walk around the perimeter of the area, and the trace will show a loop giving the feature's location. Alternatively, you can just mark the corners of the area as you pass them using waypoints, and note which waypoints are linked to make the area. The latter method is useful when the area is large and you'll be passing by its corners anyway as part of your survey. As with all other OpenStreetMap data, your first pass at mapping an area doesn't have to be perfect, so don't be afraid of drawing an approximation based on three corners of an area.

Photo mapping

You can use a digital camera to take pictures of road signs, street names, or junction layouts to speed up your mapping and help increase the accuracy of your mapping.

The first step to take is to synchronize the clock on your digital camera with the time on your GPS receiver. This is because we'll be using the timestamp information on each photo to match it up with its location, based on your GPS trace. Not all digital cameras allow you to set the time to the nearest second, but as long as the difference between the clocks isn't too great, this won't cause a problem. One way of coping with a difference between the clocks is to take a picture of your GPS receiver with the time showing. You can use this to work out the offset between your camera and the GPS clock.

Once you've done this, you can use your camera to record lots of details you'd otherwise have to note by hand, and because you can place photos by their datestamp, you don't even need to record waypoints on your GPS.

Take pictures of more things than you think you need, and in more detail than you think. For instance, street name signs may also contain a part or all of the street's postal code, or the district it's in; take your picture from too far away, and you won't be able to read it. The previous photo captures two pieces of information: the name of the road, and the speed limit to the left of the sign. We can also see another road to the left, which gives us another clue which way the camera was facing when the picture was taken.

Some built-up areas may be very difficult to get an accurate GPS fix, so taking photos can give you an idea of where any straight sections are, and where the road bends, which may not be obvious from a poor GPS trace.

You can photograph road junctions to record their layout. It can be difficult and time consuming to record a trace of every possible path through a junction, so a series of pictures can help you map the junction accurately in less time.

Once you have your pictures and the accompanying GPS trace, you can load them into an OpenStreetMap editing application and use the information to draw the map.

OpenStreetMap doesn't have any image hosting facilities itself, so if you want to make your pictures available for other mappers to use, you'll need to use a separate photo-hosting site, such as Flickr. There is a sister project called Open StreetPhoto, but this is still under development and at present only provides detailed mapping for the Benelux countries.

Audio mapping

Like photo mapping, audio mapping can speed up the surveying process, but it has an additional advantage of being useful if you're just making a regular journey. The principle is that you describe features into a voice recorder. It's possible to do audio mapping with a tape-based voice recorder, but for best results, a digital recorder that timestamps the files it creates, is used. A smartphone may have a similar function built-in, or you may be able to add some software to it that will allow you to take voice notes. If you do use a tape recorder, remember to record a waypoint in your GPS, then start your voice note with the waypoint name.

As with photo mapping, you'll need to synchronize the clock on your recorder with that on your GPS. Some difference is OK, but if you're mapping high-speed roads, you need to keep it to a minimum; at 60mph or 100kph, you're travelling 22 meters every second. At that rate, a 20 second difference between the clocks would put your mapping out by over 500 meters.

Once you've done that, just use your voice recorder to describe your surroundings. You could record street names by saying, "Turning left into High Street" just before a turn, or use the past tense just after the turn. If a street name has an unusual spelling, or could be spelled in several different ways, it's a good idea to spell out the name in your voice note. It's a good idea to note route names or numbers occasionally as well, even if you've already noted them, as it removes some uncertainty.

Getting your traces into the right format

Once you've completed your mapping, you need to get the information off your receiver and into the right format. The simplest ways of getting traces off your GPS are using a direct cable connection or a removable memory card. Some recent receivers can act as USB mass storage devices, allowing you to get your traces onto your PC with a simple file copy. For older units, you may have to use the software that came with your GPS.

OpenStreetMap only accepts traces in GPS Exchange format (GPX)—an XML vocabulary for traces and waypoints. You can find out more about the GPX vocabulary at http://www.topografix.com/gpx.asp. OpenStreetMap also only accepts GPX files with timestamps on each trackpoint in the trace. This is to prevent mappers from uploading traces that have been converted from an existing map database, which will usually be subject to copyright and will therefore, not be suitable for use in OpenStreetMap. This doesn't present a problem most of the time, as practically all receivers store the time in traces made in real time.

If your receiver doesn't produce GPX files itself, you'll need to translate from its own format into GPX. Fortunately, there's an application that can convert most formats into GPX, called GPSBabel. If you can get GPX files from your receiver, you can skip this section.

GPSBabel is a free software package, and you can download it from http://www.gpsbabel.org/ for Windows, Mac OS X, and Linux. While GPSBabel itself is a command-line application, graphical interfaces are available for Windows, Mac, and Linux. The Windows version is shown in the following screenshot, which shows the command line it creates for the options you select in the interface.

We'll work through an example of converting a file in NMEA format to GPX using GPSBabel on Windows, but the procedure is the same for any file format. GPSBabel can also communicate directly with many models of GPS, and this can speed up the conversion process over downloading and converting separately.

GPSBabel is a powerful package with many options, and you won't need most of them. We're interested in converting tracks and waypoints into the GPX format. For an NMEA file, you'd use the following command line:

gpsbabel -w -t -i nmea -f <input filename> -o gpx -F <output filename>

If you're using the Windows command line, you'll need to use gpsbabel.exe as the program name.

The first two options tell GPSBabel to process waypoints and tracks; the default is to only process waypoints, which is of no use to OpenStreetMap. The third option is the input file format to use. You specify this with the -i flag, a format identifier, and the filename. The list of every identifier GPSBabel understands is available in the online documentation or by using the program's help option:

gpsbabel -h

You set the output format using the -o option in a similar manner, and in our case, this is always -gpx. The input filename is specified in the -f option, and the output file in the -F option. The input can also be a device if you want to retrieve traces directly from your GPS. Check the GPSBabel documentation for the precise syntax needed for your device.

As already mentioned, OpenStreetMap only accepts traces with valid timestamps. If you want to conceal the time you made a journey, you can do so through a filter that will change the start time of your trace. As timestamp information is useful to other mappers and for future projects, if you're going to change your timestamps, you're asked to do so to an obviously fake time so that your trace can be filtered out from automatic processing.

Use the following option to adjust timestamps:

 

gpsbabel -w -t -i nmea -f <input filename> -x track,start=19700101000000
-o gpx -F "<output filename>

This will set the start of your trace to January 1, 1970, well before OpenStreetMap was started, so it will be obvious that these are faked timestamps.

If you want to disguise the precise location your traces start or stop at, you can use a filter to discard any points within a given radius of a point. The following command line will filter out points within 500 meters of 10 Downing Street—the British Prime Minister's residence:

gpsbabel-w -t -i nmea -f <input filename> -x radius,exclude,distance=0.5K
,lat=51.5034052,lon=-0.1274766 -o gpx -F <output filename>

You can use more complex filters to clean up your traces by taking actions such as discarding any points with a high DOP. You don't need to do this, as the crowdsourcing process eliminates such errors over time, but it can help when first mapping an area.

Adding your traces to OpenStreetMap

Once you have your traces in GPX format, you can upload them to openstreetmap. org. Whether you need to upload your traces depends on which editing method you prefer. If you want to use the online editor, Potlatch, you need to upload your traces. If you use a desktop editor such as JOSM or Merkaator, you don't need to upload your traces to use them, but it's still useful to OpenStreetMap as a project if you do.

It's hoped that in the future, the traces can be put to other uses, including automatically generating average speeds for roads, detecting one-way streets and the layout of junctions. This automatic processing isn't yet in place, but the more the data it has to work with (once it's working), the better.

Some editors and applications support direct upload of traces, but the simplest way of adding your traces to OpenStreetMap is via the website. The upload form is at the top of the list of your traces. To find this, make sure you're logged into the site, and browse to the front page. Click on GPS Traces among the tabs at the top of the map, then click on See just your traces, or upload a trace.

You should now see the upload form, shown in the previous screenshot. The top field is the file to be imported. Either enter the path to your GPX file directly, or use the Browse button to find it on your hard drive. You can only upload one trace at a time using the web interface at present.

You need to add a short description for each file you upload. You can also add tags to each trace, so you can find particular sets of traces at a later date. There are no folders or other ways of organizing your traces, so adding tags at upload is a good idea. Enter a list of comma-separated tags in the form field. You can use as many tags as you find useful.

You can set the privacy level for a trace using the Visibility drop-down. All points in traces uploaded to OpenStreetMap are visible in some way, but you can choose whether other mappers can see the trace as a whole, and whether they can see who uploaded the trace. Some mappers feel that because many of their traces start or end at their home or workplace, other users shouldn't be able to see whose traces are whose, but there have been no reported incidents of a mapper's privacy being invaded through a trace they've uploaded. You can use GPSBabel to remove all points within a given radius of your start and end points, which will have a similar effect.

You have four privacy options:

  • Private: hides all details of your traces from other users, and only shares the individual points in each trace. Other users can't see which points come from which trace, or who uploaded them. The trace isn't shown in the public list of traces.
  • Public: is a historical option and isn't useful for newly uploaded traces. It shows the trace in the public list of traces, but still anonymizes the points when an area is downloaded. This was previously the only option other than Private.
  • Trackable: allows other users to see the timestamps for each point, but not who uploaded them. The traces don't appear in the public list of traces.
  • Identifiable: allows other users to see the entire trace, including who uploaded it. The trace is shown in the public list of traces, and the original file is available for download for everyone.

Which option you choose is entirely up to you, but your traces will be of more use to the OpenStreetMap project if you use one of the last two options.

After you've completed the upload form, you can press the Upload button to submit the trace. It will then go into a queue to be processed. Processing can be almost instant, or can take several minutes, depending on how many mappers are uploading traces. Once processing is complete, you'll get an e-mail to your registered address telling you whether the import was successful or not. Common reasons for imports to fail include a lack of timestamps, or GPX files that contain only waypoints, not tracks.

Refresh your traces list, and you should now see your newly imported trace, complete with a thumbnail image, and the description and tags you entered.

Clicking on a trace's filename or the more link will take you to a details page for that trace, where you can also edit the description, tags, and visibility of that trace. You can't edit a trace itself in OpenStreetMap, although JOSM does have support for GPX file editing. You won't normally need to make changes to GPS traces, but if you do, you'll need to edit a local copy of the file, delete the version on the site, and upload the new one.

The map link in a trace entry will take you to a map view centered around the trace's starting point. The edit link will take you to Potlatch—the online editor—with that trace loaded, so you can add the features it represents to the map.

Clicking on the uploader's name will take you to his/her user page. Click on any of the tags to see any traces you've tagged with that word. You'll also see a list of your tags in the sidebar on the left of the screen. Note that when you're looking at an individual trace page, the tag links in the page and in the sidebar will take you to a list of all traces on openstreetmap.org with that tag, not just yours.

Collecting information without a GPS

It's still possible to gather data for OpenStreetMap without a GPS receiver. Roads near your area may have been mapped by someone passing through the area, so will be missing any detailed information and points of interest. There are also areas where mappers have traced aerial images or out-of-copyright maps without surveying the area in person, so these areas will need details to be filled in.

You can identify areas that have been traced purely from aerial images using the NoName layer in the slippy map. This highlights any residential roads without a name, so any large blocks where all streets are highlighted are likely to have come from aerial images.

To go mapping without a GPS, you'll need a hard copy of the existing map of an area. You can print directly from the slippy map, but you'll get better results by using the Export facility to produce a PDF map of the area you're going to survey. You can then print this out with far greater control over layout. Note that you can't export an image of the NoName layer itself, but if you have a Garmin GPS receiver, you can download an add-on map version of NoName from Cloudmade (http://downloads.cloudmade.com).

Once you have your printed map, grab a pencil and head out. Mark the map with the locations of any points of interest, or any missing streets and paths. Don't worry about precise positioning, as it's more important to have data in an approximate location than have no data at all. You or another mapper can refine the positioning later. Use the techniques described earlier in the article to ensure you cover the whole of the area you've chosen.

There's a site aimed at making the process of mapping from an existing map more streamlined. Walking Papers (http://walking-papers.org/) is a site aimed at increasing participation in OpenStreetMap beyond dedicated mappers in possession of a GPS receiver. The site allows you to choose an area of the map and print it out, so that you can make notes on it. Walking Papers uses a different style of cartography than the slippy map, so there's more room around features to write and draw.

You then scan the printed map and upload it to the site. A 2D bar code on the map allows Walking Papers to match your annotated map to the area it was taken from, and use it as a background in your editor. You can then add data to the map by drawing over your scan and adding points of interest where you've marked them. Even if you don't have a scanner, you can use Walking Papers' more spacious maps as your template to draw on.

Have you finished?

Once you've surveyed an area, it's time to turn the information you've gathered into a map. However, don't be fooled into thinking that this means the end of surveying.

The most obvious reason for needing to re-survey an area is that there have been changes on the ground, such as road layout changes, buildings being demolished and built, or the opening and closure of shops or other amenities. One of OpenStreetMap's great strengths is the ability to update it and have the new data available to everyone immediately. You'll know of construction work taking place in your local area, so you can be ready to map the new features as soon as they're finished.

You may also stumble across new roads or road layouts while making an unrelated journey; another good reason to keep your GPS receiver recording, even if you're not planning to do any surveying.

Apart from changes in the real world, your skill as a surveyor will grow the more you do it, so revisiting an area will allow you to capture more detail with greater accuracy than you may have done the first time you visited. Remember, you can record any permanent geographical feature in OpenStreetMap, and ultimately it's hoped to include anything that can be mapped.

Summary

Surveying for OpenStreetMap isn't as difficult as you might first think, and it certainly doesn't need expensive, complex equipment. We've seen that you can do surveys with one or more of:

  • An inexpensive consumer-grade GPS receiver, or even no GPS at all
  • A notebook and a pencil
  • A digital camera
  • A voice recorder

We've also learned some basic surveying techniques, including:

  • Covering an area methodically
  • Recording as much detail as possible, even if it's not immediately obvious how it will be used
  • Using a combination of recording devices to speed up and improve the accuracy of mapping
  • Surveying an area multiple times to capture changes to features, or to increase the overall accuracy of the data.

Further resources on this subject:

  • Getting Started with OpenStreetMap [article]
  • Checking OpenStreetMap Data for Problems [article]

  • OpenStreetMap Be your own cartographer
    Published: September 2010
    eBook Price: $23.99
    Book Price: $39.99
    See more
    Select your format and quantity:

    About the Author :


    Jonathan Bennett

    Jonathan Bennett is a British journalist, writer, and developer. He has been involved in the OpenStreetMap project since 2006, and is a member of the OpenStreetMap Foundation. He has written for print and online technical publications including PC Magazine, ZDNet, CNET, and has appeared on television and radio as a technology commentator. He has an extensive collection of out-of-date printed maps.

    Books From Packt


    Drupal 7
    Drupal 7

    jQuery 1.4 Reference Guide
    jQuery 1.4 Reference Guide

    Moodle 2.0 First Look
    Moodle 2.0 First Look

    Joomla! Social Networking with JomSocial
    Joomla! Social Networking with JomSocial

    Apache OfBiz Cookbook
    Apache OfBiz Cookbook

    Plone 3.3 Site Administration
    Plone 3.3 Site Administration

    Nginx HTTP Server
    Nginx HTTP Server

    IT Inventory and Resource Management with OCS Inventory NG 1.02
    IT Inventory and Resource Management with OCS Inventory NG 1.02


    Code Download and Errata
    Packt Anytime, Anywhere
    Register Books
    Print Upgrades
    eBook Downloads
    Video Support
    Contact Us
    Awards Voting Nominations Previous Winners
    Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
    Resources
    Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software