Exemplo n.º 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));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 4
0
 private int GetSimpleTime(WayHash way)
 {
     return((int)(GetSimpleDistance(way) / 13.3));            //13.3 м/с среднее время получаемое по спутнику.
 }
Exemplo n.º 5
0
 CachedDistance GetCachedGeometry(WayHash way, bool checkDB = true)
 {
     return(GetCachedGeometry(way.FromHash, way.ToHash, checkDB));
 }