suppose that I have discrete map, on this map appears country represented by color blue:
country area is always coherent.
Now I want to extract borders from it:
So:
- I have a list of unordered tiles of country, in this case: (3,3), (4,3), (4,4)...
- I want to extract ordered sequence of borders, in this case: ((2,2),(3,2)), ((3,2),(4,2)),.... where ((x1,y1),(x2,y2)) means that beggining of border starts in (x1,y1) and ends in (x2,y2)