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




