evalo82

Correct polygon shape automatically (VBA)

Discussion created by evalo82 on Apr 14, 2010
Hi,

I have a polygon layer with building footprints. What I need to do, is to find its corners that have an angle 85-95 degrees and automatically change them to be exactly 90 degrees.

So I have to write a code and its workflow should be:

1) Select the longest edge/segment of the polygon
2) Find the angle between the longest and it???s adjacent segment
3) If the angle is between 85 and 95 degrees and not 90 then correct the location of  the vertex to meet the requirement of 90 degrees
4) Select next segment
5) Select next polygon

The shape and area of the polygon should not change significantly

I'm a beginner in VBA so any help (suggestions, examples, code etc.) is deeply appreciated.

Thanks :)

Eva Loolaid-Raudpuu

Outcomes