赞
踩
最近在做一个房籍图的管理系统,其中需要处理一下地图数据。要求是给图幅接合表的图层增加一个字段,然后在属性数据库中查询每个要素(格网)的图幅数,将结果写入新建字段里。
对于经常用程序做GIS数据处理的,这个实现起来并不难,使用ArcEngine简单写个处理程序即可。不过,不同于之前的应用类程序,这种数据处理程序是要考虑效率问题的。
我第一次写的函数
private void FJT_Click(object sender, EventArgs e)
{
Stopwatch sp1 = new Stopwatch();
string sql="";
IFeatureClass icladd = AEDataHelper.OpenMdbFeatureClass("D:\\数据\\最新汇总.mdb", "WBgrid");
IFeatureCursor ifcu = icladd.Update(null, false);
IFeature pfea = ifcu.NextFeature();
sqlConnection.Open();
while (pfea!=null)
{
int xh = pfea.Fields.FindField("testname");
string va = pfea.get_Value(xh).ToString();
sql = "SELECT count(*) as cou from tm_nameinfo where name=\'" + va+"\'";
DataTable dt = Executmdbsql(sql,sqlConnection);
// DataTable dt = Executmdbsql2(sql);
string guiddd = dt.Rows[0]["cou"].ToString();
int fjt = pfea.Fields.FindField("FJTcount");
pfea.set_Value(fjt, guiddd);
pfea.St
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。