/// <summary> /// Gets the PanoID for each point of the Route /// </summary> /// <param name="firstParty">Whether the PanoIDs must be first party</param> /// <param name="searchRadius">The radius in meters to search for each point</param> /// <returns>A new Route</returns> public PanoID[] PanoIDs(bool firstParty = false, uint searchRadius = Point.DefaultSearchRadius) { PanoID[] ids = new PanoID[Length]; Parallel.For(0, Length, i => { try { ids[i] = Points[i].PanoID(firstParty, searchRadius); } catch (ZeroResultsException) { ids[i] = new PanoID(); } }); return(ids.Where(id => !string.IsNullOrEmpty(id.ID)).ToArray()); }
/// <summary> /// Gets a random usable panorama from a random spot on Earth /// </summary> /// <param name="firstParty">Whether the panorama must be first party</param> /// <returns>A random PanoID</returns> public static PanoID RandomUsable(bool firstParty = false) { bool success = false; PanoID id = new PanoID(); while (!success) { Point pt = Point.Random(); try { id = pt.PanoID(firstParty, 500000); success = true; } catch (ZeroResultsException) { } } return(id); }