Multiple Terrains and Terrain Heightmaps

Okay so i have the stitching of the terrain down packed. But what i am looking for is how to find the left, right, top, bottom vertex values of each terrain I have and then join them at the the average between the both of their Y value’s.

Terrains are display like this:
34751-untitled-2.png[3]
[4][5][6][7]

[2][3][4][5]

So i want to be able to identify the right edge of “0” and connect the vertices Y values with he left edge of “1”.

I have terrain stitching and i have used SetNeighbours although that does not achieve the next step i wish.

The basic process is:

Pick an axis to operate on first (east/west or north/south).
Pick a direction to work on in that axis.
Starting with one edge of your terrain grid, stitch all terrains to their neighbors on that axis.
Stitch all terrains to their neighbors on the other axis.
Perform any texturing necessary.
Then call set neighbors

The stitch operation will examine a certain number of rows or columns in the heights of two adjacent terrains. Just averaging the outer-most rows or columns will create unwanted jaggedness. The outer-most row or column of each terrain pair (the strip of heights which need to match exactly) will be averaged. For the other selected rows, each height should be “pulled” toward this newly-averaged height value to create a smoothing effect. The strength of that pull is determined by the distance from the respective edge, with a very strong pull at one or two strips from the edge, tapering off to no pull whatsoever after N strips from the edge.

Make sense?