I have read all feature classes and their associated geodata like Point,polyline,polygon data. API is taking too much time in reading these data.
My code is as follow:
Table testtable = geodatabase.OpenTable("\\sw_Manhole");
geoshape.Items = new List<ImpexItem>();
geoshape.LayerName = child;
bool checkFields = false;
int fieldCount = table.FieldInformation.Count;
foreach (Row row in table.Search("*", "", RowInstance.Recycle)) // reading coordinates
{
ImpexItem layerItem = new ImpexItem();
layerItem.PartList = new List<ImpexPart>();
ImpexPart itemParts = new ImpexPart();
itemParts.Coordinates = new List<PointD>();
if (row.GetGeometry().shapeType.ToString() == "Point")
{
PointShapeBuffer geometry = row.GetGeometry();
Esri.FileGDB.Point point = geometry.point;
PointD itemPoints = new PointD();
itemPoints.X = point.x;
itemPoints.Y = point.y;
itemParts.Coordinates.Add(itemPoints);
}
else
{
try
{
MultiPointShapeBuffer geometry = row.GetGeometry(); // if geometry type is polygon/polyline
Esri.FileGDB.Point[] point = geometry.Points;
for (int numpoints = 0; numpoints < point.Length; numpoints++)
{
PointD itemPoints = new PointD();
itemPoints.X = point[numpoints].x;
itemPoints.Y = point[numpoints].y;
itemParts.Coordinates.Add(itemPoints);
}
}
catch (Exception e)
{
Console.WriteLine("MultiPoint Exception" + e.Message);
}
}
layerItem.PartList.Add(itemParts);
geoshape.Items.Add(layerItem); // one layer data
}for loop will run 300 times and its taking more then 4 minutes for reading this simple data.
Message was edited by: Vince Angelo (Formatted for legibility)