I wanted to download google street view images through code , i actually did but i am facing some problems. I want to download single street view image with 180 degree camera of multiple locations.
I am using pypi's google-streetview 1.2.4 library in python for this. the code is below. https://pypi.org/project/google-streetview/ https://rrwen.github.io/google_streetview/#
# Import google_streetview for the api and helper module
import google_streetview.api
import google_streetview.helpers
# Create a dictionary with multiple parameters separated by ;
apiargs = {
'location': '23.87,90.3939;23.87,90.3944;23.87,90.3951;23.87,90.3959',
'size': '640x300',
'heading': '0;90;180',
'pitch': '0;0;0;0',
'key': 'google_dev_key'
}
# Get a list of all possible queries from multiple parameters
api_list = google_streetview.helpers.api_list(apiargs)
# Create a results object for all possible queries
results = google_streetview.api.results(api_list)
# Preview results
results.preview()
# Download images to directory 'downloads'
results.download_links('drive/colab/street_view/')
When i am using "heading" a single value like 180 or 90 it's showing pano_id keyerror.
but if i use heading = '0;90;180' then it is downloading 12 images of same locations. it's downloading repeatedly one image 3 times. as there are 4 locations 4 * 3 total 12 street view images i got but i want to download only 4 of 4 locations. how can i do it ?
Just change 'pitch': '0;0;0;0' to 'pitch': '0', it tries to download images from 4 pitches, and they are all the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With