You are on page 1of 52

DEV103 Mapping the world with

SAP HANA Geospatial Engine

Frank Albrecht SAP SE (ASCOT)


Kai-Christoph Mueller SAP Labs (ASCOT)

Public

Disclaimer
This presentation outlines our general product direction and should not be relied on in making a
purchase decision. This presentation is not subject to your license agreement or any other agreement
with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and SAP's
strategy and possible future developments are subject to change and may be changed by SAP at any
time for any reason without notice. This document is provided without a warranty of any kind, either
express or implied, including but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this
document, except if such damages were caused by SAP intentionally or grossly negligent.

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

Agenda
The Project
SAP HANA Cloud and Spatial engine
Implementation
From Real World to SAP HANA model
Architecture

Digitizing the real world


Analyzing the real world

Results
Learnings

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

The Project

The Project

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

The Project
Goal
Help a golf player to improve his
performance

Motivation

use SAP standard software


provide running code showcase
be able to become producible
show patterns, which can be used in
business related scenarios

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

Real World meets Technology

KPIs

Cloud

Sensors
capture

store, analyze & visualize

create value

Trackman

SAP HANA cloud

Real time insights

Stroke tracking

SAP HANA spatial engine

Predictions

Wind sensor

Intuitive visualization

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

Agenda
The Project
SAP HANA Cloud and Spatial engine
Implementation
From Real World to SAP HANA model
Architecture

Digitizing the real world


Analyzing the real world

Results
Learnings

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

SAP HANA
(Cloud && Spatial Engine)

Landscape: SAP HANA Cloud accessible via the Internet

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

10

SAP HANA Cloud Platform High level overview


Integrated

Developer
Experience

HANA XS && OData

Open (JAVA)

SAP HANA AppServices


Application
Services

www

Mobile

Enablement
Services

Portal

Application Management

Analytics

Collaboration

Systems Management

Security

Integration

Administration & Monitoring

SAP HANA DBServices

Transactions

Analytics

Streaming

Predictive

Spatial &
Graphs

Text Mining

SAP HANA Cloud Platform


2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

11

SAP HANA spatial engine

SAP HANA
Spatial Processing
Business Data

Geo Services

Geo Content

{ Geocoding ||
Base maps }}

{ Political
Boundaries || POIs
|| Roads || }

Spatial Data

Columnar Spatial
Processing

Calc Model /
Views
{ Joins || Views }

Real-time Data

Spatial Functions
{ Area || Distance
|| Within || }

Spatial Data
Types
{ Points || Lines ||
Polygons }

- SQL
Interfaces
- JDBC
- ODBC
- XS
-- xsjs
-- OData
-- geoJSON
2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

12

Development Tools: HANA Studio or Web Development Workbench

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

13

Agenda
The Project
SAP HANA Cloud and Spatial engine
Implementation
From Real World to SAP HANA model
Architecture

Digitizing the real world


Analyzing the real world

Results
Learnings

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

14

Implementation
From the real world to the SAP HANA model

SAP HANA Spatial Application Development


Quickly develop and deploy SAP HANA based spatial applications
via the native XS engine
HTML5
Application

iPad/
Browser

Maps

Geocoding

Geocontent

Services

Allows for visualization, interaction, and


exploration of spatial data in SAP HANA via maps
Supports HTML5 deployments for browser or iPad
Consumes SAP HANA models

Benefits:

SAP HANA XS
Spatial
Engine

Capabilities:

SAP
HANA

Quick development and deployment time


Low TCO & TCD and fast response times with 2tier architecture
Interoperates with third-party mapping services

Location
Services

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

16

The Process
From the real world to the SAP HANA model

createGolfCourseModelInHANA

1)

Acquire real world representation

2)

Create and export geoJSON / KML / ShapeFile /


{ Google Earth || OpenStreetMap || geojson.io || }

3)

Create SQL inserts using WKT format


// code..code..code

4)

Import model to SAP HANA

5)

Check the model of golf course in SAP HANA

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

17

(1) Acquire real world representation


Golf Course and Club St.Leon-Rot, Germany

Images of Golf Club St.Leon-Rot from https://www.gc-slr.de/


2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

18

GeoJSON (small excurse)


or how to model real world objects
GeoJSON is an open standard format for encoding collections of simple geographical features along
with their non-spatial attributes using JavaScript Object Notation.
~ Wikipedia
Point

{
"type": "Point",
"coordinates": [30, 10] }

LineString

{
"type": "LineString",
"coordinates": [ [30, 10], [10, 30], [40, 40] ]

Polygon

geoJSON
geometries

}
{
"type": "Polygon",
"coordinates": [ [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]]

MultiPoint

}
{
"type": "MultiPoint",
"coordinates": [ [10, 40], [40, 30], [20, 20], [30, 10] ]
}

\\

+= { MultiLineString{}, MultiPolygon{} }

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

19

GeoJSON (still a small excurse)


feature collections
GeoJSON is an open standard format for encoding collections of simple geographical features along
with their non-spatial attributes using JavaScript Object Notation.
~ Wikipedia
{ "type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [ [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] ] },
"properties": { "prop0": 0.0, "prop1": "value0" }
},
{ "type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]},
"properties": {
"prop1": { "this": "that" },
"prop0": "value0" }
}
]
}

geoJSON
features

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

20

(2) Create and export geoJSON


Tool interface and demo

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

21

(2) geoJSON for a golf course


some examples
Pin:

2014 SAP SE or an SAP affiliate company. All rights reserved.

Bunker:

Public

22

(3) Create SQL inserts in WKT format

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

23

(2) Database Table with geo data

Use ST.as_Text() to show geo information in human readable format

LINESTRING (8.628876180747724 49.245461274649351,8.628857007750653


POINT (8.624864494948630 49.247562010296519)
2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

24

(4) Import model to SAP HANA


Create a table including ST_Geometry data type

super type of all spatial geometry types

{ ST_LineString && ST_MultiLineString && ST_MultiPoint && ST_MultiPolygon && ST_Point && ST_Polygon }

Expecting WKT(Well-Known-Text) format in each constructor


insert
into "PAE"."gsm::holegeo"( "ID",
"HOLEID",
"NAME",
"TYPE",
"PROPERTIES",
"GEO") values( "PAE".SEQ_HOLEGEO.NEXTVAL,
'd-code_hole17',
'd-code_Green',
'green',
'{"golf":"green","natural":"grass","name":"Green","parent":"hole01"}',
NEW ST_POLYGON ('POLYGON((8.62538605928421 49.247343895147054,
8.625455796718596 49.24721782786144,
8.625624775886536 49.24727735967533,
8.625514805316925 49.247349147943645,
8.62538605928421 49.247343895147054 ))') ) ;

2014 SAP SE or an SAP affiliate company. All rights reserved.

Inserting a modeled
green

// first and last entry are the same


// in order to close the polygon

Public

25

(5) Check the model of golf course in SAP HANA


Hole 1 In real life and based on SAP HANA data

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

26

(5) Check the model of golf course in SAP HANA


The complete course of St.Leon in real life and modeled in SAP HANA

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

27

Implementation
Architecture

Architecture Information

SAP HANA Cloud platform


as the core
Data capturing via sensors
Geo information, analysis
and prediction from platform
services

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

29

Implementation
Digitizing the real world

Digitizing the real world Provide Information during game

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

31

Digitizing the real world Recording Strokes


NFC Tags for each club
Phone with NFC support
Records Club information
and Geo Location

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

32

Storing the recorded strokes


Phone reads NFC tag and creates OData Entity with Latitude,Longitude and ClubId

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

33

Implementation
Analyzing the real world

Analysis - Questions
The golf player wants to get answers for the following questions:
Did the ball hit the green ?
How long was the longest drive ?
Did the ball hit the Fairway ? { hit || missed left || missed right }
Green in regulation ? { hit || missed short || missed long || missed left || missed right }

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

35

KPI
Fairway { hit || missed left || missed right }

Angle as reference required

Line between tee-off and centroid of freeway

Depending on angle between


reference line && tee-off to ball land line
missed right || missed left

"PAE"."gsm::Bearing"(
SD."StartLat",
SD."StartLng",
SD."EndLat",
SD."EndLng
)

>

"PAE"."gsm::Bearing"(
SD."StartLat",
SD."StartLng",
HG_FAIRWAY.GEO.ST_CENTROID().ST_Y(),
HG_FAIRWAY.GEO.ST_CENTROID().ST_X()
)

\\ "PAE"."gsm::Bearing is a helper function

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

36

Fairway Special Case

Unsymmetrically shaped freeways require helper lines

Ball would falsely be labeled missed right here

New line between tee-off && helper point (green)

Depending on angle between


helper line && tee-off to ball land line
missed right || missed left

"PAE"."gsm::Bearing"(
FW_HLINE."Lat1",
FW_HLINE."Lng1",
SD."EndLat",
SD."EndLng
)

>

"PAE"."gsm::Bearing"(
FW_HLINE."Lat1",
FW_HLINE."Lng1",
FW_HLINE."Lat2",
FW_HLINE."Lng2
)

\\ "PAE"."gsm::Bearing is a helper function

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

37

KPI
Green in regulation (GIR)
Green in regulation (GIR) := stroke ( PAR 2 ) on the green
Possible values { Hit || Missed short || Missed long || Missed right || Missed left }
Measured in stroke direction
Unsymmetrical shape again
Missed short || Missed right?

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

38

Agenda
The Project
SAP HANA Cloud and Spatial engine
Implementation
From Real World to SAP HANA model
Architecture

Digitizing the real world


Analyzing the real world

Results
Learnings

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

39

Results

The Results

Fan experience Leader board

Player dashboard

Analytics

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

41

Fan experience Leader board

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

42

The Player Dashboard

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

43

Analytics

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

44

Agenda
The Project
SAP HANA Cloud and Spatial engine
Implementation
From Real World to SAP HANA model
Architecture

Digitizing the real world


Analyzing the real world

Results
Learnings

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

45

Learnings

Learnings
You need to understand

Longitude & Latitude versus Cartesian coordinates

Radian versus Degrees

Visualization needed for all Geospatial data during development and testing very helpful
Clock-wise/Counter Clock-wise orientation

for distances/areas on the earth

influencing distance calculations as there are two distances on a closed surface

Access via SAP HANA Cloud on every Golf Course in the world possible
Current Limitations

Geospatial cannot be used in SQL script, Analytical- and Calculation-views

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

47

Thank you
Contact information:
Frank Albrecht SAP SE (ASCOT)
Kai-Christoph Mueller SAP Labs (ASCOT)

2014 SAP SE or an SAP affiliate company. All rights reserved.

SAP d-code Virtual Hands-on Workshops and SAP d-code Online


Continue your SAP d-code education after the event!
SAP d-code Virtual Hands-on Workshops

SAP d-code Online

Access hands-on workshops post-event


Starting January 2015
Complementary with your SAP d-code registration

Access replays of keynotes, Demo Jam, SAP d-code


live interviews, select lecture sessions, and more!
Hands-on replays

http://sapdcodehandson.sap.com

2014 SAP SE or an SAP affiliate company. All rights reserved.

http://sapdcode.com/online

Public

49

Further Information

SAP Public Web


scn.sap.com
www.sap.com

SAP Education and Certification Opportunities


www.sap.com/education

Watch SAP d-code Online


www.sapcode.com/online

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

50

Feedback
Please complete your session evaluation for
DEV103

Thanks for attending this d-code session.


2014
2014SAP
SAPSE
SEororananSAP
SAPaffiliate
affiliatecompany.
company.AllAllrights
rightsreserved.
reserved.

Public

5151

2014 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark
information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing
herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or
release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for
any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forwardlooking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved.

Public

52

You might also like