#!/usr/bin/perl
####################################################################################
#
# convert ape@map tracks (see http://www.apemap.de/) to gpx format
# v2012-07-22 by peter@grobner.at
use Date::Format;
# [track]
# (48.35936737060547,15.608397483825684)
# (48.35501480102539,15.61263656616211)
# --start--
# (48.35501480102539,15.61263656616211,272.0,1342942134)
my $REAL='-?\d+\.\d+';
my $INT = '\d+';
while(<>)
{
if(/\(($REAL),($REAL),($REAL),($INT)\)/)
{
my($lat,$lon,$ele,$sec)=($1,$2,$3,$4); my $time=time2str('%Y-%m-%dT%H:%M:%SZ',$sec);
push @trkpt,qq{
$ele
}
}}
printf <
%s
END_OF_GPX
,join '',@trkpt;