Districts (Advanced)

The Drawing - Districts (Advanced) menu selection is enabled when the optional Business Tools extension has been installed and the focus is on a drawing window or on a drawing layer in a map window that contains areas. If you have not activated the Business Tools extension with a valid Business Tools serial number you will not be able to use the Districts (Advanced) command.

 

The Districts (Advanced) command takes a set of areas and automatically assigns each area into as many districts are desired. For example, if four districts are desired each area in the set will be assigned to one of the districts. Areas will be assigned so districts will be made up of areas that are grouped together into the district as reasonably as possible. The districts commands in Manifold are used to create districts that represent sales territories, voting districts or other groupings of areas, which might be states, postal code areas, voting precincts or other regions.

 

The Districts (Advanced) command will also assign areas based on the content of a numeric data field so districts can be balanced by the sum total of that field. For example, areas can be assigned into districts based on the content of a Population field so that the resultant districts all have approximately the same population. Options allow balancing not only so that each district has the same total value of the balancing field but that some districts can have proportionately more or less. For example, the command may be used to create four districts, one of which has twice the population of all the rest.

 

Using this command, Manifold can either create districts by assigning areas to them without any preconditions, or we can specify which areas must be in which district.

 

The Districts (Advanced) command is a text dialog-driven command that works with values in the drawing's table. For a more visual, interactive districting function, see the Districts (Visual) command.

 

Controls

Scope

A set of areas to be assigned into districts. Normally [All Objects] to assign all areas in the drawing but can be the selection or any saved selection.

Balance

A numeric field name to use for balancing districts. Choose none to balance districts by no field but just by the number of areas in each.

Save to

The name of a numeric column to use for district identification numbers.

Rebalance existing districts

Enabled if an existing column is selected in the Save to box. Check to rebalance districts given by the identification numbers in that column.

Modify formatting

Check to modify the formatting of areas so that areas in the same district appear in the same colors.

Create contiguous districts

Check to create contiguous districts.

Districts

A sequence of numbers separated by commas giving the number of districts to be created and the relative weights given to each district.

 

To assign areas into districts:

 

1. Open a drawing that contains areas.

2. Choose [All Objects] to assign all areas in the drawing to a district.

3. If districts are to be created based on some data attribute field, choose the field to use in the Balance box. If not, choose none.

4. Choose a column in the Save to box into which each district identification number will be written. The default choice of [New Column] will create a field called District and will write the district number for each area into that column.

5. If formatting is to be modified to show each district in a different color, choose Modify formatting (the default).

6. In the Districts box enter a number followed by a comma for each district to be created. For example, the default of "1, 1" tells Manifold to create two districts. To create four districts we would enter "1, 1, 1, 1" in this box. Press OK.

 

The command will add a column called District to the drawing's table and place the district number in that column for each record. District numbers are integers beginning with 1 so that after the Districts (Advanced) command operates all areas in the first district will have the number 1 in the District column, all areas in the second district will have the number 2 in the District column and so on.

 

If the table already has a District column the Districts (Advanced) command will use the values in the column to control its activity. All area records with a 0 in the District column will be assigned to districts. All area records with a non-zero value in the District column will retain that value as their district assignment. For example, if some areas have a value of 1 and others have a value of 2 with all the remainder having 0 then when we run the Districts (Advanced) command to create two districts those areas having a value of 1 will be assigned to district 1, those with a value of 2 will be assigned to district 2 and all other areas will be assigned to either district 1 or 2. Placing pre-existing values in a District column is a handy way of forcing some areas to be assigned to given districts.

 

The series of numbers separated by commas in the Districts box specify how many districts to be assigned and also specify the relative weight for each. For example, a 1, 1, 1 string tells Manifold to create three districts, each of which is approximately the same size considering the total value of the field specified in the Balance box. A 1, 1 string tells Manifold to assign two districts of equal size and a 1, 1, 1, 1 string tells Manifold to create four districts of equal size.

 

The size of the number in the series specifies how large that district should be relative to the others. For example, a string of 1, 3.5, 1, 1 tells Manifold to assign four districts, the second of which is to have three and a half times the total value of the other districts. A string of 1, 2, 2, 2 tells Manifold to create four districts, the first of which is one half the size of the others. Note that the values are purely relative. We could express the same effect with 0.5, 1, 1, 1 or 2, 4, 4, 4.

 

Example

 

Consider a drawing showing a group of adjacent areas. The example drawing shows areas formed of triangles and other straight edged polygons, but it could just as easily be an area showing countries, postal code districts or some other real geographic drawing.

 

images\eg_districts_adv_01.gif

 

Our task is to assign each area in the drawing to one of four districts. Ideally, we would like the districts to be reasonably compact in shape, so that areas in the same district are adjacent to each other.

 

images\eg_districts_adv_02.gif

 

If we open up the drawing's table we can see that it has no columns in it except the default system ID column.

 

images\eg_districts_adv_03.gif

 

With the focus on the drawing, we launch the Districts (Advanced) dialog. We will balance using the intrinsic field Area (I), which will result in districts all having approximately the same area. We use the string 1, 1, 1, 1 in the Districts box to create four districts of the same size. We leave the Modify formatting box checked (the default) so that right away we can see how the areas are assigned into different districts. Press OK.

 

images\eg_districts_adv_04.gif

 

Right away, the drawing is reformatted to show the new districts that have been assigned. Manifold has attempted to assign areas to districts so that the total area of each district is approximately the same and that areas assigned to each district are adjacent to each other.

 

images\eg_districts_adv_05.gif

 

If we look at the drawing's table we can see that a new District column has been added to the table. Each value in the District column specifies to what district that area object has been assigned.

 

images\eg_districts_adv_06.gif

 

For example, if we select one of the areas in the drawing…

 

images\eg_districts_adv_07.gif

 

…we can see it has a value of 3, meaning it has been assigned to district number 3.

 

images\eg_districts_adv_08.gif

 

If we would like to change the assignment of the area, we can double-click on the area in the drawing and in the Object Fields dialog change the value of the District field to 1.

 

images\eg_districts_adv_09.gif

 

The formatting of the object will change to the color for district 1

 

images\eg_districts_adv_10.gif

 

…and the value in the table, of course, will also now be 1.

 

images\eg_districts_adv_11.gif

 

Although the Districts (Visual) dialog is much easier to use for interactive changes in the assignment of areas to districts, we can show some more intricate work with the Districts (Advanced) dialog to illustrate how the assignment of areas to districts is nothing more than the assignment of a District number to each record.

 

For this example we will take four areas that are each assigned to a different district, and then reorganize all the other areas into districts about them. We being by selecting four areas, one from each district, which we want to force to be in each of the four districts.

 

images\eg_districts_adv_12.gif

 

In the table we can see that some of the records have been selected.

 

images\eg_districts_adv_13.gif

 

If we choose Edit - Select Inverse (or simply press CTRL-I) we can invert the selection so that all records previously unselected are now selected.

 

images\eg_districts_adv_14.gif

 

The table now shows that all records except the four areas we chose are now selected. We did this so we can change the District value in each of these records to 0. To do so, double-click into the District cell of any of the selected records and change the District value to 0.

 

images\eg_districts_adv_15.gif

 

All of the District values in the selected records will also change to zero. This is a very useful facility within Manifold that often comes in hand. We've deselected the records to provide a clearer illustration.

 

images\eg_districts_adv_16.gif

 

If we take a look at the drawing we see that there now remain only four areas assigned to areas with all of the other areas formatted in default gray.

 

images\eg_districts_adv_17.gif

 

We now launch the Districts (Advanced) dialog once more. This time we will use a Districts string of 1, 1, 2.5, 1, which tells Manifold to create four districts where district 3 is two and a half times larger than the other districts. In executing this command, Manifold will be constrained by the four areas we have already assigned to districts 1, 2, 3 and 4 because of the non-zero values they already have in their Districts column.

 

images\eg_districts_adv_18.gif

 

When we press OK we can see how Manifold copes with the command. It has assigned areas so that districts 1, 2 and 4 have about the same area and district 3 has approximately two and a half the area of the other districts.

 

images\eg_districts_adv_19.gif

 

Examining the table, we can see that those areas which previously had 0 in the Districts column now have numbers from 1 to 4 in the Districts column, representing their assignment to one of the four districts.

 

Notes

 

In the above examples we balanced districts using the Area (I) intrinsic field. This balances the total area of each district. If the drawing's table had other fields, such as the population of each area, we could have used one of those fields to balance the districts.

 

In "real life" situations we often want to use fields such as population or total sales to balance areas such as counties or zip code regions to form districts. In a law enforcement application we might want to assign territories to detectives such that the total number of crime incidents is balanced (the objective being so that the investigative workload on each detective's territory is about the same). In a public health application for medical services in rural regions, we might want to assemble districts to balance population, so that the medical staff assigned to each district has the same workload as other districts.

 

In such applications, quite often it is the case that some areas must be assigned to given districts because the district headquarters is already located there. We can use techniques like the example above to force some areas to be assigned to given districts and to then let Manifold optimize the allocation of other areas between districts.

 

Manifold will do its best to balance districts as directed; however, given the granularity of the balancing field and the constraint to have reasonably connected districts it may not be possible to have districts that are exactly balanced given the proportions desired.

 

See Also

 

Districts (Visual)