ส่งความคิดเห็น
ข้อมูลเมตาของรูปภาพ Street View
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บทนำ
คำขอข้อมูลเมตาของ Street View Static API จะให้ข้อมูลเกี่ยวกับภาพพาโนรามาของ Street View การใช้ข้อมูลเมตาจะช่วยให้คุณทราบว่ามีภาพ Street View ในตำแหน่งที่กำหนดหรือไม่ รวมถึงรับสิทธิ์เข้าถึงแบบเป็นโปรแกรมไปยังพิกัดละติจูดและลองจิจูด, รหัสพาโนรามา, วันที่ถ่ายภาพ และข้อมูลลิขสิทธิ์ของรูปภาพ การเข้าถึงข้อมูลเมตานี้ช่วยให้คุณปรับแต่งลักษณะการทำงานของข้อผิดพลาดในแอปพลิเคชันได้
หมายเหตุ: ค่าของฟิลด์วันที่อาจแตกต่างกันไป
ฟิลด์วันที่อาจมีความละเอียดแตกต่างกันสำหรับภาพพาโนรามาที่ต่างกัน
เช่น ฟิลด์วันที่ของพาโนรามาบางรายการจะมีปีและเดือน
ขณะที่บางรายการจะมีเพียงปี
ระบบจะละเว้นช่องวันที่หากไม่มีข้อมูล
คำขอข้อมูลเมตาของ Street View Static API พร้อมให้บริการโดยไม่มีค่าใช้จ่าย
ระบบจะไม่ใช้โควต้าเมื่อคุณขอข้อมูลเมตา
ระบบจะใช้โควต้า เมื่อคุณโหลดรูปภาพโดยใช้
Street View Static API เท่านั้น
เมื่อส่งคำขอข้อมูลเมตาของภาพ Street View ภาพพาโนรามา
จะมีความแม่นยำถึง 50 เมตร
เข้าถึงข้อมูลเมตาของภาพ
คำขอข้อมูลเมตาของรูปภาพ Street View คือ URL ของ HTTP ในรูปแบบต่อไปนี้
https://maps.googleapis.com/maps/api/streetview/metadata?parameters
หมายเหตุ : ต้องใช้โปรโตคอล https://
สำหรับคำขอข้อมูลเมตา
พารามิเตอร์ทั้งหมดคั่นด้วยเครื่องหมายแอมเพอร์แซนด์ (&) ตามมาตรฐานใน URL
คำขอข้อมูลเมตาจะยอมรับพารามิเตอร์ของ URL เดียวกัน
กับคำขอภาพจาก Street View Static API แม้ว่าจะมีเพียง
พารามิเตอร์ต่อไปนี้เท่านั้นที่จำเป็น
ดังนี้
location
— อาจเป็นสตริงข้อความ (เช่น Chagrin Falls, OH
)
หรือคู่พิกัดละติจูดและลองจิจูดที่คั่นด้วยคอมมา (40.457375,-80.009353
)
หรือ
pano
- รหัสพาโนรามาที่เฉพาะเจาะจง พาโนรามาอาจเปลี่ยนรหัสเมื่อเวลาผ่านไป ดังนั้น
อย่าเก็บรหัสนี้ไว้ แต่ให้บันทึกที่อยู่ของสถานที่หรือพิกัดละติจูดและลองจิจูดแทน เพื่อให้คุณรีเฟรชรหัสพาโนรามาได้ โปรดดูรายละเอียดที่รีเฟรชรหัสพาโนรามาที่ลบไปแล้ว
รวมถึง
key
และ signature
— ต้องระบุคีย์ API เพื่อตรวจสอบสิทธิ์คำขอ นอกจากนี้ คุณยังต้องใช้ลายเซ็นดิจิทัลในบางกรณี และเราขอแนะนำให้ใช้เสมอ
ดูข้อมูลเพิ่มเติมได้ที่
รับคีย์และลายเซ็น
คำขอข้อมูลเมตาที่มีเฉพาะพารามิเตอร์ที่จำเป็นจะมีลักษณะดังนี้
https://maps.googleapis.com/maps/api/streetview/metadata?location=& key=YOUR_API_KEY & signature=< YOUR_SIGNATURE >
หรือแบบนี้
https://maps.googleapis.com/maps/api/streetview/metadata?pano=& key=YOUR_API_KEY & signature=< YOUR_SIGNATURE >
รีเฟรชรหัสพาโนรามาที่ลบไปแล้ว
หากคุณพยายามดึงข้อมูลรหัสพาโนรามาและได้รับ ZERO_RESULTS
หรือไม่มีค่า แสดงว่ารหัสพาโนรามาถูกลบไปแล้วและต้องรีเฟรช
บันทึกที่อยู่ของสถานที่ตั้งหรือพิกัดละติจูดและลองจิจูดที่คุณใช้เพื่อ
รับรหัสพาโนรามาเพื่อให้คุณรีเฟรชได้เมื่อจำเป็น
เมื่อตรวจพบว่ารหัสพาโนรามามีการเปลี่ยนแปลง ให้ใช้ที่อยู่ของตำแหน่งเดิม
หรือพิกัดละติจูดและลองจิจูดเพื่อค้นหาพาโนรามาที่ใกล้ที่สุด
กับตำแหน่งนั้นอีกครั้งและรับรหัสพาโนรามาใหม่
หมายเหตุ: เนื่องจากระบบจะรีเฟรชภาพ Street View เป็นระยะๆ และอาจถ่ายภาพจากตำแหน่งที่แตกต่างกันเล็กน้อยในแต่ละครั้ง รหัสพาโนรามาที่ระบุจึงอาจเปลี่ยนไปเป็นพาโนรามาอื่นเมื่อมีการอัปเดตภาพหรือรหัสพาโนรามา
คุณสามารถใส่พารามิเตอร์ต่อไปนี้ในคำขอข้อมูลเมตา size
,
heading
, fov
และ pitch
โปรดทราบว่าพารามิเตอร์เหล่านี้ไม่ส่งผลต่อ
ข้อมูลเกี่ยวกับพาโนรามา หรือพาโนรามาที่พบ
API อนุญาตให้รวมพารามิเตอร์เดียวกันกับคำขอภาพ
เพื่อให้สร้างคำขอข้อมูลเมตาที่เกี่ยวข้องกับคำขอภาพที่เฉพาะเจาะจงได้ง่ายขึ้น
แต่สำหรับคำขอข้อมูลเมตา API จะไม่สนใจพารามิเตอร์ที่ไม่บังคับและ
ค่าของพารามิเตอร์เหล่านั้น ดูข้อมูลเกี่ยวกับการใช้พารามิเตอร์เหล่านี้ได้ในคู่มือสำหรับนักพัฒนาซอฟต์แวร์ Street View Static API
ระบบจะแสดงผลการตอบกลับข้อมูลเมตาในรูปแบบ JSON เท่านั้น
ตัวอย่าง
ตัวอย่างที่ 1: พบภาพพาโนรามา
URL ต่อไปนี้ขอข้อมูลเมตาและรูปภาพของพาโนรามาเดียวกันได้สำเร็จ
คำขอและการตอบกลับข้อมูลเมตา
https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300& location=eiffel%20tower,%20paris,%20france& heading=-45& pitch=42& fov=110& key=YOUR_API_KEY & signature=YOUR_SIGNATURE
{
"copyright" : "© 2017 Google",
"date" : "2016-05",
"location" : {
"lat" : 48.85783227207914,
"lng" : 2.295226175151347
},
"pano_id" : "tu510ie_z4ptBZYo2BGEJg",
"status" : "OK"
}
คำขอและคำตอบเกี่ยวกับภาพในกรณีที่คาดว่าจะมีรูปภาพ
https://maps.googleapis.com/maps/api/streetview?size=600x300& location=eiffel%20tower,%20paris,%20france& heading=-45& pitch=42& fov=110& key=YOUR_API_KEY & signature=YOUR_SIGNATURE
ตัวอย่างที่ 2: ไม่พบพาโนรามา
URL ต่อไปนี้ขอข้อมูลเมตาและรูปภาพสำหรับภาพพาโนรามาที่
ไม่พบในหรือใกล้กับตำแหน่งที่ระบุ
คำขอและคำตอบของข้อมูลเมตา
https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300& location=78.648401,14.194336& fov=90& heading=235& pitch=10& key=YOUR_API_KEY & signature=YOUR_SIGNATURE
{
"status" : "ZERO_RESULTS"
}
คำขอและคำตอบเกี่ยวกับภาพ
https://maps.googleapis.com/maps/api/streetview?size=600x300& location=78.648401,14.194336& fov=90& heading=235& pitch=10& key=YOUR_API_KEY & signature=YOUR_SIGNATURE
รหัสสถานะ
ฟิลด์ status
ภายในออบเจ็กต์การตอบกลับข้อมูลเมตาจะมีสถานะของคำขอ และอาจมีข้อมูลการแก้ไขข้อบกพร่องเพื่อช่วยคุณแก้ปัญหาที่คำขอ Street View ไม่ทำงาน ฟิลด์ status
อาจมีค่าต่อไปนี้
สถานะ
คำอธิบาย
"OK"
ระบุว่าไม่มีข้อผิดพลาดเกิดขึ้น พบภาพพาโนรามาและส่งคืนข้อมูลเมตา
"ZERO_RESULTS"
บ่งบอกว่าไม่พบภาพพาโนรามาใกล้กับตำแหน่งที่ระบุ
คำตอบนี้อาจเกิดขึ้นหากคุณระบุรหัสพาโนรามาที่ไม่มีอยู่หรือใช้ไม่ได้
ดู [รีเฟรชรหัสพาโนรามาที่ลบแล้ว](#refresh-pano)
"NOT_FOUND"
ระบุว่าไม่พบสตริงที่อยู่ที่ระบุในพารามิเตอร์ location
ข้อความนี้อาจเกิดขึ้นหากมีการระบุที่อยู่ที่ไม่มีอยู่
"OVER_QUERY_LIMIT"
ระบุว่าคุณใช้โควต้ารายวันหรือโควต้าต่อวินาทีสำหรับ API นี้เกินแล้ว
"REQUEST_DENIED"
ระบุว่าคำขอของคุณถูกปฏิเสธ ข้อความนี้อาจเกิดขึ้นหากคุณไม่ได้ให้สิทธิ์ คำขอ หรือหากไม่ได้เปิดใช้งาน Street View Static API ในโปรเจ็กต์ Google Cloud Console ที่มีคีย์ API
"INVALID_REQUEST"
โดยทั่วไปจะบ่งชี้ว่าไม่มีพารามิเตอร์การค้นหา (ที่อยู่
พิกัดละติจูดและลองจิจูด หรือคอมโพเนนต์)
"UNKNOWN_ERROR"
ระบุว่าประมวลผลคำขอไม่ได้เนื่องจากข้อผิดพลาดเกี่ยวกับเซิร์ฟเวอร์
ปัญหานี้มักเกิดขึ้นชั่วคราว คำขออาจสำเร็จหากคุณลองอีกครั้ง
ข้อมูลเพิ่มเติม
ดูข้อมูลเพิ่มเติมเกี่ยวกับการใช้ Street View Static API หรือผลิตภัณฑ์อื่นๆ ของ Google Maps API ได้ที่หน้าการสนับสนุน ของ Maps API
ส่งความคิดเห็น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-09-04 UTC
หากต้องการบอกให้เราทราบเพิ่มเติม
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-09-04 UTC"],[[["\u003cp\u003eThe Street View Static API metadata request provides data about Street View panoramas, such as location, date, and panorama ID, without consuming quota.\u003c/p\u003e\n"],["\u003cp\u003eYou need to provide either a \u003ccode\u003elocation\u003c/code\u003e (address or coordinates) or a \u003ccode\u003epano\u003c/code\u003e ID along with your API key to make a metadata request.\u003c/p\u003e\n"],["\u003cp\u003eThe response is in JSON format and includes the status of the request (e.g., \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eZERO_RESULTS\u003c/code\u003e, \u003ccode\u003eNOT_FOUND\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003ePanorama IDs can change over time, so it's recommended to save the location information to refresh the ID when necessary.\u003c/p\u003e\n"],["\u003cp\u003eWhile optional parameters like \u003ccode\u003esize\u003c/code\u003e, \u003ccode\u003eheading\u003c/code\u003e, \u003ccode\u003efov\u003c/code\u003e, and \u003ccode\u003epitch\u003c/code\u003e are accepted, they do not affect the returned metadata.\u003c/p\u003e\n"]]],["The Street View Static API metadata requests provide panorama data, including location coordinates, panorama ID, photo date, and copyright. These requests are free and don't consume quotas. To access metadata, send an HTTP URL request with required parameters: either a `location` (address or coordinates) or `pano` (panorama ID), plus an API `key` and `signature`. If a panorama ID returns `ZERO_RESULTS`, refresh it using the original location. The response, in JSON, includes a `status` field indicating success or failure.\n"],null,["# Street View Image Metadata\n\nIntroduction\n------------\n\nThe Street View Static API metadata requests provide data about Street\nView panoramas. Using the metadata, you can find out if a Street View image\nis available at a given location, as well as getting programmatic access to\nthe latitude and longitude coordinates, the panorama ID, the date the photo was\ntaken, and the copyright information for the image. Accessing this\nmetadata lets you customize error behavior in your application.\n| **Note:** The value of the date field can vary:\n|\n| - The date field can have a different granularity for different panoramas. For example, the date field for some panoramas contains a year and month, while for others it contains just the year.\n| - The date field is omitted if no data is available.\n\nStreet View Static API metadata requests are available at no\ncharge. No quota is consumed when you request metadata.\n[Quota is only consumed](/maps/documentation/streetview/usage-limits) when you load an image using the\n[Street View Static API](/maps/documentation/streetview/overview).\n\nWhen making Street View imagery metadata requests, the panorama imagery\nis accurate to 50 meters.\n\nAccess the imagery metadata\n---------------------------\n\nA Street View image metadata request is an HTTP URL of the following form: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?parameters\n```\n| **Note** : the **https://** protocol is required for metadata requests.\n\nAs is standard in URLs, all parameters are separated using the ampersand\n(\\&) character.\n\n### Required parameters for metadata requests\n\nThe metadata requests accept the\n[same URL parameters](/maps/documentation/streetview/overview#url_parameters)\nas the Street View Static API imagery requests, although only\nthe following parameters are required:\n\nEither:\n\n- `location` --- can be either a text string (such as `Chagrin Falls, OH`) or a comma-separated pair of latitude and longitude coordinates (`40.457375,-80.009353`).\n\nOr:\n\n- `pano` --- a specific panorama ID. Panoramas may change IDs over time, so don't persist this ID. Instead, save the location address or latitude and longitude coordinates so you can refresh the panorama ID. For details, see [Refresh deleted panorama IDs](#refresh-pano).\n\nAs well as:\n\n- `key` and `signature` --- the API key is required to authenticate the request. The digital signature is also required in certain instances, and always recommended. For more information, see [Get a Key and Signature](/maps/documentation/streetview/get-api-key).\n\nYour metadata request, with only required parameters, looks like this: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?location=&key=YOUR_API_KEY&signature=\u003cYOUR_SIGNATURE\u003e\n```\n\nor like this: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?pano=&key=YOUR_API_KEY&signature=\u003cYOUR_SIGNATURE\u003e\n```\n\n### Refresh deleted panorama IDs\n\nIf you attempt to retrieve a panorama ID and get either `ZERO_RESULTS` or\nno value, then the panorama ID has been deleted and needs to be refreshed.\n\n1. Save the location address or latitude and longitude coordinates you used to\n get a panorama ID so you can refresh when needed.\n\n2. When you detect that a panorama ID has changed, use the original location\n address or latitude and longitude coordinates to search again for the nearest\n panoramas to that location and get a new panorama ID.\n\n| **Note:** Because Street View imagery is periodically refreshed, and photographs may be taken from slightly different positions each time, a given panorama ID may snap to a different panorama when imagery or the panorama ID is updated.\n\n### Optional parameters for metadata requests\n\nYou can include the following parameters in your metadata request: `size`,\n`heading`, `fov`, and `pitch`. Note that these parameters don't influence\nthe data about the panorama, or which panorama is found.\nThe API allows the inclusion of the same parameters as the\n[imagery request](/maps/documentation/streetview/overview#url_parameters)\nto make it easier to construct a metadata request related to a specific imagery\nrequest, but for metadata requests, the API ignores the optional parameters and\ntheir values. For information about using these parameters, see the\n[Street View Static API developer's guide](/maps/documentation/streetview/overview#url_parameters).\n\nResponse format\n---------------\n\nMetadata responses are returned in JSON format only.\n\nExamples\n--------\n\n#### Example 1: Panorama found\n\nThe following URLs successfully request the metadata and image of the same\npanorama.\n\nMetadata request and response \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY&signature=YOUR_SIGNATURE\n``` \n\n```scdoc\n{\n \"copyright\" : \"© 2017 Google\",\n \"date\" : \"2016-05\",\n \"location\" : {\n \"lat\" : 48.85783227207914,\n \"lng\" : 2.295226175151347\n },\n \"pano_id\" : \"tu510ie_z4ptBZYo2BGEJg\",\n \"status\" : \"OK\"\n}\n```\n\nImagery request and response, where the missing image is expected. \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY&signature=YOUR_SIGNATURE\n```\n\n#### Example 2: Panorama not found\n\nThe following URLs request the metadata and image for a panorama that\ncouldn't be found at or near the specified location.\n\n**Metadata request and response** \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY&signature=YOUR_SIGNATURE\n``` \n\n```scdoc\n{\n \"status\" : \"ZERO_RESULTS\"\n}\n```\n\n**Imagery request and response** \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY&signature=YOUR_SIGNATURE\n```\n\nStatus codes\n------------\n\nThe `status` field within the metadata response object contains the status of\nthe request, and may contain debugging information to help you troubleshoot\nwhy the Street View request is not working. The `status` field may contain\nthe following values:\n\n| Status | Description |\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `\"OK\"` | Indicates that no errors occurred; a panorama is found and metadata is returned. |\n| `\"ZERO_RESULTS\"` | Indicates that no panorama could be found near the provided location. This response can occur if you provide a non-existent or invalid panorama ID. See \\[Refresh deleted panorama IDs\\](#refresh-pano). |\n| `\"NOT_FOUND\"` | Indicates that the address string provided in the `location` parameter couldn't be found. This message may occur if a non-existent address is given. |\n| `\"OVER_QUERY_LIMIT\"` | Indicates that you have exceeded your daily quota or per-second quota for this API. |\n| `\"REQUEST_DENIED\"` | Indicates that your request was denied. This message may occur if you did not [authorize](/maps/documentation/streetview/get-api-key) your request, or if the Street View Static API is not activated in the Google Cloud console project containing your API key. |\n| `\"INVALID_REQUEST\"` | Generally indicates that the query parameters (address, latitude and longitude coordinates, or components) are missing. |\n| `\"UNKNOWN_ERROR\"` | Indicates that the request couldn't be processed due to a server error. This issue is often temporary. The request may succeed if you try again. |\n\nMore information\n----------------\n\nFor more information on using the Street View Static API, or\nother Google Maps API products, be sure to check out the Maps API\n[Support page](/maps/support)."]]