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




