Tag Archives: Programming

Howfar It Is from Here to There

My redistricting algorithm selects census blocks based on their distance from the district center. The coordinates of the district center and of the next census block are given in latitude and longitude integer tenmillionths degrees. Of the many methods to calculate that distance, which is best? A first method assumes the earth is flat, and […]

The Input files

For the computer to do redistricting, the computer must receive certain data. Sandboxwalls used three data files as input. The first file contained the census block data. The second file contained the borders of the State as a polygon. The third file contained the information on what census blocks were immediately adjacent to any given […]

Out of Sorts with Redistricting

      My ideas for redistricting with a sandboxwalls program involve a lot of data sorting.  First, the census blocks of a state are sorted by latitude.  However, the states are two dimensional, not one-dimensional.  Consider a television picture.  The picture is made up of horizontal stripes.  Using that concept, the latitude of the State is […]

Faster than a speeding square root

In the data from the Census Bureau, the location of the census blocks are given by latitude and longitude. Instead of degrees, minutes, and seconds, the latitude and longitude are given in millionths of a degree. Fortunately, these are conveniently expressed as 32-bit integers. Finding the geographical distance between two points usually means employing the […]