Welcome to SP!  -
Embedded maps & GPX routes

Embedded maps & GPX routes

  Featured on the Front Page
Embedded maps & GPX routes

Page Type: Article

Object Title: Embedded maps & GPX routes

Activities: Hiking, Mountaineering, Skiing


Page By: peterbud, Nanuls, visentin, Jelf

Created/Edited: Dec 1, 2009 / Mar 8, 2011

Object ID: 578750

Hits: 18385 

Page Score: 88.19%  - 26 Votes 

Vote: Log in to vote



Over recent years, Global Positioning Systems (GPS) have become more and more sophisticated and in turn, their popularity has grown considerably. Their functionality has also improved and as a result the use of GPX files has become an increasingly common occurrence.

At the same time, the use of online mapping facilities such as Google Maps and its equivalents has grown considerably, allowing users from around the world to share their topographic data over the internet. For sites such as Summitpost, which aim to share beta on all manner of outdoor activities, this has created a number of interesting possibilities for sharing information. The displaying of route information is particularly relevant, and although still in its infancy, the incorporation of GPX files with this kind of software has made this an ever more practical solution.

Using embedded maps is not only practical (instead of posting huge JPEG files with limited functionality), it is also legal.
Reproducing maps protected by copyright laws is often illegal, not to say very dangerous with some editors : websites like refuges.info have fined for some 20,000€ for using large numbers of IGN samples without permission (see forum topic).
Embedded maps on the other hand are usually perfectly legal (provided the terms and conditions of use are adhered to) since are normally supplied directly from those who own the data.

Despite not owning a GPS unit myself, but having used the positioning function for pictures and pages on Summitpost, as well as using other websites that incorporate GPX features, my attention has been drawn to these possibilities. This is why we decided to create this "how-to" page, and by doing so, hope to encourage more Summitpost members to use such tools and thereby avoid potential legal troubles for the site.

Currently GPX files used in this way are most commonly found on cycling portals (ex: bikely.com), but also hiking websites, like this one by Philippe, a friend of mine.

Geoportail have done a really great job enabling this feature, but French maps are not the only users. Although slightly convoluted, maps by the UK's Ordnance Survey are also used, and Nanuls, who kindly offered to join me for this page, already uses it on SP.

Since the topographic view of the Google Maps doesn't provide a very accurate hiking map, but only a general idea of the terrain, I decided to search all available map data on the web, of paper maps level, enabling this kind of solutions, allowing enbedding samples in SP pages.

The first finding after the two previously mentionned was, surprisingly, Slovakia, this small but mountainous republic of Central Europe, whose mapping data, by the national VKU, is available on http://mapy.hiking.sk. As I live expatriated near this country, I searched logically the same in Poland. I found almost what I looked for: enbeddable maps, with more-than-medium accuracy, but whose interest is to display the marked trails.

Finally, and despite not living on this continent, I wondered how it was possible that USA did not have at least one of these, especially since the majority of the SummitPosters are from this side of the Atlantic. Until I found by total coincidence a forum post by Jelf who presented his tool http://www.mappingsupport.com.

I am certain that here is only the emerged part of the iceberg, as I searched mostly the areas near where I live, and I believe there are sill tons of finding to be made. I am surprised that the Alps with their top cartography, remain uncovered, especially by the german-speaking countries, but perhaps this skipped of my attention because of the language.
Perhaps, and let's hope so, this page will soon be too small to list all possible embedding possibilities across the world.

Anyone who would like to join and add a chapter, especially if they have information for a country not already covered here, are more than welcome to join us.

What are GPX and KML files ?

A GPX file is the data generated by a GPS, or possibly by any other map-based program.
It is in fact a standard XML file whith a defined standard, which can be edited as a text file. For those who have manipulated this kind of file format, or used only HTML, this is pretty easy to understand, which means it is almost possible to create one using Notepad, and without any knowledge. However, with a lot of data, it quickly becomes hardly readable, and the main purpose of editing manually such file is generally for some kind of "cutting" job.

Between the heading and ending tags "GPX" (the header containing some standards information along), we can find:
- Waypoints ("wpt" tags)
- Treks ("trk" tags)
A waypoint contains :
- Its GPS coordinates ("Lat&Lon")
- A name
- Possibly, its elevation
A trek contains also a name, and one or more segments ("trkseg"). Each segment is made of several trekpoints ("trkpt"), defined identically as Waypoints, but without a name for each.
This is the standard 1.0. There is a newer standard 1.1 with different tag names, but whose idea is the same.

Here is a small example, with one waypoint, and a trek made of four points:

KML files, contrary to the GPX, is not a common standard, but a standard developped by Google, more precisely for Google Earth and Maps. This is also an XML file, but with much more possibilities. More information here.
GPX files can always be converted into KML, however KML containing other information than waypoints and routes, while converted into a GPX, will loose all extra features.
Some websites enbedding maps use the first standard, some other the second, some both.

How to create, visualize and enbed routes with Google Maps

Standard Google MapEnlarge

If you perform on google a search with the keywords "upload GPX", you will find a crowd of tools of various nature to manipulate Google maps (including Google itself, except for creating routes).

In order to make the things as simple as possible for SummitPost users who want to enbed a route on Google Maps into a SummitPost page, after trying many tools, one of them seemed to stand well over the rest in terms of intuitivity, functionality, and quality.

This tool, just like SummitPost and MBPost, is divided into two entities (and recently more), at the difference that the mother site is the cycling one and the hiking one the variant.

These two sites are :
- http://www.wandermap.net for hiking
- http://www.bikemap.net for cycling

Registering is extremely quick, and even more simple if you have a facebook account (it synchronizes the facebook account with the bikemap/wandermap account).
Creating a route, in few clicks, is made in the simpliest way one can imagine. Both GPX and KML files are generated after a title and few details are entered. These files are stored on their server on static URL locations, which is extremely useful for many purposes detailled in the forthcoming sections, for each country (see US, Poland, SLovakia).

Just like for Google Maps (into whose field we can paste the URL of a KML file, for example one from a Wandermap route), a link allows copy/pasting a fragment of HTML code to the Summitpost page, to get an enbedded map.

But, contrary to Google, these samples are much better presented, and accompanied by a graphic with the profile of the hike elevation. You can judge with this comparison of the Wandermap enbedded map and the standard Google enbedded map:

tour cycliste 378553 - powered by Wandermap 

Member Ze mentionned also another site similar to Wandermap and worth mentioning : everytrail.com
The system is pretty similar to Wandermap, and the enbedded route looks like this :

Crest of Azet

Map your trip with EveryTrail

Creating and displaying GPX files with IGN Géoportail

Géoportail is the internet service of the french national map editor, the IGN, famous for producing some of the best maps in the world, but also their intransigence concerning copyrights. If you plan to insert french maps in your website, you should seriously consider using legal ways to do it, especially if your internet provider is in France.

IGN proves once more how much they are at the cutting edge of the mapping technology by providing interactive maps, as well as top-quality aerial photographs, by the mean of interactive APIs.
Unfortunately, and despite a well-done tutorial (https://api.ign.fr), this is quite complex to implement, and rather dedicated to experienced webmasters. Not to say impossible to make in Summitpost pages, since there is some javascript to put.
But, some other mountain-oriented portals have developped tools that allow making it in a much simplier way. You must have a basic knowledge of french keywords in order to use them, as they were made by locals, but it's quite easy.
One tool, EditGPX, was developped on the french ski-touring postal SkiTour.fr, allows creating GPX files using the IGN maps as a support :
Anoter tool, ClicGPX, on this personal website, does the same, with a wider map : Click-GPX

Once we need to display the GPX file, we need to use a different tool, VisuGPX, again by SkiTour.fr :
Try also Scrut-GPX, which is the brother of the other one, Click-GPX previously mentionned.

The advantage of VisuGPX tool, compared to Scrut-GPX, is that it stores the GPX data into its server, but first only for 2 days. In order to have it for a non-limited time, one needs to register by entering the email, but also to enter few pertinent data about the GPX route: title, activity, privacy, description. Not a big deal, but it means that if you enter a random route with uncoherent data and without a precise description, you may find it removed one of these days. Just like SP, Skitour has a certain ethic about the content.
Once the GPX is saved, the link can be used anywhere else, and the best way to enbed it into another page, just like it will be for all other forthcoming examples, is done with the HTML tag IFRAME:

IGN 1/25000 maps index
IGN map index

Don't forget to append the "&ign" at the end of the URL parameters in order to get an IGN map and not the Google Map one gets by default. Parameter iframe must also be set with 1.
It can also be fashionable to add the reference of the IGN paper map under the frame in order for the user to buy the right one for the excursion. The VisuGpx displays the link and the code of the map, which you can place under the map frame (to see this reference, open the URL with iframe=0).
VisuGpx also calculates the profile of the route, but this option is not compulsory. To hide it, one has to select a frame height of 320 instead of 520. Here is how the result looks like:

Map : 2435OT

Finally, if your circuit is of a certain interest, don't hesitate to visit the site tracegps.com, from far France's largest database of GPS tracks, to open an account and add yours.

Displaying Embedded maps and creating GPX files with Ordnance Survey

For those who don't know, the Ordnance Survey is Britain's national mapping agency. Despite being a publicly owned body, the OS, as it is often abbreviated to, is run like a business and therefore complex issues arise when it comes to reproducing its maps or publishing maps derived from its data. Although there are often talks of releasing OS maps in one form or another for free, for example a recent article in the Guardian reports that there are proposals to provide free and unlicensed maps on-line, as yet nothing has changed.

Licensing for websites has been particularly backward, with the OS attempting to retrofit licences for paper maps to digital data. This has simply resulted in confusion and a great deal of resentment from those trying to provide on-line information with good quality mapping.

So at the present time we are left with a peculiar situation. While it is possible to create GPX files based on OS data for your own personal use, it is not possible to distribute these files, freely or otherwise. Those with enough money can purchase digital data for their personal use from companies such as Memory-Map and Anquet. It is however, possible to provide embedded maps for the simple purpose of display – no routes or waypoints or anything fancy like that, just maps.

Although there are numerous ways of embedding maps, I will describe just two and as an added bonus, I will also show you where you can create your own GPX files too, just don’t go publishing them here (or anywhere else for that matter).

Embedding Maps with Get-a-map

Cwm Ogwen
Image produced from the Ordnance Survey Get-a-map service. Image reproduced with kind permission of Ordnance Survey and Ordnance Survey of Northern Ireland.
Get-a-map is perhaps the technologically least impressive way of embedding maps and is provided by the Ordnance Survey themselves. Basically all you have to do is download the map image as a JPEG and then uploaded to whatever site you want to display it on. There are rules though – the Ordnance Survey has quite a strict licensing policy – read them here - Terms and