Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some specific formats for GPX files are failing (500 error) #1350

Closed
bethschechter opened this issue Mar 27, 2017 · 10 comments · Fixed by #1503
Closed

Some specific formats for GPX files are failing (500 error) #1350

bethschechter opened this issue Mar 27, 2017 · 10 comments · Fixed by #1503

Comments

@bethschechter
Copy link

Steps to reproduce the error

Have .gpx (or a .xml made with a .gpx)
Go to attach it as a resource to a project

Actual behavior

Get platform error

Expected behavior

The file should be attached to the project.

//

Specific files are attached below:

gpx-xml.zip

@dpalomino
Copy link

Need more testing to find out what the root cause really is.

@clash99 clash99 self-assigned this Apr 7, 2017
@clash99
Copy link
Contributor

clash99 commented Apr 7, 2017

Investigation:

  • GPX file can be successfully uploaded if all points are contained in same track segment.
  • GPX file can be successfully uploaded if multiple tracks are in same file <trk>.
  • GPX file gets platform error if multiple track segments <trkseg> exist within same <trk>.

OK

<trk>
    <trkseg>
        <trkpt>
        </trkpt>
    </trkseg>
</trk>

OK

<trk>
    <trkseg>
        <trkpt>
        </trkpt>
    </trkseg>
</trk>
<trk>
    <trkseg>
        <trkpt>
        </trkpt>
    </trkseg>
</trk>

NOT OK

<trk>
    <trkseg>
        <trkpt>
        </trkpt>
    </trkseg>
    <trkseg>
        <trkpt>
        </trkpt>
    </trkseg>
</trk>

@dpalomino
Copy link

Thanks for testing @clash99! @bjohare, do you think this would be something difficult to fix?

@oliverroick
Copy link
Member

Here's the corresponding error log

@dpalomino
Copy link

We need to do some more research to know if this is a valid format, and how partner managed to have this GPX file. GPX file should not be modified in the way.

@bjohare can you please take a look, and see why this format is breaking the platform?

@clash99
Copy link
Contributor

clash99 commented Apr 12, 2017

According to the GPX 1.1 spec, a track with multiple track segments is a correct format.

A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.

If I upload the attached "broken" gpx file to a visualizer, I can see a path:

screenshot 2017-04-12 12 45 47

@SteadyCadence
Copy link

Thanks @clash99. It sounds to me like we need logic in Cadasta that connects the track segments if they are in track tags together.

@dpalomino
Copy link

Has to do with the specific format, @bjohare can you please take a look when you have a moment?

@dpalomino dpalomino changed the title Attaching .gpx or .xml as a resource produces a platform error Some specific formats for GPX files are failing (500 error) Apr 26, 2017
@SteadyCadence
Copy link

SteadyCadence commented Jun 2, 2017

I get no error or map layer when I upload this file in staging:
convertToGPX.txt

  • GH doesnt let me upload .gpx so I converted to .txt

I converted it from .gdb to .gpx in GPS Babel. Our partner in Thailand saves mostly in .gdb.... I think we will have to write a script to convert. It would be good to know what is accepted or not since the gpx doesnt seem to load.

@SteadyCadence
Copy link

Sounds like it works with @bjohare's changes! Awesome Sauce.

amplifi pushed a commit that referenced this issue Jun 13, 2017
* Fix for #1350: Add support for GPX tracks with multiple segments

* Remove gpx parse exception logging

* Possible fix for gpxpy logging issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants