April 2009
Oracle Spatial User
Conference
Oracle Spatial User Conference
April 23, 2009
Tampa, Florida USA
Mark Millman, OCA, RPF(Ret)Mizar, LLC
Joseph Seppi CMS, PMP Woolpert, Inc.
April 2009
Oracle Spatial User Conference
EAC Election Data Collection and ManagementFor Ohio Secretary of State Jennifer Brunner
April 2009
Oracle Spatial User Conference
Project Overview
The United States Congress in the Omnibus Appropriations Act for Fiscal Year 2008, Public Law 110-161 authorized the award of $2 million grants to five states to improve the collection of precinct-level elections data relating to the November 2008 election. Ohio has received one of five $2 million Grants to improve the collection of precinct-level elections data relating to the November 2008 election. The granting agency was the U.S. Election Assistance Commission (EAC). The outcome of this project will be reported to the U.S. Congress in July 2009.
In 2009 Woolpert was selected to develop a first-of-its-kind voter redistricting system for the Ohio Secretary of State's Office.
April 2009
Oracle Spatial User Conference
Project Objectives
• The one-time creation of a state-wide precinct boundary and polling location map for use with HAVA voter registration and election data. • Approximately 12,000 voter precincts and other electoral boundaries from
various manuscripts sourced from county boards-of-election. • Boundaries must be correlated (by automated conflation) to U.S. Census
Bureau TIGER Block Boundaries.• Develop an integrated mapping application for maintenance of voting
district boundaries and other election-related data (EMMA). • A complete production-ready application usable by all eighty-eight county
boards of election in Ohio.• Develop a proof-of-concept EAC voter registration election reporting tool
with MapViewer integration to the Oracle Business Intelligence Suite Enterprise Edition (OBIEE) Publisher.• With potential use in real-time election day publishing
• Technology transfer including documentation, source code, mentoring and training of personnel from the Office of the Ohio Secretary of State.
April 2009
Oracle Spatial User Conference
Project Challenges
• Schedule (six month start-to-finish) • Complex legal and business requirements• Cooperation between state and 88 county agencies• Technology transfer
April 2009
Oracle Spatial User Conference
Key Business & Statutory Requirements
• “R.C. 3501.18(B)(1) provides that precincts must be based upon geographic units (census tracts and census blocks) developed by the U.S. Department of Commerce’s Census Bureau.”
• “Boards of Elections may seek waivers from the Secretary of State from strict adherence to the census’ geographic units in creating precincts based upon geographic considerations and local development practices.”
• “In practice, the boards of elections have had a substantial amount of discretion to redraw and combine precincts. The trend over the last few years is for county boards of elections to have fewer precincts due to limited resources in terms of poll workers and the allocation of voting equipment.”
Excerpted from Creation of Political Subdivisions & Precincts Under Ohio Law, by Brian Shinn, Assistant General Counsel
April 2009
Oracle Spatial User Conference
Middle-Tier Spatial Editor?• Spatial database is not GIS!• When is middle-tier spatial editing indicated?
• Many independent participants• Counties in a State• Agencies and Municipalities in a large County• Public input
• Well constrained edit problem that can be defined as an application task as compared to open-ended GIS editing.
• Centralized control and management is central to the mission.
• Task is part of a larger middle-tier solution.
Technologies• Oracle Spatial• Oracle Maps• JPA (Eclipselink)• JSF (ADF Rich Client)• JavaScript• AJAX• Java• JDeveloper• Weblogic
The data model
• U.S. Census MAF/Tiger data• Ohio HAVA Voter database• Voter Districts and Precincts• Proposals, working and archive tables
MAF/Tiger
Ohio HAVA Voter Database
• Voters• Have addresses
• Addresses• Have regions
• Regions• Include precincts
• Precincts• Should have no more than 1400
voters
• Custom Geocoder• against MAF/Tiger Edges
Voter Districts & Precincts
• Voter Districts may be• Actual – Precinct boundaries match VTD
boundaries• Pseudo – Precinct boundaries cross Census Block
boundaries and therefore cannot match VTD boundaries which are collections of Census Blocks
Editing Voting Districts
• VTD Editing• Simply involves adding, removing, transffering
Census Blocks (TABBLOCK) between VTDs• Precinct (Pseudo-VTD editing)
• Match actual VTD by default• Adding, removing, transferring FACES.• Editing boundaries
• Requires synchronization of boundary edits for coincident Precincts
Proposal Management
• Proposals• Supports multiple
proposals• Requires
SOS authorization
• Once authorized finalization drops alternatives
Login Page
Credential Management
Create Proposal
Find Census Blocks for VTD
Faces / Edges• New MAF/Tiger data types• EDGES include all linear elements
• Census block boundaries• Roads, RR, trails, etc.• Have left and right FACES
• FACES not delivered with shapes• We build FACES shapes from EDGES using Mizar
topology package.• Census Blocks are collections of FACES• Precincts of Pseudo-VTDs can be created by
moving faces from one Precinct to another.
Face Edit
Face Edit
Face Edit
Precinct Boundary Edit
• Requires when Precinct boundaries are not associated with MAF/Tiger EDGES
• Utilizes Oracle Maps Redlining tools• Uses AJAX to call Servlet methods to ensure
that edit affects both Precincts associated with a boundary
Before Editing
Start Editing
Move Point
Add Point
Add Point
Delete Point
Delete Point
Save Edit
How It’s Done• JSPX
• ADF Rich Client – Oracle’s latest JavaServer Faces component package that is the heart of the Fusion 11g J2EE presentation layer.
• JS• Integrates with Oracle Maps and ADF
• AJAX• Uses XMLHttpRequest() to communicate with Java
• Java• Interacts with database to synchronize adjacent
precincts.
JSPX <af:commandButton
id="AddPt" text="Add Point Mode"
visible="#{WorkingPrecinctTable.currentRow.editMode}"
actionListener="#{WorkingPrecinctTable.currentRow.addMode}"
partialSubmit="true“
partialTriggers="DeletePt DeletePtStop AddPtStop AddPt cancelPrecinct updatePrecinct editPrecinct">
<af:clientListener method="OHSOS.vtdEditor.editPrecinctAddPointModeStart”type="action"/>
</af:commandButton>
JS / AJAXOHSOS.vtdEditor.editPrecinctAddPoint = function(indexI, xI, yI) {
var lastFOI = OHSOS.vtdEditor.precinctRedline.getPointFOIs()[OHSOS.vtdEditor.precinctRedline.getPointNumber()-1];
var ordinates = OHSOS.vtdEditor.precinctRedline.getOrdinates();
var geom = lastFOI.getGeometry();
var nearestPoint = 0;
if(OHSOS.vtdEditor.addPointMode == true) {
// Keep it as squared, faster, easier and I don't need to find the JS sqrt function
var nearestDistance = Math.sqrt((ordinates[0] - geom.getPointX())*(ordinates[0] - geom.getPointX()) +
(ordinates[1] - geom.getPointY())*(ordinates[1] - geom.getPointY()));
// Last element is the element we just added, so explicitly don't check it
for(var i = 0; i < OHSOS.vtdEditor.precinctRedline.getPointNumber() - 1; i++ ) {
var newDistance = Math.sqrt((ordinates[2*i] - geom.getPointX())*(ordinates[2*i] - geom.getPointX()) +
(ordinates[2*i+1] - geom.getPointY())*(ordinates[2*i+1] - geom.getPointY()));
if(newDistance < nearestDistance) {
nearestDistance = newDistance;
nearestPoint = i;
}
}
JS / AJAX// Ok, awesome, we've found the closest point if( nearestPoint == OHSOS.vtdEditor.precinctRedline.getPointNumber()-1) { nearestPoint -= 1; // Nearest point is either first or last, so we're done, we don't need to find the second nearest point } else { var prevPointDistance = Math.sqrt((ordinates[2*(nearestPoint-1)] -
geom.getPointX())*(ordinates[2*(nearestPoint-1)] - geom.getPointX()) + (ordinates[2*(nearestPoint-1)+1] -
geom.getPointY())*(ordinates[2*(nearestPoint-1)+1] - geom.getPointY())); var nextPointDistance = Math.sqrt((ordinates[2*(nearestPoint+1)] -
geom.getPointX())*(ordinates[2*(nearestPoint+1)] - geom.getPointX()) + (ordinates[2*(nearestPoint+1)+1] -
geom.getPointY())*(ordinates[2*(nearestPoint+1)+1] - geom.getPointY())); // If it's closer to the next point than the previous // We don't need to do anything in this case if(nextPointDistance < prevPointDistance) { } else { nearestPoint += 1; } } OHSOS.vtdEditor.precinctRedline.removeVertex(lastFOI); OHSOS.vtdEditor.precinctRedline.addVertex(nearestPoint+1, geom.getPointX(), geom.getPointY()); MIZAR.ajax.phaseListenerRequest('GeomEditor', "command=add" + "&pointId=" + nearestPoint +
"&newX="+geom.getPointX() + "&newY="+geom.getPointY(), false); } else { // we're not in add mode, so get ride of the point OHSOS.vtdEditor.precinctRedline.removeVertex(lastFOI); }}
Javapublic class GeomEditorHandler extends AjaxHandler { public GeomEditorHandler() {
}
public boolean processRequest(HttpServletRequest request, HttpServletResponse response) { WorkingPrecinctTable precinctTable = (WorkingPrecinctTable)FacesUtils.getCurrentInstance("WorkingPrecinctTable");
ProposalTable propTable = (ProposalTable)FacesUtils.getCurrentInstance("ProposalTable");
String command = request.getParameter("command");
String sPointId = request.getParameter("pointId");
String sNewX = request.getParameter("newX");
String sNewY = request.getParameter("newY");
if (precinctTable != null && propTable != null) {
ProposalRow propRow = (ProposalRow)propTable.getCurrentRow();
if (propRow.isEditable()) {
if (precinctTable.getList().size() > 0 && precinctTable.getCurrentRow() != null) {
if ("move".equals(command) && !"undefined".equals(sPointId) && !"undefined".equals(sNewX) && !"undefined".equals(sNewY)) {
int pointId = Integer.parseInt(sPointId, 10);
double newX = Double.parseDouble(sNewX);
double newY = Double.parseDouble(sNewY);
Code to ensure that points of adjacent precincts are synchronized
D E M O N S T R A T I O N
April 2009
Oracle Spatial User Conference
In Conclusion• Very short time-frame, 5 month time frame is half over
and core functionality is already in place leaving ample time to refine.
• Oracle Maps has been the most stable component of the emerging Oracle technologies.
• ADF Rich Client provides a superb development environment to bridge Servlet and JavaScript environments.
• Mizar packages designed to integrate ADF-RC and Oracle Maps permitted rapid deployment of core system.
Special ThanksJennifer Brunner
Ohio Secretary of State• Bob Mangan OH-SOS CIO
• OH – SOS IT developers and DBAs• One of the best teams we’ve ever worked with!
AQ&