本文整理汇总了C#中Feature.Intersection方法的典型用法代码示例。如果您正苦于以下问题:C# Feature.Intersection方法的具体用法?C# Feature.Intersection怎么用?C# Feature.Intersection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature.Intersection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InterceptLine
private void InterceptLine(Feature fea)
{
Extent exf = fea.Envelope.ToExtent();
if (currentExtent.Contains(exf))
{
#region exteny
int endRow = vector.GetCell(exf.MinX, exf.MinY)[1];
int iniRow = vector.GetCell(exf.MaxX, exf.MaxY)[1];
if (endRow == -1 || iniRow == -1) return;
for (int it = iniRow; it <= endRow; it++)
{
Coordinate ini = new Coordinate();
Coordinate end = new Coordinate();
double[] i = vector.GetCoordenatesByCell(1, it);
double[] e = vector.GetCoordenatesByCell(vector.Get_area().NumColumns, it);
ini.X = i[0] - cellsize;
ini.Y = i[1];
end.X = e[0] + cellsize;
end.Y = e[1];
LinearRing line = new LinearRing(new List<Coordinate>() { ini, end });
if (fea.Intersects(line))
{
IFeature rfea = fea.Intersection(line);
IList<Coordinate> cor = rfea.Coordinates;
if (cor.Count == 1) break;
Filldata(rfea, cor);
}
}
#endregion
}
else
{
for (int it = 0; it < vector.Get_area().NumRows; it++)
{
Coordinate ini = new Coordinate();
Coordinate end = new Coordinate();
double[] i = vector.GetCoordenatesByCell(1, it);
double[] e = vector.GetCoordenatesByCell(vector.Get_area().NumColumns, it);
ini.X = i[0] - cellsize;
ini.Y = i[1];
end.X = e[0] + cellsize;
end.Y = e[1];
LinearRing line = new LinearRing(new List<Coordinate>() { ini, end });
if (fea.Intersects(line))
{
IFeature rfea = fea.Intersection(line);
IList<Coordinate> cor = rfea.Coordinates;
if (cor.Count == 1) break;
Filldata(rfea, cor);
if (test)
{
IFeature fd = li.AddFeature((IBasicGeometry)rfea);
fd.DataRow["id"] = "c";
}
}
}
}
}