Bug#990641: gpsprune: Cannot load gpx file from OSm route manager (due to blank lines)

Wookey wookey at debian.org
Sat Jul 3 16:23:37 BST 2021


Package: gpsprune
Version: 20.2-1
Severity: normal
Tags: upstream

If I generate a gpx file with 'OSM Route manager', specifically the Ceredigion Coast path
https://osmrm.openstreetmap.de/relation.jsp?id=1806040

when I try to load it with GPSprune it says:
"Error reading file: The processing instruction target matching '[xX][mM][lL]' is not allowed." 

This is quite a cryptic error.

If try 'Import file with GPSbabel' instead I get the somewhat more helpful
"GPX Read error: 'XML declaration not at start of document.
"File: /tmp/Ceredigion+Coast+Path.gpx" Line: 13 column: 55'

Looking at the file (attached) it has 12 leading blank lines. (0x0A
unix linefeeds). Looks like GPSprune is expecting the xml header to be
on the first line.

If you remove those 12 lines then the file loads as expected.

Now I presume that GPSprune is following the gpx spec, but perhaps it
could be forgiving of leading whitespace? Certainly it could give a more
useful error message of the form 'Could not load file <name>: invalid
GPX file'.

I had a look at the gpx spec, and the schema is here:
https://www.topografix.com/GPX/1/1/gpx.xsd but I guess that whether
the xml line must be on the very first line is actually part of the
XML spec. I failed to find a simple validator I could run to check whether 

The codebase for OSMRM is here:
https://github.com/osmrmhv/osmrmhv/issues so it you are happy that
GPSprune is correct to reject this file then I guess I should file an
issue there instead.

--
Wookey



More information about the Pkg-grass-devel mailing list