本文整理汇总了C#中IGeometry.Relate方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometry.Relate方法的具体用法?C# IGeometry.Relate怎么用?C# IGeometry.Relate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGeometry
的用法示例。
在下文中一共展示了IGeometry.Relate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunRectanglePred
private void RunRectanglePred(IGeometry rect, IGeometry testGeom)
{
bool intersectsValue = rect.Intersects(testGeom);
bool relateIntersectsValue = rect.Relate(testGeom).IsIntersects();
bool intersectsOK = intersectsValue == relateIntersectsValue;
bool containsValue = rect.Contains(testGeom);
bool relateContainsValue = rect.Relate(testGeom).IsContains();
bool containsOK = containsValue == relateContainsValue;
//System.out.println(testGeom);
if (!intersectsOK || !containsOK)
{
Console.WriteLine(testGeom);
}
Assert.IsTrue(intersectsOK);
Assert.IsTrue(containsOK);
}
示例2: DoPredicates
public void DoPredicates(IGeometry a, IGeometry b)
{
Assert.IsTrue(a.Contains(b) == a.Relate(b).IsContains());
Assert.IsTrue(a.Crosses(b) == a.Relate(b).IsCrosses(a.Dimension, b.Dimension));
Assert.IsTrue(a.Disjoint(b) == a.Relate(b).IsDisjoint());
Assert.IsTrue(a.Equals(b) == a.Relate(b).IsEquals(a.Dimension, b.Dimension));
Assert.IsTrue(a.Intersects(b) == a.Relate(b).IsIntersects());
Assert.IsTrue(a.Overlaps(b) == a.Relate(b).IsOverlaps(a.Dimension, b.Dimension));
Assert.IsTrue(a.Touches(b) == a.Relate(b).IsTouches(a.Dimension, b.Dimension));
Assert.IsTrue(a.Within(b) == a.Relate(b).IsWithin());
}
示例3: ContainsProperly
private static bool ContainsProperly(IGeometry g1, IGeometry g2)
{
return g1.Relate(g2, "T**FF*FF*");
}