Bug#990641: gpsprune: Cannot load gpx file from OSm route manager (due to blank lines)
Sebastiaan Couwenberg
sebastic at xs4all.nl
Sat Jul 3 16:39:58 BST 2021
forwarded 990641 https://github.com/activityworkshop/GpsPrune/issues/38
thanks
On 7/3/21 5:23 PM, Wookey wrote:
> 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.
gpsprune could be more liberal in what it accepts, but rejecting bad
data is fine IMHO too.
This is not something that will be addressed by the package maintainer,
hence the issue has been forwarded upstream.
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
More information about the Pkg-grass-devel
mailing list