http://open.mapquestapi.com/elevation/v1/profile
Response Formats | JSON, XML |
---|---|
Authentication | Yes (Requires Key) |
Rate Limited | Yes |
Request Parameter | Description | Required? |
---|---|---|
key | The API Key, which is needed to make requests to MapQuest services. |
Yes |
latLngCollection
String/JsonArray |
Collection of latitude/longitude pairs for a given route which may be in raw or compressed format. A route session Id may be used in place of this parameter. | Yes |
sessionId |
The Route Session Id can be used in place of a latLngCollection to get the lat/lng positions for an elevation profile request. The session will expire after 30 minutes. Please also see the Advanced Routing and Options Parameters |
No - May be used in place of a latLngCollection |
inFormat | Specifies the format of the request. The JSON-formatted input text must be supplied as either the "json" parameter of an HTTP GET, or as the BODY of an HTTP POST. If this parameter is "xml", the XML-formatted input text must be supplied as either the "xml" parameter of an HTTP GET, or as the BODY of an HTTP POST. Must be one of the following, if supplied:
Defaults to "json" if not supplied |
No |
shapeFormat
String |
Shape format options. This value represents the input and output format for the shape points. Default behaviour of the service is to return all the input shape points in the response.
See the Compressed Lat/Lng description page for more detail, including sample source code and an interactive encoder/decoder. |
No |
inShapeFormat
String |
Input Shape format options. Overrides the given "shapeFormat" value for input shape
points.
See the Compressed Lat/Lng description page for more detail, including sample source code and an interactive encoder/decoder. |
No |
outShapeFormat
String |
Output Shape format options. Overrides the given "shapeFormat" value for output shape
points in the response.
See the Compressed Lat/Lng description page for more detail, including sample source code and an interactive encoder/decoder. |
No |
unit
String |
Specifies the type of units to use when calculating elevation profile. Acceptable values
are:
Default value is |
No |
useFilter
Boolean |
This is a bilinear filter (a smoothing function) that is used when sampling height data.
This option will use the lat/lng and look at the four closest lat/lng pairs and weigh them
inversely.
Default = |
No |
outFormat | Specifies the format of the response. Must be one of the following, if supplied:
Defaults to |
No |
cyclingRoadFactor | See the Advanced Routing and Options Parameters | No |
roadGradeStrategy | See the Advanced Routing and Options Parameters | No |
GET
http://open.mapquestapi.com/elevation/v1/profile?key=KEY&shapeFormat=raw&latLngCollection=39.74012,-104.9849,39.7995,-105.7237,39.6404,-106.3736
{
"shapePoints":[
39.74012,
-104.9849,
39.7995,
-105.7237,
39.6404,
-106.3736
],
"elevationProfile":[
{
"distance":0,
"height":1616
},
{
"distance":63.5583,
"height":3910
},
{
"distance":121.9561,
"height":2501
}
],
"info":{
"copyright":{
"text":"© 2018 MapQuest, Inc.",
"imageUrl":"http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText":"© 2018 MapQuest, Inc."
},
"statuscode":0,
"messages":[
]
}
}
<elevationResponse>
<distanceHeightCollection>
<distanceHeight>
<distance>0.0</distance>
<height>1616.0</height>
</distanceHeight>
<distanceHeight>
<distance>63.5583</distance>
<height>3910.0</height>
</distanceHeight>
<distanceHeight>
<distance>121.9561</distance>
<height>2501.0</height>
</distanceHeight>
</distanceHeightCollection>
<shapePoints>
<latLng>
<lat>39.74012</lat>
<lng>-104.9849</lng>
</latLng>
<latLng>
<lat>39.7995</lat>
<lng>-105.7237</lng>
</latLng>
<latLng>
<lat>39.6404</lat>
<lng>-106.3736</lng>
</latLng>
</shapePoints>
<info>
<info>
<statusCode>0</statusCode>
<messages/>
<copyright>
<imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>
<imageAltText>© 2018 MapQuest, Inc.</imageAltText>
<text>© 2018 MapQuest, Inc.</text>
</copyright>
</info>
</info>
</elevationResponse>