判断Featureclass的类型

一个Featureclass可以是Shapefile Feature Class、Personal Geodatabase Feature Class、File Geodatabase Feature Class等多种选择。判断其类型可从以下接口中获得。

1.FeatureLayer的话,可以直接从IFeatureLayer2.DataSourceType 取得。
2.Featureclass的话,可以QI到IDataset.Category
取得。

根据返回字符串的关键字进行相应判断,英文版和中文版后面的关键不同,中文版返回中文,如“要素类”等。

Layer TypeValue
Personal Geodatabase "Personal Geodatabase Feature Class"
SDE "SDE Feature Class"
Shapefile "Shapefile Feature Class"
ArcInfo or PC ArcInfo Coverage (annotation) "Annotation Feature Class"
ArcInfo or PC ArcInfo Coverage (point) "Point Feature Class"
ArcInfo or PC ArcInfo Coverage (line) "Arc Feature Class"
ArcInfo or PC ArcInfo Coverage (polygon) "Polygon Feature Class"
Edge "StreetMap Feature Class"
CAD (annotation) "CAD Annotation Feature Class"
CAD (point) "CAD Point Feature Class"
CAD (line) "CAD Polyline Feature Class"
CAD (polygon) "CAD Polygon Feature Class"
原文地址:https://www.cnblogs.com/goodmangis/p/3787548.html