mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Rename contrib contains/contained-by operators to @> and <@, per discussion.
This commit is contained in:
@ -78,7 +78,7 @@ earth_distance(earth, earth) - Returns the great circle distance between
|
||||
two points on the surface of the Earth.
|
||||
|
||||
earth_box(earth, float8) - Returns a box suitable for an indexed search using
|
||||
the cube @ operator for points within a given great circle distance of a
|
||||
the cube @> operator for points within a given great circle distance of a
|
||||
location. Some points in this box are further than the specified great circle
|
||||
distance from the location so a second check using earth_distance should be
|
||||
made at the same time.
|
||||
|
@ -743,7 +743,7 @@ SELECT cube_ll_coord(earth_box(ll_to_earth(0,0),10*earth()),1)::numeric(20,5),
|
||||
-- Test for points that should be in bounding boxes.
|
||||
--
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*1.00001) @>
|
||||
ll_to_earth(0,1);
|
||||
?column?
|
||||
----------
|
||||
@ -751,7 +751,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*1.00001) @>
|
||||
ll_to_earth(0,0.1);
|
||||
?column?
|
||||
----------
|
||||
@ -759,7 +759,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*1.00001) @>
|
||||
ll_to_earth(0,0.01);
|
||||
?column?
|
||||
----------
|
||||
@ -767,7 +767,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*1.00001) @>
|
||||
ll_to_earth(0,0.001);
|
||||
?column?
|
||||
----------
|
||||
@ -775,7 +775,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*1.00001) @>
|
||||
ll_to_earth(0,0.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -783,7 +783,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*1.00001) @>
|
||||
ll_to_earth(0.0001,0.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -791,7 +791,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(45,45),
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*1.00001) @>
|
||||
ll_to_earth(45.0001,45.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -799,7 +799,7 @@ SELECT earth_box(ll_to_earth(45,45),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(90,180),
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*1.00001) @>
|
||||
ll_to_earth(90.0001,180.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -812,7 +812,7 @@ SELECT earth_box(ll_to_earth(90,180),
|
||||
-- but further away than the distance we are testing.
|
||||
--
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*.57735) @>
|
||||
ll_to_earth(0,1);
|
||||
?column?
|
||||
----------
|
||||
@ -820,7 +820,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*.57735) @>
|
||||
ll_to_earth(0,0.1);
|
||||
?column?
|
||||
----------
|
||||
@ -828,7 +828,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*.57735) @>
|
||||
ll_to_earth(0,0.01);
|
||||
?column?
|
||||
----------
|
||||
@ -836,7 +836,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*.57735) @>
|
||||
ll_to_earth(0,0.001);
|
||||
?column?
|
||||
----------
|
||||
@ -844,7 +844,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*.57735) @>
|
||||
ll_to_earth(0,0.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -852,7 +852,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*.57735) @>
|
||||
ll_to_earth(0.0001,0.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -860,7 +860,7 @@ SELECT earth_box(ll_to_earth(0,0),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(45,45),
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*.57735) @>
|
||||
ll_to_earth(45.0001,45.0001);
|
||||
?column?
|
||||
----------
|
||||
@ -868,7 +868,7 @@ SELECT earth_box(ll_to_earth(45,45),
|
||||
(1 row)
|
||||
|
||||
SELECT earth_box(ll_to_earth(90,180),
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*.57735) @>
|
||||
ll_to_earth(90.0001,180.0001);
|
||||
?column?
|
||||
----------
|
||||
|
@ -224,28 +224,28 @@ SELECT cube_ll_coord(earth_box(ll_to_earth(0,0),10*earth()),1)::numeric(20,5),
|
||||
--
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*1.00001) @>
|
||||
ll_to_earth(0,1);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*1.00001) @>
|
||||
ll_to_earth(0,0.1);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*1.00001) @>
|
||||
ll_to_earth(0,0.01);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*1.00001) @>
|
||||
ll_to_earth(0,0.001);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*1.00001) @>
|
||||
ll_to_earth(0,0.0001);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*1.00001) @>
|
||||
ll_to_earth(0.0001,0.0001);
|
||||
SELECT earth_box(ll_to_earth(45,45),
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*1.00001) @>
|
||||
ll_to_earth(45.0001,45.0001);
|
||||
SELECT earth_box(ll_to_earth(90,180),
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*1.00001) @
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*1.00001) @>
|
||||
ll_to_earth(90.0001,180.0001);
|
||||
|
||||
--
|
||||
@ -255,28 +255,28 @@ SELECT earth_box(ll_to_earth(90,180),
|
||||
--
|
||||
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,1))*.57735) @>
|
||||
ll_to_earth(0,1);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.1))*.57735) @>
|
||||
ll_to_earth(0,0.1);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.01))*.57735) @>
|
||||
ll_to_earth(0,0.01);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.001))*.57735) @>
|
||||
ll_to_earth(0,0.001);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0,0.0001))*.57735) @>
|
||||
ll_to_earth(0,0.0001);
|
||||
SELECT earth_box(ll_to_earth(0,0),
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(0,0),ll_to_earth(0.0001,0.0001))*.57735) @>
|
||||
ll_to_earth(0.0001,0.0001);
|
||||
SELECT earth_box(ll_to_earth(45,45),
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(45,45),ll_to_earth(45.0001,45.0001))*.57735) @>
|
||||
ll_to_earth(45.0001,45.0001);
|
||||
SELECT earth_box(ll_to_earth(90,180),
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*.57735) @
|
||||
earth_distance(ll_to_earth(90,180),ll_to_earth(90.0001,180.0001))*.57735) @>
|
||||
ll_to_earth(90.0001,180.0001);
|
||||
|
||||
--
|
||||
|
Reference in New Issue
Block a user