TrailAPI

फ्रीमियम
द्वारा trailapi | अपडेट किया गया 12 days ago | Travel
लोकप्रियता

9.3 / 10

लेटेंसी

1,165ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

GPX Map

Rapid account: Thiagonepo
thiagonepo
3 years ago

How do I get GPX map data? Testing the Map GPX endpoints nothing returns. I am using the map Id from trail map list API.

Rapid account: Trailapi
trailapi Commented 3 years ago

Apologies, there is a mistake in the documentation. The Map GPX endpoint needs a Map ID, not a Trail ID.

Many trails have more than one map, so first you’ll need to get a list of maps for the trail, and choose which one you want. (For example, one map might show a race course, while another is a more complete map of all the trails in a park.)

First, get a list of available maps for a trail (in this example, we’re using Trail ID 7, Captain Jack’s in Colorado):

https://trailapi-trailapi.p.rapidapi.com/trails/7/maps/

This returns:

[{“name”:“Captain Jack’s: Official Map”,“id”:“2491”,“description”:"",“updated”:“2020-06-17T12:30:19+00:00”,“elevation_gain”:“471”,“start_location”:“38.796915,-104.898390”,“distance”:“11230”},{“name”:“Captain Jack’s: Cpt jacks leg stretcher”,“id”:“17605”,“description”:"",“updated”:“2020-06-17T12:20:55+00:00”,“elevation_gain”:“458”,“start_location”:“38.798185,-104.892715”,“distance”:“8926”}]

Generally the first JSON result is the most complete map. In this case, it’s Map ID 2491. To get this GPX file, call:

https://trailapi-trailapi.p.rapidapi.com/trails/map/2491/gpx/

Note: The GPX endpoint returns a GPX-formatted file, rather than JSON data like the other endpoints.

Edit: Actually, the documentation was correct all along, though perhaps not worded clearly:

Input (id) is a map ID, not a trail ID. To get the map ID, call /maps with the trail ID.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें