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

A string ('a curve' in more general) is a spatial data type that connects points

Overview

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

Prerequisites

Prerequisites

Steps

Step 1 Create a new line
โ€”

Open the SQL editor of your choice (web or desktop based) connected to your SAP HANA database instance.

Type the following SQL statement.

SQL
SELECT NEW ST_LineString('LineString (0 0, 4 3)').ST_Dimension() AS "LINE_DIM"
FROM "DUMMY";

This query instantiates a line in the 2-dimensional Euclidean space and returns its dimensions. In the example above it is a line connecting point (0, 0); i.e. X=0 and Y=0, with a point (4, 3), i.e. X=4 and Y=3.

The constructor is using Well-known Text (WKT). As explained in the previous tutorial, WKT is a text markup language for representing vector geometry objects defined by the Open Geospatial Consortium (OGC).

Execute the query. The ST_Dimension() method will return 1. In the previous tutorial the same method applied to the point returned 0.

String Dimension
String Dimension

Step 2 Calculate the length
+
Step 3 Add more points
+
Step 4 Create a circular string
+
Step 5 Check string characteristics
+
Step 6 Create a circle
+
Step 7 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 7
1. Create a new line 2. Calculate the length 3. Add more points 4. Create a circular string 5. Check string characteristics 6. Create a circle 7. Optional

Learn more →