Quote Originally Posted by gilgamec View Post
I've given this a try and I'm curious how you're handling the triangulation near the coastline. Not creating points outside the landmass gives triangulations like this:
Click image for larger version. 

Name:	poisson-edge-problems.jpg 
Views:	66 
Size:	25.5 KB 
ID:	73597
This in turn gives rivers that reach the coastline at very oblique angles. Are you continuing the triangulation beyond the coasts but truncating the triangles? If so, how do you handle altitudes of these triangles? Is there some other solution I've missed?
Yes I'm continuing outside the coastline. At the start, any nodes inside the land are unconnected and anything outside is connected, then I find the set of unconnected nodes adjacent to connected ones, select one at random, find the set of connected nodes adjacent to it, and select one at random, then join the two and move the newly joined node to the the connected set, and all of its adjacent nodes (that aren't connected) to the set of potential selections for the next iteration. There's no concept of elevation involved, just weight functions applied to the random selections. The final output has the rivers sticking out past the coastline. I currently fix this by applying the coastline as a clipping path in Inkscape although it shouldn't be hard to do the clipping operation in my generator, and I'll probably add that when I add a raw data output capability (shapefile, etc)