次の2つの例は、ST_SpheroidalDistanceメソッドを使用してマディソン市(-89.39, 43.09)とシカゴ市(-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;