Bug#960202: rel2gpx: add ROLE to gpx outfile

Andreas Barth aba at ayous.org
Sun May 10 15:44:05 BST 2020


Package: rel2gpx
Tags: patch
Severity: minor
Version: 0.27-2

Hi,

for my usecase I need the role of elements to be present in the gpx,
so I added them as type. Please see the patch below in case it's
usefull for anyone else (and of course, if another gpx tag is more
appropriate, please use that one).


Regards,
Andi


diff --git a/rel2gpx.pl b/rel2gpx.pl
index b4a4fb7..5997554 100755
--- a/rel2gpx.pl
+++ b/rel2gpx.pl
@@ -1373,7 +1373,9 @@ EOF
          if ($way->isOneway){
             $trkName .= "_Oneway";
          }
-         print OUTFILE "<trk>\n<name>".$trkName."</name>\n<trkseg>\n";
+         print OUTFILE "<trk>\n<name>".$trkName."</name>\n";
+         print OUTFILE "<type>".$way->{ROLE}."</type>\n" if $way->{ROLE};
+         print OUTFILE "<trkseg>\n";
          for (my $k = 0; $k < $way->nodes; $k++){
             my $lat = $way->lat($k);
             my $lon = $way->lon($k);



More information about the Pkg-grass-devel mailing list