Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Batch uploaded GPX-files in a zip-file, not showing up in Potlatch 2 #128

Open
magu01 opened this issue Dec 6, 2019 · 5 comments
Open

Comments

@magu01
Copy link

magu01 commented Dec 6, 2019

I zipped a bunch of gpx-files as mentioned in this link.
https://wiki.openstreetmap.org/wiki/Batch_Upload_of_GPX_(various_tools)

But when i try to load the trace in Potlatch 2 I can't see the trace. Potlatch is not showing any trace.

This is the trace.
https://www.openstreetmap.org/user/magu01/traces/3161726

The API is allready in place and the problem was discused in this breport.
openstreetmap/openstreetmap-website#2455

@magu01
Copy link
Author

magu01 commented Dec 6, 2019

tomhughes
"I suspect the problem is that editors don't cope with the slightly odd way we return the data, which is basically by concatenating all the files, and they are at best only parsing the first XML document they see."

@systemed
Copy link
Owner

systemed commented Dec 6, 2019

Yes, that's probably the case. The document that P2 fetches is http://www.openstreetmap.org/api/0.6/gpx/3161726/data.xml . This contains several XML documents appended together, and if you run it through an XML validator it'll squawk:

richard$ xmllint /Users/richard/Downloads/3161726.xml 
/Users/richard/Downloads/3161726.xml:378: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0" encoding="UTF-8"?>
     ^
/Users/richard/Downloads/3161726.xml:379: parser error : Extra content at the end of the document
<gpx
^

Most probably the Flash XML parser is deciding that it's an invalid document and refusing to parse any of it.

@magu01
Copy link
Author

magu01 commented Dec 6, 2019

Can you make a check if its muliple xmls and splitting it before sending it to the parser? If not, how do you suggest its solved?

@systemed
Copy link
Owner

systemed commented Dec 6, 2019

Sure - the string could be split on loading and then each XML document processed individually. It's not something I'm likely to work on any time soon but I'll leave this open in case anyone else wants to. process() in halcyon/connection/Trace.as would be the place to start looking.

Or you could just merge the source files into one .gpx with GPSBabel: https://stackoverflow.com/questions/38554131/merge-all-gpx-files-within-a-folder-into-one-file-with-gpsbabel

@magu01
Copy link
Author

magu01 commented Dec 6, 2019

Thanks for the link! Sounds good that you keep the case open. A good feature if it works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants