本文整理汇总了C#中DotSpatial.Data.FeatureSet.CopyFeatures方法的典型用法代码示例。如果您正苦于以下问题:C# FeatureSet.CopyFeatures方法的具体用法?C# FeatureSet.CopyFeatures怎么用?C# FeatureSet.CopyFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Data.FeatureSet
的用法示例。
在下文中一共展示了FeatureSet.CopyFeatures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportFieldsFromDbf
private void ImportFieldsFromDbf()
{
OpenFileDialog dlg = new OpenFileDialog
{
Filter =
SymbologyFormsMessageStrings.
TableEditorControl_ImportFieldsFromDbf_DBase_Files____dbf____DBF
};
FeatureSet fsTemp = new FeatureSet();
fsTemp.CopyFeatures(_featureLayer.DataSet, true);
if (dlg.ShowDialog() != DialogResult.OK)
{
MessageBox.Show(SymbologyFormsMessageStrings.TableEditorControl_ImportFieldsFromDbf_Could_not_import_column_fields);
return;
}
string shapeFilePath2 = dlg.FileName;
int count = shapeFilePath2.Length;
shapeFilePath2 = shapeFilePath2.Remove(count - 4, 4); //remove the extension of the file
shapeFilePath2 = shapeFilePath2 + ".shp"; //add
IFeatureSet fs = FeatureSet.Open(shapeFilePath2);
int noOfCol = fs.DataTable.Columns.Count;
//Add all column header
for (int i = 0; i < noOfCol; i++)
{
DataColumn dtcol = new DataColumn(fs.DataTable.Columns[i].ColumnName, fs.DataTable.Columns[i].DataType);
if (fsTemp.DataTable.Columns.Contains(fs.DataTable.Columns[i].ColumnName) == false)
fsTemp.DataTable.Columns.Add(dtcol);
}
dataGridView1.DataSource = fsTemp.DataTable;
}