SapHanaTutorial.Com HOME     Learning-Materials Interview-Q&A Certifications Quiz Online-Courses Forum Jobs Trendz FAQs  
     Explore The World of Hana With Us     
About Us
Contact Us
 Apps
X
HANA App
>>>
Hadoop App
>>>
Tutorial App on SAP HANA
This app is an All-In-One package to provide everything to HANA Lovers.

It contains
1. Courses on SAP HANA - Basics, Modeling and Administration
2. Multiple Quizzes on Overview, Modelling, Architeture, and Administration
3. Most popular articles on SAP HANA
4. Series of Interview questions to brushup your HANA skills
Tutorial App on Hadoop
This app is an All-In-One package to provide everything to Hadoop Lovers.

It contains
1. Courses on Hadoop - Basics and Advanced
2. Multiple Quizzes on Basics, MapReduce and HDFS
3. Most popular articles on Hadoop
4. Series of Interview questions to brushup your skills
Apps
HANA App
Hadoop App
';
Search
Stay Connected
Search Topics
Topic Index
+
-
SAP HANA Modeling
+
-
Spatial Processing

Spatial Processing in SAP HANA

SAP HANA Geospatial processing feature was launched with SAP HANA SP6.
This enables organizations to store their Geospatial data along with Business data in the same instance of HANA. By extending the HANA Platform capabilities customers can perform operations on spatial data like calculating the distance between geometries, determining the union or intersection of multiple objects. These calculations are performed using predicates such as intersects, contains, and crosses.
SAP HANA Geospatial processing

Spatial Data:

Spatial data is data that describes the position, shape, and orientation of objects in a defined space. Spatial data is represented as 2D geometries in the form of points, line strings, and polygons. For example, the following image shows the state of Massachusetts, representing the union of polygons representing zip code regions.
SAP HANA Geospatial processing


Spatial feature in SAP HANA:

  • HANA Spatial delivers the ability to store and process geospatial data types like ST_POINT, ST_GEOMETRY etc.
  • These data types allow application developers to associate spatial information with their data. For example, a table representing companies could store the location of the company as a point, or store the delivery area for the company as a polygon.
  • SAP HANA also delivers Nokia mapping services as part of the HANA Spatial features and this can be used to create apps using HANA XS engine thru which Nokia mapping services can be called using the Nokia API.
  • Once Spatial data is loaded into HANA you can create or extend HANA models (Analytic, Calculation Views) using HANA Studio and make these models available for analysis and visualization thru SAP Lumira or custom HTML5 applications. SAP HANA SQL script has been extended to support the Spatial SQL MM Standards for storing and accessing geospatial data

Spatial Type Hierarchy:

SAP HANA has brought in some new spatial data types like POINT (ST_POINT) and Geometry (ST_GEOMETRY) to store spatial information. A point is like a fixed single location in space and will be represented by X and Y co-ordinates (*can also have a Z co-ordinate in case of 3D space).
A Geometry is like a super class container and can store the below type within it. In Geometry data type we can store any of the child types like Line, Polygon or Point
The following diagram illustrates the hierarchy of the ST_Geometry data types:
SAP HANA Geospatial processing

Example on ST_POINT:

Let us see a simple example on ST_POINT in HANA. We will create a table with column type ST_POINT and insert and view the record.

SET SCHEMA "<YOUR_SCHEMA>";
CREATE COLUMN TABLE ST_POINT_EXAMPLE1
(
COORDINATE ST_POINT
);
INSERT INTO ST_POINT_EXAMPLE1 VALUES (NEW ST_POINT (40.71, 74.0));
SELECT COORDINATE.ST_ASGEOJSON () FROM ST_POINT_EXAMPLE1;

The output of SELECT query will be as below:
SAP HANA Geospatial processing

You can also see that we are querying the data as GeoJson which is a special JSON format for encoding a variety of geometrical data structures and it is easily understood by most of the MAP client APIs. More information about GeoJson can be found below here: -http://geojson.org/.

Example on ST_GEOMETRY:

Let us see a simple example on ST_POINT in HANA. We will create a table with column type ST_POINT and insert and view the record.

SET SCHEMA "<YOUR_SCHEMA>";
CREATE COLUMN TABLE ST_GEOMETRY_EXAMPLE1
(
SHAPE ST_GEOMETRY
);
INSERT INTO ST_GEOMETRY_EXAMPLE1 VALUES (NEW ST_POINT(0.0, 0.0) );
INSERT INTO ST_GEOMETRY_EXAMPLE1 VALUES (NEW ST_POLYGON('POLYGON((0.0 0.0, 4.0 0.0, 2.0 2.0, 0.0 0.0))') );
SELECT SHAPE.ST_ASGEOJSON() FROM ST_GEOMETRY_EXAMPLE1;

The output should be as below:
SAP HANA Geospatial processing




Support us by sharing this article.



Explore More
Close X
Close X

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

 © 2017 : saphanatutorial.com, All rights reserved.  Privacy Policy