postgresql/contrib/earthdistance/earthdistance.sql.in
Bruce Momjian 24bebf0b72 I have included fixes to declare some floating point constants as double
instead of int, change the calculation method to use the haversine
formula
which is more accurrate for short distances, added a grant to public for
geo_distance and added a regression test.

I will resubmit the earth distance stuff based on cube after 7.3 is
released.

Bruno Wolff III
2002-09-20 03:47:22 +00:00

25 lines
534 B
MySQL

begin;
--------------- geo_distance
CREATE OR REPLACE FUNCTION geo_distance (point, point) RETURNS float8
LANGUAGE 'c' IMMUTABLE STRICT AS 'MODULE_PATHNAME';
--------------- geo_distance as operator <@>
CREATE OPERATOR <@> (
leftarg = point,
rightarg = point,
procedure = geo_distance,
commutator = <@>
);
--
-- 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;