GraphHopper.com | Forum | GitHub | Maps | Blog

Can't load GPX file


#1

Hi, I’ve got the GraphHopper web server up and running, and it accepts my GPX files through the UI. However, when I send the same GPX files via a command line CURL, I get “HTTP error 415: Unsupported Media Type” as the return data.

I am running the Web server from within IntelliJ on Windows, and when I send the CURL command I see the text “127.0.0.1 - - [30/May/2018:13:57:24 +0000] “POST /match?vehicle=foot&type=json&traversal_keys=true&gps_accuracy=100 HTTP/1.1” 415 56 “-” “curl/7.49.0” 10” in the log/console output, so I know the request is getting to the server via this route.

My curl command is:
curl -XPOST -H “Content-Type:Application/gpx+xml” -d “@C:\Temp\connectiongpx\4225272863885359.gpx” localhost:8989"/match?vehicle=foot&type=json&traversal_keys=true&gps_accuracy=100">c:\temp\connectiongpx\4225272863885359.json

This generates DOS output of:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 863 100 56 100 807 170 2452 --:–:-- --:–:-- --:–:-- 2452

The GPX file I’m using contains the following:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gpx version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
    <trk>
        <name>4225272863885359</name>
        <trkseg>
            <trkpt lat="33.089987" lon="-96.817317">
                <time>2018-03-23T15:21:47Z</time>
            </trkpt>
            <trkpt lat="33.089987" lon="-96.817317">
                <time>2018-03-23T15:21:48Z</time>
            </trkpt>
            <trkpt lat="33.087059" lon="-96.823142">
                <time>2018-03-23T15:21:58Z</time>
            </trkpt>
            <trkpt lat="33.087059" lon="-96.823142">
                <time>2018-03-23T15:21:58Z</time>
            </trkpt>
        </trkseg>
    </trk>
</gpx>

After reading several stackoverflow posts, I’ve tried various iterations of replacing the double quotes with escaped characters to no avail.

Can anyone help?