bolson: (Default)
bolson ([personal profile] bolson) wrote2006-07-16 01:35 am
Entry tags:

Worst Polygon Ever

I'm trying to make my redistricting output prettier, but it isn't easy.

According to the census bureau's data, a polygon is made up of a collection of line segments. That's fine, but they don't give them to me in order, so I have to check the head and tail points of each line segment to see if it happens to match another line segment head or tail point and then I can link them up into a continuous loop. Except in a case like this:

That's two polygons, an outer one and an inner one. When I said "line segment" before that wasn't precise in the way we usually think about it, because the census map data has intermediate points which give the line some additional shape. In this case, the inner polygon is completely specified by one line segment which has a start and end point which coincide. The outer polygon gets those various line segments there, but no hint I have to traverse the one line segment at the bottom twice and generally no hints about how to go through the 3-edge-verticies. Grr.

These polygons are actually at a lower level of detail than I need, so I may just try to extract the edges of the higher level boundary I do actually need. Hopefully bigger blocks will be better behaved and have fewer nasty fiddly bits.

[identity profile] arpiana.livejournal.com 2006-07-16 04:59 pm (UTC)(link)
Hahaha... I'm sorry. I know this problem well.