SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Understand Points in SAP HANA Spatial

A point is a spatial data type for a 0-dimensional geometry representing a single location

Overview

🎓 beginner 10 min. SAP HANABeginnerSqlSAP HANA CloudExpress EditionSAP HANA SpatialSAP HANA Multi Model Processing
Markus Fath M Markus Fath February 7, 2023
Created by December 6, 2016
Contributors

Prerequisites

Prerequisites

  • System access: You have developer access to SAP HANA database instance, for example SAP HANA Cloud trial

Steps

Next Steps

Step 1 Select a point in the 2D Euclidean space
โ€”

SAP HANA includes a spatial engine and supports spatial data types and methods for processing spatial data. Spatial data is data that describes the position, shape, and orientation of objects in a defined space.

For more check the SAP HANA Spatial Reference

Open the SQL editor of your choice (web or desktop based) connected to your SAP HANA database instance. Screenshots in this and following tutorials are taken using SAP HANA Database Explorer.

Type the following SQL statement.

SQL
SELECT NEW ST_POINT(0,0) FROM "DUMMY";

This query selects a point in the 2-dimensional 2D Euclidean space. A point defines a single location in space. A point always has an X and Y coordinate. In the example above it is (0, 0), i.e. X=0 and Y=0.

Spatial support in SAP HANA database follows the ISO/IEC 13249-3 “SQL multimedia and application packages – Part 3: Spatial” (SQL/MM) standard. This standard defines:

  • how to store, retrieve and process spatial data using SQL,
  • how spatial data is to be represented as values,
  • which functions are available for converting, comparing, and processing this data in various ways.

A key component of this standard is the use of the spatial data types hierarchy. Within the hierarchy, the prefix ST is used for all data types (also referred to as classes or types).

The ST_POINT type is a 0-dimensional geometry which represents a single location. To get an object of the ST_POINT spatial type you need to call a type’s constructor following the syntax NEW ST_Point(<x>,<y>), where x and y are the corresponding longitude and latitude coordinate values of data type DOUBLE.

Execute the query. Congratulations! You’ve just run your very first query using the spatial capabilities of SAP HANA.

Select a point
Select a point

Step 2 Change result format
+
Step 3 Define a point in the constructor
+
Step 4 Try other spatial methods
+
Step 5 Optional
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Select a point in the 2D Euclidean space 2. Change result format 3. Define a point in the constructor 4. Try other spatial methods 5. Optional

Learn more →