# Programmatically detect Geometry type contained in a Shapefile

**URL:** <https://community.thinkgeo.com/t/programmatically-detect-geometry-type-contained-in-a-shapefile/1459>\
**Category:** WinForms\
**Created:** [October 11, 2010, 3:57pm UTC](https://community.thinkgeo.com/t/programmatically-detect-geometry-type-contained-in-a-shapefile/1459 "2010-10-11T15:57:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rod](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Rod](https://community.thinkgeo.com/u/Rod)\
**Post date:** [October 11, 2010, 3:57pm UTC](https://community.thinkgeo.com/t/programmatically-detect-geometry-type-contained-in-a-shapefile/1459/1 "2010-10-11T15:57:41Z")

</div>

I&nbsp;would&nbsp;like&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;programmatically&nbsp;detect&nbsp;the&nbsp;geometry&nbsp;type&nbsp;(point,&nbsp;line,&nbsp;area,...)&nbsp;which&nbsp;a&nbsp;shapefile&nbsp;contains.&nbsp;&nbsp;How&nbsp;would&nbsp;I&nbsp;do&nbsp;this&nbsp;with&nbsp;C#&nbsp;code?

Rod

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [October 12, 2010, 8:32am UTC](https://community.thinkgeo.com/t/programmatically-detect-geometry-type-contained-in-a-shapefile/1459/2 "2010-10-12T08:32:15Z")

</div>

Rod,

Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;questions.&nbsp;Following&nbsp;API&nbsp;shows&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;geometries&nbsp;in&nbsp;the&nbsp;shape&nbsp;file.&nbsp;Hope&nbsp;it&nbsp;helps.  
`ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"");ShapeFileType shapeType = worldLayer.GetShapeFileType();`  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
Thanks.  
Yale
