I need to create a grid of polygons. Each polygon is rectangle, thus has 4 corners (vertices). When I create polygon features using ArcObjects they seem to have wrong geometry, which results in wrong label placement (outside polygons).
I use the following approach:
Dim pPntColl As IPointCollection
pPntColl = New Polygon
Dim pPoint As IPoint
pPoint = New Point
pPoint.PutCoords(dX, dY)
pPntColl.AddPoint(pPoint)
...
When I use 4 vertices I get a polygon which has one segment missing (visible in Edit session).
When I add the first point at the end of polygon (as a 5th point), geometry looks good, but the label is still off.
I know I can use ITopologicalOperator2
and Simplify()
method but:
- This affects the performance (I need to create many thousands of polygons).
- I don't understand, what is the reason of the problem. I have 4 points, they should create a topologically correct polygons...
So, my question is: what is the best way of creating polygon features within a polygon feature class using ArcObjects?
I already checked some ESRI recommended approaches, e.g.:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000002wm000000
but the problem is still the same: I need to use Simplify()
to get polygons right.
Any help and hints how to optimize this will be appreciated.