本文整理汇总了C#中DotSpatial.Data.FeatureSet.Buffer方法的典型用法代码示例。如果您正苦于以下问题:C# FeatureSet.Buffer方法的具体用法?C# FeatureSet.Buffer怎么用?C# FeatureSet.Buffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Data.FeatureSet
的用法示例。
在下文中一共展示了FeatureSet.Buffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchPolygonFromPolyLine
public static IEnumerable<OCM.API.Common.LatLon> SearchPolygonFromPolyLine(List<OCM.API.Common.LatLon> points, double distanceKM)
{
//http://dotspatial.codeplex.com/wikipage?title=CycleThroughVerticesCS&referringTitle=Desktop_SampleCode
//create feature set from points
Feature f = new Feature();
FeatureSet fs = new FeatureSet(f.FeatureType);
Coordinate[] coord = new Coordinate[points.Count];
for (int i = 0; i < points.Count; i++)
{
coord[i] = new Coordinate((double)points[i].Latitude, (double)points[i].Longitude);
}
LineString ls = new LineString(coord);
f = new Feature(ls);
fs.Features.Add(f);
fs.Buffer(distanceKM, false); //TODO: approx km to lat/long coord value
IFeatureSet iF = fs.Buffer(10, true);
//export polygon points
List<OCM.API.Common.LatLon> polyPoints = new List<OCM.API.Common.LatLon>();
Extent extent = new Extent(-180, -90, 180, 90);
foreach (ShapeRange shape in fs.ShapeIndices)
{
if (shape.Intersects(extent))
foreach (PartRange part in shape.Parts)
{
foreach (Vertex vertex in part)
{
if (vertex.X > 0 && vertex.Y > 0)
{
// prepare export of polygon points
Console.WriteLine(vertex.X);
polyPoints.Add(new OCM.API.Common.LatLon { Latitude = vertex.X, Longitude = vertex.Y });
}
}
}
}
return polyPoints;
}