Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

i'd like to develope an application with arcengine that can calculate area of a polygon .

i wrote the below code to select a polygon in combobox

 for (int i = 0; i < pmapcontrol2.LayerCount; i++)

                        Pfeaturelayer = (IFeatureLayer)pmapcontrol2.get_Layer(i);
                        if (Pfeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)


but i couldn't wrote code to calculate pfeaturelayer area . i think i should use Ilayer interface and Ilayer use Ifeature to calculate area not ifeaturelayer . is there any way to use Ifeature for this application ? thank you.

share|improve this question
up vote 1 down vote accepted

Here is a link for some sample code that calculates area of selected polygon feature.

share|improve this answer
thank you . but this example used editor to calculate area .i'd like to calculate the selected layer in combobox . – wetland Feb 9 '12 at 19:56
@majid moosavi, Can you elaborate more what you mean by 'calculate the selected layer in combobox'? – artwork21 Feb 9 '12 at 20:22
,i have a combobox and a button .when i click to the button ,the program calculate area of the selected layer in combobox and show the area in messagebox. thanks – wetland Feb 9 '12 at 21:19
IArea.Area property gives you the area size. If you'd like to compute the combines area of all selected polygons you will need to iterate through a cursor of features and add the areas then display in your control. – Jakub Feb 10 '12 at 14:32

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.