TrueCP6 / streetview-journey

A semi-private tool that allows easy downloading of streetview images, processing of streetview information and generation of videos
1 stars 0 forks source link

StreetviewJourney

A library for modifying and using point, panorama and route data for Google Streetview.

Example results

Example Panorama

YouTube Playlist

Usage

Routes

Routes can be created from .gpx or .svjson files, Point arrays or PanoID arrays. Routes can be modified with various methods this library contains. Routes can be downloaded as ImageFolder image sequences. Example usage:

Route route = new Route(@"D:\routes\old.gpx");
route = route.Interpolate(5).GetBearings().SmoothBearings();
Console.WriteLine(route.TotalDistance + " metres");
route.Save(@"D:\routes\new.svj");

Points

Points are latitude-longitude co-ordinates used to keep track of the positions of Routes and PanoIDs which come with an attached Bearing. They can be modified using various methods. Example usage:

Point point1 = new Point(40.748705, -73.985571);
Point point2 = Point.RandomUsable();
point1 = point1.Exact();
Console.WriteLine(point1.DistanceTo(point2) + " metres");

Bearings

Bearings are used to store compass heading values from 0 to 360. These are attached to a point and can be calculated using Route and Point methods.

ImageFolders

These are used to manage downloaded images from Routes. The ImageFolder can be deleted or the image sequence can be converted into a video using FFmpeg.

PanoIDs

Panorama IDs are linked to specific panorama on Google Streetview and are split into two categories: first party and third party. First party panoramas are uploaded by Google while third party panoramas are uploaded by users. Certain methods can only be used with first party panoramas. Example usage:

PanoID pano = PanoID.RandomUsable();
if (!pano.isThirdParty)
    pano.DownloadPanorama().Save(@"D:\images\panorama.jpg", ImageFormat.Jpeg);
Point point = pano.Position;

Setup

Setup.SetStaticStreetviewAPIInfo must be executed to allow usage of most functionality within this library. This requires a Google Streetview Static API Key and URL Signing Secret and billing to be enabled on the account. Setup.DontBillMe can be set to prevent unintentional billing and allows only allows metadata queries to be made (which is not billed by Google). Setup.FFmpegExecutablesFolder should be the directory containing the FFmpeg executables. Setup.DownloadFFmpeg() can however be used to download the latest version of FFmpeg. Setup.GeckodriverPath should be the path to the geckodriver executable. The latest version of geckodriver can be automatically downloaded using Setup.DownloadGeckodriver().

Miscellaneous Features