Are there any good approaches to generating regions for a 2D map? Suppose you have a world map and would like to create country or province borders with a somewhat realistic look.
I found this blog post (and its two successors) recently, and I think it's quite close to what you're looking for.
http://simblob.blogspot.com/2010/09/polygon-map-generation-part-1.html
He's using his methods to create realistic landscapes but hopefully you can see ways to use the same techniques to group areas into believable regions.
Tessellation using a Voroni diagram is one approach, and whilst the shapes can be made quite irregular, it is not very realistic.
Martin Källman's idea seems the best way to do it since you don't have natural terrain to define some of the borders. Generate random points within your borders and then Voronoi them into country borders. I would probably take it one step further and make more points than desired countries, and then merge several adjacent cells to make some of the resulting areas concave. You could use an algorithm similar to a randomized Kruskal to perform the merging (take all the countries, merge two adjacent countries, repeat until you have the desired total). I can't get to Kylotan's link, but it may describe a better way to merge the cells generated by the Voronoi.
I'd use a scriptable/programmable CAD or Vector illustration package to draw the shapes by hand, then process the data with a custom script into custom data files or directly into source code. In fact I have done this a number of times in the past (usually to generate VB.NET code for creating GraphicsPath objects from CAD line drawings).
Could you be more specific? What kind of format do these regions need to have? What kind of data do you already have?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With