Amap Maps Post V4 Grasproad Driving

1.00 credits/call
ae_amap_maps_post_v4_grasproad_driving

Correct a recorded driving trajectory against actual roads using Amap (高德). Supply request_body as a native JSON array of at most 500 points, not a string or a points wrapper object. Every point must include x and y (GCJ-02 longitude and latitude, up to six decimal places; longitude −180 to 180 and latitude −90 to 90), sp (speed in km/h), ag (heading relative to true north), and integer tm. For the first point, tm is a Unix timestamp in seconds; for later points, it is the number of seconds relative to the first point. Speed should reflect the movement, and zero or unreasonable headings may affect the result. The response provides corrected x/y coordinates in data.points and distance in data.distance, along with errcode, errmsg, and error detail errdetail when present. Business success requires errcode = 0, not merely HTTP 200. This is trajectory correction, not destination-to-destination route planning.

Maps
1.00 credits/call

Pricing

1.00 credits/call
ConditionCharge
Each call1.00 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
request_bodyarrayYes必填的轨迹点原生 JSON 数组,最多 500 个点;该数组直接作为 application/json 请求体发送,不是 JSON 字符串,也不要包装为 points 对象。每点必须包含 x、y(GCJ-02 经度、纬度)、sp(速度,km/h)、ag(设备方向与正北的夹角)和 tm(整数秒)。第一点的 tm 为 Unix 秒时间戳;后续各点的 tm 为相对第一点的秒数,而不是各点的绝对时间戳,也不是相邻两点的时间差。例如第一点 tm=1478031031、第二点 tm=2 表示第二点发生在第一点之后 2 秒。—
request_body[].xnumberYesGCJ-02 经度,最多六位小数。—
request_body[].ynumberYesGCJ-02 纬度,最多六位小数。—
request_body[].agnumberYes设备方向与正北的夹角;0 或不合理值可能影响纠偏结果。—
request_body[].spnumberYes速度,km/h,须与轨迹移动情况相符。—
request_body[].tmintegerYes第一点为 Unix 秒时间戳;其余点为相对第一点的秒数。—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_amap_maps_post_v4_grasproad_driving' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "request_body": [
      {
        "ag": 0,
        "sp": 19,
        "tm": 1478031031,
        "x": 116.478928,
        "y": 39.997761
      },
      {
        "ag": 0,
        "sp": 10,
        "tm": 2,
        "x": 116.478907,
        "y": 39.998422
      },
      {
        "ag": 110,
        "sp": 10,
        "tm": 3,
        "x": 116.479384,
        "y": 39.998546
      },
      {
        "ag": 120,
        "sp": 10,
        "tm": 4,
        "x": 116.481053,
        "y": 39.998204
      },
      {
        "ag": 120,
        "sp": 10,
        "tm": 5,
        "x": 116.481793,
        "y": 39.997868
      },
      {
        "ag": 30,
        "sp": 10,
        "tm": 6,
        "x": 116.482898,
        "y": 39.998217
      },
      {
        "ag": 30,
        "sp": 10,
        "tm": 7,
        "x": 116.483789,
        "y": 39.999063
      },
      {
        "ag": 30,
        "sp": 10,
        "tm": 8,
        "x": 116.484674,
        "y": 39.999844
      }
    ]
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "data": {
    "distance": 696.0,
    "points": [
      {
        "x": 116.47893348907736,
        "y": 39.9977610347501
      }
    ]
  },
  "errcode": 0,
  "errdetail": null,
  "errmsg": "OK",
  "ext": null
}

This example shows part of the response. Copied content is valid JSON.