0

I'm using batchUpdate method for panos connection. I have an issue with connections. The navigation is not working in proper direction. Please suggest me where I'm wrong?

enter image description here

I have attached an image for my problem. I want to go north direction but here, arrow is showing in east direction. I'm not getting, Is this problem related to latitude or longitude or heading or pitch? Please help me.

This is my method for Upload the metadata of the photo :

def upload_image_metadata(upload_link, heading, pitch, latitude, longitude, place_id):
    global ACCESS_KEY
    ACCESS_KEY = get_access_key()
    metadata_upload_url = "https://streetviewpublish.googleapis.com/v1/photo?key={}".format(API_KEY)
    headers = {"Authorization": "Bearer {}".format(ACCESS_KEY), "Content-Length": "0",
               "Content-Type": "application/json"}
    data = {

        "uploadReference": {
            "uploadUrl": upload_link
        },
        "pose": {
            "latLngPair": {
                "latitude": latitude,
                "longitude": longitude
            },
            "heading": heading,
            "pitch": pitch,
        },

        "places": [{
            "placeId": place_id,
        }],
    }
    meta_photo_request = requests.post(metadata_upload_url, json=data, headers=headers)
    photoid = meta_photo_request.json()['photoId']['id']
    return photoid
Menu
  • 677
  • 1
  • 12
  • 30

2 Answers2

0

As stated in this link, the direction of the arrow can be determined by the lat,lng and heading of each set of 2 panos which are linked.

From this thread,

You need to edit the heading of each photo that you want to connect. Example, for pano_1 with arrow pointing to right with heading:90, your pano_2 should have a heading:270. Be noted that you need to edit both pictures. (I've done this by trial and error.)

abielita
  • 13,147
  • 2
  • 17
  • 59
  • For example I have 3 panos and connection as in 1-2, 2-3 then what should be the value of heading and pitch? How much distance should be between latitude and longitude of each panos?? 0.001 or 0.005 or 0.005? – Menu Jul 19 '17 at 18:20
  • Hey @abielita can you give an example for this query? – Menu Jul 21 '17 at 06:09
  • Check the [sample query](https://stackoverflow.com/a/45234943/5832311) of @Harish. Regarding the distance, from this [documentation: Tips for creating multiple 360 photos](https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604) you must be spacing the photos about two small steps apart (1 m / 3 ft) when indoors and five steps apart (3 m / 10 ft) when outdoors. – abielita Jul 21 '17 at 11:04
0

Consider the following image

Connection between 4 panoramas

You can see in the above image There are four panos here. pano_1 is connected to pano_2 and pano_3. To make a perfect connection and correct arrow position you have to set heading first of pano_1 (Note: heading value sets a north position of a panorama. It will open the default view which we sets heading value for it). pano_2 is located at south of pano_1 so put the lat and lon towards south from pano_1 pano_3 is located at north of pano_1 put it at the lat and lon towards north from pano_1

Request JSON for this would be:

 {"updatePhotoRequests": 
  [{ "updateMask": 
    "connections", "photo": {
         "photoId": {
             "id": "pano_1"
          },
         "connections": [
          {
              "target": {
                "id": "pano_2"
                 }
                   },
                   {
               "target": {
                "id": "pano_3"
                     }
                   }
                ]
                }
           }
        ]
      }
  }] 
}

and pano_4 is at the east of pano_3. put it towards right/east side from pano_3 json request would be :

{
 "updatePhotoRequests": [
{
   "updateMask": "connections",
   "photo": {
      "photoId": {
         "id": "pano_3"
       },
   "connections": [
   {
      "target": {
        "id": "pano_4"
       }
     },
   ] 
   }
  }]
}
Harish Kumar
  • 927
  • 3
  • 20
  • 46
  • Hey @Harish can you suggest me what should be the value of heading for each pano? – Menu Jul 22 '17 at 09:28
  • @A.R. Heading should be the value which is pointing to the view you want to see when the panorama loads. the very center of the panorama is 0. if you drag towards east/right its starts increasing. You don't have a panorama viewer to see pano tour? I suggest to use [google street view service](https://developers.google.com/maps/documentation/javascript/streetview) it will help you to fetch the value of heading – Harish Kumar Jul 22 '17 at 09:54
  • Thanks for the reply. I'm also using this panorama viewer to see the pano tour but still I'm not getting right navigation arror. – Menu Jul 22 '17 at 10:18