mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-05 07:46:56 +02:00
24bebf0b72
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
25 lines
534 B
MySQL
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;
|