... IPoint point = feature.Shape as IPoint; if (!CompareSpatialRefs(spatialReferenceOut,spatialReferenceSiren)) point.Project(spatialReferenceOut); ICircularArc circArc = new CircularArcClass(); ILine2 lineClosePolygon = new LineClass(); ISegmentCollection ring1 = new RingClass(); ring1.AddSegment(circArc as ISegment, ref missing, ref missing); ring1.AddSegment(lineClosePolygon as ISegment, ref missing, ref missing); IPolygon4 polygon = new PolygonClass(); polygon.SpatialReference = spatialReferenceOut; IGeometryCollection geometryCollection = polygon as IGeometryCollection; geometryCollection.AddGeometry(ring1 as IGeometry, ref missing, ref missing); circArc.PutCoordsByAngle(point, start_angle, central_angle_span, radius * HorizontalUnit_FT2OutputUnit); lineClosePolygon.PutCoords(circArc.ToPoint, circArc.FromPoint); geometryCollection.GeometriesChanged(); outputFeatureBuffer.Shape = polygon; outputFCcursor.InsertFeature(outputFeatureBuffer); ...
Solved! Go to Solution.
The polygons in your shapefile are oriented in the wrong direction. When you create a polygon, exterior rings should be oriented clockwise. A ring that is oriented counter-clockwise is considered a "hole" and will have a negative area.