private int GetSimpleDistance(WayHash way) { return((int)(GMap.NET.MapProviders.GMapProviders.EmptyProvider.Projection.GetDistance( CachedDistance.GetPointLatLng(way.FromHash), CachedDistance.GetPointLatLng(way.ToHash) ) * 1000)); }
private int TimeSec(long fromHash, long toHash) { var wayHash = new WayHash(fromHash, toHash); var way = GetCachedGeometry(wayHash, true); return(way?.TravelTimeSec ?? GetSimpleTime(wayHash)); }
private int DistanceMeter(long fromHash, long toHash) { var wayHash = new WayHash(fromHash, toHash); var way = GetCachedGeometry(wayHash, true); return(way?.DistanceMeters ?? GetSimpleDistance(wayHash)); }
private int GetSimpleTime(WayHash way) { return((int)(GetSimpleDistance(way) / 13.3)); //13.3 м/с среднее время получаемое по спутнику. }
CachedDistance GetCachedGeometry(WayHash way, bool checkDB = true) { return(GetCachedGeometry(way.FromHash, way.ToHash, checkDB)); }