本文整理汇总了C#中ILineString.Intersects方法的典型用法代码示例。如果您正苦于以下问题:C# ILineString.Intersects方法的具体用法?C# ILineString.Intersects怎么用?C# ILineString.Intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILineString
的用法示例。
在下文中一共展示了ILineString.Intersects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartRun
public override void StartRun(int runSize)
{
int nVertices = runSize*DENSIFY_FACTOR;
_line1 = CreateLine("LINESTRING (0 0, 100 100)", nVertices);
_line2 = CreateLine("LINESTRING (0 1, 100 99)", nVertices);
// force compilation of intersects code
_line1.Intersects(_line2);
}
示例2: LineStringFirstIntersectionOffset
/// <summary>
/// Returns the offset to the first intersection of lineString by cutLineString.
/// </summary>
/// <param name="lineString"></param>
/// <param name="cutLineString"></param>
/// <returns>offset to the first intersection, -1 if there is no intersection -1</returns>
public static double LineStringFirstIntersectionOffset(ILineString lineString, ILineString cutLineString)
{
if(!lineString.Intersects(cutLineString))
{
return -1;
}
IGeometry intersection = lineString.Difference(cutLineString);
if (intersection is IMultiLineString)
{
var result = (IMultiLineString) lineString.Difference(cutLineString);
return result.Geometries[0].Length;
}
return intersection.Length;
}