I'd like to develop an application with ArcEngine that can calculate the area of a polygon.
I wrote the below code to select a polygon in a combobox:
for (int i = 0; i < pmapcontrol2.LayerCount; i++)
{
Pfeaturelayer = (IFeatureLayer)pmapcontrol2.get_Layer(i);
if (Pfeaturelayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
{
cmbfeaturelayer.Items.Add(pmapcontrol2.get_Layer(i).Name);
}
}
But I couldn't write 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?