mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-07 04:49:24 +02:00
left a reference to cube in a comment in the regression test (that also shows up in the expected output). This doesn't cause any real problem, but people who read the comment might be confused. Attached is a diff to remove the reference. Bruno Wolff III
46 lines
2.0 KiB
PL/PgSQL
46 lines
2.0 KiB
PL/PgSQL
--
|
|
-- Test earth distance functions
|
|
--
|
|
|
|
--
|
|
-- first, define the datatype. Turn off echoing so that expected file
|
|
-- does not depend on contents of earthdistance.sql.
|
|
--
|
|
\set ECHO none
|
|
\i earthdistance.sql
|
|
\set ECHO all
|
|
|
|
--
|
|
-- Test getting the distance between two points using geo_distance.
|
|
--
|
|
|
|
SELECT geo_distance('(0,0)'::point,'(0,0)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,0)'::point,'(180,0)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,0)'::point,'(0,90)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,0)'::point,'(90,0)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,0)'::point,'(1,0)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,0)'::point,'(0,1)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,30)'::point,'(1,30)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,30)'::point,'(0,31)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,60)'::point,'(1,60)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(0,60)'::point,'(0,61)'::point)::numeric(20,5);
|
|
SELECT geo_distance('(87.6,41.8)'::point,'(106.7,35.1)'::point)::numeric(20,5);
|
|
SELECT (geo_distance('(87.6,41.8)'::point,'(106.7,35.1)'::point)*5280.*12.*2.54/100.)::numeric(20,5);
|
|
|
|
--
|
|
-- Test getting the distance between two points using the <@> operator.
|
|
--
|
|
|
|
SELECT ('(0,0)'::point <@> '(0,0)'::point)::numeric(20,5);
|
|
SELECT ('(0,0)'::point <@> '(180,0)'::point)::numeric(20,5);
|
|
SELECT ('(0,0)'::point <@> '(0,90)'::point)::numeric(20,5);
|
|
SELECT ('(0,0)'::point <@> '(90,0)'::point)::numeric(20,5);
|
|
SELECT ('(0,0)'::point <@> '(1,0)'::point)::numeric(20,5);
|
|
SELECT ('(0,0)'::point <@> '(0,1)'::point)::numeric(20,5);
|
|
SELECT ('(0,30)'::point <@> '(1,30)'::point)::numeric(20,5);
|
|
SELECT ('(0,30)'::point <@> '(0,31)'::point)::numeric(20,5);
|
|
SELECT ('(0,60)'::point <@> '(1,60)'::point)::numeric(20,5);
|
|
SELECT ('(0,60)'::point <@> '(0,61)'::point)::numeric(20,5);
|
|
SELECT ('(87.6,41.8)'::point <@> '(106.7,35.1)'::point)::numeric(20,5);
|
|
SELECT (('(87.6,41.8)'::point <@> '(106.7,35.1)'::point)*5280.*12.*2.54/100.)::numeric(20,5);
|