Command-line Python 3 script to get a number of Street View images from random locations in a given country.
Random (lat, lon) co-ordinates are generated from the country's border's bounding box, then checked to make sure they're within the actual borders. The corresponding Street View image downloaded. Repeat until required number of images have been fetched.
python -m pip install pillow "pyshp>=2"
or pip install -r requirements.txt
usage: random_street_view.py [-h] [-n IMAGES_WANTED] [-hdg HEADING] [-p PITCH]
country
Get random Street View images from a given country
positional arguments:
country ISO 3166-1 Alpha-3 Country Code
options:
-h, --help show this help message and exit
-n IMAGES_WANTED, --images-wanted IMAGES_WANTED
Number of images wanted (default: 10)
-hdg HEADING, --heading HEADING
Heading in degrees: 0 and 360 north, 90 east, 180
south, 270 west (default: None)
-p PITCH, --pitch PITCH
Pitch in degrees: 0 is default, 90 straight up, -90
straight down (default: None)
For example:
python3 random_street_view.py GBR