Esempio n. 1
0
        /// <summary>
        /// Test whether two geometries lie within a given distance of
        /// each other.
        /// </summary>
        /// <param name="g0">a <see cref="Geometry"/>
        /// </param>
        /// <param name="g1">another <see cref="Geometry"/>
        /// </param>
        /// <param name="distance">the distance to test
        /// </param>
        /// <returns> true if g0.distance(g1) <= distance
        /// </returns>
        public static bool IsWithinDistance(Geometry g0, Geometry g1,
                                            double distance)
        {
            DistanceOp distOp = new DistanceOp(g0, g1, distance);

            return(distOp.Distance() <= distance);
        }
Esempio n. 2
0
        /// <summary>
        /// Compute the the closest points of two geometries.
        /// The points are presented in the same order as the
        /// input geometries.
        ///
        /// </summary>
        /// <param name="g0">
        /// A Geometry.
        /// </param>
        /// <param name="g1">
        /// Another Geometry.
        /// </param>
        /// <returns> the closest points in the geometries
        /// </returns>
        public static Coordinate[] ClosestPoints(Geometry g0, Geometry g1)
        {
            DistanceOp distOp = new DistanceOp(g0, g1);

            return(distOp.ClosestPoints());
        }
Esempio n. 3
0
        /// <summary>
        /// Compute the Distance between the closest points of two geometries.
        /// </summary>
        /// <param name="g0">a Geometry
        /// </param>
        /// <param name="g1">another Geometry
        /// </param>
        /// <returns> the Distance between the geometries
        /// </returns>
        public static double Distance(Geometry g0, Geometry g1)
        {
            DistanceOp distOp = new DistanceOp(g0, g1);

            return(distOp.Distance());
        }