Maybe you could try to generalize the geometries before counting the number of vertices? That could help getting rid of extraneous vertices.
Hi,
Just a hint: Closed / Open polygons will make the difference...
Pratap
Hi @juli
I figure you should be able to find the triangles because they will have 3 (or fewer) interior angles <90 degrees. A rectangle would have more.
So... I created this workspace. You can download it with test data here:
https://www.dropbox.com/s/qumhpmagurj3km5/SpotTheTriangles.fmwt?dl=0
It seems to work well on spotting triangles, but also the occasional rectangle creeps through. I think it would depend on your source data. Here the data is building footprints, which are fairly rectangular (in fact I have to drop points out of a few to make triangles).
The angle test I actually set at 92 degrees. You might get better results by changing that - I can't decide whether up or down would work better. Probably upwards would filter out more rectangles (of one type) but let through different ones.
Anyway. I hope this helps
Mark
@juli
If the triangles have areas they obviously are closed and are polygons, and have 4 or more vertices .
Not closed triangular polylines have four or more vertices but no area. (last vetex has same coordinates as first)
If a polygon boundary cannot be generalised to 4 vertices, they are not true triangles.
So to identify true triangles all you need to do is test for vertexcount = 4.
To test for "trianglishish" area's you could use this:
Tolerance to set triangle acceptence rate.
Works by the assumption that any triangle is 50% of the area of its oriented boundingbox. (try it out)