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

Using columns to store and process spatial data in tables

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 11, 2016
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Review spatial types
โ€”

The following spatial types can be used in column tables in SAP HANA:

  • ST_POINT,
  • ST_GEOMETRY.

Spatial columns are not supported in SAP HANA row tables.

The column type ST_GEOMETRY supports multidimensional spatial data for the following spatial data types: ST_CircularString, ST_GeometryCollection, ST_LineString, ST_MultiLineString, ST_MultiPoint, ST_MultiPolygon, ST_Point, and ST_Polygon.

ST_GEOMETRY is a core component of the SQL Multimedia (SQL/MM) standard for storing and accessing geospatial data. SQL-MM follows an object-oriented approach. Geometry is the overarching type for objects such as points, strings, and polygons. The geometry type is the supertype for all supported spatial data types.

The following diagram is taken from the SAP HANA Spatial Reference Guide and illustrates the hierarchy of the ST_Geometry data types:

Spatial hierarchy
Spatial hierarchy

Object-oriented properties of spatial data types:

  • A subtype (or derived type) is more specific than its supertype (or base type).
  • A subtype inherits all methods from all supertypes. For example, ST_Polygon values can call methods defined for the ST_Geometry.
  • A value of a subtype can be automatically converted to any of its supertypes. For example, an ST_Point value can be used where an ST_Geometry parameter is required.
  • A column or variable of type ST_Geometry can store spatial values of any type.
Step 2 Create a table and load sample data
+
Step 3 Geospatial data validation
+
Step 4 Aggregate shapes from a spatial column using union
+
Step 5 Additional aggregation methods
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Review spatial types 2. Create a table and load sample data 3. Geospatial data validation 4. Aggregate shapes from a spatial column using union 5. Additional aggregation methods 6. Optional

Learn more →