其他分享
首页 > 其他分享> > Arcgis Engine(ae)接口详解(1):featureClass

Arcgis Engine(ae)接口详解(1):featureClass

作者:互联网

//IFeatureClass 来源请自行解决
                IFeatureClass featureClass = null;

                //获取featureClass的各种名称
                //PS:featureClass可以as到IDataset,因此不能只看接口名,并不是只有数据集才实现IDataset接口
                IDataset dataset = featureClass as IDataset;
                //理论上Name和BrowseName都是名称,在很多情况下都是一样的,在什么时候一样我也无法完全总结,一般可以优先用Name
                string name = dataset.Name;
                string browseName = dataset.BrowseName;
                //别名
                string aliasName = featureClass.AliasName;
                //去掉sde用户名的名称,因为如果是sde的featureClass,名称前会带所属的sde用户名,例如:sde.road,那经过处理后会返回road
                string nameWithoutSdeName = FeatureClassHelper.GetDatasetNameWithOutSDEUser(dataset);

                //几何类型,包括点(point)线(polyline)面(polygon)等
                esriGeometryType geometryType2 = featureClass.ShapeType;

                //wordspace,可以获得featureClass所在的worksapce
                IWorkspace wordspace = dataset.Workspace;
                //wordspace,可以获得featureClass所在的数据集,如果featureClass不在数据集内,此属性返回null
                IFeatureDataset featureDataset = featureClass.FeatureDataset;

                //oid字段的字段名
                string oidFieldName = featureClass.OIDFieldName;
                //几何字段的字段名
                string shapeFieldName = featureClass.ShapeFieldName;

                //IGeoDataset是几何相关的接口
                IGeoDataset geoDataset = featureClass as IGeoDataset;
                //featureClass的范围
                IEnvelope envelope = geoDataset.Extent;
                //空间参考
                ISpatialReference spatialReference2 = geoDataset.SpatialReference;

 

标签:Engine,IDataset,ae,string,sde,IGeoDataset,dataset,Arcgis,featureClass
来源: https://www.cnblogs.com/cannel/p/11074312.html