300 likes | 442 Vues
A Middle-tier MAF/Tiger Voter District Editing Tool for State & Local Governments. June 2010 WV GIS Conference. June 2010 WV GIS Conference. Joseph Seppi CMS, PMP Woolpert, Inc. Key Concepts. Voting Districts & Redistricting U.S. Census TIGER Topology Topological Editing
E N D
A Middle-tier MAF/Tiger Voter District Editing Tool for State & Local Governments June 2010 WV GIS Conference
June 2010 WV GIS Conference Joseph Seppi CMS, PMPWoolpert, Inc.
Key Concepts • Voting Districts & Redistricting • U.S. Census TIGER Topology • Topological Editing • Highly purposed middle-tier applications • Case Study
Key Statutory Requirements of Voter Precinct Delineation in West Virginia “The basic territorial election unit” Determined by County Commissions 300 – 1500 registered voters for precincts within urban centers 200 – 700 registered voters for precincts in rural areas unless granted SOS exemption for “undue hardship” Precincts may be split or “divided” when the number of voters in a precinct exceeds these limits Precincts may be dissolved or “consolidated” when the number of voters falls short of these limits Precinct must coincide with boundaries of any municipality of the county and with the wards or other geographical districts of the municipality All municipalities shall provide accurate and current maps of their boundaries Precinct boundaries must be comprised of intersecting geographic physical features or municipal boundaries recognized by the U.S. Census Bureau including streets, roads, streams, creeks, rivers, railroad tracks and mountain ridge lines. The county commission of every county must modify precinct boundaries to follow geographic physical features or municipal boundaries and submit changes to the West Virginia office of legislative services by June 30, 2007 and by the thirtieth day of June, every ten calendar years thereafter. The county commission must also submit precinct boundary details to the U.S. Census Bureau upon request. June 2010 WV GIS Conference Source: §3-1-5 WV Code
Key Statutory Requirements of Voter Precinct Delineation §3-1-5. Voting precincts and places established; number of voters in precincts; precinct map; municipal map. (a) The precinct shall be the basic territorial election unit. The county commission shall divide each magisterial district of the county into election precincts, shall number the precincts, shall determine and establish the boundaries thereof, and shall designate one voting place in each precinct, which place shall be established as nearly as possible at the point most convenient for the voters of the precinct. Each magisterial district shall contain at least one voting precinct and each precinct shall have but one voting place therein. Each precinct within any urban center shall contain not less than three hundred nor more than one thousand five hundred registered voters. Each precinct in a rural or less thickly settled area shall contain not less than two hundred nor more than seven hundred registered voters, unless upon a written finding by the county commission that establishment of or retention of a precinct of less than two hundred voters would prevent undue hardship to the voters, the secretary of state determines that such precinct be exempt from the two hundred voter minimum limit. If, at any time the number of registered voters exceeds the maximum number specified, the county commission shall rearrange the precincts within the political division so that the new precincts each contain a number of registered voters within the designated limits. If a county commission fails to rearrange the precincts as required, any qualified voter of the county may apply for a writ of mandamus to compel the performance of this duty: Provided, That when in the discretion of the county commission, there is only one place convenient to vote within the precinct and when there are more than seven hundred registered voters within the existing precinct, the county commission may designate two or more precincts with the same geographic boundaries and which have voting places located within the same building. The county commission shall designate alphabetically the voters who will be eligible to vote in each precinct so created. Each such precinct shall be operated separately and independently with separate voting booths, ballot boxes, election commissioners and clerks, and whenever possible, in separate rooms. No two of such precincts may use the same counting board. (b) In order to facilitate the conduct of local and special elections and the use of election registration records therein, precinct boundaries shall be established to coincide with the boundaries of any municipality of the county and with the wards or other geographical districts of the municipality except in instances where found by the county commission to be wholly impracticable so to do. Governing bodies of all municipalities shall provide accurate and current maps of their boundaries to the clerk of any county commission of a county in which any portion of the municipality is located. (c) To facilitate the federal and state redistricting process, precinct boundaries must be comprised of intersecting geographic physical features or municipal boundaries recognized by the U.S. Census Bureau. For purposes of this subsection, geographic physical features include streets, roads, streams, creeks, rivers, railroad tracks and mountain ridge lines. The county commission of every county must modify precinct boundaries to follow geographic physical features or municipal boundaries and submit changes to the West Virginia office of legislative services by June 30, 2007 and by the thirtieth day of June, every ten calendar years thereafter. The county commission must also submit precinct boundary details to the U.S. Census Bureau upon request. The West Virginia office of legislative services shall be available for consultation with the county commission regarding the precinct modification process: Provided, That nothing in this subsection removes or limits the ultimate responsibility of the county commission to modify precinct boundaries to follow geographic physical features. (d) The provisions of this section are subject to the provisions of section twenty-eight, article four of this chapter relating to the number of voters in precincts in which voting machines are used. (e) The county commission shall keep available at all times during business hours in the courthouse at a place convenient for public inspection a map or maps of the county and municipalities with the current boundaries of all precincts. June 2010 WV GIS Conference Source: §3-1-5 WV Code
Key Statutory Requirements of Voter Precinct Delineation §3-1-6. Municipal voting precincts. The governing bodies of all municipalities shall, for the purpose of municipal elections, provide by ordinance for making the voting precincts in the respective municipalities coincide, as nearly as possible, to the boundaries of the voting precincts fixed by the county court for all state and county elections. §3-1-7. Precinct changes; procedure; precinct record. (a) Subject to the provisions and limitations of section five of this article, the county commission of any county may change the boundaries of any precinct within the county, or divide any precinct into two or more precincts, or consolidate two or more precincts into one, or change the location of any polling place whenever the public convenience may require it. (b) No order effecting the change, division or consolidation shall be made by the county commission within ninety days prior to an election nor without giving notice at least one month before the change, division or consolidation by publication of the notice as a Class II-0 legal advertisement in compliance with the provisions of article three, chapter fifty-nine of this code. The publication area is the county in which the precinct or precincts are located. The county commission shall also, within fifteen days after the date of the order, publish the order in the manner required for publication of the notice. (c) The county commission shall also, before the next succeeding election, cause the voters in the several precincts affected by the order to be duly registered in the proper precinct or precincts and shall mail written notification to all registered voters affected by the change. (d) The county commission shall keep in a well-bound book, marked "election precinct record", a complete record of all their proceedings hereunder and of every order made creating a precinct or precincts or establishing a place of voting therein. The "election precinct record" shall be kept by the county commission clerk in his or her office and shall, at all reasonable hours, when not actually in use by the county commission, be open to inspection by any citizen of the county. (e) When the county commission establishes a polling place at a location other than the location used for holding the preceding primary, general or special election in that precinct, the commission shall cause a notice to be posted on election day on the door of the previous polling place describing the location of the newly established polling place and shall mail written notification to all registered voters affected by the change. (f) If for any reason the election cannot be held at the designated polling place in a precinct and no provision has been made by the county commission for holding the election at another place, the commissioners of election for that precinct may hold the election at the nearest place which they can secure for the purpose. They shall make known by proclamation to voters present at the time for opening the polls, and by posting a notice at or near the entrance of the first named polling place, the location at which the election will be held. The county commission shall establish another place of voting for that precinct as soon thereafter as practicable. (g) Notwithstanding any provision herein to the contrary, in the case of an emergency, the county commission may make the precinct change no later than sixty days prior to an election in accordance with the requirements herein with the approval of the secretary of state. A change, if made however, shall not cause any voter to be moved to a different district. June 2010 WV GIS Conference Source: §3-1-6 and §3-1-7 WV Code
MAF/Tiger June 2010 WV GIS Conference
June 2010 WV GIS Conference 2009 Census Block Boundaries
June 2010 WV GIS Conference with Congressional Districts
June 2010 WV GIS Conference With 2002 WV VDT from State Legislative Services
June 2010 WV GIS Conference With 2003 SAMB Imagery
June 2010 WV GIS Conference With 2003 SAMB/USGS DEM 3m
How It’s Done June 2010 WV GIS Conference • 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.
June 2010 WV GIS Conference Architecture
JSPX June 2010 WV GIS Conference <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 / AJAX June 2010 WV GIS Conference OHSOS.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 June 2010 WV GIS Conference // 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); } }
Java June 2010 WV GIS Conference public 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