Actually, this is a continuation of a previous post entitled "Count the number of corners of a polygon". Although I managed to count the number of points (i.e. saying corners) of each polygon the problem is that even a polygon may be approximately rectangular actually has more than four points because of the digitization process i.e. sometimes an approximate straight line consists of more than 2 points. How can I ignore the intermediate additional points that are not really needed for my purpose? Thanks.
I would simplify the polygon first to remove any of the unwanted vertices.
Go through each vertex and for each that is outside of tolerance of 180 degrees include in the count?