osmin icon indicating copy to clipboard operation
osmin copied to clipboard

some *.gpx files fail to import

Open magdesign opened this issue 1 year ago • 5 comments

Some, or lets say most *.gpx tracks fail to import. when selected they throw error:

Parsing file has failed. The
format is not supported ог data
are corrupted.

however, there is a simple workaround:

Open the *.gpx file in any text editor and replace the header:

e.g. this unsupported header:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx
version="1.0"
creator="laavu.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://www.topografix.com/GPX/1/0" 
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">

with one osmin accepts:

<?xml version="1.0"?>
<gpx version="1.1" creator="GDAL 2.2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogr="http://osgeo.org/gdal" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">

and you are ready to use it in osmin.

osmin Version: 1.12.2 alpine/postmarketOS

magdesign avatar Jul 31 '24 18:07 magdesign

The required version of the GPX file should 1.1 with namespace "http://www.topografix.com/GPX/1/1". The required version for Garmin extension is v3, with namespace "http://www.garmin.com/xmlschemas/GpxExtensions/v3". Those requirements are validated at https://github.com/Framstag/libosmscout/blob/e6585b8fc0e817cb375edc96d1f46519b63366e2/libosmscout-gpx/src/osmscoutgpx/Import.cpp#L282 . We could extend the supported versions, but old versions are no longer used from a decade.

janbar avatar Aug 01 '24 07:08 janbar

I created a PR to allow importing v1.0. See https://github.com/Framstag/libosmscout/pull/1587 .

janbar avatar Aug 01 '24 09:08 janbar

The release 1.12.4 includes the patch.

janbar avatar Aug 01 '24 10:08 janbar

thanks!

magdesign avatar Aug 01 '24 13:08 magdesign

i hope this will also change other things. i having such a hard time importing gpx files, even newly created ones like this do throw an import error:

gagoulu.zip

magdesign avatar Aug 05 '24 10:08 magdesign

just compiled osmin 1.13.0 and i can import the .gpx files.

🙏 Thank you so much for fixing this! 🙏

magdesign avatar Oct 04 '24 00:10 magdesign