I have a set of 1000 coordinates, each of which represents urban centers of a certain state. These cities belong to one of the 20 counties, and I know which cities belong to the county. I want to shade a map based on the data that I have for each county. For example, if the graph has a value of 100%, then I want the color of this district to be dark red, if the county is associated with 0%, then I will color this part of the map with white.
I donβt have borders for each county, because they are old counties, and it will take a lot of work to keep track of borders from old maps. I have borders of the state, including islands and lakes, etc.
So here are the data that I have:
Town1 50.1,4.89 County1 Town2 49.9,4.78 County1 Town3 50.3,4.59 County1 Town4 50.2,4.99 County1 Town5 50.0,4.99 County1 ... Town1000 57.0,8.33 County20
and
County1 100% County2 100% County3 68% ... County20 0%
as well as state boundaries.
Solution1: Thus, one of the ways to create my desired map can be to create polygons around each coordinate (city), and this polygon represents the entire area on the map closest to this city and closer to no other city. Then I draw this polygon according to its county.
Solution2: Perhaps the best approach would be a combination of colors between cities. Therefore, if I have two neighboring cities in different counties, one with 100% and one with 0%, then half the path between them will be pink (halfway between dark red and white).
Therefore, I want to programmatically create this map as an image file, where this file is easy to scale and where I can import it into Photoshop to add other elements. Would you recommend SVG in this case?
What library or algorithm can I use to create polygons, as required in solution 1?
Is there a library that I can use to create an SVG document with a mesh type gradient, as required in solution 2?
I want to use Python3 if possible, but I am open to other languages. I am also open to other SVG solutions and alternatives.
I am using macOS.