A library for modifying and using point, panorama and route data for Google Streetview.
Route
s can be created from .gpx or .svjson files, Point
arrays or PanoID
arrays.
Route
s can be modified with various methods this library contains.
Route
s 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");
Point
s are latitude-longitude co-ordinates used to keep track of the positions of Route
s and PanoID
s 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");
Bearing
s 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.
These are used to manage downloaded images from Route
s.
The ImageFolder
can be deleted or the image sequence can be converted into a video using FFmpeg.
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.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()
.