robolyst / streetview Goto Github PK
View Code? Open in Web Editor NEWPython package for retrieving current and historical photos from Google Street View
Python package for retrieving current and historical photos from Google Street View
I can't import and test the module. Got an error:
TypeError Traceback (most recent call last)
<ipython-input-3-a3aca3365c67> in <module>
----> 1 import streetview
~/Tools/anaconda3/lib/python3.7/site-packages/streetview/__init__.py in <module>
1 from .api import get_panorama_meta, get_streetview # noqa
2 from .download import get_panorama # noqa
----> 3 from .search import search_panoramas # noqa
~/Tools/anaconda3/lib/python3.7/site-packages/streetview/search.py in <module>
7
8
----> 9 class Panorama(BaseModel):
10 pano_id: str
11 lat: float
~/Tools/anaconda3/lib/python3.7/site-packages/streetview/search.py in Panorama()
14 pitch: float
15 roll: float
---> 16 date: str | None
17
18
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Hi. Sorry to bother you. I was working on a project to extract many google street view images with streetview.search_panoramas(lat, lon) ? Is there a daily limit on the use of this API? Thanks.
Hello,
thanks for offering a python-based solution to download GSV-panos. Is there a possibility to decrease the resolution of the downloaded image and therefore make the get_panorama function quicker. I did some experiments with the several functions and arguments in download.py but could not figure a way.
Hello, thanks for creating this tool! Forgive me, but I can't make any headway with the following error:
streetview.download_tiles(x, '/Desktop/stv_tiles')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/streetview/init.py", line 176, in download_tiles
with open(directory + '/' + fname, 'wb') as out_file:
FileNotFoundError: [Errno 2] No such file or directory: '/Desktop/stv_tiles/OWgBBxHr-cRIEKElKPorWw_0x0.jpg'
Does the error mean the file cannot be downloaded?
Hey, thanks for the awesome code. I've been testing it and it has been very helpful for my research project.
However, before I use the code to download more pictures, I wanted to understand your code better because I want to ensure that I am not violating any terms and conditions from Google.
I was going over your code and could not figure out how you got the following snippet from the make_search_url
function in the file search.py:
"https://maps.googleapis.com/maps/api/js/"
"GeoPhotoService.SingleImageSearch"
"?pb=!1m5!1sapiv3!5sUS!11m2!1m1!1b0!2m4!1m2!3d{0:}!4d{1:}!2d50!3m10"
"!2m2!1sen!2sGB!9m1!1e2!11m4!1m3!1e2!2b1!3e2!4m10!1e1!1e2!1e3!1e4"
"!1e8!1e6!5m1!1e2!6m1!1e2"
"&callback=callbackfunc"
)
return url.format(lat, lon)
Could you link me the documentation that you used to write this snippet? I tried doing a google search, but cannot find it. I am unsure if they deprecated it or maybe I am not looking at the right place.
Thanks in advance.
Hi,
First, thank you for developing this useful package. I‘ve successfully used this package to retrieve current street view images. However, I am interested in accessing historical images as well.
I noticed that the package description mentions the ability to retrieve both current and old photos, but I haven't been able to figure out how to access the historical images. Could you please provide some guidance or examples on how to achieve this?
Thank you for your assistance!
Please add request signing to support changes to the streetview api.
I'm taking crops of panoramas facing the heading but it doesn't seem to be the true heading of the car and I can't see any documentation regarding it - what does the heading represent?
When translating GPS coordinates into panorama IDs, how can I obtain the IDs with the most recent date?
Is there a way to find out the orientation of the panorama?
As in degrees from north for example ?
maybe in the rest response?
thanks!
May I know is it possible to retrieve panoramas id from URL?
panos = search_panoramas(url)
first = panos[0]
print(first)
Thank you.
Hi, I am trying to do something like this:
import streetview
panoids = streetview.panoids(lat=-33.85693857571269, lon=151.2144895142714)
x = streetview.tiles_info(panoids)
streetview.download_tiles(x,"C:\\test")
but then, I get this:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Alejandro Jaramillo\AppData\Local\Programs\Python\Python36\lib\site-packages\streetview_init_.py", line 176, in download_tiles
with open(directory + '/' + fname, 'wb') as out_file:
OSError: [Errno 22] Invalid argument: "C:\test/[{'panoid': 'pV6jtRc157XZtWpVIR-rtg', 'lat': -33.85693857571269, 'lon': 151.2144895142714, 'year': 2015, 'month': 12}, {'panoid': 'OH7ReEUauWGKYqUwff4csA', 'lat': -33.85701117876561, 'lon': 151.2144738599703}, {'panoid': 'aX3nhhCruYOr-i1vSef13Q', 'lat': -33.85686132734697, 'lon': 151.2145114182827}, {'panoid': 'iEEnn7eeubWaaOGtgyZFkA', 'lat': -33.85664534945421, 'lon': 151.2145670599141}, {'panoid': 'Dnwib32GDUwR0ZEUpaRjwA', 'lat': -33.85721538674072, 'lon': 151.2144087097325}, {'panoid': 'U-xGOUhYBvhoQLW3fRWiMQ', 'lat': -33.85649956995691, 'lon': 151.2146045465586}, {'panoid': 'D2hYV0KIE5z2DT3zKISPIw', 'lat': -33.8567304764448, 'lon': 151.2145464537685}, {'panoid': '0Ih6zwlaAi7BJBPMyCGzIw', 'lat': -33.85656717348672, 'lon': 151.2145896255711}, {'panoid': 'fyU-UFzcm46oYIHpfaqdEA', 'lat': -33.85715286182172, 'lon': 151.2144278142204}, {'panoid': 'UnQPs_i5Ve4PKBsiiKCGIg', 'lat': -33.85709265803713, 'lon': 151.2144511550587}, {'panoid': 'T3Olav_5BHcO4mp26-p5uA', 'lat': -33.85679700784097, 'lon': 151.2145324891978}, {'panoid': 'QHQTTGU4c5FPNTRAef8NMQ', 'lat': -33.85728178709976, 'lon': 151.2143873393158}, {'panoid': 'AF1QipPDgwFWANWNHlYQocV1ImaUfSJFbPbmM1nNZJQp', 'lat': -33.85735703877369, 'lon': 151.2143414204161}]_0x0.jpg"
What I am doing wrong?
Thank you!
I want to request you, can you please share some Python code to download the GSV images by automatically using the coordinate. we have the GPS coordinate in csv file I want to download the GSV panorama images corresponding to each coordinate.
Can you suggest some code to download the panorama images between two points by fixing some intervals?
I have a project that requires some heavy downloading where the time spent was actually critical. I'm opening this issue to propose support for multithreaded download. I had a working version and will soon make a proper PR. I'll make it a parameter in get_panorama
and by default turned off.
How can I find the panorama information (lat, lng, focal, zoom, ..etc)
Hi could you please help me with how to select and download Panoids by a specific year or range of years?
E.g just those panoids for images which were taken between 2013-2016.
I can see how the info is there - if I print the panoids variable then it lists all panoids, including ones that have info on which year they are from - but can't figure out how to use it how I want to.
I know this is probably really easy but I'm new to this and have been stuck trying to figure it out for a while!
Sorry and thanks heaps
I've been trying to use streetview but the documentation is so poor I could not retrieve images at all, you should at least include on working example of every function you have so people would have the slightest idea of what each variable represents, for example variable "flat_dir" in function streetview.api_download is not clear what values should be there, it is very vaguely explained .
This applies for all of the functions as well. In order for streetview to be helpful you have to satisfy this bare minimum.
Hi,
I was wondering if there is a trick to get the image of the house rather than the front facing camera with
get_streetview(pano_idpano_id, api_key=")
Thanks
the stitching logic in get_panorama
is not super robust. When I was trying to fetch panoid EVGmA-L6LuI_7-elZaDq1g
, because the actual image resolution was 13312 × 6656
, and not 16384 x 8192
(which seems to be the default), the downloaded image has black bars on the right and bottom. This non 16k*8k resolution is also captured by google, their backpack gear is just specced differently from the car gear. I suspect it wouldn't work well with some other user-uploaded panorama.
I haven't come up with a great solution, not having a deeper knowledge of the quirks of Google tile api. Happy to chat about it and improve it.
Hi :) I was wondering if it is possible to also download depth map paired with the panorama? Or where can I find the documentation for this API (cbk0.google.com)? Many thank
I have many maps objects (links to map and place_id). I would like to get an image of every building from my links. Its important to get the exact building on the image, so I dont like the idea to get streetview with lat lon or with name as they are not that accurate. Places api returns list of images of the place, but I'm afraid of getting indoor photos instead of outdoor ones. Streetview api has the important feature of getting outdoor picture only, but it doesnt get place_id as input argument, doesnt it? Is there any way to solve my problem with your lib or do you have any thoughts on that?
Is there a way to get the information of a panorama through the panoid? e.g I have a panoid and want to find the (lat,lng).
There are a few metadata the library is discarding from the response.
get_panorama_meta
search_panoramas
extract_panoramas
response has "elevation" that's not being savedHi, thank you for this package.
When I check the coords (35.658353457849685, 139.6920989241623), the below error apeared.
IndexError Traceback (most recent call last)
Cell In[135], line 1
----> 1 panos = search_panoramas(lat=coords[517][0], lon=coords[517][1])
File e:\Anaconda\envs\googlestreet\Lib\site-packages\streetview\search.py:96, in search_panoramas(lat, lon)
91 """
92 Gets the closest panoramas (ids) to the GPS coordinates.
93 """
95 resp = search_request(lat, lon)
---> 96 pans = extract_panoramas(resp.text)
97 return pans
File e:\Anaconda\envs\googlestreet\Lib\site-packages\streetview\search.py:76, in extract_panoramas(text)
72 raw_dates = raw_dates[::-1]
74 dates = [f"{d[1][0]}-{d[1][1]:02d}" for d in raw_dates]
---> 76 return [
77 Panorama(
78 pano_id=pano[0][1],
79 lat=pano[2][0][2],
80 lon=pano[2][0][3],
81 heading=pano[2][2][0],
82 pitch=pano[2][2][1],
83 roll=pano[2][2][2],
84 date=dates[i] if i < len(dates) else None,
...
85 )
86 for i, pano in enumerate(raw_panos)
87 ]
IndexError: list index out of range
Hi,
recently, I have encountered error in parsing of elevation from response when searching for panoramas.
I have tried to perform searching for panoramas step-by-step and I found out, that the elevation could be obtained from
pano[2][1][0]
I can send pull request for that, but I have seen that there are some special cases which are solved by if statement when creating Panorama class which I am not familiar with and could be part of wider changes of API.
Thanks!
Rostislav
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.