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 Spatial Reference Systems in SAP HANA Spatial

In the context of spatial databases, the defined space in which geometries are described is called a spatial reference system (SRS).

Overview

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

Prerequisites

Prerequisites

Steps

Next Steps

Step 1 Calculating the distance on the flat surface
โ€”

What is the distance between two points: (0, 0) and (1, 0)?

SQL
SELECT NEW ST_Point('POINT (0 0)').ST_Distance(NEW ST_Point('POINT (1 0)')) AS "DISTANCE"
FROM "DUMMY";

Distance in SRS=0
Distance in SRS=0

The result is 1.

1, but in what units? In this example the default unit of distance is meter, and conversion to other units is possible in some spatial methods. The list of pre-installed units is available in the system view ST_UNITS_OF_MEASURE.

One of them is yard, used in the following example.

SQL
SELECT NEW ST_Point('POINT (0 0)').ST_Distance(NEW ST_Point('POINT (1 0)'), 'yard') AS "DISTANCE"
FROM "DUMMY";

Convert to yard
Convert to yard

All required units of measure are already pre-loaded in SAP HANA Cloud.

More units of measures can be manually created or loaded into the SAP HANA on-prem using a separate Geospatial Metadata Installer. The Geospatial Metadata Installer is available for registered customers and partners.

Step 2 Introducing Spatial Reference Systems
+
Step 3 Calculating the distance on the round Earth
+
Step 4 Defining additional Spatial Reference Systems
+

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. Calculating the distance on the flat surface 2. Introducing Spatial Reference Systems 3. Calculating the distance on the round Earth 4. Defining additional Spatial Reference Systems 5. Optional

Learn more →