Skip to content

TurtleCode84/google-streetview-comb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

google-streetview-comb

A niche tool for searching areas on Google Maps for street view panoramas taken on a certain date.

Huh?

I recently was in a very niche situation where I was given a screenshot of a Google Maps street view location, and was asked to find the address.

Disclaimer: For privacy reasons, I will not be sharing this photo or location details. I received proper consent to find this location and was given the data by the very person it would affect, should I reveal the information. I am not a stalker, this was purely a challenge, similar to GeoGuessr. That being said, I am not responsible for any consequences experienced by the initial person that may result from their willing consent given for me to find unsaid location.

In any case (skipping the parts of my process unrelated to this tool), I eventually got to a point where I knew the location was within an XX mile radius. This was exciting, but I still had a lot of ground to comb to match the streetview screenshot with a location, and looking through every panorama would have taken literal years. So, I looked for a way to automate the process of searching hundreds of locations.

I knew that not all roads have a street view, and by looking through a few areas I noticed that sections or even entire towns were photographed in the same month and year. This is somewhat obvious, true, but it got me thinking: if I could programmatically get information on all of the panoramas in a certain area and sort out the ones that were taken on a certain date (YYYY-MM), then I could narrow the area I would need to search manually to a single town, possibly even a couple of roads, using the screenshot I mentioned earlier. The screenshot, while not displaying the address, showed me that it was taken in X of XXXX, so if I could find street view panos taken then, I could theoretically only search those roads, still within my XX mile radius.

Now we get to the fun part. I did a bit of research and found the Google Maps API, one part of which has access to street view metadata. By inputting coordinates or a location, one could find out if any panoramas were found at (or near?) that location. More information on this API can be found in their docs. By requesting data from this API, I could find out if the photo at that location matched the date I had. For this method to work, though, I would have to request data from this API about every coordinate in the radius, or at least every X degrees. The smaller I made that number, I figured, the more thorough of a search my program would make.

The script I wrote takes 4 sets of numbers, defining a rectangle of coordinate points, and systematically fetches the street view metadata for every single point within the boundaries. If the response data includes the date you're looking for, meaning the API returned a matching panorama, the API response is dumped in the console for further inspection. It's simple, but effective. It does require a Google Maps API key, however, if you know where to look, they're not that difficult to find.

...

And by that I mean you can create one for yourself in the Google Cloud Console. Right. I did that. Entirely legitimately. Moving on.

Anyway, I probably got lucky in the case of my search, the area I searched in had exactly one road photographed on the date I was searching for. After that, it wasn't difficult to search the street view and match the screenshot with one of my own. I won the challenge, and was from then on known as "the hacker version of Rainbolt."

...soooo if you somehow find yourself in this odd situation or just want to play around with the tool I created, I've put it in this repository along with instructions you can follow to run it in the background of something like a GitHub Codespace.

Happy hacking,
TurtleCode

Legal

This software makes use of the Google Maps API. By using this software, you are bound by the Google Maps Terms of Use, Google's Terms of Service, and Google's Privacy Policy. I, TurtleCode84, the author of this software, am not responsible for the use of this open-source software for purposes or intents which may break the aforementioned Terms and Policy, including but not limited to illegal or malicious usage. By using this tool, you release the author from liability, as detailed in the LICENSE document.

About

A niche tool for searching areas on Google Maps for street view panoramas taken on a certain date.

Topics

Resources

License

Stars

Watchers

Forks