Method: geocode.location.geocodeLocation
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วิธีนี้จะดำเนินการ Geocode ตำแหน่ง ซึ่งจะแมป LatLng กับที่อยู่ นอกจากนี้ยังให้ข้อมูลที่มีโครงสร้างเกี่ยวกับที่อยู่ด้วย
คำขอ HTTP
GET https://geocode.googleapis.com/v4beta/geocode/location
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
languageCode |
string
ไม่บังคับ ภาษาที่ควรแสดงผลลัพธ์
|
regionCode |
string
ไม่บังคับ รหัสภูมิภาค รหัสภูมิภาคที่ระบุเป็นค่า ccTLD ("โดเมนระดับบนสุด") 2 อักขระ พารามิเตอร์นี้จะส่งผลต่อผลลัพธ์ตามกฎหมายที่เกี่ยวข้อง
|
types[] |
string
ไม่บังคับ ชุดแท็กประเภทเพื่อจำกัดผลลัพธ์ ระบบจะนำผลลัพธ์ที่ไม่มีประเภทที่ระบุออก ดูรายการค่าที่เป็นไปได้ทั้งหมดได้ที่ตาราง ก. และตาราง ข. ใน https://developers.google.com/maps/documentation/places/web-service/place-types
|
granularity[] |
enum (GeocodeResult.Granularity )
ไม่บังคับ ตัวกรองของ Enum ความละเอียดของสถานที่อย่างน้อย 1 รายการ
|
พารามิเตอร์ Union location_input สถานที่ตั้งที่จะเข้ารหัสพิกัดภูมิศาสตร์ location_input ต้องเป็นค่าใดค่าหนึ่งต่อไปนี้เท่านั้น |
locationQuery |
string
ตำแหน่งในรูปแบบสตริง "lat,lng" เช่น "64.7611872,-18.4705364"
|
location |
object (LatLng )
สถานที่ตั้งในรูปแบบที่มีโครงสร้าง
|
เนื้อความของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ GeocodeLocationResponse
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต 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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[],[],null,["# Method: geocode.location.geocodeLocation\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nThis method performs a location geocode, which maps a LatLng to an address. It also provides structured information about the address.\n\n### HTTP request\n\n`GET https://geocode.googleapis.com/v4beta/geocode/location`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `languageCode` | `string` Optional. Language in which the results should be returned. |\n| `regionCode` | `string` Optional. Region code. The region code, specified as a ccTLD (\"top-level domain\") two-character value. The parameter affects results based on applicable law. |\n| `types[]` | `string` Optional. A set of type tags to restrict the results. Results that do not have any of the specified types are removed. For the complete list of possible values, see Table A and Table B at \u003chttps://developers.google.com/maps/documentation/places/web-service/place-types\u003e. |\n| `granularity[]` | `enum (`[GeocodeResult.Granularity](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeResult.Granularity)`)` Optional. A filter of one or more location granularity enums. |\n| Union parameter `location_input`. The location to geocode. `location_input` can be only one of the following: ||\n| `locationQuery` | `string` The location in the format of \"lat,lng\" string. For example, \"64.7611872,-18.4705364\". |\n| `location` | `object (`[LatLng](/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng)`)` The location in the structured format. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [GeocodeLocationResponse](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeLocationResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode.location`"]]