我将如何缓冲一个 IPoint 以使用 IRelationalOperator 进行交叉检查?
为了争论,我有:
IPoint p1 = xxx;
IPoint p2 = yyy;
IRelationalOperator rel1 = (IRelationalOperator)p1;
if (rel.Intersects (p2))
// Do something
但是现在我想在我的检查中添加一个容差,所以我认为正确的方法是缓冲 p1 或 p2。对?如何添加这样的缓冲区?
注意:我使用的 Intersects 方法是我为简化代码而编写的扩展方法。这里是:
/// <summary>
/// Returns true if the IGeometry is intersected.
/// This method negates the Disjoint method.
/// </summary>
/// <param name="relOp">The rel op.</param>
/// <param name="other">The other.</param>
/// <returns></returns>
public static bool Intersects (
this IRelationalOperator relOp,
IGeometry other)
{
return (!relOp.Disjoint (other));
}