I have an array, containing lat/lon coordinates which form a polygon(the boundaries of certain cities on the map). I got this data from OpenStreetMap's database, and my problem is what follows:
Certain location boundaries, are formed by 5-6000+ lat/lon coordinates, which is a very large data for me to work with. In the meanwhile, I've observed that a lot of these polygons could be trimmed down to contain a fewer points, because a lot of lat/lon coordinates are placed on the same line.
What I would be interested in, is if it would be possible, to get a polygon, and programatically check if multiple points of it reside on the same line(with a small error margin), and delete unneeded(in my case) points, thus so minifying the polygon itself?