HANA Spatial Week2
HANA Spatial Week2
HANA Spatial Week2
Reverse Geocoding
Geocoding and Reverse Geocoding
Motivation
SAP HANA
Generates latitude and longitude from an address, and generates addresses from
latitude and longitude coordinates.
Prerequisites
Download and install the geocode directories from SAP Service Marketplace
Set up appropriate permissions
Notes
The accuracy of the point is based on the completeness of the address.
The Geocode node falls back to a lower-level point when the finer level cannot be obtained.
The value in the GEO_ASMT_LEVEL output column identifies the level that the point
represents.
SAP HANA smart data quality may require additional licenses.
Automatic updates
ID City Str Lon Geocode
/Lat index
SAP HANA
Options
Use the SAP HANA smart data quality geocode provider
Or use a custom provider
Prerequisites
Set up SAP HANA smart data quality
Or implement a custom geocode provider, e.g. using JavaScript on XSC
Notes
The assignment of the point may fail if the address cannot be resolved on a specific
address level.
Contact information:
[email protected]
2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Set operations
Operations performed on a set of geometries, e.g. the intersection of the trading
areas of your sales stores and the downtown business area.
Aggregation
Grouping operations on a set of geometries, e.g. the convex hull over the
customer location of a sales store.
SELECT "REGION_1".ST_Union("REGION_2")
FROM "SALES_REGIONS";
"SHAPE_A".ST_Union("SHAPE_B")
"SHAPE_A".ST_Intersection("SHAPE_B")
Union
"SHAPE_A".ST_Difference("SHAPE_B")
Intersection
"SHAPE_A".ST_SymDifference("SHAPE_B")
Difference
Symmetric
ST_IntersectionAggr("SHAPE")
Difference
ST_UnionAggr("SHAPE")
ST_AsSVGAggr("SHAPE")
Returns a complete or partial SVG document that renders the
geometries in a group
ST_ConvexHullAggr ("SHAPE")
Returns the convex hull for all of the geometries in a group
ST_EnvelopeAggr ("SHAPE")
Returns the bounding rectangle for all of the geometries in a group
ST_IntersectionAggr ("SHAPE")
Returns the spatial intersection of all of the geometries in a group
ST_UnionAggr ("SHAPE")
Returns the spatial union of all of the geometries
Contact information:
[email protected]
2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
g1 g2 g1
g2
g2
g1 g2 g1
g2 g2
g1
g1.ST_Within(g2) g1 g1 g2
g2
g1 g2 = g1 I(g1) E(g2) = g1
g2 g2
g1.ST_Contains(g2) g1 g1.ST_Crosses(g2)
g1
g1
g2 g1.ST_Touches(g2)
g1.ST_Intersects(g2) g1
g1 (g1 g2 ) (B(g1) B(g2) = )
g1 g2
g1 g2
g1
g1 g1.ST_Overlaps(g2)
g2 g2
g1 g2 (I(g1) I(g2) )
g2 (I(g1) E(g2) )
g1.ST_Disjoint(g2)
g1.ST_Equals(g2) g1.ST_Covers(g2) *
g1 g2 (E(g1) I(g2) )
g1 g2 =
g1 = g2 g1 g2 = g2
* No OGC standard
2016 SAP SE or an SAP affiliate company. All rights reserved. Public 3
Spatial Predicates and Joins
ST_WithinDistance
"SHAPE_A".ST_WithinDistance("SHAPE_B",
[distance],[unit])
The ST_Relate method tests if a geometry is spatially related to another geometry by looking for
intersection between the interior, boundary, and exterior.
"SHAPE_A".ST_Relate("SHAPE_B" , 'T*F**F***') = 0
You pass a DE-9IM string reflecting the intersection results to test for. If the conditions are satisfied,
ST_Relate returns 1; if not, 0 is returned.
As JOIN condition
SELECT * FROM "STORES" AS S
LEFT JOIN "CUSTOMERS" AS C
ON C."LOCATION".ST_Within(S."TRADING_AREA") = 1;
Contact information:
[email protected]
2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
The ST_Relate method tests if a geometry value is spatially related to another geometry value by
testing for the intersection between the interior, boundary, and exterior of two geometries.
"SHAPE_A".ST_Relate("SHAPE_B") = '212111212'
The result is a 9-character string in DE-9IM format, where each character of the string represents the
dimension of the result of an intersection test.
g2 I g2 B g2 E
g1 I 1 2 3 In the above example, the first digit is '2', which means the
g1 B 4 5 6 intersection of the interiors of SHAPE_A and SHAPE_B
g1 E 7 8 9 has dimension 2.
I = Interior
B = Boundary
E = Exterior
Transform
Contact information:
[email protected]
2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Methods
ST_ClusterID()
ST_ClusterEnvelope()
Methods
ST_ClusterID()
ST_ClusterCentroid()
Methods
ST_ClusterID()
Contact information:
[email protected]
2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.