
jbe@46: 
jbe@46: CREATE TYPE epoint_with_sample_count;
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ekey_point_in_dummy(cstring)
jbe@46:   RETURNS ekey_point
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_notimpl';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ekey_point_out_dummy(ekey_point)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_notimpl';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ekey_area_in_dummy(cstring)
jbe@46:   RETURNS ekey_area
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_notimpl';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ekey_area_out_dummy(ekey_area)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_notimpl';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_in(cstring)
jbe@46:   RETURNS epoint
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_in';
jbe@46: 
jbe@46: CREATE FUNCTION epoint_with_sample_count_in(cstring)
jbe@46:   RETURNS epoint_with_sample_count
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_with_sample_count_in';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_in(cstring)
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_in';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_in(cstring)
jbe@46:   RETURNS ecircle
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_in';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_in(cstring)
jbe@46:   RETURNS ecluster
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_in';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_out(epoint)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_out';
jbe@46: 
jbe@46: CREATE FUNCTION epoint_with_sample_count_out(epoint_with_sample_count)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_with_sample_count_out';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_out(ebox)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_out';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_out(ecircle)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_out';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_out(ecluster)
jbe@46:   RETURNS cstring
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_out';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_recv(internal)
jbe@46:   RETURNS epoint
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_recv';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_recv(internal)
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_recv';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_recv(internal)
jbe@46:   RETURNS ecircle
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_recv';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_send(epoint)
jbe@46:   RETURNS bytea
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_send';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_send(ebox)
jbe@46:   RETURNS bytea
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_send';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_send(ecircle)
jbe@46:   RETURNS bytea
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_send';
jbe@46: 
jbe@46: CREATE TYPE epoint_with_sample_count (
jbe@46:   internallength = 20,
jbe@46:   input = epoint_with_sample_count_in,
jbe@46:   output = epoint_with_sample_count_out,
jbe@46:   alignment = double );
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_lt(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_lt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_le(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_le';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_eq(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_eq';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_ne(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_ne';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_ge(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_ge';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_gt(epoint, epoint)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_gt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_btree_cmp(epoint, epoint)
jbe@46:   RETURNS int4
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_epoint_cmp';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_lt(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_lt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_le(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_le';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_eq(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_eq';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_ne(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_ne';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_ge(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_ge';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_gt(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_gt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_btree_cmp(ebox, ebox)
jbe@46:   RETURNS int4
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ebox_cmp';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_lt(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_lt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_le(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_le';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_eq(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_eq';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_ne(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_ne';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_ge(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_ge';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_gt(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_gt';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_btree_cmp(ecircle, ecircle)
jbe@46:   RETURNS int4
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_btree_ecircle_cmp';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION cast_epoint_to_ebox(epoint)
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_to_ebox';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION cast_epoint_to_ecircle(epoint)
jbe@46:   RETURNS ecircle
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_to_ecircle';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION cast_epoint_to_ecluster(epoint)
jbe@46:   RETURNS ecluster
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_to_ecluster';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION cast_ebox_to_ecluster(ebox)
jbe@46:   RETURNS ecluster
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_to_ecluster';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint(float8, float8)
jbe@46:   RETURNS epoint
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_epoint';
jbe@46: 
jbe@46: CREATE FUNCTION epoint_with_sample_count(epoint, int4)
jbe@46:   RETURNS epoint_with_sample_count
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_epoint_with_sample_count';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION empty_ebox()
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_empty_ebox';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox(float8, float8, float8, float8)
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_ebox';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox(epoint, epoint)
jbe@46:   RETURNS ebox
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_ebox_from_epoints';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle(float8, float8, float8)
jbe@46:   RETURNS ecircle
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_ecircle';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle(epoint, float8)
jbe@46:   RETURNS ecircle
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_create_ecircle_from_epoint';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION latitude(epoint)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_lat';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION longitude(epoint)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_lon';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION min_latitude(ebox)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_lat_min';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION max_latitude(ebox)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_lat_max';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION min_longitude(ebox)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_lon_min';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION max_longitude(ebox)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_lon_max';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION center(ecircle)
jbe@46:   RETURNS epoint
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_center';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION radius(ecircle)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_radius';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ebox_overlap_proc(epoint, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ebox_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ecircle_overlap_proc(epoint, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ecircle_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ecluster_overlap_proc(epoint, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ecluster_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ecluster_may_overlap_proc(epoint, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ecluster_may_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_overlap_proc(ebox, ebox)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_ecircle_may_overlap_proc(ebox, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_ecircle_may_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ebox_ecluster_may_overlap_proc(ebox, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ebox_ecluster_may_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_overlap_proc(ecircle, ecircle)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_ecluster_overlap_proc(ecircle, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_ecluster_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_ecluster_may_overlap_proc(ecircle, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_ecluster_may_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_overlap_proc(ecluster, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_may_overlap_proc(ecluster, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_may_overlap';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_contains_proc(ecluster, ecluster)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_contains';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_distance_proc(epoint, epoint)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_distance';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ecircle_distance_proc(epoint, ecircle)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ecircle_distance';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION epoint_ecluster_distance_proc(epoint, ecluster)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_epoint_ecluster_distance';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_distance_proc(ecircle, ecircle)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_distance';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecircle_ecluster_distance_proc(ecircle, ecluster)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecircle_ecluster_distance';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION ecluster_distance_proc(ecluster, ecluster)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_distance';
jbe@46: 
jbe@46: DROP FUNCTION monte_carlo_area(ecluster, int4);
jbe@46: 
jbe@46: CREATE FUNCTION fair_distance_operator_proc(ecluster, epoint_with_sample_count)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE C IMMUTABLE STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_ecluster_epoint_sc_fair_distance';
jbe@46: 
jbe@46: CREATE OPERATOR <=> (
jbe@46:   leftarg = ecluster,
jbe@46:   rightarg = epoint_with_sample_count,
jbe@46:   procedure = fair_distance_operator_proc
jbe@46: );
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_consistent(internal, internal, smallint, oid, internal)
jbe@46:   RETURNS boolean
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_consistent';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_union(internal, internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_union';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_compress_epoint(internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_compress_epoint';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_compress_ecircle(internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_compress_ecircle';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_compress_ecluster(internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_compress_ecluster';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_decompress(internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_decompress';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_penalty(internal, internal, internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_penalty';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_picksplit(internal, internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_picksplit';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_same(internal, internal, internal)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_same';
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION pgl_gist_distance(internal, internal, smallint, oid)
jbe@46:   RETURNS internal
jbe@46:   LANGUAGE C STRICT
jbe@46:   AS '$libdir/latlon-v0009', 'pgl_gist_distance';
jbe@46: 
jbe@46: DROP OPERATOR CLASS ecluster_ops USING gist;
jbe@46: 
jbe@46: CREATE OPERATOR CLASS ecluster_ops
jbe@46:   DEFAULT FOR TYPE ecluster USING gist AS
jbe@46:   OPERATOR  21 &&  (ecluster, epoint),
jbe@46:   OPERATOR 121 &&+ (ecluster, epoint),
jbe@46:   OPERATOR 221 @>  (ecluster, epoint),
jbe@46:   OPERATOR  22 &&  (ecluster, ebox),
jbe@46:   OPERATOR 122 &&+ (ecluster, ebox),
jbe@46:   OPERATOR 222 @>  (ecluster, ebox),
jbe@46:   OPERATOR 322 <@  (ecluster, ebox),
jbe@46:   OPERATOR  23 &&  (ecluster, ecircle),
jbe@46:   OPERATOR 123 &&+ (ecluster, ecircle),
jbe@46:   OPERATOR  24 &&  (ecluster, ecluster),
jbe@46:   OPERATOR 124 &&+ (ecluster, ecluster),
jbe@46:   OPERATOR 224 @>  (ecluster, ecluster),
jbe@46:   OPERATOR 324 <@  (ecluster, ecluster),
jbe@46:   OPERATOR  31 <-> (ecluster, epoint) FOR ORDER BY float_ops,
jbe@46:   OPERATOR  32 <-> (ecluster, ebox) FOR ORDER BY float_ops,
jbe@46:   OPERATOR  33 <-> (ecluster, ecircle) FOR ORDER BY float_ops,
jbe@46:   OPERATOR  34 <-> (ecluster, ecluster) FOR ORDER BY float_ops,
jbe@46:   OPERATOR 131 <=> (ecluster, epoint_with_sample_count) FOR ORDER BY float_ops,
jbe@46:   FUNCTION 1 pgl_gist_consistent(internal, internal, smallint, oid, internal),
jbe@46:   FUNCTION 2 pgl_gist_union(internal, internal),
jbe@46:   FUNCTION 3 pgl_gist_compress_ecluster(internal),
jbe@46:   FUNCTION 4 pgl_gist_decompress(internal),
jbe@46:   FUNCTION 5 pgl_gist_penalty(internal, internal, internal),
jbe@46:   FUNCTION 6 pgl_gist_picksplit(internal, internal),
jbe@46:   FUNCTION 7 pgl_gist_same(internal, internal, internal),
jbe@46:   FUNCTION 8 pgl_gist_distance(internal, internal, smallint, oid),
jbe@46:   STORAGE ekey_area;
jbe@46: 
jbe@46: CREATE OR REPLACE FUNCTION fair_distance(ecluster, epoint, int4 = 10000)
jbe@46:   RETURNS float8
jbe@46:   LANGUAGE sql IMMUTABLE AS 'SELECT $1 <=> epoint_with_sample_count($2, $3)';
jbe@46: 
jbe@46: 




