Coastline

We already got scalable Voronoi graph and heightmap on it. The next step is to draw a coastline that will make the border between water a land masses clearer.

The easiest way to separate land and water is just to omit the water rendering. We can set background to our svg element to represent the water and then draw only the polygons higher than water threshold. It’s a good idea to have a small margin for a water height, it will be useful later. As the currently used spectral color scheme already provides rather plausible colors I prefer to define a sea level to 0.2 (green color starts here). In this case polygons with height less than 0.2 will be considered as water and won’t be drawn, polygons with height more or equal to 0.2 will be considered as lands.

Just minor change and voila, map looks plausible and even close to the some of these NASA relief maps.

Continue reading “Coastline”