Exemplo n.º 1
0
        public static double GetDistance(double fromLat, double fromLng, double toLat, double toLng)
        {
            Point ptFrom = Context.MakePoint(fromLng, fromLat);
            Point ptTo   = Context.MakePoint(toLng, toLat);

            return(Context.GetDistCalc().Distance(ptFrom, ptTo));
        }
Exemplo n.º 2
0
        public static double GetDistance(double fromLat, double fromLng, double toLat, double toLng)
        {
            Point ptFrom   = Context.MakePoint(fromLng, fromLat);
            Point ptTo     = Context.MakePoint(toLng, toLat);
            var   distance = Context.GetDistCalc().Distance(ptFrom, ptTo);

            return((distance / RadiansToDegrees) * EarthMeanRadiusKm);
        }
Exemplo n.º 3
0
        public static double GetGeographicalDistance(double fromLat, double fromLng, double toLat, double toLng)
        {
            var   Context  = new NtsSpatialContext(true);
            Point ptFrom   = Context.MakePoint(fromLng, fromLat);
            Point ptTo     = Context.MakePoint(toLng, toLat);
            var   distance = Context.GetDistCalc().Distance(ptFrom, ptTo);

            return((distance / RadiansToDegrees) * EarthMeanRadiusKm);
        }