3 ms·
Here is an idea I had awhile ago - the rules should limit the ability of a boundary to be concave. It isn't reasonable to say "no concave polygons", but you cou
by viggity 8y ago
Here is an idea I had awhile ago - the rules should limit the ability of a boundary to be concave. It isn't reasonable to say "no concave polygons", but you could create a measure of "concavity". If you look at a ridiculously drawn boundary, you'll see it can kind of spiral - it'll hop down a street turn a couple times all in order get the current congressman's house within his existing district.
How to do that? Use the ray casting solution to the Point in Polygon problem. (https://en.wikipedia.org/wiki/Point_in_polygon https://en.wikipedia.org/wiki/Point_in_polygon)
If there is any point within the boundary that has to cross the boundary more than 3 times to get to a point outside of the boundary, then the proposed congressional district is too complex. if it crosses 4 times (or any even number), the point isn't actually within the boundary to begin with. Crossing the boundary 3 times still allows for some concavity, but 5 is kinda ludicrous.