Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I programmatically determine if a shapefile contains points, polygons, or lines?

ArcEngine 10, VS2010, C#

share|improve this question
up vote 4 down vote accepted

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:

share|improve this answer

Searching for arcengine+shapetype will help you find: IFeatureClass Or much faster if you like: check byte 32-35 of the file

share|improve this answer
The problem with links to google in an answer (in general) is that there's a good chance that the #1 result in a little while will be this question. (Assuming this site will accumulate the sort of googlejuice that has...) Also, LMGTFY is a touch snarky, which I appreciate, but not everyone does. ;) – Dan S. Feb 24 '11 at 19:03
I've added the link which you are supposed to find. Using lmgtfy is educational here. – johanvdw Feb 24 '11 at 19:06

You can use IFeatureclass.ShapeType. Opening a featureclass is a bit expensive, I bet johanvdw's method is faster.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.