Upload
lymien
View
243
Download
0
Embed Size (px)
Citation preview
Oracle Fusion 11g & Maps
A review of recent State and County implementations
Mark Millman
Mizar, LLC [email protected]
Enterprise Framework Goals
• Security – All components must be securable within a comprehensive and
tractable system. • Scalability
– Applications need to be scalable to support thousands or even millions of users.
• Reliability – Systems must be able to survive any threat, including total destruction
of the main computing center. • Supportability
– To be supportable enterprise applications must fit within a common family, in this case Oracle technology stack.
– Middle‐tier means lower total‐cost of ownership through centralized control and management.
– Available of source code essential for long term client control
3
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.
Common Issues
• Enterprise framework goals – Security, scalability, reliability, supportability
• Diverse data sources – Multiple structured, non‐structured, and spatial data sources
• Not GIS Systems – Spatially enabled databases – GIS is a content provider
• Comprehensive enterprise data store – Spatial is just a data type
5
Technologies
• Java • Java Enterprise Edition (Java EE) • Java Persistence Architecture (JPA) • Eclipselink • JavaServer Faces (JSF) • MyFaces Trinidad • Oracle ADF Rich Client • Oracle Spatial • Oracle Maps
6
West Virginia Department of Emergency Services
• 60% or more of West Virginia residences did not have street addresses
• E911 reporting doesn’t work if you cannot report an address, let alone geolocate
• Project required street addressing and site numbering supporting 55 counties – Some with GIS of many different types
– Most without
• Not possible for State tomandate Counties to use a particular GIS
• Not possible for State to impose costs on Counties
• Required centralized State operated database and management system
• Integration with Telco systems
• Must support Counties with GIS who wanted to use them
• Technologies – Oracle RDBMS & Application Server
– Oracle Spatial and MapViewer
7
Login
8
Credential Management
9
Map Page
10
Streets
11
Many Names
12
Change History
13
Sites
14
Site Details
15
Site Photos
16
Jobs – an ETL approach
17
Street Editing
18
Street Editing
19
Street Editing
20
Street Editing
21
Street Editing
22
Street Editing
23
Production Statistics
24
Production Statistics
25
Cuyahoga County, OH
26
• Greater Cleveland area • 59 independent town governments
• 30 more independent agencies
• Every conceivable GIS in use • Required County wide comprehensive spatial data repository
• Magnet application to draw voluntary participation
Cuyahoga County, OH
27
• Federated Database – Standardized Street inventory – Site address inventory – Updated hydrography, contours, imagery and other engineering
content – Tax Parcel maps – Planning maps – Auditors land and tax records – Crime records – Property foreclosures – NAVTEQ – Gas prices – Ad hoc data
Cuyahoga County, OH
28
• Three initial applications –MyCuyahoga
– Cuyahoga Planning
– Cuyahoga Auditors Kiosk
• Work Order Management System – Cuyahoga Co. Sanitary Sewer
MyCuyahoga
29
Parcel Search
30
Link to Auditors Site
31
Layers
32
GeoRaster
33
Features of Interest
34
Features of Interest
35
Nearest Locations
36
Routing
37
Save as Spreadsheet
38
Navigation
39
Measure Tools
40
How Far is that Jog
41
Quick Picks
42
Cuyahoga Planning
43
Parcel Details
44
Search Area
45
Demographics
46
U.S.Census Reports
47
Export to Excel
48
Feature Query
49
What is that?
50
Cuyahoga Auditor Kiosk
51
Auditor’s Parcel Warehouse
52
Value
53
Taxes
54
Transfers
55
Print Map
56
Print Map
57
Print Parcel Report
58
Advanced Query
59
Cuyahoga Sites
• Developed on beta releases – Oracle Containers for Java (OC4J) – Oracle Maps – ADF Rich Faces – EclipseLink
• Common code base – Shared Java model classes – Shared JSPX pages using ADF PageTemplates – JavaScript interface using ADF
• clientAttributes • clientListener
60
Technologies
• Java • Java Enterprise Edition (Java EE) • Java Persistence Architecture (JPA) • Eclipselink • JavaServer Faces (JSF) • MyFaces Trinidad • Oracle ADF Rich Client • Oracle Spatial • Oracle Maps
61
Java
• Originally released in 1995 • Syntax is similar to C#, C, & C++ • In May 2007 the majority of Java was open sourced
under a GNU license • Highly portable
– Runs on Windows, Linux, Max OS X, Solaris, and other O/S through third‐parties.
– Hardware independent • Java Virtual Machine built into Oracle database
– No marshalling required – Very fast performance
62
Java EE • Extends Java Standard Edition (SE) for Service Oriented Architectures (SOA) • Certified implementations
– Oracle Containers for Java (OC4J) – Oracle Weblogic Server (formerly BEA) – Sun Java System Application Server – JBoss – Apache Geronimo – IBM WebShere – SAP NetWeaver – others
• APIs – Enterprise Java Beans (EJB) – Faces (JSF) – Persistence (JPA) – Transactions (JTA) – XML Streams – Java Messaging Server (JMS)
63
JPA
• EJB 3.0 dramatically simplifies persistence using POJO Entity Beans.
• Easier to learn, program, maintain.
• Configuration by exception • Annotations
– Internal configuration
• ORM.XML – External configuration
64
JPA Advantages
• Open Source standard ORM • Enforces good RDBMS practices • Isolates all JDBC and RDBMS issues • Enforces constraints within Java object scope • Minimizes source code • Cache management
– Memory conservation & – Performance boost
• orm.xml facilitates re‐purposing • Well documented, multiple references • It makes you a better RDBMS programmer
65
JPA Challenges
66
Eclipselink
• Oracle donated Toplink to the Eclipse Foundation
• Oracle team now continues development of Open Source Eclipselink
• Supports both single‐node and clustered implementations
• Supports for leading relational databases, not just Oracle
• SpatialExtensions
67
JavaServer Faces
• A comprehensive standards‐based web application framework
• Supports JSP, XUL, and Facelets • Custom tag libraries with default UI components • A server‐side event model • Managed Beans (Application, Session, or Request scoped) • Unified Expression Language (EL) supporting bi‐directional • Analogous to ASP.NET • Extensible
Swing for the Web!
68
JSF Overview
69
From JavaServer Faces in Action by Kito D. Mann
JSF Compared
70
From JavaServer Faces in Action by Kito D. Mann
JSF Client‐Server
71 From JavaServer Faces in Action by Kito D. Mann
JSF Managed Beans
• Managed beans
– Application, Session, or Request scoped – Exposed to JSPX and Servlet
• faces‐config.xml <managedbean>
<managedbeanname>MapOverlayTree</managedbeanname> <managedbeanclass>
com.mizar.trinidad.components.themes.MapOverlayTree </managedbeanclass> <managedbeanscope>session</managedbeanscope>
</managedbean>
• JSF‐EL <f:inputText label=“Schema:” value="#MapOverlayTree.schema"/>
72
MyFaces Trinidad
You really don’t want to use bare‐bones JSF
• Opensource managed by Apache MyFaces – http://myfaces.apache.org/trinidad/index.html
• Trinidad is a great JSF component implementation • You can extend your own components too. • Donated by Oracle (was ADF Faces) • Oracle remains a major contributor • Extends JSF
– Partial Page Rendering – PageFlowScope – Skinning framework – Client‐side validation – Dialog framework – Over 100 tags
73
ADF Rich Client
• Extends MyFaces Trinidad
• Destined for Open Source • Extensive visualization components
• JavaScript API • Page Templates
• Over 150 AJAX‐enabled components
74
Oracle Spatial • Not a GIS • Available as Spatial ($$$) and Locator (Free) • A rich‐content extension to Oracle’s RDBMS
• Integrates spatial attribution within the core RDBMS.
75 From Pro Oracle Spatial: for Oracle Database 11g by Kothuri, Godfrind, & Beinat
Locator vs Spatial
76 From Pro Oracle Spatial: for Oracle Database 11g by Kothuri, Godfrind, & Beinat
Oracle Spatial
77 From Pro Oracle Spatial: for Oracle Database 11g by Kothuri, Godfrind, & Beinat
Oracle MapViewer
• A pure Java server‐side component included as part of Oracle Application Server
• Map Rendering
• Family of APIs
• MapBuilder metadata editing tool
• Creates static JPEGs / PNGs / GIF / etc.
78
Oracle Maps
• A MapViewer client application
• Map Cache Server
• Feature of Interest (FOI) Server • Ajax‐based JavaScript mapping client API
79
Oracle MapViewer
80 From Pro Oracle Spatial: for Oracle Database 11g by Kothuri, Godfrind, & Beinat
Oracle Maps
81 From Pro Oracle Spatial: for Oracle Database 11g by Kothuri, Godfrind, & Beinat
Maps JavaScript API
82
Maps Redline
83
Maps JavaScript API
84
Maps JavaScript Tutorials
85
• Oracle has turned over a new leaf viz. developer support.
• Well documented • Tutorials greatly accelerate learning curve • Easily extensible • Growing set of spatial editing tools
Mizar Jars
86
OH Secretary of State • 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.
87
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 / AJAX 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 // 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*(nearestPoint1)] geom.getPointX())*(ordinates[2*(nearestPoint1)] geom.getPointX()) +
(ordinates[2*(nearestPoint1)+1] geom.getPointY())*(ordinates[2*(nearestPoint1)+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 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