How to Export Garmin Tracks/Activities to Google Maps

While it’s possible to share your Garmin tracks or activities with people through the Garmin website, I like exporting my tracks to Google Maps so I can embed them on my website. Here’s how I do that.

First, log in to your Garmin Connect account. Once you have logged in, click on the Activities tab.

You’ll see a list of your activities. Look for and find the activity you want to share.

Click on the activity you want and you’ll see all the details for the activity. To export the GPS track of your activity, look for the gear icon on the upper right of the screen:

Click on the gear icon and you’ll see several options. The one you want is “Export to GPX.”

You should then get a prompt to download a GPX file. Download it to your computer (and, of course, remember where you downloaded it to). If you’re curious, you can open the GPX file with a text editor and see that it is basically just a list of points using a markup language.

Now, log in to your Google account. The next part is always the part that takes me the longest when doing this – figuring out the URL where I can upload the GPX file to create a map. Google doesn’t make this easy (and, admittedly, it has changed over time). The link to upload and create maps using Google Maps is this one: Assuming you are signed in and everything works, you should see a page called “My Maps” that looks like this:

I’ve made a fair number of maps!

Click on “+CREATE A NEW MAP”, the big red button. On the next screen, you’ll see a checkbox next to “Untitled Layer” and below that a link that says “Import.”

Click on the “Import” link and you’ll get this window:

You can either click on the blue button and select your GPX file or just drag it to the window. Either way, as soon as it has been uploaded, the site will process it and overlay your track onto a map, like this:

(BONUS: Since I have created quite a few of these for my hikes, I actually try to keep them organized in my Google Drive. If you’re going to create a lot of these, you should do the same.)

Now you have lots of options to customize your map. You should obviously click on where it says “Untitled map” and give it a name. You can also add layers, add points of interest, insert pins, etc. You can also change the Base map to terrain or satellite instead of the default map. I added three pins, a title, and a description to my map:

When you’re done modifying your map, you should do two things to share it. First, change the permissions by clicking on the “Share” icon.

By default, maps are restricted and you can only provide access to specific people. You can change that by clicking at the bottom of that window where it says “Change to anyone with the link.”

Now you can embed the map into a different website or just share the link with people. To embed the map, click the three little vertical dots near the title and select “Embed on my site”:

You’ll then get a window with the embed code:

The code should look something like this:

<iframe src="" width="640" height="480"></iframe>

And here’s how it looks actually embedded on your site:

 12,661 total views,  7 views today

Linux: Creating Maps on Linux with QGIS

For my job, I occasionally need to create maps to illustrate some concept or another.  For instance, it can be useful to see a the racial makeup of the US as a map color-coded to reflect the percent of the population that identifies as black in each state.  It provides a quick illustration of how people identifying as a certain race are distributed across the US.  Back when I used Windows, I had a hard time finding simple software that would create maps like this, but it seemed like there were more or at least cheaper options with Windows.  However, you can’t beat free, and that’s how much the software you’ll need for this tutorial costs!  I’m going to do this tutorial in three parts: 1) Getting ready; (2) Creating your map; (3) Preparing your map for printing/export.

Part 1: Getting Ready to Create a Map

  1. To begin with, you’ll need some software.  The software I’ll be using is called QGIS.  It’s free and is included in most Linux repositories (it’s included in the Ubuntu repositories; I run Kubuntu).  That makes it easy to install, either from Synaptic or from the terminal (e.g., sudo apt-get install qgis python-qgis).  QGIS runs on Windows and Mac as well, so this tutorial will probably work for those OSes, too.  So, step 1 is to install QGIS.
  2. You’re also going to need some shape or map files.  You can create your own, but you don’t want to do that as it takes forever and almost any common map you could want has already been created for you.  There are two great places to download maps: For maps related to the US, try the U.S. Census Bureau’s Tiger files website.  The shape file I’ll be using for this tutorial came from their website.  For a broader array of maps, try NaturalEarthData, which has lots and lots of maps to choose from.  Download the shapefile’s you think you’ll want, unzip them, and store them in a location where you can access them readily.
  3. Finally, if you’re adding data to your map, you’ll need that data, ideally in a spreadsheet.  There are lots of sources of data.  I tend to use a lot from Statistical Abstracts, which is now run by Proquest since it was defunded by the Census Bureau.  But you can use data from wherever.  The key, however, is to make sure it’s cleanly entered into a spreadsheet.

Part 2: Creating Your Map

  1. Once you have your software installed, you’ve download the necessary shape files, and you’ve got your data ready, it’s time to create your map.  First, open QGIS.  You’ll see a blank screen with lots of buttons and such. Lots to do here, but we’re going to keep this simple.QGIS-01
  2. The first thing you need to do is add your shapefile.  Assuming you have downloaded the shapefile and unzipped it, let’s import it into QGIS.  You’re going to add it as a layer.  Click on the add vector layer button:
  3. You’ll then need to find the map file you want to import using the “browse” button and click “open.”QGIS-03
  4. You should then see the map show up in QGIS.
  5. You’ll next need to make sure that you’ve properly prepared your data for importing into QGIS.  There are two things you need to check.  First, right-click on the map or shapefile you just imported and scroll down to “Open Attribute Table.”QGIS-04
  6. You’ll now seen a table with lots of information.  This table basically provides all the information to QGIS to tell it how to generate the map.  You’re going to link your data to this table.QGIS-17
  7. What you need to find is a variable in the table (one of the columns) with information that you can use to link your data file with this table.  You should probably use something like “GEOID” or “NAME”.
  8. By clicking on the header of any of the columns, the table will be sorted by that column.  Since I’m using states for my map, I clicked on the column header “NAME” so the states are sorted alphabetically.  I then checked the names of the states and the GEOID with those in my data file in a separate spreadsheet.  (Here’s a file with accurate names and GEOIDs.)  You’re checking these because this is how you’ll link your data to this table.  Make sure that you have the correct names or GEOIDs in your data file.  Whichever variable/column you choose to link the shapefile and your data file, it’s a good idea to use the same column header in your data file as exists in the shapefile attributes table.  As you can see, I’m using GEOIDs.  (Hint: Most GEOIDs in attribute files have zeros in front of small numbers, like “001” instead of “1”.  To link files, you should set your GEOID column in your spreadsheet software to “text” rather than “numbers” or those zeros will disapper and QGIS won’t link those records.)  Here’s how my data file looks in LibreOffice:QGIS-06
  9. Now, if you’re using LibreOffice, save your data file as a “.dbf” file.  That’s the file format that QGIS reads.
  10. Now you’re going to import your data file into QGIS.  Go back to QGIS and click on the same button you used to add a vector layer.  You’ll have to tell QGIS that you want to see “All Files” as it won’t show DBF files by default, but it can import them.QGIS-07
  11. Find your DBF file and select “Open.”  You’ll now see it in the list of layers.QGIS-08
  12. Now for the important part.   You’re going to link or join your data file with the the shapefile attribute table.  To do this, double-click on the shapefile in the layers box in QGIS and you’ll get a new window:QGIS-09
  13. Click on the “Joins” tab and you’ll see this:QGIS-10
  14. Now click on the green + icon and you’ll see this window:QGIS-11
  15. In the “Join layer” field, choose your data file you imported.  In the “Join field” field, choose the column header for the variable you are using in your data file to link to the attribute file.  In my case, it is GEOID.  In the “Target field,” choose the column header your linking your data file to in the attribute table.  In my case, it is GEOID.  Like this:QGIS-12
  16. Now hit OK on that window and then “OK” again on the properties window and your data file should be linked to the Attribute Table of the shapefile.  You can check that the join worked by right-clicking on your shapefile and opening up Attribute Table again.  You should see your data added to the end of the Attribute Table file.  (NOTE: QGIS is smart enough to know when there isn’t data for a row in the joined data and inserts NULL instead.  For instance, I didn’t import any data for Puerto Rico, so that is listed as NULL.  Also, if for some reason your data don’t get linked, it will insert NULL.  That’s usually a sign that you didn’t enter a value in correctly on your linking variable.)QGIS-13
  17. If your data are in the Attribute Table, you’ve succeeded with the hardest part of this project.  Now we just need to display that data on the map.  QGIS makes displaying data based on colors very easy.  Just below the shapefile you should see a box (it’s called a “group”).  That box is basically just a stand in for the current map that is being displayed.
  18. Double-click on that box and you’ll get a new “Layer Properties” window.  In that window, click on “Style.”QGIS-15
  19. If you want QGIS to do most of the work of coloring for you, look for the dropdown menu that says “Single Symbol.”  That is the current color of the map.  Click on that and choose, instead, “Graduated.”  The options in the window will now change.  “Graduated” means that the color coding will be based on the values of the variable you choose.  You can choose how many colors to display where it says “Classes.”  You can change the colors used where it says “Color ramp”.  You can choose the width of the intervals where it says “Mode.”  But, most importantly, we want to choose the variable that is going to be used for calculating the colors where it says “Column.”  Like I have below:
    (insert screen capture here)QGIS-18
  20. Once you’re ready, click “OK” and watch your map change to reflect color coded values based on your variable, like this:QGIS-16
  21. At this point, you’ve successfully created your map.  In Part 3 below I’ll show you how to prepare your map for exporting to an image file or for printing.

Part 3: Preparing Your Map for Printing/Exporting

  1.  It may seem like you’re done at this point, and you’re pretty close, as you’ve done the hard part.  But QGIS has an additional feature that makes creating maps even nicer – composing the finished map.  Yes, you could just take a screen capture of the map you created and that may be sufficient, but wouldn’t it be nice to have a legend?  And a title?  And, in my case, include Hawaii and Alaska all in the same image?  You can do all of that from the “Print Composer” feature of QGIS.  To open the Print Composer, click here:QGIS-19
  2. Once you click on the “Print Composer” button you’ll be asked to give your print a title.  Title it whatever you want, then you’ll see this screen:QGIS-20
  3. The first thing you’ll want to do is set your Composition size.  If you’re going to save your map as an SVG file, size won’t really matter.  But if you’re saving it as any other image file, you should probably go as big as possible.  This is done using the “Composition” tab on the right side of the screen.QGIS-21
  4. Next, you’re going to want to import the map you just created as the center piece of your print.  To do this, click on the “Add new Map” button:QGIS-22
  5. When you click on that button, you’ll then be able to draw a rectangle on your canvas (the white area) that will import onto the canvas whatever is showing in the main QGIS window.  So, make sure that whatever you want to import onto your canvas is showing in the other window, then drag your rectangle to import it.QGIS-23
  6. You’ll then want to switch to the primary selection tool, which is what you’ll use to interact with the different components of your map composition:
  7. By selecting one of the components of your map, you can also modify it’s properties on the right hand side under “Item Properties”:QGIS-25
  8. We now have the main part of our map.  But, in my case, I also want to include Alaska and Hawaii, as well as a legend.  To add Alaska and Hawaii, recenter the primary QGIS window over them one at a time and then import them the same way you imported the continental US.
  9. The next item I want to add is a legend.  To add a legend, click the icon at the top of the screen to do so:
  10. You can adjust the properties of the legend under the “Item Properties” tab on the right of the canvas.
  11. The final item you should add is a title.  This is done with the “Add new Label” button at the top of the screen:QGIS-29
  12. Like the other items, you can adjust your title under the “Item Properties” tab until you’re happy with it.
  13. Once you’ve got your map how you want it, it’s time to export it.  If you aren’t familiar with SVG files, they are really neat.  Basically, they can scale to any size without pixelating because of how they are stored (SVG stands for “scalable vector graphics”).  That’s probably the ideal format for exporting.  But you can also export the map in a variety of other formats.  Below is the final map exported as a PNG file.



I drew on the following tutorials to create this one.


 3,139 total views,  4 views today