From b5bf7d0cc6a0389c12b9cc0e6feddecf756a0bbf Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 11 Jan 2005 15:10:13 +0000 Subject: [PATCH] removed obsoleted script git-svn-id: http://svn.osgeo.org/postgis/trunk@1272 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom.sql.in | 478 ------------------------------------------- 1 file changed, 478 deletions(-) delete mode 100644 lwgeom/lwgeom.sql.in diff --git a/lwgeom/lwgeom.sql.in b/lwgeom/lwgeom.sql.in deleted file mode 100644 index 99e0df157..000000000 --- a/lwgeom/lwgeom.sql.in +++ /dev/null @@ -1,478 +0,0 @@ -#if USE_VERSION > 71 -#define CREATEFUNCTION CREATE OR REPLACE FUNCTION -#else -#define CREATEFUNCTION CREATE FUNCTION -#endif - -BEGIN; - -CREATEFUNCTION lwgeom_in(cstring) - RETURNS lwgeom - AS '@MODULE_FILENAME@','LWGEOM_in' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_out(lwgeom) - RETURNS cstring - AS '@MODULE_FILENAME@','LWGEOM_out' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATE TYPE lwgeom ( - internallength = variable, - input = lwgeom_in, - output = lwgeom_out, - storage = main -); - -CREATEFUNCTION box2d_in(cstring) - RETURNS box2d - AS '@MODULE_FILENAME@','BOX2DFLOAT4_in' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_out(box2d) - RETURNS cstring - AS '@MODULE_FILENAME@','BOX2DFLOAT4_out' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATE TYPE box2d ( - internallength = 16, - input = box2d_in, - output = box2d_out, - storage = plain -); - -CREATEFUNCTION box2d(LWGEOM) - RETURNS box2d - AS '@MODULE_FILENAME@','LWGEOM_to_BOX2DFLOAT4' - LANGUAGE 'C' WITH (isstrict,iscachable); - - - - -CREATEFUNCTION lwgeom(text) - RETURNS lwgeom - AS '@MODULE_FILENAME@','parse_WKT_lwgeom' - LANGUAGE 'C' WITH (isstrict,iscachable); - ----- BOX2D support functions - - -CREATEFUNCTION box2d_overleft(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_overright(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_left(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_right(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_overbelow(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_below(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_above(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_overabove(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_contain(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_contained(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_overlap(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION box2d_same(box2d, box2d) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATE OPERATOR << ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_left, - COMMUTATOR = '>>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR &< ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_overleft, - COMMUTATOR = '&>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR <<| ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_below, - COMMUTATOR = '|>>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR &<| ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_overbelow, - COMMUTATOR = '|&>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR && ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_overlap, - COMMUTATOR = '&&', - RESTRICT = areasel, JOIN = positionjoinsel -); - -CREATE OPERATOR &> ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_overright, - COMMUTATOR = '&<', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR >> ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_right, - COMMUTATOR = '<<', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR |&> ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_overabove, - COMMUTATOR = '&<|', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR |>> ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_above, - COMMUTATOR = '<<|', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR ~= ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_same, - COMMUTATOR = '~=', - RESTRICT = eqsel, JOIN = eqjoinsel -); - -CREATE OPERATOR @ ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_contained, - COMMUTATOR = '~', - RESTRICT = contsel, JOIN = contjoinsel -); - -CREATE OPERATOR ~ ( - LEFTARG = box2d, RIGHTARG = box2d, PROCEDURE = box2d_contain, - COMMUTATOR = '@', - RESTRICT = contsel, JOIN = contjoinsel -); - - --- lwgeom operator support functions - - -CREATEFUNCTION lwgeom_overleft(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_overright(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_overabove(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_overbelow(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_left(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_right(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_above(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_below(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_contain(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_contained(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_overlap(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom_same(lwgeom, lwgeom) - RETURNS bool - AS '@MODULE_FILENAME@' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATE OPERATOR << ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_left, - COMMUTATOR = '>>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR &< ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_overleft, - COMMUTATOR = '&>', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR && ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_overlap, - COMMUTATOR = '&&', - RESTRICT = areasel, JOIN = positionjoinsel -); - -CREATE OPERATOR &> ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_overright, - COMMUTATOR = '&<', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR >> ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_right, - COMMUTATOR = '<<', - RESTRICT = positionsel, JOIN = positionjoinsel -); - -CREATE OPERATOR ~= ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_same, - COMMUTATOR = '~=', - RESTRICT = eqsel, JOIN = eqjoinsel -); - -CREATE OPERATOR @ ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_contained, - COMMUTATOR = '~', - RESTRICT = contsel, JOIN = contjoinsel -); - -CREATE OPERATOR ~ ( - LEFTARG = lwgeom, RIGHTARG = lwgeom, PROCEDURE = lwgeom_contain, - COMMUTATOR = '@', - RESTRICT = contsel, JOIN = contjoinsel -); - - --- gist support functions - - -CREATEFUNCTION gist_lwgeom_consistent(internal,lwgeom,int4) - RETURNS bool - AS '@MODULE_FILENAME@' ,'gist_lwgeom_consistent' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_compress(internal) - RETURNS internal - AS '@MODULE_FILENAME@','gist_lwgeom_compress' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_penalty(internal,internal,internal) - RETURNS internal - AS '@MODULE_FILENAME@' ,'lwgeom_box_penalty' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_picksplit(internal, internal) - RETURNS internal - AS '@MODULE_FILENAME@' ,'lwgeom_gbox_picksplit' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_union(bytea, internal) - RETURNS internal - AS '@MODULE_FILENAME@' ,'lwgeom_box_union' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_same(box2d, box2d, internal) - RETURNS internal - AS '@MODULE_FILENAME@' ,'lwgeom_gbox_same' - LANGUAGE 'C'; - -CREATEFUNCTION gist_lwgeom_decompress(internal) - RETURNS internal - AS '@MODULE_FILENAME@' ,'gist_rtree_decompress' - LANGUAGE 'C'; - - --- gist opclass -CREATE OPERATOR CLASS gist_lwgeom_ops - DEFAULT FOR TYPE lwgeom USING gist AS - OPERATOR 1 << , - OPERATOR 2 &< , - OPERATOR 3 && , - OPERATOR 4 &> , - OPERATOR 5 >> , - OPERATOR 6 ~= , - OPERATOR 7 ~ , - OPERATOR 8 @ , - FUNCTION 1 gist_lwgeom_consistent (internal, lwgeom, int4), - FUNCTION 2 gist_lwgeom_union (bytea, internal), - FUNCTION 3 gist_lwgeom_compress (internal), - FUNCTION 4 gist_lwgeom_decompress (internal), - FUNCTION 5 gist_lwgeom_penalty (internal, internal, internal), - FUNCTION 6 gist_lwgeom_picksplit (internal, internal), - FUNCTION 7 gist_lwgeom_same (box2d, box2d, internal); - -UPDATE pg_opclass - SET opckeytype = (select oid from pg_type where typname = 'box2d') - WHERE opcname = 'gist_lwgeom_ops'; - - - --- other lwgeom functions - -CREATEFUNCTION addBBOX(lwgeom) - RETURNS lwgeom - AS '@MODULE_FILENAME@','LWGEOM_addBBOX' - LANGUAGE 'C' WITH (isstrict,iscachable); - - -CREATEFUNCTION getSRID(lwgeom) - RETURNS int4 - AS '@MODULE_FILENAME@','LWGEOM_getSRID' - LANGUAGE 'C' WITH (isstrict,iscachable); - --- defined for backward compatibility (pre LWGEOM) -CREATEFUNCTION SRID(lwgeom) - RETURNS int4 - AS '@MODULE_FILENAME@','LWGEOM_getSRID' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION setSRID(lwgeom,int4) - RETURNS lwgeom - AS '@MODULE_FILENAME@','LWGEOM_setSRID' - LANGUAGE 'C' WITH (isstrict,iscachable); - - -CREATEFUNCTION asText(lwgeom) - RETURNS TEXT - AS '@MODULE_FILENAME@','LWGEOM_asText' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION getbbox(LWGEOM) - RETURNS box2d - AS '@MODULE_FILENAME@','LWGEOM_to_BOX2DFLOAT4' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION geometrytype(LWGEOM) - RETURNS text - AS '@MODULE_FILENAME@', 'LWGEOM_getTYPE' - LANGUAGE 'C' WITH (isstrict); - - -COMMIT; - -begin; --- extra conversions (might not work if there's no postgis install) - -CREATEFUNCTION lwgeom(wkb,int4) - RETURNS lwgeom - AS '@MODULE_FILENAME@','LWGEOMFromWKB' - LANGUAGE 'C' WITH (isstrict,iscachable); - - - -CREATEFUNCTION wkb(lwgeom) - RETURNS wkb - AS '@MODULE_FILENAME@','WKBFromLWGEOM' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION asbinary(lwgeom) - RETURNS wkb - AS '@MODULE_FILENAME@','WKBFromLWGEOM' - LANGUAGE 'C' WITH (isstrict,iscachable); - -CREATEFUNCTION lwgeom(wkb) - RETURNS lwgeom - AS '@MODULE_FILENAME@','LWGEOMFromWKB' - LANGUAGE 'C' WITH (isstrict,iscachable); - - -CREATEFUNCTION geometry(lwgeom) - RETURNS geometry - AS -'BEGIN - RETURN GeomFromWKB(asBinary($1),getSRID($1) ); - END;' -LANGUAGE 'plpgsql' WITH (iscachable,isstrict); - - -CREATEFUNCTION lwgeom(geometry) - RETURNS lwgeom - AS -'BEGIN - RETURN setSRID(lwgeom(asBinary($1)),SRID($1) ); - END;' -LANGUAGE 'plpgsql' WITH (iscachable,isstrict); - -CREATE CAST (lwgeom as geometry) WITH FUNCTION geometry(lwgeom) AS IMPLICIT ; -CREATE CAST (geometry as lwgeom) WITH FUNCTION lwgeom(geometry) AS IMPLICIT ; -CREATE CAST (lwgeom as box2d) WITH FUNCTION box2d(lwgeom) AS IMPLICIT ; - -CREATE CAST (lwgeom as wkb) WITH FUNCTION wkb(lwgeom) AS IMPLICIT ; -CREATE CAST (wkb as lwgeom) WITH FUNCTION lwgeom(wkb) AS IMPLICIT ; - --- --- Aggregate functions --- - -CREATEFUNCTION combine_bbox(box2d,lwgeom) - RETURNS box2d - AS '@MODULE_FILENAME@', 'combine_box2d' - LANGUAGE 'C'; - -CREATE AGGREGATE extent( - sfunc = combine_bbox, - basetype = lwgeom, - stype = box2d - ); - -COMMIT; - - -- 2.40.0