[转] AE中如何由IFeature 如何获取所对应的FeatureClass
转载的原文 AE中如何由IFeature 如何获取所对应的FeatureClass
private void OnDeleteFeatureMethod(object o)
{
IFeature pFeature = o as IFeature;
IFeatureClass pFeatureClass = pFeature.Class as IFeatureClass;
for (int i = 0; i < axMapControl1.Map.LayerCount;i++ )
{
IFeatureLayer iFeatureLayer = axMapControl1.get_Layer(i) as IFeatureLayer;
IFeatureClass iFeatureCla = iFeatureLayer.FeatureClass; if (iFeatureCla == pFeatureClass)
{
IWorkspace pWorkSpace = m_EngineEditor.EditWorkspace;
textBox3.Text += "操作的文件全路径:" + pWorkSpace.PathName + "\\" + axMapControl1.get_Layer(i).Name + ".shp " + "\r\n";
break;
}
} if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
{
IGeometry iGe = pFeature.Shape;
IPoint ipo = new PointClass();
ipo = iGe as IPoint;
int a = 0;
int b = 0;
axMapControl1.FromMapPoint(ipo, ref a, ref b);
textBox3.Text += "删除的点的ID号:" + pFeature.OID + ",坐标:(" + a + "," + b + ")" + "\r\n";
}
else if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
{
textBox3.Text += "删除的多边形对象的ID号:" + pFeature.OID + ",坐标:";
IPolygon pPolygon = (IPolygon)pFeature.Shape;
int a = 0;
int b = 0;
//把该feature强制转换为一个点的集合,再取点的坐标
IPointCollection pPointCollection = pPolygon as IPointCollection;
for (int i = 0; i < pPointCollection.PointCount - 1; i++)
{
IPoint ipo = pPointCollection.get_Point(i);
axMapControl1.FromMapPoint(ipo, ref a, ref b);
textBox3.Text += "(" + a + "," + b + ")" + "\t";
}
textBox3.Text += "\r\n";
} else if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
{
textBox3.Text += "删除的线对象的ID号:" + pFeature.OID + ",其坐标:";
IPolyline pPolygon = (IPolyline)pFeature.Shape;
int a = 0;
int b = 0;
//把该feature强制转换为一个点的集合,再取点的坐标
IPointCollection pPointCollection = pPolygon as IPointCollection;
for (int i = 0; i < pPointCollection.PointCount; i++)
{
IPoint ipo = pPointCollection.get_Point(i);
axMapControl1.FromMapPoint(ipo, ref a, ref b);
textBox3.Text += "(" + a + "," + b + ")" + "\t";
}
textBox3.Text += "\r\n";
}
axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
}
[转] AE中如何由IFeature 如何获取所对应的FeatureClass的更多相关文章
- AE中Shapefile文件添加到SDE数据集
linder_lee 原文 AE中Shapefile文件添加到SDE数据集(c#) 主要完成用C#,通过AE将本地Shapefile文件导入到SDE的指定数据集下面. 首先说下思路: (1) 通过Op ...
- AE中Identify查询工具的实现
原文 AE中Identify查询工具的实现 主要实现点击查询并闪烁显示,并把查询要素的信息通过DataGridView显示出来,主要用到的接口: IIdentity.IArray.IIdentifyO ...
- AE中地图查询方式
樱木 原文 AE中地图查询方式 地图查询主要有两种查询:空间查询和属性查询 所用到知识点: 1 Cursor(游标)对象 本质上是一个指向数据的指针,本身不包含数据内容,提供一个连接到ROW对象或者 ...
- PHP用正则批量替换Img中src内容,用正则表达式获取图片路径实现缩略图功能
PHP用正则批量替换Img中src内容,用正则表达式获取图片路径实现缩略图功能 网上很多正则表达式只能获取或者替换一个img的src内容,或者只能替换固定的字符串,要动态替换多个图片内容的试了几个小时 ...
- git拉取远程分支并创建本地分支和Git中从远程的分支获取最新的版本到本地
git拉取远程分支并创建本地分支 一.查看远程分支 使用如下Git命令查看所有远程分支: git branch -r 二.拉取远程分支并创建本地分支 方法一 使用如下命令: git checkout ...
- Git中从远程的分支获取最新的版本到本地
Git中从远程的分支获取最新的版本到本地有这样2个命令: 1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge git fetch origin mastergit l ...
- jQuery遍历table中的tr td并获取td中的值
jQuery遍历table中的tr td并获取td中的值 $(function(){ $("#tableId tr").find("td").each(func ...
- JAVA中执行JavaScript代码并获取返回值
JAVA中执行JavaScript代码并获取返回值 场景描述 实现思路 技术要点 代码实现 测试方法 运行结果 改进空间 场景描述 今天在CSDN上偶然看到一个帖子对于一段字符串 “var p=‘xx ...
- springboot中使用ContextLoaderListener.getCurrentWebApplicationContext();获取WebApplicationContext为空问题
WebApplicationContext applicationContext = ContextLoaderListener.getCurrentWebApplicationContext(); ...
随机推荐
- Oracle调优总结(经典实践 重要)
转载:http://langgufu.iteye.com/blog/1974211 Problem Description:1.每个表的结构及主键索引情况2.每个表的count(*)记录是多少3.对于 ...
- 转: 在.NET中操作数字证书
作者:玄魂出处:博客2010-06-23 12:05 http://winsystem.ctocio.com.cn/19/9492019.shtml .NET为我们提供了操作数字证书的两个主要的类,分 ...
- hdu 1850 Being a Good Boy in Spring Festival 博弈论
求可行的方案数!! 代码如下: #include<stdio.h> ]; int main(){ int n,m; while(scanf("%d",&n)&a ...
- DIV+CSS列表式布局(同意图片的应用)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 小心!#define max(a,b) a>b?a:b
今天做oj的时候,定义了两个宏: //wrong code#define max_2(a,b) a>b?a:b #define max_3(a,b,c) (a>b?a:b)>c?(a ...
- Highcharts中初始化最大值与最小值的柱状图
<!doctype html> <html lang="en"> <head> <script type="text/javas ...
- [mock]8月8日
第一题是整数的方阵,求其中的子方阵,和最大.返回最大和以及子方阵宽度.因为做了topcoder的题,所以比较顺手,O(n^3)的复杂度. pair<int,int> maxiSum(vec ...
- Shell最多支持多少个参数
本文转自:http://www.jb51.net/article/56548.htm 这篇文章主要介绍了Shell最多支持多少个参数?本文是对Shell最多可以输入多少个参数的一篇测试文章,需要的 ...
- Jdk命令之jps
jps -- Java Virtual Machine Process Status Tool jps命令类似于Linux下的ps命令,可以列出本机所有正在运行的java进程.
- 59. Spiral Matrix II
题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. ...