How can I programmatically determine if a shapefile contains points, polygons, or lines?
ArcEngine 10, VS2010, C#
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communitySearching for arcengine+shapetype will help you find: IFeatureClass Or much faster if you like: check byte 32-35 of the file http://en.wikipedia.org/wiki/Shapefile
you can iterate through the geometry features and determine the type of the geometry feature in a conditional statement using the GetGeometryType method I suggest you go through the API found here: http://geoinformatics.tkk.fi/doc/Geo-GDAL/html/class_geo_1_1_o_g_r_1_1_geometry.html
You can use IFeatureclass.ShapeType. Opening a featureclass is a bit expensive, I bet johanvdw's method is faster.