AE 缓冲区分析问题
高手们帮我看一下 我这个代码哪里有问题,刚开始学习AE二次开发,很多不懂.....
private void buttonBuffer_Click(object sender, EventArgs e)
{
if (textBoxDistance.Text == "" || comboBoxUnit.Text == comboBoxUnit.Items[0].ToString() || comboBox1.Text == "" || textBox1.Text == "")
{
MessageBox.Show("单位设置不正确!");
}
else
{
string path = textBox1.Text;
string strFolder = System.IO.Path.GetDirectoryName(path);
string strFilename = System.IO.Path.GetFileNameWithoutExtension(path);
CreatShapefile(strFolder, strFilename);
ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new Geoprocessor();
IFeatureLayer pLayer = null;
for (int i = 0; i < axMapControl1.LayerCount; i++)
{
if (axMapControl1.Map.get_Layer(i).Name.ToString() == comboBox1.SelectedItem.ToString())
{
pLayer = (IFeatureLayer)axMapControl1.Map.get_Layer(i);
break;
}
}
ESRI.ArcGIS.AnalysisTools.Buffer pBuffer = new ESRI.ArcGIS.AnalysisTools.Buffer(pLayer, textBox1.Text, Convert.ToString(textBoxDistance.Text) + "" + (string)comboBoxUnit.SelectedItem);
IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(pBuffer, null);
pBuffer.dissolve_option = "All";
MessageBox.Show("ok");
}
我是先创建了shapefile文件 ,再以此文件来作为缓冲文件的,在创建文件时我把空间参考定义为pGeoDefEdit.SpatialReference_2 = new UnknownCoordinateSystemClass();,不知道对不对,做完了以后在创建的shape文件中好像什么东西都没有,还请高手看一下,
能告诉我AE学习步骤更好了,
[解决办法]
看到一堆代码就头疼..
你先从网上找个功能正常的例子再去改吧
[解决办法]
多半都是参数输入不正确。