Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. metadata_upload_url = "https://streetviewpublish.googleapis.com/v1/photo?key={}".format(API_KEY)
  2. headers = {"Authorization": "Bearer {}".format(ACCESS_KEY), "Content-Length": "0",
  3. "Content-Type": "application/json"}
  4. data = {
  5.  
  6. "uploadReference": {
  7. "uploadUrl": upload_link
  8. },
  9. "pose": {
  10. "latLngPair": {
  11. "latitude": latitude,
  12. "longitude": longitude
  13. },
  14. # "altitude": 500,
  15. "heading": heading,
  16. "pitch": pitch,
  17. "level": {
  18. "number": 1,
  19. "name": "arr"
  20. }
  21. },
  22.  
  23. "places": [{
  24. "placeId": place_id,
  25. }],
  26. }
  27. meta_photo_request = requests.post(metadata_upload_url, json=data, headers=headers)
  28. photoid = meta_photo_request.json()['photoId']['id']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement