The Drawing - Districts (Visual) 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 (Visual) command.
The Districts (Visual) command provides an interactive dialog that allows specifying districts using a point and click visual user interface. In the main display pane the dialog shows a visual preview of the drawing in which districts are assigned. The dialog also lists the districts and relevant data for each district in a districts list pane.

To operate the dialog, add the number of districts desired into the district list pane (which opens by default with two districts), choose a field to use for balancing the districts and press Assign. Districts may then be modified by clicking as desired in the visual preview pane or in the districts list pane. Press OK to apply the districts to the drawing and Cancel to exit the dialog without making any changes.
To make manual adjustments, choose one of the districts in the districts list pane by clicking on that row to highlight the district. Clicking on an area in the visual preview pane will now assign it to that district, or if it is assigned will remove it from the district (clicking an area will toggle its membership in the district). The toolbar buttons just above the districts list pane affect the highlighted district in the visual districts pane. For example, to remove a district from the list, click on it to highlight it and then press the Delete button.
Controls
|
(Visual preview pane) |
Displays the drawing either in default gray color or as colored by districts assigned with the Assign button. |
|
|
Zoom To Fit - Zoom so that the entire drawing fits within the preview pane. |
|
|
Zoom In - Magnify the view as if seen from a closer distance. |
|
|
Zoom Out - Reduce the view as if seen from farther away. |
|
|
Zoom Box - Zoom to the size of the cursor box drawn with the mouse. |
|
|
Center Point - Pan the view so that the spot clicked is centered. |
|
|
Grabber - Interactive pan: click and drag with the grabber hand. The scene will be panned so that the initial point is moved to the spot where the drag is released. |
|
(Districts list pane) |
A list of districts to which areas may be assigned. The first number gives the relative weight of each district. Use the default weight of 1.00 so that each district will be created the same size (that is, the same total value of the Balance field). Click on a district to highlight it. Double-click into either the weight cell or into the color well to change the weight or color used for that district. |
|
|
New - Add a district in the district list pane. |
|
|
Delete - Delete the highlighted district from the districts list pane. |
|
|
Move to Top - Move the highlighted district to the top of the district list pane. |
|
|
Move Up - Move the highlighted district up one position in the district list pane. |
|
|
Move Down - Move the highlighted district down one position in the district list pane. |
|
|
Move to Bottom - Move the highlighted district to the bottom of the district list pane. |
|
|
Fill - Assign all unassigned areas to the highlighted district. |
|
|
Clear - Toggle to unassigned all areas in the highlighted district. |
|
|
Clear All - Clear all district assignments from all areas. |
|
|
Show Counts - Push in to show the number of areas in the district for each district in the districts list. |
|
|
Show Values - Push in to show the sum total of the Balance value for all areas in the district for each district in the districts list. |
|
|
Show Value Percentages - Push in to show the percentage of the total value for all areas being districted of each district in the districts list. |
|
Assign |
Assign all unassigned areas to districts using the given settings. Areas that are already assigned to districts will not be re-assigned. |
|
Scope |
Objects to be districted. [All Objects] or [Selection] or a saved selection. |
|
Balance |
Choose a numeric field to use to balance districts. Manifold will add up the totals in this field when assigning areas so that each district has the same total value for this field. 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. |
|
Load Districts |
Enabled if the drawing already has a numeric field called District or some other field that can be used to store district numbers. Pressing the Load Districts button will load district assignments into the dialog from the values in the District field or from whatever field has been chosen in the Save to dialog. This is used when districts have already been assigned in a drawing and the dialog is re-launched to make changes. |
|
Modify formatting |
Check to modify the formatting of areas so that areas in the same district appear in the same colors. |
|
Create contiguous districts |
Use a networking algorithm to try to assign areas to districts so that areas in the same district are adjacent to each other. On by default. If this option is turned off, the system can work much faster but areas might be assigned to districts in such a way that not all areas in the same district are adjacent to each other. |
|
OK |
Accept the current assignment and update the drawing with the districts as seen in the preview pane and reported in the districts list pane. |
|
Cancel |
Exit the dialog without making any changes to the drawing. |
Pre-Assigning Areas to Districts
To force an area to be assigned to a give district, highlight that district in the districts list pane and then click on the area. When the Assign button is pressed the district assignment will keep that area assigned to that district and will attempt to build the district around that area.
Example
Let's consider an example using the sample drawing of Mexican provinces on the Manifold CD. We will assign different provinces to different districts.

When we open the drawing we see it rendered in default gray formatting. The drawing shows provinces in Mexico as areas.

If we open the drawing's table we can see it has numerous fields. Visible in the illustration above is the ID field giving the internal object identifier, a SQMI field that gives the area of each province in square miles, a SQKM field that gives the area in square kilometers and a POBL_1990 field that gives the 1990 population of each province. There are more fields in the table outside the view shown in the illustration above.
With the focus on the drawing window, we choose Drawing - Districts (Visual) in the main menu.

The dialog launches as seen above. This illustration and other illustrations in this example that show the preview pane are shown in a reduced view to more easily fit into this documentation. The dialog has a visual preview pane at the top that shows the drawing, a districts list pane in the lower left that lists districts with information about each district, and a group of options to the right.

Looking more closely at the districts list pane we see it opens by default with two districts, colored yellow and blue, that at present have no areas assigned to them.

Looking more closely at the options we see that the dialog opens using the Area (I) intrinsic field as the balancing field by default. This is simply because the Area (I) intrinsic field is the first column in alphabetical order of the columns available in this drawing's table.
We shall create districts based on the number of square miles of each province. To do so, we will change the Balance field to SQMI.

Click into the Balance box and choose SQMI.

The dialog is now set up to create two districts of approximately equal size, assigning areas so that total value of SQMI in each district is approximately the same. To assign districts, we press the Assign button. The system will compute for a while (potentially a long while with complex drawings that have many areas) and will assign areas to districts.


The illustration above shows a reduced view of the preview pane and part of the districts list pane.
We can see in the visual preview pane that each area has been colored yellow or blue depending the district to which it has been assigned. In the districts list pane we can see that 13 areas have been assigned to the yellow district, for a total SQMI value of 410588.96 and that 19 areas have been assigned to the blue district for a total SQMI value of 411531.37. Manifold helpfully tells us the total percentage of SQMI in both the yellow and the blue districts. We can see that with the yellow district having 49.94% and the blue district having 50.06% the assignment of areas to districts worked out very well for the objective of having about the same total SQMI in each district.
It's not always possible, of course, to assign areas to districts so that the value being balanced works out so evenly. However, Manifold will do its best and will usually assign areas to districts with much better accuracy than can be done by hand. The task is especially difficult if the Create contiguous districts box is checked (the default) so that not only must districts be balanced but they must also have all areas in contiguous contact with each other.

We can try a different arrangement of districts. To do so, we first press the Clear All button to clear all assignments.

The visual preview pane will go back to the default unassigned gray for all areas and the districts list will clear all values for the two districts.
![]()
![]()
We can next try creating districts again, but this time unchecking the Create contiguous districts box to see the effect of relaxing this constraint. Once more we press Assign. This time, the assignment process happens virtually instantaneously since relaxing the requirement to create contiguous districts allows Manifold to work much faster.


With the Create contiguous districts box turned off, the districts created are rather similar, but we can see from the districts list pane that the balance is not quite as good. In this case, the precentages are 47.95% and 52.05%, not quite as even as with the Create contiguous districts box checked on. This shows a secondary effect of this option box, in that it not only directs Manifold to form contiguous districts but as a side effect of the algorithm used to form contiguous districts it will often end up with slightly better balancing.
Using Three Districts
![]()
Let's check the Create contiguous districts box once more, and let's add a third district and assign the provinces into three districts instead of only two. We press the Clear All to clear district assignments and make way for new assignments.

To add a third district, click the New button in the districts list pane toolbar.

This adds a third district to the districts list, by default colored red. If we would like to change the colors of any of the districts, we can double-click into the district's color well to change the color.
After adding the third district we press Assign.


Manifold will compute optimal assignments for three districts and assign each area to a red, yellow or blue district. We can see from the percentages that districts have been assigned quite evenly, with approximately 33% of the total SQMI area in each district.
How would the districts look if we unchecked the Create contiguous districts box?
![]()
![]()
We uncheck the Create contiguous districts box, press Clear All to clear district assignments and then press Assign.


The result is not quite as good as with the Create contiguous districts box checked. Note that the percentages are not as close to an even 33% for each district and also that one of the areas in the red district is not adjacent to the others. Note also that Manifold has switched the colors of districts assigned, with the blue district now occurring in the North.
In general, when we ask Manifold to assign districts from a blank slate the system has a free hand in how areas are assigned. If we would like to control the assignment of areas to districts, we can do so.
Manual Assignment of Districts
![]()
Let's begin by checking the Create contiguous districts box once more so contiguous districts are created. We will also press Clear All to start with a blank slate once more.


To assign an area to a district, click on the district in the districts list pane to highlight it and then click on any area in the preview pane. If an area is unassigned or has been assigned to a different district, clicking on it will assign it to the highlighted district. If an area has already been assigned to the highlighted district, clicking on it will clear the assignment. In the illustration above we have highlighted the red district in the districts list pane and have already clicked on two unassigned areas to assign them to the red district. The districts list shows statistics for two areas in the red district.


As areas are added to or removed from each district the districts list pane will show updated statistics. The districts list pane now shows statistics for three areas in the red district.


To assign areas to a different district, click on that district in the districts list pane to highlight it. In the illustration above we have clicked on the yellow district in the districts list pane and then we've clicked on three areas in the preview pane to add them to the yellow district. Note that the districts list pane has been updated with information on the three areas in the yellow district as well.


We can click on the blue district and then click on five areas in the preview pane to assign them to the blue district.
The areas that are assigned to a district will stay assigned if we now press the Assign button to assign the remaining areas to districts. Pre-assigning areas manually is a way of forcing them to be part of a desired district and to compel Manifold to do the best job it can of balancing the remaining areas into districts.


If we press the Assign button Manifold will balance the remaining districts as seen above. By pre-assigning some areas to the red, yellow and blue districts we can guide the desired shape of a district, perhaps at some cost to the optimization of balancing.
Re-balancing Districts
We can also clear some districts and force Manifold to re-balance them while retaining existing districts.

To clear a district, highlight the district in the districts list and then press the Clear button. In the illustration above we have highlighted the red district and will now Clear it.


The result is that all areas formerly in the red district have now been unassigned.


We can also highlight the yellow district and then press the Clear button to clear all areas in the yellow district as well.


If we press the Assign button Manifold will assign all unassigned areas to the three districts. Note that in making this assignment Manifold added two small areas to the blue district in addition to those areas that were already assigned to the blue district. When areas are pre-assigned Manifold will never remove them from the district but it is always possible that Manifold will add some areas to a district.
Districting with Different Weights
So far this example has assigned areas to districts where each district had a weight of 1. This means that the objective has been to create districts that all have the same total value of the balancing field. If desired, we can change the weights on districts so that, for example, one district is created three times larger than the other districts.
We will now re-balance the districts so that the red district is three times larger than the yellow or blue districts.


We begin by pressing the Clear All button. Next, we double-click into the 1.00 weight in the red district's line and change it to 3.00.


When we press Assign Manifold will attempt to assign areas to districts so that the red district is three times larger than the yellow or blue districts. As we can see above, the assignment is remarkably close to the ideal. At almost 60% the red district is indeed three times larger than the other districts, which are approximately 20% each.
However, we might not be happy with the shape of the red district. Perhaps we would be willing to sacrifice some of the accuracy of the numeric balancing in order to get districts that are more compact. If desired, we can adjust the districts manually.


For example, we could highlight the blue district and then move two of the areas assigned to the red district into the blue district by clicking on them.


Next, we could highlight the yellow district and then click on one of the blue areas to move it into the yellow district. The net result of these changes is a more compact shape to our districts but at the cost of increasing the share of the smaller districts to about 25% each and decreasing the share of the larger district to about 53%.
Working with districts is often a tradeoff between having districts that are numerically close to an ideal value and having districts that are compact or otherwise have a desired shape. We rarely have the opportunity to assign districts that have exactly the shape as well as the numeric balance desired. Manifold's Districts (Visual) dialog is therefore generally used interactively to change options, pre-assign some districts and otherwise develop the assignment desired.
Results
So far, all work has happened within the Districts (Visual) dialog. If we press OK, the formatting will be transferred to the drawing and the drawing will be updated with a new Districts field that contains the number of each district for each area.

When we press OK the drawing is updated with the formatting used in the dialog.

If we open the drawing's table, we will not initially see a District field because it is hidden by default.

To make it visible we choose the Table - Columns dialog and click the District field on. In the illustration above we have also used the Move Up button to move this field near the top of the table.

The District field will then appear. We can see that each area has been assigned to one of districts 1, 2 or 3. If an area was not yet assigned it would have a value of 0 in the District field.
Using the Load Districts Button
If a drawing's table already has a districts field (which could be called District or some other name) with district assignments for each area we can load those assignments into the dialog by choosing the field in the Save to box and then pressing the Load Districts button.
Performance
Assigning areas to districts can be computationally very intensive if the Create contiguous districts box is checked, as we would normally want it to be. It is possible to redistrict a drawing with approximately a thousand areas in less than fifteen minutes on modern machines with adequate memory, however larger drawings can take longer.
Note
This example has balanced districts using the SQMI field in the drawing, which gives the area of each province in square miles. We've used this field because it makes it immediately visually obvious what is being balanced, the total size of each district. However, districts are more frequently balanced using some other field, such as total population or total number of customers, that does not have a direct relationship with the surface area of the areas being assigned.


In the illustration above, we have created districts that are balanced using the POBL_1990 field that gives the population for each province. Each district has approximately the same population, remarkably close to 33.33% for each district. The districts have unequal geographic area because much of Mexico's population is concentrated within densely populated provinces near Mexico City.
Tech Tip
It is frequently the case that we would like to give districts names such as "North," "Central," and "South" instead of using numbers. There are two ways of approaching this. The first is to change the type of the District field to a text type and then in the table select all records with District equal to 1, change them to "North" (easy to do when they are all selected because changing one changes them all) and so on. However, that loses the formatting and district information from the numeric District field, since the Districts (Visual) dialog works only with numeric fields. If we take this approach we will have to manually format the area colors using a thematic format based on unique text values of the District field.
Another approach is to create a new text column in the table, perhaps called District Name or some other convenient name and to then use the transform toolbar to copy the values from the District column to the District Name column. Manifold will automatically translate type on the fly from numeric to text. We can then select all records with District Name equal to 1, change them to North and so on. This will retain the original numeric District field and formatting while also providing us with a text field that can be used for labels and so on.
See the Editing Data in Tables topic for information on selecting cells in records and changing all selected items at once.
See Also