arduino-tech

Mapping Data

Once you have collected your data via the GPS data logger, it is realtivly easy to visulaize it using Google Maps. First, we have to massage the data into a simplified format for Google Maps, then upload it to our Google Apps account and finally map it.

Here's How

Google Maps doesn't need all the information we collected with the data logger. Primarily it is only interested in three parameters, time/date, latitude and longitude. In order to map the data easily we need to remove the other additional fields from the CSV file. The easiet way to do this is to open the CSV file in Excel or some other spreadsheet program and remove the REPORT TYPE, MAC ADDRESS, ALTITUDE, SPEED and HEADING columns.

In this example we are using Libre Office (which is a free suite of Microsoft Office type programs) to open the CSV data file. Follow these steps below:

  • Rename GPS.LOG file to GPS.CSV
  • Right-click the GPS.CSV file and select Open With --> Libre Office Calc from the pop-up menu
  • Once Libre Office calc opens you will be prompted with the Text Import dialog box (Figure 1)
Figure 1

Ensure that you select the following options

  • Separated by (under Separator options)
  • Separator Options (only select Comma)

Click OK

Delete Columns

Since Google Maps is really only interested in three columns, date/time, latitude and longitude, we need to delete the other columns from the spreadsheet. To do this Ctrl-click the columns that you wish to delete and then right-click and select Delete Columns (Figure 2).


Figure 2

Saving the Data

Once you've pared down the file to just the columns you want save it as another CSV file. You could just write over top of your existing file but I prefer to create a new file to keep the original one intact. Select Save As from the File menu and ensure that you select Text CSV (.csv) from the Save as type: drop down list box in the Save As dialog box.

You'll be prompted with a message to confirm the file format. Make sure you click Use Text CSV Format and not Use ODF format.

Uploading Data to Google Maps

The next step is to upload the data into Google Maps. To do this you will have to have a Gmail account. If you have one go ahead and point your web browser to the following address: Launch Google Maps Engine. If you don't already have a Gmail account go ahead and sign up for a free account and come back to this page after you have setup your account.

Once you login to your mapsengine account you will be prompted to create a custom map. Click the New map button to create a map. Select Import to import data from a CSV file or spreadsheet (Figure 3).


Figure 3

Next you will be prompted to upload your CSV file to the Google maps engine. Simply drag and drop the CSV file in the window. If your CSV file contains more than 100 data points you will receive a message stating that you have exceeded the limit. Just click OK. Your first 100 data points will be imported.

Click Continue when you are prompted to choose the columns to position your placemarks. Select DATE/TIME when prompted to choose a column to title your markers. Then click Finish.

Awesome!

A map with all your data points will be created and you will be able to visualize where your tracker has been (Figure 4).

Google Map - Click to enlarge

Figure 4

You can click on any of the placemarkers and a data box will appear showing you the date and time as well as the latitude and longitude of the position report.

That's it. It is really simple to map your data using the Google Maps Engine. In part two I will explore ways to automatically upload the data to a server and track your data logger in real time.