Exemplo n.º 1
0
        public double RectangeDistance(Coordinate coordinate)
        {
            if (PointContains(coordinate) != InterseptResult.None)
            {
                return(0);
            }

            var min = EarthUtilities.GetDistance(new CoordinateRectangle(Left, Top, Right, Top), coordinate);
            var res = EarthUtilities.GetDistance(new CoordinateRectangle(Right, Top, Right, Bottom), coordinate);

            if (res < min)
            {
                min = res;
            }
            res = EarthUtilities.GetDistance(new CoordinateRectangle(Right, Bottom, Left, Bottom), coordinate);
            if (res < min)
            {
                min = res;
            }
            res = EarthUtilities.GetDistance(new CoordinateRectangle(Left, Bottom, Left, Top), coordinate);
            if (res < min)
            {
                min = res;
            }

            return(min);
        }
Exemplo n.º 2
0
 public double Distance(Coordinate coordinate)
 {
     return(EarthUtilities.GetLength(this, coordinate));
 }
Exemplo n.º 3
0
 public Coordinate GetNearestPoint(Coordinate pt)
 {
     return(EarthUtilities.GetNearestPoint(this, pt));
 }
Exemplo n.º 4
0
 public double LineDistance(Coordinate coordinate)
 {
     return(EarthUtilities.GetDistance(this, coordinate));
 }