Friday, June 29, 2018

American City Voronoi

This in a Java Swing application which tries to find areas most reached by a city. It uses a modified Voronoi diagram drawing algorithm which factors in a "reach" value in addition to the distance when drawing the diagram. As it stands right now, reach is the cubic root of the metropolitan area population divided by 100K. The distance comparer compares the distance between two cities and a point using the following formula.

compVal = bDist * aReach - aDist * bReach

Positive values mean b is less reachable than a is.
There are checkboxes for using taxicab/manhattan distance, using reach or using the standard voronoi diagram drawing algorithm, and minimum population culling. The metropolitan areas selected were from the United States and Canada. I used the following lists for reference, but took some liberties in combining close-by areas as I saw fit.

https://en.wikipedia.org/wiki/List_of_primary_statistical_areas_of_the_United_States
https://en.wikipedia.org/wiki/List_of_census_metropolitan_areas_and_agglomerations_in_Canada

State boundaries were defined from defining state boundaries in Google Maps, and exporting the data into a format that I could easily convert into x,y data in my coordinate system.
 
The following images show what the application looks like in action, as well as the output it produces.

Using the save button, one can generate a picture of the entire map.
In later editions, I allowed for custom area colors.  This map shows a map which included major universities, where the university colors were included in the XML data file.
Later versions also included an improved distance calculator, and linking together cities into regions, as the below picture illustrates.
More about this project, as well as the source, can be found here:
https://github.com/RollerSimmer/AmericanCityVoronoi
https://github.com/RollerSimmer/AmericanCityVoronoi/releases







No comments:

Post a Comment