创建等时线

如需生成等时线,请向 generate 端点发送 HTTP POST 请求:

POST https://isochrones.googleapis.com/v1/isochrones:generate

示例:标准驾车等时线

以下请求会从华盛顿州西雅图的某个位置生成一条 5 分钟(300 秒)的平滑驾车等时线。

curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate" \
  -H "X-Goog-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "location": {
      "latitude": 47.6062,
      "longitude": -122.3321
    },
    "travel_duration": "300s",
    "travel_mode": "DRIVE",
    "routing_preference": "TRAFFIC_UNAWARE",
    "enable_smoothing": true,
    "travel_direction": "FROM"
  }'

西雅图驾驶等时线(已平滑处理)

示例:步行等时线

此请求会从罗马斗兽场附近的位置生成一条 26 分钟(1800 秒)的步行等时线。

curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate?key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "location": {
    "latitude": 41.8967068,
    "longitude": 12.4822025
  },
  "travel_duration": "1800s",
  "travel_mode": "WALK",
  "routing_preference": "TRAFFIC_UNAWARE",
  "enable_smoothing": true,
  "travel_direction": "FROM"
}'

罗马步行等时线(不含平滑处理)

示例:使用地点 ID 的驾车等时线

以下请求会生成一条 26 分钟(1800 秒)的驾车等时线,起点为金门大桥观景点。

curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate" \
  -H "X-Goog-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "place": "places/ChIJZbs2BuyGhYARE9aDfk_IKf0",
    "travel_duration": "1800s",
    "travel_mode": "DRIVE",
    "routing_preference": "TRAFFIC_UNAWARE",
    "enable_smoothing": true,
    "travel_direction": "FROM"
  }'

金门大桥驾车等时圈