本文整理匯總了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);
}