News

ArcUser Online


Search ArcUser

newlogo2
The Magazine for
Esri Software Users
 
Home
Subscribe
Advertise
Current Issue


Previous Issues
Submit an Article
What is ArcUser?

Modeling with
ArcView GIS

 
 
 
Faster, Flexible Redistricting Application
Built with MapObjects

By Kevin Gainey and Tim Johnson,
North Carolina Center for Geographic Information and Analysis
Dan Frey, Information Systems Division, North Carolina General Assembly


    The North Carolina General Assembly's Information Systems Division (ISD) is responsible for enabling state legislators, legal counsel, and Division staff to draw and analyze political districts. ISD also makes redistricting information and plans available to the public.
    A mainframe-based system was used for the 1990 census, but the Division decided that a similar system, developed for the PC platform using Microsoft's Visual Basic and MapObjects, would increase efficiency and flexibility and have greater stability and scalability. The new PC-based system would enhance performance, expand the associated database, and allow staff to make modifications to the system. It would give decision makers more information and allow them to consider more alternatives in the same amount of time.
    When the project began in early 1997, the project team, which consisted of NCCGIA personnel and representative users from ISD and other components of the General Assembly, drafted a requirements document. redistricting app Initially, ArcView GIS, modified with extensive Avenue scripting, was considered. However, staff from Esri's regional office in Charlotte, North Carolina, suggested using a new technology, MapObjects, for the redistricting application.
    After testing and comparing the development costs of both MapObjects and ArcView GIS, the team chose MapObjects as the GIS tool for implementing the application. Visual Basic was chosen as the development environment because it is easier to learn and has industrywide support. This combination would allow the team to create a scalable application that could be more easily integrated into the PC environment at ISD. Work on the redistricting application is currently focused on refining application performance and delivering the final product. A separate contract for implementing additional functionality and improving performance is also being drafted.

Designing the Redistricting Application
    Though the needs assessment for the redistricting application covered all the functionality and system design specifications required to support ISD's redistricting efforts, only requirements affecting the basic architecture of the application are discussed here. Two of the primary requirements were the ability to assign geography from any level to a district and use any hierarchy of data layers. Users should be able to click on a tract, precinct, or military base and assign that area to a district. The three polygons mentioned represent three different structures that would be supported in the application-county-tract-block group-block; county-precinct-block; and no defined structure and/or structure defined by the use of a reference layer for selection.
    The ISD's data and plan management needs required that all plan information be stored in a Microsoft SQL Server database. All geography and associated census attributes for plans as well as user access and plan types are stored in a dedicated SQL Server database, allowing for centralized data management of tabular data. However, census geography shapefiles are still distributed to each desktop.
    The application must administer its own level of security. Locking and determination of read and write privileges are handled by the application. To augment the plan creation and editing capabilities, ISD required that the application support basic mapping needs, chart and graph generation, and standard report creation. Compactness, contiguity, summary, and split unit reports as well as other reports specific to ISD's needs were required. The application also had to support bill text generation.
    The application was developed using Microsoft Visual Basic 6.0 Professional Edition, MapObjects 2, Microsoft SQL Server 6.5, Seagate Crystal Reports 6.0, and NuMega DevPartner for Visual Basic 6.1. DevPartner was used for error checking, debugging, and source code analysis.

The Application Object Model
    The object model for the entire application consists of two primary objects, the Plan object and the User object. These objects were created with class files in Visual Basic. The User object contains properties and methods that satisfy security requirements and track users throughout the program. The Plan object is the primary object. Its properties and methods control the activities and characteristics of a given plan. The Plan class contains the core selection engine as well as supporting methods that lock districts from further assignments, create a district polygon, and identify split units.

The Selection Engine
    The requirements for assigning geography and using data layers determined the type of selection engine that could be used for the application. The selection engine is just the method that allows a unit of geography to be uniquely identified with a district along with associated attribute information. The selection engine uses a Dictionary object in Visual Basic 6.0 to store the geographic shapes. When a user selects a polygon to add it to a district, the engine determines if the polygon has already been assigned. If the polygon is unassigned and free to be added to the current selection district, the Shape object from the MapObjects Recordset is added to the Dictionary object. The associated census statistics are queried from a SQL Server table and added to the current population statistics for the plan, which are also stored as a table on the server. The shapefiles for all districts are then drawn on the map with the unique user-defined symbology for that district. This selection engine performs efficiently for most layers, but has some performance hits when a large number of blocks are selected by the user.

Managing Application Development
    Due to the large size of this application, the project was broken down into manageable units of related functionality. redistricting applicationThese interim releases allowed the users to see the software while it was being developed and assured them that the work was being done to their satisfaction. As with all software development projects, there are some basic issues that must be thoroughly planned before any coding is done. The scope of the application must be decided. In the authors' experience, it is best to focus on developing the core selection engine first. This ensures the desired performance can be obtained from the system before supporting functionality is developed. Supporting functionality, such as reporting and graphing, no matter how well developed, will be of little use if the application performs poorly in its primary function.

Additional Design Considerations
    Data and plan management decisions had a large impact on the system architecture.Variety of output The following issues were considered during the development of the redistricting application: Where will the geography be stored? Where will attribute information reside? How will it be distributed? The answers to these questions determine system architecture. The activities of users are also a factor. While using a central DBMS may fit an organization's structure, bottlenecks can occur during periods of peak usage. Creating and tracking all plans may be a requirement. How will this be done? Will the plans all reside in one central directory, or will there be a system to submit completed plans only after the builder has completed the plan? These decisions affect the integrity of plans being drafted by more than one user. They also affect security and are system performance factors.
    When deciding to use MapObjects, consider how important cartographic tools will be to the application. A MapObjects application may be augmented with existing map production functionality from ArcView GIS or ARCPLOT. Some MapObjects spatial operators require extra time to process. It may be possible to structure the database so that SQL queries based on unique keys result in faster selections.

Incremental Enhancements
    The actual large-scale use of the application will not occur until after April 1, 2001. Changes in technology will certainly occur in the intervening time. Consequently, there are plans to enhance the application incrementally. The following enhancements are being considered for future versions of the application:
  • Because the General Assembly is upgrading all of its production databases from SQL Server version 6.5 to 7.0, the redistricting application will also be upgraded to take advantage of any additional benefits provided by SQL Server 7.0.
  • The largest planned enhancement is rewriting the selection engine. Because the polygon object in MapObjects 2 allows union and dissolve methods, district polygons can be created on the fly. These methods will allow the Plan object to hold only as many shapes in the Dictionary object as there are districts in the plan type. Various scenarios for how the attribute data could be computed on the server side through stored procedures will also be evaluated.
  • The use of ArcSDE will be considered. Currently, attribute information is stored in SQL Server, but geography is duplicated for each installation. Tests will determine if storing geography in SQL Server improves the overall performance of the application.
  • Depending on the development path that data vendors take, Extensible Markup Language (XML) may be used as a plan exchange format.
  • Functionality that would let users view Census 2000 data as both sampled and absolute values is being explored.
Conclusion
    Developing a reliable, efficient product to support the redistricting process requires thoroughly evaluating many factors that contribute to an effective solution. This article provides background information on some of the major issues encountered during the development process but does not cover the many details involved in a project of this magnitude.
    For more information on this application, please contact

Kevin Gainey
NCCGIA GIS Applications Programmer
E-mail: kevin@cgia.state.nc.us
or
Tim Johnson
NCCGIA Services Program Manager
E-mail: tim@cgia.state.nc.us

North Carolina Center for Geographic Information and Analysis
20322 Mail Service Center
Raleigh, North Carolina 27699-0322
Tel.: 919-733-2090
Fax: 919-715-0725


Acknowledgement
    The North Carolina Center for Geographic Information and Analysis would like to thank the State of Florida, especially Stan Hammer and Linc Clay of the Florida legislature, for their support and willingness to share what they have learned in developing Florida's new redistricting system. Special thanks also to Alan Ware and Shane Groves of the State of Texas for their help and support.

About the Authors
Dan Frey

Dan Frey has been in charge of the North Carolina State Legislature's GIS and mapping operations since 1995. He has a master's degree in geography from Appalachian State University and a bachelor's degree in biology from Fort Lewis College. Prior to his employment by the legislature, he worked in environmental education with the U.S. Peace Corps, in ecological restoration with The Nature Conservancy, and in wastewater treatment with the Aspen Consolidated Sanitation District.

Tim Johnson
Tim Johnson, services program manager for the NCCGIA, is responsible for directing the services component of the agency's mission and manages application development for the evaluation of new hardware and software. He also assists other agencies in determining their GIS needs and conducts research on the applicability of new technologies to the needs of NCCGIA. Johnson, who holds a bachelor's degree in geography from Appalachian State University and a master's degree in geography from the State University of New York at Buffalo, has been involved in several major system specification, design, and implementation efforts for federal and state government organizations.

Kevin Gainey
Kevin Gainey is a GIS applications programmer with NCCGIA. His work focuses on custom application development using primarily Visual Basic and Avenue. Gainey received a bachelor's degree in forest management from North Carolina State University (NCSU). His master's degree was also completed at NCSU, where he was a Center for Transportation and the Environment fellow. His research focused on the use of GIS and operations research techniques for mitigating transportation impacts to wetlands.

 


Contact Us | Privacy | Legal | Site Map