יצירת איזוכרון

כדי ליצור איזוכרון, שולחים בקשת HTTP POST לנקודת הקצה generate:

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

דוגמה: איזוכרון נסיעה רגיל

הבקשה הבאה יוצרת איזוכרון נסיעה מוחלק למשך חמש דקות (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"
  }'

seattle driving isochrone with smoothing

דוגמה: איזוכרון הליכה

הבקשה הזו יוצרת איזוכרון הליכה של 26 דקות (1,800 שניות) ממיקום ליד הקולוסיאום ברומא.

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"
}'

rome walking isochrone without smoothing

דוגמה: איזוכרון נהיגה באמצעות מזהה מקום

הבקשה הבאה יוצרת איזוכרון נסיעה של 26 דקות (1,800 שניות) שמתחיל בנקודת התצפית על גשר שער הזהב.

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"
  }'

golden gate driving isochrone