http://www.mapquestapi.com/daas/v1/trace
Response Formats | JSON, XML, CSV |
---|---|
Authentication | Yes (Requires Key) |
Rate Limited | Yes |
The endpoint for GPS observations allows clients to curate the stream of information by defining predicates expressed as query parameters. Currently, query parameters are available to perform filtering on attributes such as location (bounding box) and speed.
Request Parameter | Description | Required? |
---|---|---|
key String |
The API Key, which is needed to make requests to MapQuest services. | Yes |
Bounding Box Predicate | ||
bbox Numeric |
Provides the capability of filtering observation data by a geographic bounding box
expressed as the bottom left and top right corners of a rectangle. The format is xmin,ymin,xmax,ymax. These values must be provided in decimal degrees. Example
|
No |
Speed Predicates | ||
speed speed.eq Numeric |
Provides the capability of filtering observation data by exact speed expressed in
kph.
Example
|
No |
speed.gt Numeric |
Provides the capability of filtering observation data by speed (expressed in kph)
greater than the user supplied value.
Example
|
No |
speed.ge Numeric |
Provides the capability of filtering observation data by speed (expressed in kph)
greater than or equal to the user supplied value.
Example
|
No |
speed.lt Numeric |
Provides the capability of filtering observation data by speed (expressed in kph)
less than the user supplied value.
Example
|
No |
speed.le Numeric |
Provides the capability of filtering observation data by speed (expressed in kph)
less than or equal to the user supplied value.
Example
|
No |
Note: | Multiple speed predicates (above) can be use to form range-based queries
to be able to return records where the speed is (either inclusively or exclusively)
between a minimum and maximum value.
Example
|
The streaming service allows the rendering of data in a variety of formats. Each observation is returned as a single line followed by a newline character. A client application can request a specific format to render each observation by using standard HTTP request headers to perform the necessary content negotiation. The default format for returning GPS observation data is GeoJSON when no content negotiation is requested.
Format | Content Negotiation | Description | Default |
---|---|---|---|
GeoJSON | Accept: application/json | Observation data is returned as an GeoJSON Feature document. | Yes |
XML | Accept: application/xml | Observation data is returned as an XML document. | No |
CSV | Accept: application/csv | Observation data is returned as a series of comma-separated fields. | No |
The default response for GPS observations provides access to the data elements described in the Basic Attribution section. All information is anonymized for privacy, however, data points related to the same session can still be collated using the transaction_id to form a line string or ribbon representing the route.
Response Field | Description | |
---|---|---|
Basic Attribution | ||
transaction_id String |
A UUID identifying a distinct routing session.
Format Regex:
|
|
observed_at Long |
The UNIX epoch time stamp detailing when the observation was made of the device. | |
received_at Long |
The UNIX epoch time stamp detailing when the observation was reported to MapQuest. | |
longitude Decimal |
The x-coordinate expressed in decimal degrees.
Constraint:
Values between -180 and 180.
|
|
latitude Decimal |
The y-coordinate expressed in decimal degrees.
Constraint:
Values between -90 and 90.
|
STREAM
http://www.mapquestapi.com/daas/v1/trace?key=KEY&speed.ge=0&speed.lt=161
{
"type": "Feature",
"properties": {
"transaction_id": "E1AD1BD4-0B59-4DA2-956B-9B398A1DB013",
"observed_at": 1456951468,
"received_at": 1456951472
},
"geometry": {
"type": "Point",
"coordinates": [
-119.682464,
36.75068
]
}
}
<trace>
<transaction_id>E1AD1BD4-0B59-4DA2-956B-9B398A1DB013</transaction_id>
<observed_at>1456951468</observed_at>
<received_at>1456951472</received_at>
<latitude>36.75068</latitude>
<longitude>-119.682464</longitude>
</trace>
received_at,observed_at,transaction_id,latitude,longitude
1456951468,1456951472,E1AD1BD4-0B59-4DA2-956B-9B398A1DB013,36.75068,-119.682464