本文整理汇总了C#中SharpMap.Layers.VectorLayer.ExecuteIntersectionQuery方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLayer.ExecuteIntersectionQuery方法的具体用法?C# VectorLayer.ExecuteIntersectionQuery怎么用?C# VectorLayer.ExecuteIntersectionQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpMap.Layers.VectorLayer
的用法示例。
在下文中一共展示了VectorLayer.ExecuteIntersectionQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestMap
public void TestMap()
{
var m = new Map(new Size(1024, 786)) {BackColor = Color.FloralWhite};
const string samplePath = @"D:\GIS\FileGDB\samples\data\Topo.gdb";
var p = new FileGdbProvider(samplePath);
foreach (var fc in p.GetFeatureClasses("\\USA"))
{
if (fc.StartsWith("\\USA\\T"))
continue;
Console.WriteLine(fc);
var pUse = new FileGdbProvider(samplePath) { Table = fc };
var vl = new VectorLayer("Layer:" + fc, pUse)
{
SmoothingMode = SmoothingMode.HighQuality,
Style = {Fill = RandomBrush(), Line = RandomPen()}
};
m.Layers.Add(vl);
var fds = new FeatureDataSet();
vl.ExecuteIntersectionQuery(vl.Envelope, fds);
fds.Tables[0].TableName = fc;
var res = fds.Tables[0].Rows[0].ItemArray;
foreach (DataColumn col in fds.Tables[0].Columns)
Console.Write(string.Format("{0} [{1}], ", col.ColumnName, col.DataType));
Console.WriteLine();
foreach (var item in res)
Console.Write(string.Format(CultureInfo.InvariantCulture, "{0}, ", item));
Console.WriteLine();
Console.WriteLine(pUse.GetGeometryByID(1));
var r = pUse.GetFeature(1);
foreach (var item in r.ItemArray)
Console.Write(string.Format(CultureInfo.InvariantCulture, "{0}, ", item));
Console.WriteLine();
Console.WriteLine();
}
Console.WriteLine();
p.Dispose();
m.ZoomToExtents();
var b = m.GetMap();
b.Save("fgdb-usa-states.bmp");
//var fds = new FeatureDataSet();
//lc.ExecuteIntersectionQuery(m.GetExtents().GetCentroid(), fds);
//fds.Tables[0].TableName = lc.LayerName;
//fds.Tables[0].WriteXml(Console.Out);
}