2002-09-20 05:47:22 +02:00
|
|
|
begin;
|
2000-06-15 21:05:22 +02:00
|
|
|
|
|
|
|
--------------- geo_distance
|
|
|
|
|
2002-09-20 05:47:22 +02:00
|
|
|
CREATE OR REPLACE FUNCTION geo_distance (point, point) RETURNS float8
|
|
|
|
LANGUAGE 'c' IMMUTABLE STRICT AS 'MODULE_PATHNAME';
|
2000-06-15 21:05:22 +02:00
|
|
|
|
|
|
|
--------------- geo_distance as operator <@>
|
|
|
|
|
|
|
|
CREATE OPERATOR <@> (
|
|
|
|
leftarg = point,
|
|
|
|
rightarg = point,
|
|
|
|
procedure = geo_distance,
|
|
|
|
commutator = <@>
|
|
|
|
);
|
|
|
|
|
2002-09-20 05:47:22 +02:00
|
|
|
--
|
|
|
|
-- By default this function is made executable by anyone. To restrict
|
|
|
|
-- access by default, comment out the following grant command.
|
|
|
|
--
|
|
|
|
|
|
|
|
grant execute on function geo_distance(point, point) to public;
|
|
|
|
|
|
|
|
commit;
|