コード例 #1
0
        /// <summary>
        /// Test whether two geometries lie within a given distance of each other.
        /// </summary>
        /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
        /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
        /// <param name="distance">The distance to test</param>
        /// <returns><value>true</value> if <c>g0.distance(g1) &lt;= <paramref name="distance"/></c></returns>
        public static bool IsWithinDistance(IGeometry g0, IGeometry g1,
                                            double distance)
        {
            var distOp = new Distance3DOp(g0, g1, distance);

            return(distOp.Distance() <= distance);
        }
コード例 #2
0
	private void CheckDistance(IGeometry g1, IGeometry g2, double expectedDistance, double tolerance)
	{
		var distOp = new Distance3DOp(g1, g2);
		var dist = distOp.Distance();
		Assert.AreEqual(expectedDistance, dist, tolerance);
	}
コード例 #3
0
        /// <summary>
        /// Compute the the nearest points of two geometries. The points are
        /// presented in the same order as the input Geometries.
        /// </summary>
        /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
        /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
        /// <returns>The nearest points in the geometries</returns>
        public static Coordinate[] NearestPoints(IGeometry g0, IGeometry g1)
        {
            var distOp = new Distance3DOp(g0, g1);

            return(distOp.NearestPoints());
        }
コード例 #4
0
        /// <summary>
        /// Compute the distance between the nearest points of two geometries.
        /// </summary>
        /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
        /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
        /// <returns>The distance between the geometries</returns>
        public static double Distance(IGeometry g0, IGeometry g1)
        {
            var distOp = new Distance3DOp(g0, g1);

            return(distOp.Distance());
        }
コード例 #5
0
 /// <summary>
 /// Test whether two geometries lie within a given distance of each other.
 /// </summary>
 /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
 /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
 /// <param name="distance">The distance to test</param>
 /// <returns><value>true</value> if <c>g0.distance(g1) &lt;= <paramref name="distance"/></c></returns>
 public static bool IsWithinDistance(IGeometry g0, IGeometry g1,
     double distance)
 {
     var distOp = new Distance3DOp(g0, g1, distance);
     return distOp.Distance() <= distance;
 }
コード例 #6
0
 /// <summary>
 /// Compute the distance between the nearest points of two geometries.
 /// </summary>
 /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
 /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
 /// <returns>The distance between the geometries</returns>
 public static double Distance(IGeometry g0, IGeometry g1)
 {
     var distOp = new Distance3DOp(g0, g1);
     return distOp.Distance();
 }
コード例 #7
0
 /// <summary>
 /// Compute the the nearest points of two geometries. The points are
 /// presented in the same order as the input Geometries.
 /// </summary>
 /// <param name="g0">A <see cref="IGeometry">geometry</see></param>
 /// <param name="g1">A <see cref="IGeometry">geometry</see></param>
 /// <returns>The nearest points in the geometries</returns>
 public static Coordinate[] NearestPoints(IGeometry g0, IGeometry g1)
 {
     var distOp = new Distance3DOp(g0, g1);
     return distOp.NearestPoints();
 }