阅读:1758回复:2
如何判断一个图层是shape图层
利用AB+arcENgine 开发时,如何判断一个图层是shape图层?谢谢!
|
|
1楼#
发布于:2006-07-06 09:59
<DIV>
<H1>IFeatureLayer.<FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> Property [C#]</H1></DIV> <DIV> <H4>See Also</H4><a href="ms-help://ESRI.ArcGIS/esriCarto/html/IFeatureLayer.htm" target="_blank" >IFeatureLayer Interface</A></DIV> <DIV><B>Language</B> <UL> <LI><a href="" target="_blank" >C#</A><BR> <LI><a href="" target="_blank" >Visual Basic .NET</A><BR> <LI><a href="" target="_blank" >Show All</A></LI></UL></DIV> <DIV> <P>Data source type. </P><PRE none">[Visual Basic .NET] <B>Public Property <FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> As </B><a>String</A></B></PRE><PRE block">[C#] <B>public </B><a>string</A> <B><FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> {get; set;}</B></PRE> <H4>Product Availability</H4> <DIV>Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.</DIV> <H4>Description</H4> <P>Describes the type of data referenced by the feature layer. In ArcMap and ArcCatalog this description appears on the layer's properties dialog on the Source tab after "Data Type:"</P> <H4>Remarks</H4> <DIV class=tableDiv>By default, the <STRONG><FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> </STRONG>for a layer matches the value returned by <STRONG>IDataset::Category </STRONG>when you access the layer's feature class through <STRONG>IDataset</STRONG>. You can set a layer's <STRONG><FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> </STRONG>to any string.</DIV> <P>Here is a list of default values for <STRONG><FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>DataSourceType</FONT> </STRONG>for common feature layer types:</P> <DIV class=tableDiv> <DIV class=tableDiv> <TABLE> <TR> <TH>Layer Type</TH> <TH>Value</TH> <TR> <TD>Personal Geodatabase</TD> <TD>"Personal Geodatabase Feature Class"</TD></TR> <TR> <TD>SDE</TD> <TD>"SDE Feature Class"</TD></TR> <TR> <TD>Shapefile</TD> <TD>"Shapefile Feature Class"</TD></TR> <TR> <TD>ArcInfo or PC ArcInfo Coverage (annotation)</TD> <TD>"Annotation Feature Class"</TD></TR> <TR> <TD>ArcInfo or PC ArcInfo Coverage (point)</TD> <TD>"Point Feature Class"</TD></TR> <TR> <TD>ArcInfo or PC ArcInfo Coverage (line)</TD> <TD>"Arc Feature Class"</TD></TR> <TR> <TD>ArcInfo or PC ArcInfo Coverage (polygon)</TD> <TD>"Polygon Feature Class"</TD></TR> <TR> <TD>Edge</TD> <TD>"StreetMap Feature Class"</TD></TR> <TR> <TD>CAD (annotation)</TD> <TD>"CAD Annotation Feature Class"</TD></TR> <TR> <TD>CAD (point)</TD> <TD>"CAD Point Feature Class"</TD></TR> <TR> <TD>CAD (line)</TD> <TD>"CAD Polyline Feature Class"</TD></TR> <TR> <TD>CAD (polygon)</TD> <TD>"CAD Polygon Feature Class"</TD></TR></TABLE></DIV></DIV></DIV> |
|
|
2楼#
发布于:2006-07-06 10:25
<P>把这个图层强制转换成IFeatuerLayer,如果转换失败就不是shape几何类型图层。如IFeatureLayer iFeatureLyr = iLyr as IFeatureLayer;</P>
<P>if(iFeatureLyr == null)...</P> |
|