给你说下思路吧。首先是在map里面你要找到对应的图层。
点是一个图层,面栅格是另外一个图层。先定义一个Map,就是你要选的那个图
IMap pMap = axMapControl1Map;
IActiveView pActiveView = axMapControl1ActiveView;
ILayer pLyr1 = pMapget_Layer(1);//点图层
ILayer pLyr2 = pMapget_Layer(2);//面图层
IFeatureLayer pFeatLyr1 = pLyr1 as IFeatureLayer;//转化为要素图层
IFeatureLayer pFeatLyr2 = pLyr2 as IFeatureLayer;
IFeatureClass pFeatCls1 = pFeatLyr1FeatureClass;//转化为要素类
IFeatureClass pFeatCls2 = pFeatLyr2FeatureClass;
IQueryFilter pQueryFtr=new QueryFilterClass();//查询过滤器
pQueryFtrWhereClause="NAME like ''";
//图层右击Open attribute table,查找名字为的面
IFeatureCursor pPolyCursor=pFeatCls2Search(pQueryFtr, false);
IFeature pPolyFeature = pPolyCursorNextFeature();
IPolygon pPolygon = pPolyFeatureShapeCopy as IPolygon;
IFeatureCursor pCursor=pFeatCls1Search(null, false);//查找所有点
IFeature pPointFeature = pPolyCursorNextFeature();
IPoint pPoint = pPointFeature ShapeCopy as IPoint;
ITopologicalOperator pTopologicalOperator =pPoint as ITopologicalOperator;
pPoint pPointResult = pTopologicalOperatorIntersect(pPolygon,
esriGeometryDimensionesriGeometry1Dimension) as IPoint ;
最重要的是最后一句,选取两个相交的部分,希望我的回答对你有帮助。有问题再问我哈
还有如果你只是在map中查看的话,就只是点击工具栏里面的editor选取start editing用鼠标选中就可以了啊。
是的,先得到IFeatureLayer
IFeatureLayer featureLayer = m_mapControlget_Layer(0) as IFeatureLayer;
IFeatureClass featureClass = featureLayerFeatureClass;
int num = featureClassFieldsFieldCount;
List<string> lstName = new List<string>();
for (int i = 0; i < num; i++) {
string name = featureClassFieldsget_Field(i)Name;
lstNameAdd(name);
}
朋友,得到图层的空间参考需要在ILayer和IGeoDataset接口之间进行转换:首先使用ILayer接口得到图层ILayer layer=mapLayer[i]; 然后转换到IGeoDataset接口,访问IGeoDataset接口的SpatialReferenceName属性即可。
以上就是关于arcgis中怎样在属性表中选中和面栅格相交的点 如下图全部的内容,包括:arcgis中怎样在属性表中选中和面栅格相交的点 如下图、ArcEngine我要获取当前shp图层的所有字段名,是不是必须先获取图层要素、如何用ArcEngine编程得到当前图层的坐标系等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)