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 Map
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.
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:
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.
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 : http://www.skitour.fr/maps/ign/gpx-online.php
Anoter tool, ClicGPX, on this personal website, does the same, with a wider map : Click-GPX
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 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:
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).
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 Conditions.
Personally, I find the best way to use this facility is for embedding hyper links into to text to aid directional information. For example:
“Mynydd Mawr (SH 539 548) is located on the north western edge of the Snowdonia National Park...”
Although not encouraged, it is possible to do this with the following piece of code:
At present, Multimap offer what is by far the best way to embed Ordnance Survey maps on web pages. What’s more, it’s very easy to do.
Once on Multimap’s home page, click on the ‘find a map’ tab and zoom in on the area you wish to embed. Once zoomed in far enough the option to display an ‘OS Map’ will appear, click on this and choose the level of zoom you want. Both 1:25 000 and 1:50 000 scale maps are available. You can also place a circular ‘marker’, either by typing a location into the ‘find a map’ search bar on the left-hand side of the map window, or by right clicking on the map and selecting the ‘place red circle’ option. On the top right-hand corner of the map window are a number of options, to get the html code for an embedded map click on the ‘link option. Now a small pop-up window will appear with the option to link to the map or embed it. To get the necessary html code you will need to agree with the Terms and Conditions of use, which are less stringent than those required by the Ordnance Survey for their Get-a-map facility. Once you have agreed with the Terms and Conditions you will be able to either copy the code straight from the pop-up window, or click on a link to ‘customize and preview’ your map. Here you will be able to adjust the size and zoom of your map, as well as refine the area you want to display. Once you’re happy with the result, simply copy the html code from the customization page to your own web page, and hey presto, you have a fully scrollable Ordnance Survey map for you use.
The Ordnance Survey are currently piloting a number of services designed to make their mapping more accessible online. The first worth mentioning is Ordnance Survey Explore (Beta version). This service enables users to mark their own routes on Ordnance Survey maps and share them through the Ordnance Survey website. However, the service is somewhat limited in that routes cannot be marked on 1:25 000 maps, cannot be embedded on external websites and cannot be downloaded for use with GPS systems. Those wishing to use the information while in the mountains, or wherever they choose to be, must print out a copy of the map before setting out. Click here for an Example Route
Creating GPX Files
As I was saying, despite its complexity, OpenSpace has already yielded some great results, and one of these is www.maptogps.com, a site which allows you to crate your own GPX files based on OS mapping data.
It's remarkably simple to use. All you have to do is type in the name of the area or location you wish to plot, select the right location from a list of options and hey presto you're presented with a zoomable OS map to plot against. Once your done click on the 'Create GPX' tab and the website will automatically generate the code for you, which you can then download and save on your computer. Remember though, you are not licensed to distribute this file – it's for your personal use only.
Jelf, in his post, described a very interesting tool, which gathers all the previously mentioned possibilities, apart (from the moment...) creating directly GPX (or KMLs) from the map.
The maps provided by Mappingsupport.com are of the quality of real hiking maps, and make a very good support.
12-12-2009 update: The Gmap4 map viewer now has a detailed help file. If you take a look at the Quick Start section then you can get an idea of the kinds of things Gmap4 can help you do. http://www.mappingsupport.com/p/gmap4_help.pdf
The tool allows displaying routes over this map layer by the means of either KML files or GPX files.
12-30-2009 update: Gmap4 can now read Google MyMaps. And since Google allows you to "import" a KML file into a MyMap, this is a very quick way to put your KML files online for free.
The existence of such interactive mapping system for this little country of Central Europe, is a kind of miracle, which, contrary to most other cases here, is not the result of some big compamy, but from a little team of passionate hiking people, just like the title of their portal, hiking.sk, tells.
The north-carpathian mountainous ranges are small on the map of the world, but not by considering the density of SP contributors and contributions for it (see the "PL-SK-CZ-H Team" in the forum !). For sure, this tool will be appreciated by many.
Unfortunately, at the present, a couple of minor issues affect the tool:
- Routes do not appear on the map using IE as a navigator (which, unfortunately, still a lot of people do)
- Despite the map uses static URLs for GPX files, the wandermap links cannot be used, which, according to the author, is only a problem of variable type (hopefully solved soon !)
Let's come to the tool itself, Turisticka Mapa. Unfortunately again, one must have some basic knowledge of Slovak to understand the finality. But we quickly understand how pragmatic it is. All is in the right-top green box.
* Vrstvy => Layer
- Satelitná mapa => Satellit map
- Turistická mapa => Topo map
- Turistické značky => Touristic signs
- Chaty, útulne, salaše => Huts, shelters
- Hrady a zrúcaniny => Castle and ruins
- Fotografie => Pictures
- Geocaching skrýše => B&B accomodations, rooms
- Ubytovanie LIMBA => LIMBA Accommodations
* Vložiť GPX => Load GPX
* Hľadaj bod => Item Search
- Podľa súradnice (desatiny minút) => by coordinates (decimal minutes)
- Používajte desatinnú bodku, nie čiarku => Use the decimal dot, not comma
- Podľa súradnice (desatiny stupňa) => by coordinates (decimal degrees)
- Používajte desatinnú bodku, nie čiarku => Use the decimal dot, not comma
* Nástroje => Tools
- Zobrazovať súradnicu po kliknutí => View coordinates of clicks
- Pohyb v mape => movement on the map
- Kresli body / zmaž / GPX => draw points / delete / get GPX
- Kresli čiary / zmaž / GPX => draw a line / delete / get GPX
- Meraj vzdialenosť => measure distance
* Dalšie => More
- fórum k mape => map forum thread
This forum is in Slovak, but they have created a category for english speakers.
Let's come now to the possibilities of displaying a GPX from a static URL.
(soon, hopefully, we will be able to paste a GPX url from wandermap, and it should be possible like : http://mapy.hiking.sk/?gpx=http://www.wandermap.net/route/378553/export.gpx ).
Currently, there is no polish map layer at the quality of Polish paper maps available on internet. But, one familly of maps, different than the Google Maps and featured with few similar functionalities, has focused my attention. Despite the map quality is inferior to the Google standard, it contains all PTTK marked trails in Poland, which can turn to be useful.
Currently, there is no possibility to create neither GPX neither KML files, but the author has developped an interesting possibility to interface it with the previously mentioned Bikemap/Wandermap maps.
One needs to take the ID at the end of a route:
Using the HTML tags for the I-frames, we can embed such map easily:
Displaying embedded maps of Central Europe using OpenMaps
The Open Maps Project and turistautak.hu are two volunteer-based mapping groups who compile road and topo maps (with trails) of some Central and Eastern European countries, for GPS devices. Recently they came up with an online viewer as well, which can also be embedded to other pages. A slight drawback of this map is that you cannot permanently visualize your own gpx files on it at the moment. However, you can send your tracks to the developers, to be processed and incorporated in the map (instructions on how to do this, are available on their websites). This map is already the best available information for Hungary and Romania, and it contains a lot of information for Slovakia as well.
Embedding OpenMaps map into other pages is not so easy, but possible. To make your life easier, here's a pre-baked code below, which needs only a little customization. It is built up of three units. First comes a shelldiv tag, which defines a container for the other two compartments. Within this, there is a captiondiv, which contains the copyright info - please note that this is required by the developers of the map. Then follows the map invocation, by calling the http://mser.elte.hu/gv/Geo.php file in an iframe container and passing down several parameters to it. These parameters, conjoined by & characters, are the following:
- the size of the map area ("w=" and "h=" both in pixels);
- center coordinates of the map and zoom level ("initpos=" latitude, longitude and scale - separated by commas);
- language of the control panel ("lang=" let this be English);
- different layer options ("layers_on=" the pre-baked code below contains everything we might find useful on SP).
Implementing the example code above, you'll get the following map of Prédikálószék's area (Visegrád Mountains, Hungary). Please note that the online viewer is java-based, so visitors of the page (where you embedded OpenMaps) might be prompted to trust this java application to be able to view the map.
There is one thing that you have to adjust for your own map (position), and another one that you may want (size).
Here comes the work for you. As you see, the first two coordinates of the "initpos" parameter are the latitude and longitude. These can be easily set manually (using data from Google Earth, for example). The third component defines the scale of the map. In the example above, the scale is 1:24500, so the third number is set to 24500. Remember that the "initpos" parameter occurs twice in the code!
The code provided above renders a map area 800 pixels wide and 500 pixels high. If you wish to change this size, you'll have to change the following:
- the shell div's width: 800 parameter;
- the iframe tag's height="500" width="800" parameters;
- the map invocation's w=800 and h=500 parameters (remember that this part occurs twice in the code!)
Other maps ?
Few other parts of the world have an interactive mapping system which seems very close to get the embedding feature, and possibly the GPX routes. But where the language is kind of barrier... Any native speakers from these countries are welcome to explore deeper all possibilities !
These countries are :
- Norway, with Norgesglasset
- Switzerland, with GeoCat
- Austria, with AustrianMap
- Austria, with BergFex
- Slovenia, with Geodetska uprava
- Czech Rapublic, with Mapy.CZ
- Czech Rapublic, with Amapy.CZ