gpx2map
rev. 340

Download

Get latest version: gpx2map rev. 340

If you browse this file locally, please look at the homepage of gpx2map: http://sethdepot.org/gpx2map


Overview

gpx2map reads a gps track in GPX format (as produced by e.g. gpsbabel) and writes out an Google Map, a Yahoo Map or OpenStreetMaps mash-up containing the route and a height profile.

It comes very handy when you e.g. own an Garmin eTrex and want to know where you wandered around last time. Then you just use gpsbabel to fetch your tracks in GPX format and let gpx2map write out an map overlay for you.

License

HTML Include is put under the GNU General Public License.

    gpx2map
    Copyright (C) 2007-2009 Robert Lange
    robert.lange@s1999.tu-chemnitz.de

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

Requirements

First of all Perl itself is needed, but also some packages from CPAN.
The CPAN-Modules can be found at http://search.cpan.org

For Geo::Distance no pre-packaged version was available at the time of gpx2map development. Thus, there is an special work-around available: When Geo::Distance is not found globally, then as a second try it is searched in the directory cpan/ below the executable. When you have Geo::Distance installed at your system then you can safely delete the directory cpan/ in the distribution.

Chart::Gnuplot is required for drawing the height graph. When you don't want to use this feature this package is not needed.

gpx2map is likely to work also with other versions than the one mentioned here. When you encounter problems just drop me a note.

Installation

Just copy (or link) the file gpx2map into your path or any place you like.
Put the mash-up template files gpx2map.google.template, gpx2map.osm.template and gpx2map.yahoo.template where you put gpx2map itself (not to the link, in case you linked it).

When you don't have the CPAN module Geo::Distance installed then you also need to place the sub-directory cpan/ below the location you put gpx2map into. See also section Requirements.

Finally, you need to configure gpx2map to use your own Yahoo Maps API key in case you really want to use the Yahoo Maps Interface (which is currently broken anyway). Otherwise you won't be able to see your route pages online. See section Configuration.

Operation

The input file formal is GPX. You can get this e.g. by gpsbabel (gpx2map includes a shortcut for calling gpsbabel).
gpx2map then reads the GPX file and writes out a html page containing either an Google, OpenStreetMaps or Yahoo Map mash-up.

An GPX file can contain several tracks. You can select to write out only one specific track, merge all track points together or create one html file for each track.

Program Options

gpx2map [--help|-h] [--version|-V] [--route|-r route] [--merge]
[--title|-t title] [--osm|-o] [--yahoo|-y] [--[no]height] inputfile

--help, -h Help screen
--version, -V Version
--osm, -o Create OpenStreetMaps Mash-Up
--yahoo, -y Create Yahoo Mash-Up (currently broken)
Default is Google Mash-Up
--title, -t <title> Title of web page, when not specified use route name (or leave empty)
--route, -r <route> Route to read
--merge Use all points from all routes in gpx file
--height|--noheight Enable (Default) or Disable height profile
inputfile GPX file to read
Can be compressed with gzip or bzip2

Output format is Google maps, unless --osm or --yahoo is given.
When neither --route nor --merge are specified, create individual web pages for each route.

Output is written to <inputfile_without_suffix>[.<route>].html

gpsbabel

For your convenience gpsbabel can be invoked over gpx2map. Just use the following command line:

gpx2map --babel outfile

Configuration

You can change certain settings of gpx2map operation in the header of the executable. Just search for "global settings".

In case you want to try out (or fix) the currently broken Yahoo interface you certainly want to change the Yahoo Maps API key. It's required when you want to upload the html pages to a server. Otherwise the API refuses to work.
Google recently (End of 2009) dropped the API key requirement in their Version 3 API.

Most common settings - the others are documented in the script itself:

map_key_yahoo
Yahoo API Map key - just apply at Yahoo
map_line_dist
Distance between Polyline points, in kilometer
map_points_dist
Distance between mapping points in kilometer. Must be a multiple of map_line_dist
height_diff
Height difference between height diagram points in meter. The more accurate your GPS records height information, the smaller value you can use here (and vice versa)
gpsbabel_cmd
Call to gpsbabel, without output file name. The shell tokens are split up into fields.
You most certainly need to change here to use gpsbabel with gpx2map.

Examples

GPX File Google Output OSM Output
ischgl.xml ischgl-google.html ischgl-osm.html
juh.xml juh-google.html juh-osm.html
monte_viso.gpx monte_viso-google.html monte_viso-osm.html
italy_hiking.xml Monte Baldo
Vesio
Brenta Dolomites

Known Issues

The browser compatibility could be improved.
gpx2map generated pages are tested sucessfully with Firefox 2 and 3, with most other (older) browsers you can expect drawbacks.

Secondly the Yahoo Maps mash-up is currently broken and most probably won't be fixed, because I myself don't use it at all. You're welcome to provide me an updated template file to use with gpx2map.

To run gpx2map on windows probably have to make the following adaptions:
In the sub height_profile_image add the line: $filename =~ s{\\}{/}g;
In Gnuplot.pm, sub _execute, replace the line my $gnuplot = 'gnuplot'; with
my $gnuplot = 'C:/gnuplot/bin/pgnuplot.exe';

When you want to contribute to gpx2map you're warmly welcome. Just contact me.

Author and Credits

The author is Robert Lange <robert.lange@s1999.tu-chemnitz.de>
If you have any questions, just write me.

The home page of gpx2map is http://sethdepot.org/gpx2map
Please look there for new versions.


created by rola Valid HTML 4.0! last modification: 2009-10-20
$LastChangedRevision: 344 $
$LastChangedDate: 2009-10-25 14:28:04 +0100 (Sun, 25 Oct 2009) $