Package google.maps.geocode.v4beta

索引

GeocodeService

用於執行地理編碼的服務。

GeocodeAddress

rpc GeocodeAddress(GeocodeAddressRequest) returns (GeocodeAddressResponse)

這個方法會執行地址地理編碼,將地址對應至 LatLng。並提供地址的結構化資訊。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/maps-platform.geocode
  • https://www.googleapis.com/auth/maps-platform.geocode.address
GeocodeLocation

rpc GeocodeLocation(GeocodeLocationRequest) returns (GeocodeLocationResponse)

這個方法會執行位置地理編碼,將 LatLng 對應至地址。並提供地址的結構化資訊。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/maps-platform.geocode
  • https://www.googleapis.com/auth/maps-platform.geocode.location
GeocodePlace

rpc GeocodePlace(GeocodePlaceRequest) returns (GeocodeResult)

這個方法會使用地點 ID 執行地理編碼查詢。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/maps-platform.geocode
  • https://www.googleapis.com/auth/maps-platform.geocode.place

GeocodeAddressRequest

GeocodeService.GeocodeAddress 的要求訊息。

欄位
location_bias

LocationBias

(非必要) 要搜尋的區域。這個位置會做為偏差,也就是說,系統可能會傳回指定位置附近的結果。

language_code

string

(非必要) 應傳回結果的語言。

region_code

string

(非必要) 區碼。區碼,採 ccTLD (「頂層網域」) 的兩位字元值 這個參數會根據適用法律影響搜尋結果。這個參數也會影響服務的結果,但不會完全限制結果。

聯集欄位 address_input。要進行地理編碼的地址。address_input 只能是下列其中一項:
address_query

string

要進行地理編碼的非結構化地址。

address

PostalAddress

以郵寄地址格式,將要地理編碼的結構化地址。

LocationBias

要搜尋的區域。這個位置會做為偏差,也就是說,系統可能會傳回指定位置附近的結果。

欄位
聯集欄位 type。位置偏誤的類型。type 只能是下列其中一項:
rectangle

Viewport

由東北角和西南角定義的矩形框。rectangle.high() 必須是矩形檢視區的東北點。rectangle.low() 必須是矩形檢視區的西南點。rectangle.low().latitude() 不得大於 rectangle.high().latitude()。這會導致經度範圍為空白。矩形檢視區的寬度不得超過 180 度。

GeocodeAddressResponse

GeocodeService.GeocodeAddress 的回應訊息。

欄位
results[]

GeocodeResult

地理編碼結果。

GeocodeLocationRequest

GeocodeService.GeocodeLocation 的要求訊息。

欄位
language_code

string

(非必要) 傳回結果時應使用的語言。

region_code

string

(非必要) 區碼。區碼,採 ccTLD (「頂層網域」) 的兩位字元值 這個參數會根據適用法律影響搜尋結果。

types[]

string

(非必要) 一組用於限制結果的類型代碼。系統會移除沒有任何指定類型的結果。

如需可能值的完整清單,請參閱 https://developers.google.com/maps/documentation/places/web-service/place-types 中的表格 A 和表格 B。

granularity[]

Granularity

(非必要) 一或多個位置精細度列舉的篩選器。

聯集欄位 location_input。要進行地理編碼的位置。location_input 只能是下列其中一項:
location_query

string

位置的格式為「lat,lng」字串。例如「64.7611872,-18.4705364」。

location

LatLng

結構化格式的地點。

GeocodeLocationResponse

GeocodeService.GeocodeLocation 的回應訊息。

欄位
results[]

GeocodeResult

地理編碼結果。

plus_code

PlusCode

要求中位置的 Plus Code。

GeocodePlaceRequest

GeocodeService.GeocodePlace 的要求訊息。

欄位
place

string

必要欄位。地點 ID,格式為 places/{place}。

language_code

string

(非必要) 傳回結果時應使用的語言。

region_code

string

(非必要) 區碼。區碼,採 ccTLD (「頂層網域」) 的兩位字元值 這個參數會根據適用法律影響搜尋結果。

GeocodeResult

地理編碼結果包含地點的地理資訊。

欄位
place

string

這個結果的完全符合規定的地點 ID。格式為「//places.googleapis.com/places/{placeID}」。詳情請參閱 https://developers.google.com/maps/documentation/places/web-service/place-id

place_id

string

這個結果的地點 ID。

location

LatLng

這個地址的 latlng。

granularity

Granularity

位置的精細程度。

viewport

Viewport

適合顯示地理編碼結果的可視區域。

bounds

Viewport

地址的邊界框。

formatted_address

string

格式正確的單行地址。

postal_address

PostalAddress

地址的郵政地址格式。

address_components[]

AddressComponent

各個地區層級的重複元件。

postal_code_localities[]

LocalizedText

郵遞區號內含的完整縣市清單。

只有在結果的類型為「postal_code」時,才會填入這個值。

types[]

string

此結果的類型標記組合。例如「political」和「administrative_area」。

如需可能值的完整清單,請參閱 https://developers.google.com/maps/documentation/places/web-service/place-types 中的表格 A 和表格 B。

plus_code

PlusCode

這個地理編碼中的位置 Plus Code。

AddressComponent

形成格式化地址的結構化元件 (如果有這項資訊的話)。

欄位
long_text

string

地址元件的完整文字說明或名稱。舉例來說,澳洲的國家/地區地址元件長名稱為「Australia」。

short_text

string

地址元件的縮寫文字名稱 (如有)。舉例來說,澳洲的地址元件可能有「AU」這個簡稱。

types[]

string

這個陣列會指出地址元件的類型。

詳情請參閱 https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types

language_code

string

用於格式化此元件的語言,以 CLDR 符號表示。

精細程度

位置的精細程度。

列舉
GRANULARITY_UNSPECIFIED 請勿使用。
ROOFTOP 與比對地址相對應的實際地塊非內插位置。
RANGE_INTERPOLATED 從街道號碼範圍內插。舉例來說,如果我們知道 Amphitheatre Pkwy 的某個區段包含 1600 到 1699 之間的數字,那麼 1650 可能會位於兩個端點的中間。
GEOMETRIC_CENTER 我們擁有多邊形資料的地圖項目幾何中心。
APPROXIMATE 其他所有內容。

PlusCode

Plus Code (http://plus.codes) 是一種位置參照,有兩種格式:全球代碼定義 14 公尺 x 14 公尺 (1/8000 度) 或更小的矩形,複合代碼則會將前置字元替換為參照位置。

欄位
global_code

string

地點的全球 (完整) 代碼,例如「9FWM33GV+HQ」,代表 1/8000 度 x 1/8000 度 (約 14 公尺 x 14 公尺) 的面積。

compound_code

string

地點的複合代碼,例如「33GV+HQ, Ramberg, Norway」,包含全球代碼的後置字串,並將前置字串替換為參考實體的格式化名稱。