Пример #1
0
 private int GetSimpleDistance(WayHash way)
 {
     return((int)(GMap.NET.MapProviders.GMapProviders.EmptyProvider.Projection.GetDistance(
                      CachedDistance.GetPointLatLng(way.FromHash),
                      CachedDistance.GetPointLatLng(way.ToHash)
                      ) * 1000));
 }
Пример #2
0
        private int TimeSec(long fromHash, long toHash)
        {
            var wayHash = new WayHash(fromHash, toHash);
            var way     = GetCachedGeometry(wayHash, true);

            return(way?.TravelTimeSec ?? GetSimpleTime(wayHash));
        }
Пример #3
0
        private int DistanceMeter(long fromHash, long toHash)
        {
            var wayHash = new WayHash(fromHash, toHash);
            var way     = GetCachedGeometry(wayHash, true);

            return(way?.DistanceMeters ?? GetSimpleDistance(wayHash));
        }
Пример #4
0
 private int GetSimpleTime(WayHash way)
 {
     return((int)(GetSimpleDistance(way) / 13.3));            //13.3 м/с среднее время получаемое по спутнику.
 }
Пример #5
0
 CachedDistance GetCachedGeometry(WayHash way, bool checkDB = true)
 {
     return(GetCachedGeometry(way.FromHash, way.ToHash, checkDB));
 }