C# AE 如何把ifeature所指要素单独arcgis导出选中要素来?

温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(7668)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'AE--属性表添加字段,修改字段属性',
blogAbstract:'一、&//定义新字段&&&&&&&&&&&&IField pField = new FieldClass();&&&&&',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:4,
publishTime:4,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}没有更多推荐了,
不良信息举报
举报内容:
AE(C#)Shapefile导入mdb数据库
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
网上的代码是点击dataGridView控件的rowheader,通过查询属性表FID列获取FID值,再将选中图层相应的要素高亮显示。搞清楚原理后,我又增加了双击dataGridView单元格高亮显示图层要素,成功。下面是代码,这里就不贴源代码了。///////////////////////////////////////华丽的分割线/////////////////////////////////////////////////////////////////// &summary&& & & &&/// 高亮显示选择要素& & & & /// &/summary&& & & & /// &param name="sender"&&/param&& & & & /// &param name="e"&&/param&/////& & & & private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)& & & & {& & & & & & axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);& & & & & & IQueryFilter pQuery = new QueryFilterClass();& & & & & & int count = this.dataGridView1.SelectedRows.C& & & & & && & & & & && & & & & & col = this.dataGridView1.Columns[0].N& & & & & & //当只选中一行时& & & & & & if (count == 1)& & & & & & {& & & & & & & & val = this.dataGridView1.SelectedRows[0].Cells[col].Value.ToString();& & & & & & & & //设置高亮要素的查询条件& & & & & & & & pQuery.WhereClause = col + "=" +& & & & & & }& & & & & & else//当选中多行时& & & & & & {& & & & & & & && & & & & & & && & & & & & & & for (i = 0; i & count - 1; i++)& & & & & & & & {& & & & & & & & & & val = this.dataGridView1.SelectedRows[i].Cells[col].Value.ToString();& & & & & & & & & & str = col + "=" + val + " OR ";& & & & & & & & & & pQuery.WhereClause +=& & & & & & & & }& & & & & & & & //添加最后一个要素的条件& & & & & & & & val = this.dataGridView1.SelectedRows[i].Cells[col].Value.ToString();& & & & & & & & str = col + "=" +& & & & & & & & pQuery.WhereClause +=& & & & & & }///////注意下行代码中的& & & & & & IFeatureLayer pFeatureLayer = SelectedLayer_TOC as IFeatureL& & & & & & IFeatureSelection pFeatS& & & & & &&& & & & & & pFeatSelection = pFeatureLayer as IFeatureS& & & & & & pFeatSelection.Clear();& & & & & & pFeatSelection.SelectFeatures(pQuery, esriSelectionResultEnum.esriSelectionResultNew, false);& & & & & & axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null); & & & & && & & & }& & & & private void simpleButton1_Click(object sender, EventArgs e)& & & & {& & & & & & dataGridView1.DataSource =& & & & & & dataGridView1.Width = 0;& & & & }& & & & private void simpleButton2_Click(object sender, EventArgs e)& & & & {& & & & & & dataGridView1.ClearSelection();& & & & & & axMapControl1.Map.ClearSelection();& & & & & & axMapControl1.Refresh();& & & & }/////这是我增加的单元格双击显示要素的代码,去掉了选择多行的部分& & & & private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)& & & & {& & & & & & axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);& & & & & & IQueryFilter pQuery = new QueryFilterClass();& & & & & && & & & & && & & & & & col = this.dataGridView1.Columns[0].N& & & & & & val = this.dataGridView1.CurrentCell.OwningRow.Cells[0].Value.ToString();& & & & & & //设置高亮要素的查询条件& & & & & & pQuery.WhereClause = col + "=" +& & & & & & IFeatureLayer pFeatureLayer = SelectedLayer_TOC as IFeatureL& & & & & & IFeatureSelection pFeatS& & & & & & pFeatSelection = pFeatureLayer as IFeatureS& & & & & & pFeatSelection.Clear();& & & & & & pFeatSelection.SelectFeatures(pQuery, esriSelectionResultEnum.esriSelectionResultNew, false);& & & & & & axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);& & & & }亲测可行,&
阅读(1663)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'C# AE
点击属性表 axMapConl图层高亮显示图层要素',
blogAbstract:'在网上找到了一段代码,试试可行,在此感谢伟大无私的程序员网友们。网上的代码是点击dataGridView控件的rowheader,通过查询属性表FID列获取FID值,再将选中图层相应的要素高亮显示。搞清楚原理后,我又增加了双击dataGridView单元格高亮显示图层要素,成功。下面是代码,这里就不贴源代码了。///////////////////////////////////////华丽的分割线////////////////////////////////////////////////////////////////',
blogTag:'c#,arcgis,ae,高亮显示',
blogUrl:'blog/static/5',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:5,
permalink:'blog/static/5',
commentCount:1,
mainCommentCount:1,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}博客分类:
功能:远程web上传shp文件,然后添加到指定的SDE已经存在的FeatureClass里
思路:读取shp里的Feature,编程连接到SDE,打开指定的FeatureClass,然后插入。
缺点:现在只能适用没有注册为版本的FeatureClass,在测试过程中,如果注册为版本,则运行报“Objects in this class cannot be updated outside an edit session ” 这个错误,一直不知道怎么解决,还请高手指点。
主要实现代码:
文件上传功能实现:
private void UpLoadFiles()
string filepath = Server.MapPath("./") + "UpLoadFiles";
HttpFileCollection uploadedFiles = Request.F
for (int i = 0; i & uploadedFiles.C i++)
HttpPostedFile userPostedFile = uploadedFiles[i];
if (userPostedFile.ContentLength & 0)
userPostedFile.SaveAs(filepath + "\\" + System.IO.Path.GetFileName(userPostedFile.FileName));
message.Text = this.ShpFile + "上传成功!";
message.Text = this.ShpFile + "上传失败!";
读取shp里的Feature功能实现:
public IFeatureClass GetShpFeatureClass()
IFeatureClass returnFeatureClass =
//取得服务中的基本信息
IServerContext soc = GetSoc();
string filepath = Server.MapPath("./") + "UpLoadFiles";
IWorkspaceFactory pWorkspaceFactory = (IWorkspaceFactory)soc.CreateObject("esriDataSourcesFile.ShapefileWorkspaceFactory");
IFeatureWorkspace pFeatWS = pWorkspaceFactory.OpenFromFile(@filepath, 0) as IFeatureW
//IFeatureLayer pLayer = (IFeatureLayer)pSOC.CreateObject("esriCarto.FeatureLayer");
returnFeatureClass = pFeatWS.OpenFeatureClass("china-hlj.shp");
//pLayer.Name = "rivers";
soc.ReleaseContext();
return returnFeatureC
添加Feature到SDE的功能实现:
public void Add_Fea(string FeaName, IFeature insertFeature)
IServerContext soc = GetSoc();
IPropertySet propSet = new PropertySetClass();
propSet.SetProperty("SERVER", this.SdeServer);
propSet.SetProperty("INSTANCE", this.SdeInstance);
propSet.SetProperty("USER", this.SdeUser);
propSet.SetProperty("PASSWORD", this.SdePassword);
propSet.SetProperty("VERSION", this.SdeVerson);
IWorkspaceFactory pWorkSpFac = (IWorkspaceFactory)soc.CreateObject("esriDataSourcesGDB.SDEWorkspaceFactory");
IFeatureWorkspace pFeaWorkSp =
pFeaWorkSp = (IFeatureWorkspace)(pWorkSpFac.Open(propSet, 0));//打开要素空间
IFeatureClass FeaCls = pFeaWorkSp.OpenFeatureClass(FeaName);//取得要素集
IFeatureCursor FeaCursor = FeaCls.Insert(true);
IFeatureBuffer FeaBuffer = FeaCls.CreateFeatureBuffer(); ;
IField Fld = new FieldClass();
IFields Flds = insertFeature.F
for (int i = 0; i & Flds.FieldC i++)
Fld = Flds.get_Field(i);
int index = FeaBuffer.Fields.FindField(Fld.Name);
if (index != -1)
FeaBuffer.set_Value(index, insertFeature.get_Value(i));
FeaCursor.InsertFeature(FeaBuffer);
soc.ReleaseContext();
pFeaWorkSp =
使用注意事项:在使用时要设置SdeServer、SdeInstance、SdeUser、SdePassword、SdeVerson、FeatureClass等属性。
下载次数: 92
浏览: 1264383 次
来自: 成都
5、MapResourceManager控件中添加了两个服务, ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'

我要回帖

更多关于 团队领导力的五个要素 的文章

 

随机推荐