in reply to Map grid to boundary conversion algorithm

Hi,
I'd first define a 2-dimensional system to identify the terrain-data and to identify all distinct border pieces within the same terrain. You should be able of identifying all 4 borders of any terrain-piece. You should also be able of identifying the crossings in the same way.
So if you start with a piece of terrain e.g. $t[x][y] you should have an algorithm to find its borders and border-crossings.
One possibility might be to define that every piece of terrain has it's own borders and crossings and make the identification dependant like that: $t[x][y] would lead to $b[x][y][E], $b[x][y][S], $c[x][y][NE] and $c[x][y][SE].

pelagic