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

Add Planar Geometries to SAP HANA Database in SAP HANA Cloud

Learn about what Spatial Reference Systems are and how to add planar geometries based on WGS84 geometries to a table in SAP HANA Cloud, SAP HANA database.

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA SpatialSAP HANA CloudSAP HANA DatabaseSAP HANA Multi Model Processing

You will learn

  • โœ”How to add planar geometries
  • โœ”How to create a column using planar Spatial Reference System (SRS)
  • โœ”How to transform geometries from one spatial reference system to another
Unknown U Unknown November 1, 2022
Created by July 14, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

In this tutorial, you will learn how to add planar geometries based on WGS84 geometries. This includes three steps:

  • Create Planar Spatial Reference System
  • Add Column with Type ST_Geometry
  • Persist Projected Geometries

Step 1 Representing geometries in Spatial Reference Systems
โ€”

In our current dataset, we have a column of type ST_Geometry (*) holding latitude and longitude values. We can view latitude and longitude as double values by selecting ST_X() (*) and ST_Y() (*) from our geometry column.

SQL
SELECT
	"geometry_GEO".ST_X() AS LONGITUDE,
	"geometry_GEO".ST_Y() AS LATITUDE
FROM LONDON_VERTICES;

Geometries can be represented in different Spatial Reference Systems (SRS). The given latitude and longitude values are based on a round-earth model and the corresponding spatial reference system is WGS84 (id 4326).

For performance reasons, it is recommended to use a projected spatial reference system instead of a round-earth model. This way Euclidean geometry can be used for spatial calculations, which is less expensive than calculations on the sphere. The second general recommendation when dealing with spatial data is to persist the base geometries. This way, in-database optimizations such as spatial indices can be leveraged.

Check out this brief YouTube Video to get an overview of the concept of Spatial Reference Systems.

Now that you know the basics, your first step in this exercise will be to create a planar spatial reference system in SAP HANA Cloud, SAP HANA database.

Step 2 Create planar Spatial Reference System with id 32630
+
Step 3 Persist projected geometries
+
Step 4 Test yourself
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Representing geometries in Spatial Reference Systems 2. Create planar Spatial Reference System with id 32630 3. Persist projected geometries 4. Test yourself

Learn more →