Geocoding API の SearchDestinations メソッドに、目的地の詳細な駐車場情報が含まれるようになりました。このデータは、ユーザーが次の方法で移動を計画するのに役立ちます。
- 到着時に利用できる駐車施設を把握する。
- 駐車スペースを探すのにどれくらいの時間を割り当てるべきかを見極める。
駐車場情報をリクエストする
駐車場の情報を受け取るには、リクエストのフィールド マスクに destinations.parkingOptions を含める必要があります。X-Goog-FieldMask ヘッダーを使用して、レスポンスに含めるフィールドを指定します。
cURL リクエストの例
curl -X POST -d '{
"place": "places/ChIJcWnnWiz0wokRCB6aVdnDQEk"
}' \
-H 'Content-Type: application/json' \
-H "X-Goog-Api-Key: API_KEY" \
-H "X-Goog-FieldMask: destinations.primary.place,destinations.parkingOptions" \
https://geocode.googleapis.com/v4alpha/geocode/destinations
レスポンスの内容
リクエストされた場合、レスポンスの Destination オブジェクトに parkingOptions フィールドが含まれます。
parkingOptions
このオブジェクトには、目的地での駐車状況に関する詳細が含まれます。
駐車場の種類: ブール値フラグは、特定の駐車場の種類の有無を示します。
onsiteParking: 目的地に敷地内駐車場がある場合は true。freeParkingLot: 無料の駐車場がある場合は true。paidParkingLot: 有料駐車場がある場合は true。freeStreetParking: 無料の路上駐車スペースがある場合は true。paidStreetParking: 有料の路上駐車スペースがある場合は true。valetParking: バレー パーキングを利用できる場合は true。freeGarageParking: 無料の屋内駐車場がある場合は true。paidGarageParking: 有料の屋内駐車場がある場合は true。
Availability: 駐車場の見つけやすさを示す列挙型。
AVAILABILITY_UNSPECIFIED: 駐車場の空き状況に関する情報は利用できません。PLENTY: 通常、駐車場を見つけやすい。SOMEWHAT_DIFFICULT: 駐車が難しい場合があります。DIFFICULT: 駐車スペースを見つけるのが非常に難しいことが多い。
駐車施設(
parkingFacilities): 目的地に関連付けられた個別の駐車オプション(特定の屋内駐車場や駐車場など)を表すParkingFacilityオブジェクトのリスト。place: 特定の駐車場施設(place、placeId、displayName、location、formattedAddress、displayPolygonを含む)を表すPlaceView。onsite: 駐車施設が主な目的地の敷地内にある場合は true。popular: 駐車施設が、主な目的地に移動する訪問者に人気のある選択肢である場合は true。straightLineDistanceMeters: メインの目的地 からこの駐車場までの直線距離(メートル単位)。
レスポンス スニペットの例
{
"destinations": [
{
"primary": {
"place": "places/ChIJcWnnWiz0wokRCB6aVdnDQEk",
"displayName": {
"text": "Yankee Stadium",
"languageCode": "en"
}
// ... other primary place fields
},
"parkingOptions": {
"paidParkingLot": true,
"freeStreetParking": true,
"paidStreetParking": true,
"paidGarageParking": true,
"onsiteParking": true,
"parkingFacilities": [
{
"place": {
"place": "places/ChIJ8TdM8y70wokRToHbbtCEthQ",
"placeId": "ChIJ8TdM8y70wokRToHbbtCEthQ",
"displayName": {
"text": "164th St Parking Garage",
"languageCode": "en"
},
"primaryType": "parking_garage",
"formattedAddress": "164th St Parking Garage, 65 W 164th St, Bronx, NY 10452, USA",
"structureType": "POINT",
"location": {
"latitude": 40.830543999999996,
"longitude": -73.924656
}
// ... other place fields
},
"onsite": true,
"popular": false
},
{
"place": {
"place": "places/ChIJ-zvoYG71wokRElYeJWoI9GY",
"placeId": "ChIJ-zvoYG71wokRElYeJWoI9GY",
"displayName": {
"text": "River Ave. Parking Garage",
"languageCode": "en"
},
"primaryType": "parking_garage",
"formattedAddress": "River Ave. Parking Garage, 999-943 River Ave, Bronx, NY 10452, USA",
"structureType": "POINT",
"location": {
"latitude": 40.8298561,
"longitude": -73.9245919
}
// ... other place fields
},
"onsite": false,
"popular": false,
"straightLineDistanceMeters": 12.754842758178711
}
// ... other parking facilities
]
}
// ... other destination fields
}
]
}
フィードバック
これは Geocoding API の試験運用版の機能です。フィードバックがございましたら、geocoding-feedback-channel@google.com までお寄せください。