banner



Google Maps Street View Animated Route

Google Street View Movie Maker

It makes movies out of Google Street View images!

You provide point A and point B. Information technology uses the Google Roads API to get directions from A to B, then repeatedly looks for Street View images along that path, and converts them into a pic.

Eastward.m., here is a video taken forth the Copacabana embankment in Rio, with a little snippet of Senor Coconut's "Neon Lights (Cha Cha Cha)" added for fun:

Requirements

To run this code yourself takes some fussing around:

  1. Make sure FFMPEG is installed and callable from the command line. I mash-installed it.
  2. pip-install this project's python requirements. The but packages you may non have are googlemaps and polyline. Note: this projection is written for Python 2.
  3. Lastly, and trickiest of all: the code requires API keys for Google Map'south Street View and Directions APIs. Annotation: setting up the Street View API now requires a billing business relationship! it tends to be free for small amounts of traffic, just you have to set information technology up anyway.

Project history

When using Google Maps to programme a route I oasis't driven or walked before, I ever though it would be smashing to exist able to preview the directions every bit a video. Apparently, you lot can check out the route by looking at Street View at random points, or navigating in Street View style itself. But these options are irksome!

Other people have had the same idea; at least two have created web services to do information technology:

  • Streetview Player
  • Route View

In each case, the user gives points A and B, the site fetches directions, picks a fix of waypoints about 150m apart, and shows you the image at each waypoint. But the sites don't download the images and compile them into a movie; they just repeatedly reload Google Street View at each waypoint. I wanted to obtain a faux video preview.

Too, both services are basically defunct now that using the Street View API requires billing. (I terminal checked the functional sites in 2017.)

Project hurdles

Step 1 was downloading an prototype. I started with the Street View API documentation, but to get it working in Python, I used this weblog postal service as a reference.

Step ii was computing the route and selecting GPS points along that route. Using the Directions API was straightforward with the Python Client for Google Maps Services.

Step iii was computing the correct heading (compass direction) from A to B, which is really tricky! I ultimately found someone else'south code to practice this.

Simply there were lots of failed hacks in between. The math for computing distances and angles on spheres is very cool---the Haversine formula, only I probably would accept enjoyed learning near it more than in high school. The best among them used the GeoPy package, but was ugly: with GeoPy, I couldn't compute the heading from A to B. But, given point A, a begetting, and a distance, I could compute a destination C. I could also compute the distance between any two points. So, I computed 360 potential destinations, each a degree autonomously and a fixed distance from A, and then constitute the one that was nearest to C, which gave the judge heading.

Step iv was concatenating the images into a motion-picture show, for which FFMPEG is indispensible!

Source: https://github.com/jblsmith/street-view-movie-maker

Posted by: evenyoushothe85.blogspot.com

0 Response to "Google Maps Street View Animated Route"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel