16.20 - Example: ST_SpheroidalDistance - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ Geospatial Data Types

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1181-162K
Language
English (United States)

The following two examples show how to use the ST_SpheroidalDistance method to get the spheroidal distance between Madison (-89.39, 43.09) and Chicago (-87.65, 41.90):

   CREATE TABLE sample_points1 (skey1 INTEGER, point1 ST_Geometry);

   INSERT INTO sample_points1 VALUES (101, 'POINT(-89.39 43.09)');

   SELECT point1.ST_SpheroidalDistance(
      new ST_Geometry(
                    'ST_POINT(-87.65 41.90)'), 6378137, 298.257223563)
   FROM sample_points1;

   SELECT point1.ST_SpheroidalDistance(
      new ST_Geometry('POINT(-87.65 41.90)') )
   FROM sample_points1;