mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-26 10:02:50 +00:00
8484b440ae
git-svn-id: http://svn.osgeo.org/postgis/trunk@394 b70326c6-7e19-0410-871a-916f4a2858ee
170 lines
4 KiB
MySQL
170 lines
4 KiB
MySQL
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
--
|
|
-- $Id$
|
|
--
|
|
-- PostGIS - Spatial Types for PostgreSQL
|
|
-- http://postgis.refractions.net
|
|
-- Copyright 2001-2003 Refractions Research Inc.
|
|
--
|
|
-- This is free software; you can redistribute and/or modify it under
|
|
-- the terms of hte GNU General Public Licence. See the COPYING file.
|
|
--
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- $Log$
|
|
-- Revision 1.2 2003/11/28 11:06:49 strk
|
|
-- Added WKB_recv function for binary WKB input
|
|
--
|
|
-- Revision 1.1 2003/11/11 10:38:23 strk
|
|
-- Postgresql 7.4 enabler scripts.
|
|
--
|
|
-- Revision 1.2 2003/07/01 18:30:55 pramsey
|
|
-- Added CVS revision headers.
|
|
--
|
|
--
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
-- You might have to define the PL/PgSQL language usually done with the
|
|
-- changelang script.
|
|
|
|
-- Here's some hokey code to test to see if PL/PgSQL is installed
|
|
-- if it is, you get a message "PL/PgSQL is installed"
|
|
-- otherwise it will give a big error message.
|
|
|
|
(select 'PL/PgSQL is installed.' as message from pg_language where lanname='plpgsql') union (select 'You must install PL/PgSQL before running this SQL file,\nor you will get an error. To install PL/PgSQL run:\n\tcreatelang plpgsql <dbname>'::text as message) order by message limit 1;
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- HISTOGRAM2D
|
|
|
|
CREATE FUNCTION histogram2d_in(cstring)
|
|
RETURNS histogram2d
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION histogram2d_out(histogram2d)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE TYPE histogram2d (
|
|
alignment = double,
|
|
internallength = variable,
|
|
input = histogram2d_in,
|
|
output = histogram2d_out,
|
|
storage = main
|
|
);
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- BOX3D
|
|
|
|
CREATE FUNCTION box3d_in(cstring)
|
|
RETURNS box3d
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION box3d_out(box3d)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE TYPE box3d (
|
|
alignment = double,
|
|
internallength = 48,
|
|
input = box3d_in,
|
|
output = box3d_out
|
|
);
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- SPHEROID
|
|
|
|
CREATE FUNCTION spheroid_in(cstring)
|
|
RETURNS spheroid
|
|
AS '@MODULE_FILENAME@','ellipsoid_in'
|
|
LANGUAGE 'C' WITH (isstrict,iscachable);
|
|
|
|
CREATE FUNCTION spheroid_out(spheroid)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@','ellipsoid_out'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE TYPE spheroid (
|
|
alignment = double,
|
|
internallength = 65,
|
|
input = spheroid_in,
|
|
output = spheroid_out
|
|
);
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- WKB
|
|
|
|
CREATE FUNCTION wkb_in(cstring)
|
|
RETURNS wkb
|
|
AS '@MODULE_FILENAME@','WKB_in'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION wkb_out(wkb)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@','WKB_out'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION wkb_recv(internal)
|
|
RETURNS wkb
|
|
AS '@MODULE_FILENAME@','WKB_recv'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- CHIP
|
|
|
|
CREATE FUNCTION chip_in(cstring)
|
|
RETURNS chip
|
|
AS '@MODULE_FILENAME@','CHIP_in'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION chip_out(chip)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@','CHIP_out'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE TYPE chip (
|
|
alignment = double,
|
|
internallength = variable,
|
|
input = chip_in,
|
|
output = chip_out,
|
|
storage = extended
|
|
);
|
|
|
|
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
-- GEOMETRY
|
|
|
|
CREATE FUNCTION geometry_in(cstring)
|
|
RETURNS geometry
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE FUNCTION geometry_out(geometry)
|
|
RETURNS cstring
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C' WITH (isstrict);
|
|
|
|
CREATE TYPE geometry (
|
|
alignment = double,
|
|
internallength = variable,
|
|
input = geometry_in,
|
|
output = geometry_out,
|
|
storage = main
|
|
);
|
|
|
|
--
|
|
-- GiST selectivity function
|
|
--
|
|
|
|
CREATE FUNCTION postgis_gist_sel (internal, oid, internal, int4)
|
|
RETURNS float8
|
|
AS '@MODULE_FILENAME@'
|
|
LANGUAGE 'C';
|
|
|
|
|