Dissolve the feature after applying buffer to featureClass

464
0
06-18-2018 06:49 AM
MayurPatel
New Contributor II

Hi, I am new to ArcObject C#. I want to dissolve the feature of the featureClass after applying buffer to it. Below is my code. 

ISpatialFilter spatialFilter = new SpatialFilter();
spatialFilter.Geometry = areafeature;
spatialFilter.GeometryField = priUGFtClass.ShapeFieldName;
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

IFeatureCursor priUGCursor = priUGFtClass.Search(spatialFilter, true);         // priUGFTClass is my featureClass
IFeature priUGFeature = null;
IGeometry buffGeometry;
ITopologicalOperator topologicalOperator, topologicalOperator1;
IGeometry polygon, geometry;

while ((priUGFeature = priUGCursor.NextFeature()) != null)
{
Console.WriteLine("Total Fields before buffer : "+priUGFeature.Fields.FieldCount);
buffGeometry = priUGFeature.ShapeCopy;
topologicalOperator = buffGeometry as ITopologicalOperator;
polygon = topologicalOperator.Buffer(0.00004);

priUGFeature = shapeFileClass.CreateFeature();
priUGFeature.Shape = polygon;
topologicalOperator1 = priUGFeature.ShapeCopy as ITopologicalOperator;
geometry = topologicalOperator1.Intersect(areafeature, esriGeometryDimension.esriGeometry2Dimension);

priUGFeature.Shape = geometry;
priUGFeature.Store();  // I am storing feature in FeatureClass
// Console.WriteLine("Total fields : " + priUGFeature.Fields.FieldCount); */
}

After applying buffer to feature, at the same time I want to dissolve that featureClass. I googled but didn't find anything. 
I also want to Union all buffered feature.


Thanks in advance.

Tags (2)
0 Kudos
0 Replies