52
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 1 May 21, 2014 Walter E. Washington Convention Center Washington, DC USA

May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 1

May 21, 2014 Walter E. Washington Convention Center

Washington, DC USA

Page 2: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Using Location Analysis in Large Scale Operational Systems Siva Ravada Senior Director of Development Spatial and Graph & MapViewer Oracle

Page 3: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 3

Program Agenda

 Operational Systems based on DBs

  Location Analysis without a GIS

 Hierarchical Data Models for Map-based reports

 APEX Integration

Page 4: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 4

Conceptual Architecture

Browser Based UI

SO

A /

Ser

vice

s In

frast

rucu

re A

pplic

atio

ns

and

Dat

a U

ser

Inte

rface

User Interface Services

Business Process Services

Connectivity & Integration Services

3rd party Applications

3rd party Applications

3rd party Applications

3rd party Applications

Oracle Applications

Bespoke Applications

Page 5: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 5

Browser Based UI

SO

A /

Ser

vice

s In

frast

rucu

re A

pplic

atio

ns

and

Dat

a U

ser

Inte

rface

User Interface Services

Business Process Services

Connectivity & Integration Services

3rd party Applications

3rd party Applications

3rd party Applications

3rd party Applications

3rd party Applications

Oracle Spatial – where does it fit?

Page 6: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 6

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center

Internet Internet Wireless

Contractor

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Page 7: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 7

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Customer call Emergency Gas Escape

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

SPATIALLY-ENABLED ORACLE DATABASE

Page 8: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 8

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Customer call Emergency Gas Escape

Raise Emergency Job

•  Register contact & problem •  Eliminate duplicate incidents •  Identify responsible party

Display Map •  Customers •  Assets •  Jobs & their status • Territories / LDZ

Map Rendering Service Identify Location

•  Determine coordinates of Incident location

Geocoding Service

Determine Territory •  Inside which LDZ is the

incident located?

Spatial Query Service

Capture Location •  Create a point feature

representing the incident •  Location of all incidents

stored persistently

Create Feature Service

Intuitive map-based interface - Customer is at the centre of the process

Call Handling

SPATIALLY-ENABLED ORACLE DATABASE

Page 9: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 9

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Create Emergency Job

•  Copy incident details into job •  Assess worker safety •  Assess risk of hazard •  Identify opportunistic jobs

Find nearby risks •  Find places of interest (schools,

transportation infrastructure, traffic routes, etc.) close to emergency job location

Spatial Query Service

Find opportunistic jobs

•  Find unallocated job(s) nearby

Spatial Query Service

Optimised scheduling - More efficient, safer operations

Schedule

SPATIALLY-ENABLED ORACLE DATABASE

Page 10: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 10

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Update Emergency Job & Tasks

•  Assign job to engineer •  Send job location, maps, route to engineer

Identify Resources •  Find closest engineer based upon

street-level routing •  Prepare route •  Determine journey-time

Routing Service

Generate Map(s)

•  Location of job & assets •  Supporting information e.g. job

history, switches, etc

Map Rendering Service

Optimised dispatch - Field-based staff with right information

Dispatch

SPATIALLY-ENABLED ORACLE DATABASE

Page 11: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 11

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless Capture Location

•  Update job location

Create Feature Service

Identify Location

•  Determine actual coordinates of job

Geocoding Service

Investigate Emergency Job & Update •  On-site risk assessment •  Correct/improve information received •  Make safe or create repair job

One “job” updated throughout its life cycle

Attend Site

SPATIALLY-ENABLED ORACLE DATABASE

Page 12: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 12

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Execute Work

Update Repair Job & Tasks – Create Confirmations

•  Report Time & Material consumed •  Feedback work details

Capture Redlining •  Store network changes as spatial

features •  Job status indicates need for

network updates

Create Feature Service

Identify Location

•  Determine location of actual work

Geocoding Service

Capture Location

•  Update job location

Create Feature Service

Accurate data capture – Improved network management

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

SPATIALLY-ENABLED ORACLE DATABASE

Page 13: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 13

Yes

No

Check Area/Location

Check Asset pipe location

& details

Act

ion

Act

iviti

es

Con

tract

s

Take details Give advice Input information

0800 111 999 Identify ESE Send job

Attend Site Make safe

Call repair crew Repair and restore supply

Is the ESE working on his own DN asset?

Process takes account for DN attending another transporters escape

ESE remains on site until relieved by another ESP

First responsibility of the ESE is to protect life & property, irrespective of the asset owner

Manage work Closure & info

capture

Incident Reported

Handle Call

Dispatch work

Attend site

Repair or

Plan work

Customer CSR Contractor Biz Analysts Regional Manager

Internet Call Center Internet Internet Wireless

Contractor

Shared Business Services

User Interface Services – Portal, Wireless, Radio

Service Orchestration

Dispatcher

Wireless Wireless

Manage work Closure & info capture

Oracle Apps CIS BPM Simulation Dispatch Documents Procedures

SPATIALLY-ENABLED ORACLE DATABASE

Page 14: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 14

Spatial Analysis in the System

Raise Emergency Job

•  Register contact & problem •  Eliminate duplicate incidents •  Identify responsible party

Display Map •  Customers •  Assets •  Jobs & their status • Territories / LDZ

Map Rendering Service Identify Location

•  Determine coordinates of Incident location

Geocoding Service

Determine Territory •  Inside which LDZ is the

incident located?

Spatial Query Service

Capture Location •  Create a point feature

representing the incident •  Location of all incidents

stored persistently

Create Feature Service

Intuitive map-based interface - Customer is at the centre of the process

Create Emergency Job

•  Copy incident details into job •  Assess worker safety •  Assess risk of hazard •  Identify opportunistic jobs

Find nearby risks •  Find places of interest (schools,

transportation infrastructure, traffic routes, etc.) close to emergency job location

Spatial Query Service

Find opportunistic jobs

•  Find unallocated job(s) nearby

Spatial Query Service

Optimised scheduling - More efficient, safer operations

Update Repair Job & Tasks – Create Confirmations

•  Report Time & Material consumed •  Feedback work details

Capture Redlining •  Store network changes as spatial

features •  Job status indicates need for

network updates

Create Feature Service

Identify Location

•  Determine location of actual work

Geocoding Service

Capture Location

•  Update job location

Create Feature Service

Accurate data capture – Improved network management

Page 15: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 15

PL/SQL Web Services

 PL/SQL packaged functions can be exposed as simple web services  Easy to develop XML-based protocol for accessing services on the

Web by using XML syntax to send commands over HTTP   JDeveloper provides many features to help create and deploy web

services  These web services can be deployed in any J2EE container or APEX  These are useful to expose specific database search or DML

operations are web services to other components in a system

Simple Search and DML interfaces

Page 16: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 16

Why not OGC web services ?

 OGC web services are useful for systems that need to publish services over the web to other institutions or departments

–  They are useful for well defined sets of operations –  Overkill if simple interactions are required between different components of

a workflow in a single system or closely related systems

Page 17: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 17

Simple Search Example

CREATE FUNCTION FIND_NEARBY_RISKS( LONGITUDE NUMBER, LATITUDE NUMBER) RETURN VARCHAR2

AS Result varchar2(3000); BEGIN SELECT XMLELEMENT( … xmlagg(feature_name) …) into result FROM features_of_interest a WHERE SDO_ANYINTERACT(a.geometry, sdo_geometry(2001,8307, sdo_point_type(longitude,latitude,null), null, null)) = ‘TRUE’; return result; END;

Create a PL/SQL function

Page 18: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 18

Publishing and Using the web service

  Jdeveloper makes it easy to take the PL/SQL function and publish it a s web service

–  No code require, all widget driven –  OTN Jdeveloper pages have examples

 Use HTTP GET methods to use the service –  http://localhost/getNearbyRisks?long=-121.34&lat=37 –  This will return an XML document with potential features of interest that are

at risk near the incident location

 These type of services are easy to integrate into the workflow of a system that requires results based on spatial searches

Page 19: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 19

Simple DML Example

CREATE FUNCTION CREATE_INCIDENT( LONGITUDE NUMBER, LATITUDE NUMBER) RETURN VARCHAR2 AS

Result incident_number; BEGIN incident_number := service_incidents_seq.nextVal; INSERT INTO service_incidents values (incident_number, sdo_geometry(2001,8307, sdo_point_type(longitude,latitude,null), null, null)) ; commit; return incident_number; END;

Create a PL/SQL function

Page 20: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 20

Publishing and Using the web service

 A field technician wants to report an incident at a certain location  Use HTTP PUT method to use the service

–  http://localhost/createIncident –d “{longitude: -121.37 longitude: 37}” –  This will create an entry in the incidents table and trigger an event to

generate a service request to process the event –  Database triggers should be used to automatically trigger these services

requests based on the incidents

Page 21: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 21

Provide Spatial analytics as web services

 Don’t need to have SQL access to add spatial capabilities to an application

 Many times simple spatial search interfaces can integrated into different components of a system using PL/SQL based web services

 Don’t need a separate GIS system if the application does not have direct access to the Spatial database

 Use the database services as much as possible to truly take advantage of enterprise wide spatial data

Page 22: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 22

Hierarchical Report Generation

 Requirement –  Generate reports and maps using custom or standard geographic entities –  Provide drill down and drill up capabilities –  Hierarchy can be geometry based or name based

 Solution –  Use MapViewer for maps and reports –  Use commercial or open source data sets to build the hierarchies –  And associate these hierarchies with the application data

Page 23: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 23

Hierarchy Examples  Customer locations have an address

–  Find the aggregate information for all customers in a city/county/state/country

–  Map interface to drill up and drill down to navigate through the hierarchy and visualize the aggregate information at different levels

Page 24: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 24

Creating Hierarchical Data Model

 Many data sources available for coarse level admin area boundary data

–  Oracle bundles HERE data (certain levels of administrative boundaries) sets with the database

–  Open source data sets are also readily available

 Create a COUNTRY_HIERARCHY table with these columns (AREA_ID, NAME, ADMIN_LEVEL, PARENT_AREA_ID, GEOMETRY)  Populate the parent_area_id column using SDO_RELATE operations

Page 25: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 25

Using Hierarchical Data Model

 Associate each customer with the lowest level of the hierarchy –  In this example, lets say city is at level 4, county at level 3, etc. –  Associate the customer records with the city level admin area

 Once this hierarch is established it is easy to calculate aggregate metrics for different customer attributes at different admin areas

 Using SQL it is then easy to find the number of customers in each city/county/state/country

 MapViewer api can be used to define themes that will show aggregate customer data at each level of the hierarchy

 All of this can be done dynamically on the operational data

Geometry based hierarchy

Page 26: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 26

Custom Hierarchies

 Users want to create own geometry regions  Define hierarchies based on user defined collections of geometries  Hierarchies are defined based on business rules and do not necessary

follow admin hierarchies  Examples: postal_codes/sales_territories/sales_regions, etc.

Geometry hierarchy

Page 27: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 27

Custom Hierarchies

Data editing tools Session (spatial)

content and state Data sources and session settings

Page 28: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 28

MapViewer

 A web-based spatial data editing tool (java applet)

 Supports versioned, concurrent editing through editing sessions

 Supports Workspace Manager  Supports geometry model  All aspects of an editing session are

saved in database

Web-based Editor

Page 29: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 29

APEX Map Application

Page 30: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 30

Spatial enabled Applications in APEX  Spatial data in tables

–  First approach: two NUMBER columns –  What about lines and polygons?

 Spatial processing – SQL, PL/SQL  Visualization on a map  Adding new spatial data via the browser  Geocoding  Spatial queries:

–  Within Distance –  Nearest Neighbors –  Spatial Intersections

Page 31: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 31

1) Map

Page 32: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 32

2) Geocoder

Page 33: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 33

3) Spatial Query: Within Distance

Page 34: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 34

4) Spatial Query: Anyinteract

Page 35: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 35

APEX and the Database provide everything you need ...

•  Spatial Data Type: SDO_GEOMETRY •  Spatial functions in SQL and PL/SQL •  Oracle eLocation Map Service •  Oracle eLocation Geocoder Service •  APEX plugins and widgets •  APEX Sample application

Page 36: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 36

Sample Geolocation Showcase

Page 37: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 37

Oracle Maps Utility Plugins

Page 38: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 38

SPATIAL DATA Step 1

Page 39: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 39

Create a table for spatial data

create  table  my_spatial_images(      id                        number(10)  not  null,      image                  blob,      thumbnail          blob,      file_name          varchar2(200)    not  null,      mimetype            varchar2(200),      geometry            sdo_geometry,      exif                    xmltype,      datetime            timestamp  with  time  zone,      constraint  my_spatial_images_pk  primary  key  (id)  )  

•  Can store points, lines, polygons and complex geometries •  Database provides indexing, query and processing capabilities

Page 40: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 40

Spatial tables need additional tasks

begin      -­‐-­‐  create  metadata  for  spatial  table      -­‐-­‐  coordinates  are  lon/lat  –  and  over  the  whole  world      apex_spatial.insert_geom_metadata_lonlat(          p_table_name      =>  'MY_SPATIAL_IMAGES',          p_column_name    =>  'GEOMETRY'      );  end;        create  index  MY_SPATIAL_IMAGES_SX    on  MY_SPATIAL_IMAGES  (GEOMETRY)  indextype  is  MDSYS.SPATIAL_INDEX  

•  Maintain spatial metadata •  Create an index mandatory for spatial queries

Page 41: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 41

Geocoding: APEX Plugin Dynamic Action Plugin

Page 42: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 42

VISUALIZATION ON A MAP Step 2

Page 43: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 43

Architecture

Oracle eLocation Service with Map Database

APEX database

Client Browser Background Maps

Geocoding Reverse Geocoding

APEX Pages and objects to be

shown on the map

Page 44: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 44

Oracle MapViewer and Oracle Maps

 Map Rendering based on spatial data in the database  Alternatives in APEX

–  Own Installation of Fusion Middleware MapViewer –  Use Oracle eLocation Service maps.oracle.com

 Programmers Interfaces –  APEX Plugin –  Oracle Maps JavaScript API

Page 45: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 45

Oracle Maps APEX Plugin

Page 46: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 46

SPATIAL QUERY AND ANALYSIS Step 3

Page 47: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 47

Within Distance Search

•  WHERE Clause: SDO_WITHIN_DISTANCE

•  Geometry column must be spatially indexed •  Input Parameters

•  Geometry column to search in •  Search Geometry •  Distance •  Unit to use

Page 48: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 48

Nearest Neighbor Search

•  WHERE Clause: SDO_NN

•  Geometry column must be spatially indexed •  Input Parameters

•  Geometry column to search in •  Start geometry •  Maximum Distance •  Max. neighbors •  Unit to use

select  *  from  feature_table  t    where      sdo_nn(          t.geometry,          start_geometry,          'distance=XX  unit=km'      )  =  'TRUE'  

Page 49: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 49

BUILD YOUR OWN APPLICATION

Page 50: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 50

Your own application ...

Page 51: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 51

APEX and the Database But you can go further ...

•  Use your own map server ... •  Use own map styles or own map data •  Deep Integration between database and map server

•  Use your own geocoding facility •  Geocoder directly embedded in the database •  No HTTP requests any more

And you can still use the APEX plugins and widgets

Page 52: May 21, 2014 Walter E. Washington Convention Center … · 2014-05-28 · Customer CSR Regional Manager Contractor Biz Analysts Call Center Internet Internet Wireless Internet Shared

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 52

May 21, 2014 Walter E. Washington Convention Center

Washington, DC USA