SAP

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

Markus Fath M Markus Fath February 7, 2023
Created on February 11, 2017
Contributors

More from Markus Fath

See all 13 tutorials by Markus Fath →

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