-- Generated by BladeSmith 3.60.TC2  DO NOT MODIFY. --

execute procedure ifx_allow_newline('t');

begin work;

------------------------------------------------------------------------
-- SE_setup_tables
--
-- This procedure creates the spatial_references and geometry_columns
-- tables if they do not already exist.
--
-- This procedure replaces the 8.1x version of SE_setup_tables, which
-- copied entries from the sde database's spatial_references and
-- geometry_columns tables (if they exist) into the current database's
-- tables.  This was to allow migration from SDE3.0.2.2 to ArcSde8.1.
-- Direct migration is no longer supported, you must first register
-- spatial datablade version 8.1x.
------------------------------------------------------------------------

CREATE PROCEDURE SE_setup_tables()

DEFINE tab_exists INT;
LET tab_exists = 0;

SELECT count(*) INTO tab_exists FROM informix.systables
   WHERE tabname='sde.spatial_references';

IF (tab_exists = 0) THEN
   -- Metadata tables do not exist; fresh install
   CREATE TABLE sde.spatial_references
   (
       srid               integer       NOT NULL,
       description        varchar(64),    
       auth_name          varchar(255),
       auth_srid          int,
       falsex             float         NOT NULL,
       falsey             float         NOT NULL,
       xyunits            float         NOT NULL,
       falsez             float         NOT NULL,
       zunits             float         NOT NULL,
       falsem             float         NOT NULL,
       munits             float         NOT NULL,
       srtext             char(2048)    NOT NULL,
     PRIMARY KEY (srid) 
         CONSTRAINT sde.sp_ref_pk
   );

   CREATE TABLE sde.geometry_columns
   (
       f_table_catalog    varchar(32)  NOT NULL,
       f_table_schema     varchar(32)  NOT NULL,
       f_table_name       varchar(128) NOT NULL,
       f_geometry_column  varchar(128) NOT NULL,
       storage_type       integer,
       geometry_type      integer      NOT NULL,
       coord_dimension    integer,
       srid               integer      NOT NULL,
     PRIMARY KEY (f_table_catalog, f_table_schema,
                  f_table_name, f_geometry_column)
         CONSTRAINT sde.geocol_pk,
     FOREIGN KEY(srid) REFERENCES sde.spatial_references(srid)
         CONSTRAINT sde.geocol_fk
   );

   CREATE VIEW sde.spatial_ref_sys AS
     SELECT srid, auth_name, auth_srid, srtext FROM sde.spatial_references;

END IF

END PROCEDURE;  -- SE_setup_tables

EXECUTE PROCEDURE SE_setup_tables();

DROP PROCEDURE SE_setup_tables();

------------------------------------------------------------------------
-- SE_add_srids
--
-- The procedure inserts several entries into the spatial references
-- table if they do not already exist.  These entries are intended
-- for use by the sample shapefile data that is supplied along with
-- the datablade.  They represent four very common datums and each
-- has a false origin and scale factors suitable for worldwide 
-- unprojected (lat/lon) data.
------------------------------------------------------------------------

CREATE PROCEDURE SE_add_srids();
  DEFINE ZeroInUse  INT;
  DEFINE LastSrid   INT;
  DEFINE FoundUnk   INT;
  DEFINE FoundWGS84 INT;
  DEFINE FoundNAD27 INT;
  DEFINE FoundNAD83 INT;
  DEFINE FoundOldHI INT;

  LET ZeroInUse  = 0;
  LET LastSrid   = 0;  
  LET FoundUnk   = 0;
  LET FoundWGS84 = 0;
  LET FoundNAD27 = 0;
  LET FoundNAD83 = 0;
  LET FoundOldHI = 0;

  SELECT count(*) INTO ZeroInUse FROM sde.spatial_references WHERE srid = 0;  

  -- Correct srtext field for unknown spatial reference systems
  UPDATE sde.spatial_references 
    SET srtext = 'UNKNOWN' WHERE srtext = 'WORLD';

  -- Check if each of the SRIDs we are about to insert already exists.
  SELECT count(*) INTO FoundUnk   FROM sde.spatial_references
      WHERE falsex = -180 AND falsey = -90 AND xyunits = 5965232
        AND srtext = 'UNKNOWN';

  SELECT count(*) INTO FoundWGS84 FROM sde.spatial_references
      WHERE falsex = -180 AND falsey = -90 AND xyunits = 5965232
        AND srtext = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]';

  SELECT count(*) INTO FoundNAD27 FROM sde.spatial_references
      WHERE falsex = -180 AND falsey = -90 AND xyunits = 5965232
        AND srtext = 'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]';

  SELECT count(*) INTO FoundNAD83 FROM sde.spatial_references
      WHERE falsex = -180 AND falsey = -90 AND xyunits = 5965232
        AND srtext = 'GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]';

  SELECT count(*) INTO FoundOldHI FROM sde.spatial_references
      WHERE falsex = -180 AND falsey = -90 AND xyunits = 5965232
        AND srtext = 'GEOGCS["GCS_Old_Hawaiian",DATUM["D_Old_Hawaiian",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]';

  IF (ZeroInUse = 0) THEN
    -- srid 0 is not in use, so use it for generic worldwide data
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (0, 'Unspecified datum for use with unprojected lat/lon coords',
              NULL, NULL, -180, -90,
              5965232, -50000, 1000, -1000, 1000, 'UNKNOWN');
    LET FoundUnk = 1;
  END IF 

  SELECT max(srid) INTO LastSrid FROM sde.spatial_references;

  IF (FoundUnk = 0) THEN
    LET LastSrid = LastSrid + 1;
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (LastSrid, 
              'Unspecified datum for use with unprojected lat/lon coords',
              NULL, NULL, -180, -90,
              5965232, -50000, 1000, -1000, 1000, 'UNKNOWN');
  END IF 


  IF (FoundOldHI = 0) THEN  
    LET LastSrid = LastSrid + 1;
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (LastSrid,
              'Old Hawaiian datum for use with unprojected lat/lon coords',
              'EPSG', 4135, -180, -90, 5965232, -50000, 1000, -1000, 1000,
              'GEOGCS["GCS_Old_Hawaiian",DATUM["D_Old_Hawaiian",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]');
  END IF 

  IF (FoundNAD27 = 0) THEN  
    LET LastSrid = LastSrid + 1;
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (LastSrid,
              'NAD 1927 datum for use with unprojected lat/lon coords',
              'EPSG', 4267, -180, -90, 5965232, -50000, 1000, -1000, 1000,
              'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]');
  END IF 

  IF (FoundNAD83 = 0) THEN  
    LET LastSrid = LastSrid + 1;
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (LastSrid,
              'NAD 1983 datum for use with unprojected lat/lon coords',
              'EPSG', 4269, -180, -90, 5965232, -50000, 1000, -1000, 1000,
              'GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]');
  END IF 

  IF (FoundWGS84 = 0) THEN  
    LET LastSrid = LastSrid + 1;
    INSERT INTO sde.spatial_references
             (srid, description, auth_name, auth_srid, falsex, falsey,
              xyunits, falsez, zunits, falsem, munits, srtext)
      VALUES (LastSrid,
              'WGS 84 datum for use with unprojected lat/lon coords',
              'EPSG', 4326, -180, -90, 5965232, -50000, 1000, -1000, 1000,
              'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]');
  END IF 

END PROCEDURE;

EXECUTE PROCEDURE SE_add_srids();
DROP PROCEDURE SE_add_srids();

create function SE_TestSbspace(varchar(255)) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_TestSbspace)'
   language c;

grant execute on function SE_TestSbspace(varchar(255)) to public;

-- Verify that a default sbspace has been created.
-- The Spatial DataBlade needs this to store metadata.
select SE_TestSbspace("SBSPACENAME") from informix.systables where tabname='systables';

-- Verify that a system sbspace has been created.   This is needed
-- if you run update statistics medium or high on a Spatial column.
select SE_TestSbspace("SYSSBSPACENAME") from informix.systables where tabname='systables';

create procedure SE_SpRefBeforeTrig()
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_SpRefBeforeTrig)'
  language c;

create procedure SE_SpRefAfterTrig()
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_SpRefAfterTrig)'
  language c;

grant execute on procedure SE_SpRefBeforeTrig() to public;
grant execute on procedure SE_SpRefAfterTrig() to public;

create trigger SE_SpRefInsTrig
    insert on sde.spatial_references
    before (execute procedure SE_SpRefBeforeTrig())
    after  (execute procedure SE_SpRefAfterTrig());

create trigger SE_SpRefUpdTrig
    update on sde.spatial_references
    before (execute procedure SE_SpRefBeforeTrig())
    after  (execute procedure SE_SpRefAfterTrig());

create trigger SE_SpRefDelTrig
    delete on sde.spatial_references
    before (execute procedure SE_SpRefBeforeTrig())
    after  (execute procedure SE_SpRefAfterTrig());

create opaque type SE_Metadata
  (internallength = variable, alignment = 8);

create function SE_MetadataIn (lvarchar) returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataFromText)'
  language c;
create function SE_MetadataOut (SE_Metadata) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataToText)'
  language c;
create function SE_MetadataSend (SE_Metadata) returns sendrecv
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataToText)'
  language c;
create function SE_MetadataRecv (sendrecv) returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataFromText)'
  language c;
create function SE_MetadataImpT (impexp) returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataFromText)'
  language c;
create function SE_MetadataExpT (SE_Metadata) returns impexp
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataToText)'
  language c;
create function SE_MetadataImpB (impexpbin) returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataFromText)'
  language c;
create function SE_MetadataExpB (SE_Metadata) returns impexpbin
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataToText)'
  language c;
create procedure Destroy(SE_Metadata)
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataDestroy)'
  language c;
create function LOhandles(SE_Metadata) returns lolist
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataLOhandles)'
  language c;
create function SE_MetadataDump(int) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataDump)'
  language c;

grant usage on type SE_Metadata to public;

grant execute on function SE_MetadataIn (lvarchar) to public;
grant execute on function SE_MetadataOut (SE_Metadata) to public;
grant execute on function SE_MetadataSend (SE_Metadata) to public;
grant execute on function SE_MetadataRecv (sendrecv) to public;
grant execute on function SE_MetadataImpT (impexp) to public;
grant execute on function SE_MetadataExpT (SE_Metadata) to public;
grant execute on function SE_MetadataImpB (impexpbin) to public;
grant execute on function SE_MetadataExpB (SE_Metadata) to public;
grant execute on procedure Destroy(SE_Metadata) to public;
grant execute on function LOhandles(SE_Metadata) to public;
grant execute on function SE_MetadataDump(int) to public;


create cast (SE_Metadata as lvarchar with SE_MetadataOut);
create cast (SE_Metadata as sendrecv with SE_MetadataSend);
create cast (SE_Metadata as impexp with SE_MetadataExpT);
create cast (SE_Metadata as impexpbin with SE_MetadataExpB);
create implicit cast (lvarchar as SE_Metadata with SE_MetadataIn);
create implicit cast (sendrecv as SE_Metadata with SE_MetadataRecv);
create implicit cast (impexp as SE_Metadata with SE_MetadataImpT);
create implicit cast (impexpbin as SE_Metadata with SE_MetadataImpB);

create table SE_MetadataTable
(
    smd SE_Metadata
);
revoke all on SE_MetadataTable from public;


create opaque type ST_Geometry
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_Curve
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_MultiCurve
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_Surface
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_MultiSurface
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_Point
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_MultiPoint
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_LineString
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_MultiLineString
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_Polygon
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_MultiPolygon
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);
create opaque type ST_GeomCollection
   (internallength = variable, cannothash, maxlen = 2048, alignment = 8);

grant usage on type ST_Geometry to public;
grant usage on type ST_Curve to public;
grant usage on type ST_MultiCurve to public;
grant usage on type ST_Surface to public;
grant usage on type ST_MultiSurface to public;
grant usage on type ST_Point to public;
grant usage on type ST_MultiPoint to public;
grant usage on type ST_LineString to public;
grant usage on type ST_MultiLineString to public;
grant usage on type ST_Polygon to public;
grant usage on type ST_MultiPolygon to public;
grant usage on type ST_GeomCollection to public;

create function DeepCopy(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_Curve) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_MultiCurve) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_Surface) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_MultiSurface) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_Point) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_MultiPoint) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_LineString) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_MultiLineString) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_Polygon) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_MultiPolygon) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;
create function DeepCopy(ST_GeomCollection) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDeepCopy)'
   language c;

grant execute on function DeepCopy (ST_Geometry) to public;
grant execute on function DeepCopy (ST_Curve) to public;
grant execute on function DeepCopy (ST_MultiCurve) to public;
grant execute on function DeepCopy (ST_Surface) to public;
grant execute on function DeepCopy (ST_MultiSurface) to public;
grant execute on function DeepCopy (ST_Point) to public;
grant execute on function DeepCopy (ST_MultiPoint) to public;
grant execute on function DeepCopy (ST_LineString) to public;
grant execute on function DeepCopy (ST_MultiLineString) to public;
grant execute on function DeepCopy (ST_Polygon) to public;
grant execute on function DeepCopy (ST_MultiPolygon) to public;
grant execute on function DeepCopy (ST_GeomCollection) to public;

create function Assign(SE_Metadata) returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataAssign)'
  language c;
create function SE_MetadataPrep() returns SE_Metadata
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MetadataPrep)'
  language c;

grant execute on function Assign(SE_Metadata) to public;
grant execute on function SE_MetadataPrep() to public;

create function SE_MetadataInit() returns varchar(255)
   begin
   on exception in (-206) end exception with resume
     drop table SE_MetadataTable;
   end
   create table SE_MetadataTable (smd SE_Metadata);
   insert into SE_MetadataTable values (SE_MetadataPrep());
   revoke all on SE_MetadataTable from public;
   return 'OK';
end function;

execute function SE_MetadataInit();

create function ST_GeomIn(lvarchar) returns ST_Geometry
    with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomIn)'
   language c;
create function ST_GeomOut(ST_Geometry) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_GeomSend(ST_Geometry) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_GeomRecv(sendrecv) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomRecv)'
   language c;
create function ST_GeomImpT(impexp) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomIn)'
   language c;
create function ST_GeomExpT(ST_Geometry) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_GeomImpB(impexpbin) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomRecv)'
   language c;
create function ST_GeomExpB(ST_Geometry) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_Geometry)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_Geometry) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_GeomFromSde(lvarchar,lvarchar,integer) returns ST_Geometry
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_GeomFromSde)'
   language c;
create function SE_GeomFromShape(lvarchar,integer) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_GeomFromShape)'
   language c;
create function ST_GeomFromText(lvarchar,int) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomFromText)'
   language c;
create function ST_GeomFromWKB(lvarchar,integer) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomFromWKB)'
   language c;
create function SE_ShapeToSQL(lvarchar) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ShapeToSQL)'
   language c;
create function ST_WKTToSQL(lvarchar) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_WKTToSQL)'
   language c;
create function ST_WKBToSQL(lvarchar) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_WKBToSQL)'
   language c;

grant execute on function ST_GeomIn (lvarchar) to public;
grant execute on function ST_GeomOut (ST_Geometry) to public;
grant execute on function ST_GeomSend (ST_Geometry) to public;
grant execute on function ST_GeomRecv (sendrecv) to public;
grant execute on function ST_GeomImpT (impexp) to public;
grant execute on function ST_GeomExpT (ST_Geometry) to public;
grant execute on function ST_GeomImpB (impexpbin) to public;
grant execute on function ST_GeomExpB (ST_Geometry) to public;
grant execute on function Assign (ST_Geometry) to public;
grant execute on procedure Destroy (ST_Geometry) to public;
grant execute on function LOhandles (ST_Geometry) to public;
grant execute on function SE_GeomFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_GeomFromShape (lvarchar,integer) to public;
grant execute on function ST_GeomFromText (lvarchar,integer) to public;
grant execute on function ST_GeomFromWKB (lvarchar,integer) to public;
grant execute on function SE_ShapeToSQL(lvarchar) to public;
grant execute on function ST_WKTToSQL(lvarchar) to public;
grant execute on function ST_WKBToSQL(lvarchar) to public;

create implicit cast (lvarchar as ST_Geometry with ST_GeomIn);
create explicit cast (ST_Geometry as lvarchar with ST_GeomOut);
create explicit cast (ST_Geometry as sendrecv with ST_GeomSend);
create implicit cast (sendrecv as ST_Geometry with ST_GeomRecv);
create implicit cast (impexp as ST_Geometry with ST_GeomImpT);
create explicit cast (ST_Geometry as impexp with ST_GeomExpT);
create implicit cast (impexpbin as ST_Geometry with ST_GeomImpB);
create explicit cast (ST_Geometry as impexpbin with ST_GeomExpB);


create function ST_PointIn(lvarchar) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointIn)'
   language c;
create function ST_PointOut(ST_Point) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_PointSend(ST_Point) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_PointRecv(sendrecv) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointRecv)'
   language c;
create function ST_PointImpT(impexp) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointIn)'
   language c;
create function ST_PointExpT(ST_Point) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_PointImpB(impexpbin) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointRecv)'
   language c;
create function ST_PointExpB(ST_Point) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_Point) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_Point)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_Point) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_Point(float,float,integer) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointFromValues)'
   language c;
create function SE_PointFromSde(lvarchar,lvarchar,integer) returns ST_Point
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PointFromSde)'
   language c;
create function SE_PointFromShape(lvarchar,integer) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PointFromShape)'
   language c;
create function ST_PointFromText(lvarchar,integer) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointFromText)'
   language c;
create function ST_PointFromWKB(lvarchar,integer) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointFromWKB)'
   language c;
create function SE_M(ST_Point) returns float
   with (not variant, percall_cost=100)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_M)'
   language c;
create function ST_X(ST_Point) returns float
   with (not variant, percall_cost=100)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_X)'
   language c;
create function ST_Y(ST_Point) returns float
   with (not variant, percall_cost=100)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Y)'
   language c;
create function SE_Z(ST_Point) returns float
   with (not variant, percall_cost=100)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Z)'
   language c;

grant execute on function ST_PointIn (lvarchar) to public;
grant execute on function ST_PointOut (ST_Point) to public;
grant execute on function ST_PointSend (ST_Point) to public;
grant execute on function ST_PointRecv (sendrecv) to public;
grant execute on function ST_PointImpT (impexp) to public;
grant execute on function ST_PointExpT (ST_Point) to public;
grant execute on function ST_PointImpB (impexpbin) to public;
grant execute on function ST_PointExpB (ST_Point) to public;
grant execute on function Assign (ST_Point) to public;
grant execute on procedure Destroy (ST_Point) to public;
grant execute on function LOhandles (ST_Point) to public;
grant execute on function ST_Point(float,float,integer) to public;
grant execute on function SE_PointFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_PointFromShape (lvarchar,integer) to public;
grant execute on function ST_PointFromText (lvarchar,integer) to public;
grant execute on function ST_PointFromWKB (lvarchar,integer) to public;
grant execute on function SE_M (ST_Point) to public;
grant execute on function ST_X (ST_Point) to public;
grant execute on function ST_Y (ST_Point) to public;
grant execute on function SE_Z (ST_Point) to public;

create implicit cast (lvarchar as ST_Point with ST_PointIn);
create explicit cast (ST_Point as lvarchar with ST_PointOut);
create explicit cast (ST_Point as sendrecv with ST_PointSend);
create implicit cast (sendrecv as ST_Point with ST_PointRecv);
create implicit cast (impexp as ST_Point with ST_PointImpT);
create explicit cast (ST_Point as impexp with ST_PointExpT);
create implicit cast (impexpbin as ST_Point with ST_PointImpB);
create explicit cast (ST_Point as impexpbin with ST_PointExpB);

create function ST_PolyIn(lvarchar) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyIn)'
   language c;
create function ST_PolyOut(ST_Polygon) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_PolySend(ST_Polygon) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_PolyRecv(sendrecv) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyRecv)'
   language c;
create function ST_PolyImpT(impexp) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyIn)'
   language c;
create function ST_PolyExpT(ST_Polygon) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_PolyImpB(impexpbin) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyRecv)'
   language c;
create function ST_PolyExpB(ST_Polygon) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_Polygon) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_Polygon)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_Polygon) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_PolyFromSde(lvarchar,lvarchar,integer) returns ST_Polygon
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PolyFromSde)'
   language c;
create function SE_PolyFromShape(lvarchar,integer) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PolyFromShape)'
   language c;
create function ST_PolyFromText(lvarchar,integer) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyFromText)'
   language c;
create function ST_PolyFromWKB(lvarchar,integer) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyFromWKB)'
   language c;
create function ST_Polygon(ST_LineString) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PolyFromLineString)'
   language c;
create function ST_ExteriorRing(ST_Polygon) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_ExteriorRing)'
   language c;
create function ST_InteriorRingN(ST_Polygon,integer) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_InteriorRingN)'
   language c;
create function ST_NumInteriorRing(ST_Polygon) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_NumInteriorRing)'
   language c;

grant execute on function ST_PolyIn (lvarchar) to public;
grant execute on function ST_PolyOut (ST_Polygon) to public;
grant execute on function ST_PolySend (ST_Polygon) to public;
grant execute on function ST_PolyRecv (sendrecv) to public;
grant execute on function ST_PolyImpT (impexp) to public;
grant execute on function ST_PolyExpT (ST_Polygon) to public;
grant execute on function ST_PolyImpB (impexpbin) to public;
grant execute on function ST_PolyExpB (ST_Polygon) to public;
grant execute on function Assign (ST_Polygon) to public;
grant execute on procedure Destroy (ST_Polygon) to public;
grant execute on function LOhandles (ST_Polygon) to public;
grant execute on function SE_PolyFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_PolyFromShape (lvarchar,integer) to public;
grant execute on function ST_PolyFromText (lvarchar,integer) to public;
grant execute on function ST_PolyFromWKB (lvarchar,integer) to public;
grant execute on function ST_Polygon(ST_LineString) to public;
grant execute on function ST_ExteriorRing (ST_Polygon) to public;
grant execute on function ST_InteriorRingN (ST_Polygon,integer) to public;
grant execute on function ST_NumInteriorRing (ST_Polygon) to public;

create implicit cast (lvarchar as ST_Polygon with ST_PolyIn);
create explicit cast (ST_Polygon as lvarchar with ST_PolyOut);
create explicit cast (ST_Polygon as sendrecv with ST_PolySend);
create implicit cast (sendrecv as ST_Polygon with ST_PolyRecv);
create implicit cast (impexp as ST_Polygon with ST_PolyImpT);
create explicit cast (ST_Polygon as impexp with ST_PolyExpT);
create implicit cast (impexpbin as ST_Polygon with ST_PolyImpB);
create explicit cast (ST_Polygon as impexpbin with ST_PolyExpB);

create function ST_LineIn(lvarchar) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineIn)'
   language c;
create function ST_LineOut(ST_LineString) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_LineSend(ST_LineString) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_LineRecv(sendrecv) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineRecv)'
   language c;
create function ST_LineImpT(impexp) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineIn)'
   language c;
create function ST_LineExpT(ST_LineString) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_LineImpB(impexpbin) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineRecv)'
   language c;
create function ST_LineExpB(ST_LineString) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_LineString) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_LineString)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_LineString) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_LineFromSde(lvarchar,lvarchar,integer) returns ST_LineString
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_LineFromSde)'
   language c;
create function SE_LineFromShape(lvarchar,integer) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_LineFromShape)'
   language c;
create function ST_LineFromText(lvarchar,integer) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineFromText)'
   language c;
create function ST_LineFromWKB(lvarchar,integer) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LineFromWKB)'
   language c;
create function ST_Length(ST_Curve) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LengthCurve)'
   language c;
create function ST_PointN(ST_LineString,integer) returns ST_Point
   with (not variant, percall_cost=50)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointN)'
   language c;
create function SE_Midpoint(ST_LineString) returns ST_Point
   with (not variant, percall_cost=50)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Midpoint)'
   language c;

grant execute on function ST_LineIn (lvarchar) to public;
grant execute on function ST_LineOut (ST_LineString) to public;
grant execute on function ST_LineSend (ST_LineString) to public;
grant execute on function ST_LineRecv (sendrecv) to public;
grant execute on function ST_LineImpT (impexp) to public;
grant execute on function ST_LineExpT (ST_LineString) to public;
grant execute on function ST_LineImpB (impexpbin) to public;
grant execute on function ST_LineExpB (ST_LineString) to public;
grant execute on function Assign (ST_LineString) to public;
grant execute on procedure Destroy (ST_LineString) to public;
grant execute on function LOhandles (ST_LineString) to public;
grant execute on function SE_LineFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_LineFromShape (lvarchar,integer) to public;
grant execute on function ST_LineFromText (lvarchar,integer) to public;
grant execute on function ST_LineFromWKB (lvarchar,integer) to public;
grant execute on function ST_Length (ST_Curve) to public;
grant execute on function ST_PointN (ST_LineString,integer) to public;
grant execute on function SE_Midpoint (ST_LineString) to public;

create implicit cast (lvarchar as ST_LineString with ST_LineIn);
create explicit cast (ST_LineString as lvarchar with ST_LineOut);
create explicit cast (ST_LineString as sendrecv with ST_LineSend);
create implicit cast (sendrecv as ST_LineString with ST_LineRecv);
create implicit cast (impexp as ST_LineString with ST_LineImpT);
create explicit cast (ST_LineString as impexp with ST_LineExpT);
create implicit cast (impexpbin as ST_LineString with ST_LineImpB);
create explicit cast (ST_LineString as impexpbin with ST_LineExpB);

create function ST_MLineIn(lvarchar) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineIn)'
   language c;
create function ST_MLineOut(ST_MultiLineString) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MLineSend(ST_MultiLineString) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_MLineRecv(sendrecv) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineRecv)'
   language c;
create function ST_MLineImpT(impexp) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineIn)'
   language c;
create function ST_MLineExpT(ST_MultiLineString) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MLineImpB(impexpbin) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineRecv)'
   language c;
create function ST_MLineExpB(ST_MultiLineString) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_MultiLineString) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_MultiLineString)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_MultiLineString) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_MLineFromSde(lvarchar,lvarchar,integer) returns ST_MultiLineString
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MLineFromSde)'
   language c;
create function SE_MLineFromShape(lvarchar,integer) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MLineFromShape)'
   language c;
create function ST_MLineFromText(lvarchar,integer) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineFromText)'
   language c;
create function ST_MLineFromWKB(lvarchar,integer) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MLineFromWKB)'
   language c;
create function ST_Length(ST_MultiCurve) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_LengthMultiCurve)'
   language c;

grant execute on function ST_MLineIn (lvarchar) to public;
grant execute on function ST_MLineOut (ST_MultiLineString) to public;
grant execute on function ST_MLineSend (ST_MultiLineString) to public;
grant execute on function ST_MLineRecv (sendrecv) to public;
grant execute on function ST_MLineImpT (impexp) to public;
grant execute on function ST_MLineExpT (ST_MultiLineString) to public;
grant execute on function ST_MLineImpB (impexpbin) to public;
grant execute on function ST_MLineExpB (ST_MultiLineString) to public;
grant execute on function Assign (ST_MultiLineString) to public;
grant execute on procedure Destroy (ST_MultiLineString) to public;
grant execute on function LOhandles (ST_MultiLineString) to public;
grant execute on function SE_MLineFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_MLineFromShape (lvarchar,integer) to public;
grant execute on function ST_MLineFromText (lvarchar,integer) to public;
grant execute on function ST_MLineFromWKB (lvarchar,integer) to public;
grant execute on function ST_Length (ST_MultiCurve) to public;

create implicit cast (lvarchar as ST_MultiLineString with ST_MLineIn);
create explicit cast (ST_MultiLineString as lvarchar with ST_MLineOut);
create explicit cast (ST_MultiLineString as sendrecv with ST_MLineSend);
create implicit cast (sendrecv as ST_MultiLineString with ST_MLineRecv);
create implicit cast (impexp as ST_MultiLineString with ST_MLineImpT);
create explicit cast (ST_MultiLineString as impexp with ST_MLineExpT);
create implicit cast (impexpbin as ST_MultiLineString with ST_MLineImpB);
create explicit cast (ST_MultiLineString as impexpbin with ST_MLineExpB);

create function ST_MPointIn(lvarchar) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointIn)'
   language c;
create function ST_MPointOut(ST_MultiPoint) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MPointSend(ST_MultiPoint) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_MPointRecv(sendrecv) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointRecv)'
   language c;
create function ST_MPointImpT(impexp) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointIn)'
   language c;
create function ST_MPointExpT(ST_MultiPoint) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MPointImpB(impexpbin) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointRecv)'
   language c;
create function ST_MPointExpB(ST_MultiPoint) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_MultiPoint) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_MultiPoint)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_MultiPoint) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_MPointFromSde(lvarchar,lvarchar,integer) returns ST_MultiPoint
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MPointFromSde)'
   language c;
create function SE_MPointFromShape(lvarchar,integer) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MPointFromShape)'
   language c;
create function ST_MPointFromText(lvarchar,integer) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointFromText)'
   language c;
create function ST_MPointFromWKB(lvarchar,integer) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPointFromWKB)'
   language c;

grant execute on function ST_MPointIn (lvarchar) to public;
grant execute on function ST_MPointOut (ST_MultiPoint) to public;
grant execute on function ST_MPointSend (ST_MultiPoint) to public;
grant execute on function ST_MPointRecv (sendrecv) to public;
grant execute on function ST_MPointImpT (impexp) to public;
grant execute on function ST_MPointExpT (ST_MultiPoint) to public;
grant execute on function ST_MPointImpB (impexpbin) to public;
grant execute on function ST_MPointExpB (ST_MultiPoint) to public;
grant execute on function Assign (ST_MultiPoint) to public;
grant execute on procedure Destroy (ST_MultiPoint) to public;
grant execute on function LOhandles (ST_MultiPoint) to public;
grant execute on function SE_MPointFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_MPointFromShape (lvarchar,integer) to public;
grant execute on function ST_MPointFromText (lvarchar,integer) to public;
grant execute on function ST_MPointFromWKB (lvarchar,integer) to public;

create implicit cast (lvarchar as ST_MultiPoint with ST_MPointIn);
create explicit cast (ST_MultiPoint as lvarchar with ST_MPointOut);
create explicit cast (ST_MultiPoint as sendrecv with ST_MPointSend);
create implicit cast (sendrecv as ST_MultiPoint with ST_MPointRecv);
create implicit cast (impexp as ST_MultiPoint with ST_MPointImpT);
create explicit cast (ST_MultiPoint as impexp with ST_MPointExpT);
create implicit cast (impexpbin as ST_MultiPoint with ST_MPointImpB);
create explicit cast (ST_MultiPoint as impexpbin with ST_MPointExpB);

create function ST_MPolyIn(lvarchar) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyIn)'
   language c;
create function ST_MPolyOut(ST_MultiPolygon) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MPolySend(ST_MultiPolygon) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_MPolyRecv(sendrecv) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyRecv)'
   language c;
create function ST_MPolyImpT(impexp) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyIn)'
   language c;
create function ST_MPolyExpT(ST_MultiPolygon) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MPolyImpB(impexpbin) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyRecv)'
   language c;
create function ST_MPolyExpB(ST_MultiPolygon) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_MultiPolygon) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_MultiPolygon)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_MultiPolygon) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function SE_MPolyFromSde(lvarchar,lvarchar,integer) returns ST_MultiPolygon
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MPolyFromSde)'
   language c;
create function SE_MPolyFromShape(lvarchar,integer) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_MPolyFromShape)'
   language c;
create function ST_MPolyFromText(lvarchar,integer) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyFromText)'
   language c;
create function ST_MPolyFromWKB(lvarchar,integer) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MPolyFromWKB)'
   language c;

grant execute on function ST_MPolyIn (lvarchar) to public;
grant execute on function ST_MPolyOut (ST_MultiPolygon) to public;
grant execute on function ST_MPolySend (ST_MultiPolygon) to public;
grant execute on function ST_MPolyRecv (sendrecv) to public;
grant execute on function ST_MPolyImpT (impexp) to public;
grant execute on function ST_MPolyExpT (ST_MultiPolygon) to public;
grant execute on function ST_MPolyImpB (impexpbin) to public;
grant execute on function ST_MPolyExpB (ST_MultiPolygon) to public;
grant execute on function Assign (ST_MultiPolygon) to public;
grant execute on procedure Destroy (ST_MultiPolygon) to public;
grant execute on function LOhandles (ST_MultiPolygon) to public;
grant execute on function SE_MPolyFromSde (lvarchar,lvarchar,integer) to public;
grant execute on function SE_MPolyFromShape (lvarchar,integer) to public;
grant execute on function ST_MPolyFromText (lvarchar,integer) to public;
grant execute on function ST_MPolyFromWKB (lvarchar,integer) to public;

create implicit cast (lvarchar as ST_MultiPolygon with ST_MPolyIn);
create explicit cast (ST_MultiPolygon as lvarchar with ST_MPolyOut);
create explicit cast (ST_MultiPolygon as sendrecv with ST_MPolySend);
create implicit cast (sendrecv as ST_MultiPolygon with ST_MPolyRecv);
create implicit cast (impexp as ST_MultiPolygon with ST_MPolyImpT);
create explicit cast (ST_MultiPolygon as impexp with ST_MPolyExpT);
create implicit cast (impexpbin as ST_MultiPolygon with ST_MPolyImpB);
create explicit cast (ST_MultiPolygon as impexpbin with ST_MPolyExpB);

create function ST_SurfaceIn(lvarchar) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SurfaceIn)'
   language c;
create function ST_SurfaceOut(ST_Surface) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_SurfaceSend(ST_Surface) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_SurfaceRecv(sendrecv) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SurfaceRecv)'
   language c;
create function ST_SurfaceImpT(impexp) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SurfaceIn)'
   language c;
create function ST_SurfaceExpT(ST_Surface) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_SurfaceImpB(impexpbin) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SurfaceRecv)'
   language c;
create function ST_SurfaceExpB(ST_Surface) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_Surface) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_Surface)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_Surface) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_Area(ST_Surface) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_AreaSurface)'
   language c;
create function ST_Centroid(ST_Surface) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CentroidSurface)'
   language c;
create function ST_Perimeter(ST_Surface) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PerimeterSurface)'
   language c;
create function ST_PointOnSurface(ST_Surface) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointOnSurface)'
   language c;

grant execute on function ST_SurfaceIn (lvarchar) to public;
grant execute on function ST_SurfaceOut (ST_Surface) to public;
grant execute on function ST_SurfaceSend (ST_Surface) to public;
grant execute on function ST_SurfaceRecv (sendrecv) to public;
grant execute on function ST_SurfaceImpT (impexp) to public;
grant execute on function ST_SurfaceExpT (ST_Surface) to public;
grant execute on function ST_SurfaceImpB (impexpbin) to public;
grant execute on function ST_SurfaceExpB (ST_Surface) to public;
grant execute on function Assign (ST_Surface) to public;
grant execute on procedure Destroy (ST_Surface) to public;
grant execute on function LOhandles (ST_Surface) to public;
grant execute on function ST_Area (ST_Surface) to public;
grant execute on function ST_Centroid (ST_Surface) to public;
grant execute on function ST_Perimeter (ST_Surface) to public;
grant execute on function ST_PointOnSurface (ST_Surface) to public;

create implicit cast (lvarchar as ST_Surface with ST_SurfaceIn);
create explicit cast (ST_Surface as lvarchar with ST_SurfaceOut);
create explicit cast (ST_Surface as sendrecv with ST_SurfaceSend);
create implicit cast (sendrecv as ST_Surface with ST_SurfaceRecv);
create implicit cast (impexp as ST_Surface with ST_SurfaceImpT);
create explicit cast (ST_Surface as impexp with ST_SurfaceExpT);
create implicit cast (impexpbin as ST_Surface with ST_SurfaceImpB);
create explicit cast (ST_Surface as impexpbin with ST_SurfaceExpB);

create function ST_MSurfaceIn(lvarchar) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MSurfaceIn)'
   language c;
create function ST_MSurfaceOut(ST_MultiSurface) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MSurfaceSend(ST_MultiSurface) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_MSurfaceRecv(sendrecv) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MSurfaceRecv)'
   language c;
create function ST_MSurfaceImpT(impexp) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MSurfaceIn)'
   language c;
create function ST_MSurfaceExpT(ST_MultiSurface) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MSurfaceImpB(impexpbin) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MSurfaceRecv)'
   language c;
create function ST_MSurfaceExpB(ST_MultiSurface) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_MultiSurface) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_MultiSurface)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_MultiSurface) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_Area(ST_MultiSurface) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_AreaMultiSurface)'
   language c;
create function ST_Centroid(ST_MultiSurface) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CentroidMultiSurface)'
   language c;
create function ST_Perimeter(ST_MultiSurface) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PerimeterMultiSurface)'
   language c;
create function ST_PointOnSurface(ST_MultiSurface) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_PointOnMultiSurface)'
   language c;

grant execute on function ST_MSurfaceIn (lvarchar) to public;
grant execute on function ST_MSurfaceOut (ST_MultiSurface) to public;
grant execute on function ST_MSurfaceSend (ST_MultiSurface) to public;
grant execute on function ST_MSurfaceRecv (sendrecv) to public;
grant execute on function ST_MSurfaceImpT (impexp) to public;
grant execute on function ST_MSurfaceExpT (ST_MultiSurface) to public;
grant execute on function ST_MSurfaceImpB (impexpbin) to public;
grant execute on function ST_MSurfaceExpB (ST_MultiSurface) to public;
grant execute on function Assign (ST_MultiSurface) to public;
grant execute on procedure Destroy (ST_MultiSurface) to public;
grant execute on function LOhandles (ST_MultiSurface) to public;
grant execute on function ST_Area (ST_MultiSurface) to public;
grant execute on function ST_Centroid (ST_MultiSurface) to public;
grant execute on function ST_Perimeter (ST_MultiSurface) to public;
grant execute on function ST_PointOnSurface (ST_MultiSurface) to public;

create implicit cast (lvarchar as ST_MultiSurface with ST_MSurfaceIn);
create explicit cast (ST_MultiSurface as lvarchar with ST_MSurfaceOut);
create explicit cast (ST_MultiSurface as sendrecv with ST_MSurfaceSend);
create implicit cast (sendrecv as ST_MultiSurface with ST_MSurfaceRecv);
create implicit cast (impexp as ST_MultiSurface with ST_MSurfaceImpT);
create explicit cast (ST_MultiSurface as impexp with ST_MSurfaceExpT);
create implicit cast (impexpbin as ST_MultiSurface with ST_MSurfaceImpB);
create explicit cast (ST_MultiSurface as impexpbin with ST_MSurfaceExpB);

create function ST_CurveIn(lvarchar) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CurveIn)'
   language c;
create function ST_CurveOut(ST_Curve) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_CurveSend(ST_Curve) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_CurveRecv(sendrecv) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CurveRecv)'
   language c;
create function ST_CurveImpT(impexp) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CurveIn)'
   language c;
create function ST_CurveExpT(ST_Curve) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_CurveImpB(impexpbin) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CurveRecv)'
   language c;
create function ST_CurveExpB(ST_Curve) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_Curve) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_Curve)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_Curve) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_EndPoint(ST_Curve) returns ST_Point
   with (not variant, percall_cost=100)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_EndPoint)'
   language c;
create function ST_IsClosed(ST_Curve) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsClosedCurve)'
   language c;
create function ST_IsRing(ST_Curve) returns boolean
   with (not variant, percall_cost=200)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsRing)'
   language c;
create function ST_StartPoint(ST_Curve) returns ST_Point
   with (not variant, percall_cost=50)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_StartPoint)'
   language c;

grant execute on function ST_CurveIn (lvarchar) to public;
grant execute on function ST_CurveOut (ST_Curve) to public;
grant execute on function ST_CurveSend (ST_Curve) to public;
grant execute on function ST_CurveRecv (sendrecv) to public;
grant execute on function ST_CurveImpT (impexp) to public;
grant execute on function ST_CurveExpT (ST_Curve) to public;
grant execute on function ST_CurveImpB (impexpbin) to public;
grant execute on function ST_CurveExpB (ST_Curve) to public;
grant execute on function Assign (ST_Curve) to public;
grant execute on procedure Destroy (ST_Curve) to public;
grant execute on function LOhandles (ST_Curve) to public;
grant execute on function ST_EndPoint (ST_Curve) to public;
grant execute on function ST_IsClosed (ST_Curve) to public;
grant execute on function ST_IsRing (ST_Curve) to public;
grant execute on function ST_StartPoint (ST_Curve) to public;

create implicit cast (lvarchar as ST_Curve with ST_CurveIn);
create explicit cast (ST_Curve as lvarchar with ST_CurveOut);
create explicit cast (ST_Curve as sendrecv with ST_CurveSend);
create implicit cast (sendrecv as ST_Curve with ST_CurveRecv);
create implicit cast (impexp as ST_Curve with ST_CurveImpT);
create explicit cast (ST_Curve as impexp with ST_CurveExpT);
create implicit cast (impexpbin as ST_Curve with ST_CurveImpB);
create explicit cast (ST_Curve as impexpbin with ST_CurveExpB);

create function ST_MCurveIn(lvarchar) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MCurveIn)'
   language c;
create function ST_MCurveOut(ST_MultiCurve) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MCurveSend(ST_MultiCurve) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_MCurveRecv(sendrecv) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MCurveRecv)'
   language c;
create function ST_MCurveImpT(impexp) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MCurveIn)'
   language c;
create function ST_MCurveExpT(ST_MultiCurve) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_MCurveImpB(impexpbin) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_MCurveRecv)'
   language c;
create function ST_MCurveExpB(ST_MultiCurve) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_MultiCurve) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_MultiCurve)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_MultiCurve) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_IsClosed(ST_MultiCurve) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsClosedMultiCurve)'
   language c;

grant execute on function ST_MCurveIn (lvarchar) to public;
grant execute on function ST_MCurveOut (ST_MultiCurve) to public;
grant execute on function ST_MCurveSend (ST_MultiCurve) to public;
grant execute on function ST_MCurveRecv (sendrecv) to public;
grant execute on function ST_MCurveImpT (impexp) to public;
grant execute on function ST_MCurveExpT (ST_MultiCurve) to public;
grant execute on function ST_MCurveImpB (impexpbin) to public;
grant execute on function ST_MCurveExpB (ST_MultiCurve) to public;
grant execute on function Assign (ST_MultiCurve) to public;
grant execute on procedure Destroy (ST_MultiCurve) to public;
grant execute on function LOhandles (ST_MultiCurve) to public;
grant execute on function ST_IsClosed (ST_MultiCurve) to public;

create implicit cast (lvarchar as ST_MultiCurve with ST_MCurveIn);
create explicit cast (ST_MultiCurve as lvarchar with ST_MCurveOut);
create explicit cast (ST_MultiCurve as sendrecv with ST_MCurveSend);
create implicit cast (sendrecv as ST_MultiCurve with ST_MCurveRecv);
create implicit cast (impexp as ST_MultiCurve with ST_MCurveImpT);
create explicit cast (ST_MultiCurve as impexp with ST_MCurveExpT);
create implicit cast (impexpbin as ST_MultiCurve with ST_MCurveImpB);
create explicit cast (ST_MultiCurve as impexpbin with ST_MCurveExpB);

create function ST_GeomCollIn(lvarchar) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomCollIn)'
   language c;
create function ST_GeomCollOut(ST_GeomCollection) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_GeomCollSend(ST_GeomCollection) returns sendrecv
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function ST_GeomCollRecv(sendrecv) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomCollRecv)'
   language c;
create function ST_GeomCollImpT(impexp) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomCollIn)'
   language c;
create function ST_GeomCollExpT(ST_GeomCollection) returns impexp
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryOut)'
   language c;
create function ST_GeomCollImpB(impexpbin) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeomCollRecv)'
   language c;
create function ST_GeomCollExpB(ST_GeomCollection) returns impexpbin
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometrySend)'
   language c;
create function Assign(ST_GeomCollection) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryAssign)'
   language c;
create procedure Destroy(ST_GeomCollection)
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryDestroy)'
   language c;
create function LOhandles(ST_GeomCollection) returns lolist
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryLOhandles)'
   language c;
create function ST_NumGeometries(ST_GeomCollection) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_NumGeometries)'
   language c;
create function ST_GeometryN(ST_GeomCollection,integer) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeometryN)'
   language c;

grant execute on function ST_GeomCollIn (lvarchar) to public;
grant execute on function ST_GeomCollOut (ST_GeomCollection) to public;
grant execute on function ST_GeomCollSend (ST_GeomCollection) to public;
grant execute on function ST_GeomCollRecv (sendrecv) to public;
grant execute on function ST_GeomCollImpT (impexp) to public;
grant execute on function ST_GeomCollExpT (ST_GeomCollection) to public;
grant execute on function ST_GeomCollImpB (impexpbin) to public;
grant execute on function ST_GeomCollExpB (ST_GeomCollection) to public;
grant execute on function Assign (ST_GeomCollection) to public;
grant execute on procedure Destroy (ST_GeomCollection) to public;
grant execute on function LOhandles (ST_GeomCollection) to public;
grant execute on function ST_NumGeometries (ST_GeomCollection) to public;
grant execute on function ST_GeometryN (ST_GeomCollection,integer) to public;

create implicit cast (lvarchar as ST_GeomCollection with ST_GeomCollIn);
create explicit cast (ST_GeomCollection as lvarchar with ST_GeomCollOut);
create explicit cast (ST_GeomCollection as sendrecv with ST_GeomCollSend);
create implicit cast (sendrecv as ST_GeomCollection with ST_GeomCollRecv);
create implicit cast (impexp as ST_GeomCollection with ST_GeomCollImpT);
create explicit cast (ST_GeomCollection as impexp with ST_GeomCollExpT);
create implicit cast (impexpbin as ST_GeomCollection with ST_GeomCollImpB);
create explicit cast (ST_GeomCollection as impexpbin with ST_GeomCollExpB);

create function Compare(ST_Geometry,ST_Geometry) returns int
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryCompare)'
   language c;
create function NotEqual(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryNotEqual)'
   language c;
create function SE_Anno_Text(ST_Geometry) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Anno_Text)'
   language c;
create function SE_Area(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Area)'
   language c;
create function ST_AsBinary(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsBinaryIDS)'
   language c;
create function ST_AsText(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsTextIDS)'
   language c;
create function SE_AsShape(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsShapeIDS)'
   language c;
create function SE_AsSde(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsSdeIDS)'
   language c;
create function ST_Boundary(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Boundary)'
   language c;
create function ST_Buffer(ST_Geometry,float) returns ST_Geometry
   with (not variant, percall_cost=8000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Buffer)'
   language c;
create function ST_ConvexHull(ST_Geometry) returns ST_Geometry
   with (not variant, percall_cost=1000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_ConvexHull)'
   language c;
create function ST_CoordDim(ST_Geometry) returns int
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CoordDim)'
   language c;
create function ST_Difference(ST_Geometry,ST_Geometry) returns ST_Geometry
   with (not variant, percall_cost=8000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Difference)'
   language c;
create function ST_Dimension(ST_Geometry) returns int
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Dimension)'
   language c;
create function ST_Disjoint(ST_Geometry,ST_Geometry) returns boolean
   with (not variant, percall_cost=1000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Disjoint)'
   language c;
create function ST_Distance(ST_Geometry,ST_Geometry) returns float
   with (not variant, percall_cost=300)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Distance)'
   language c;
create function ST_Envelope(ST_Geometry) returns ST_Geometry
   with (not variant, percall_cost=50)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Envelope)'
   language c;
create function SE_Generalize(ST_Geometry,float) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Generalize)'
   language c;
create function ST_GeometryType(ST_Geometry) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_GeometryType)'
   language c;
create function ST_Intersection(ST_Geometry,ST_Geometry) returns ST_Geometry
   with (not variant, percall_cost=8000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Intersection)'
   language c;
create function SE_Is3D(ST_Geometry) returns boolean
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Is3D)'
   language c;
create function ST_IsEmpty(ST_Geometry) returns boolean
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsEmpty)'
   language c;
create function SE_IsMeasured(ST_Geometry) returns boolean
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_IsMeasured)'
   language c;
create function ST_IsSimple(ST_Geometry) returns boolean
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsSimple)'
   language c;
create function ST_IsValid(ST_Geometry) returns boolean
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IsValid)'
   language c;
create function SE_Length(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Length)'
   language c;
create function SE_LocateAlong(ST_Geometry,float) returns ST_Geometry
   with (not variant, percall_cost=5000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_LocateAlong)'
   language c;
create function SE_LocateBetween(ST_Geometry,float,float) returns ST_Geometry
   with (not variant, percall_cost=500)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_LocateBetween)'
   language c;
create function SE_Mmax(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Mmax)'
   language c;
create function SE_Mmin(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Mmin)'
   language c;
create function ST_NumPoints(ST_Geometry) returns int
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_NumPoints)'
   language c;
create function ST_Relate(ST_Geometry,ST_Geometry,lvarchar) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Relate)'
   language c;
create function SE_SdeEntity(ST_Geometry) returns int
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_SdeEntity)'
   language c;
create function SE_SpatialKey(ST_Geometry) returns int8
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_SpatialKey)'
   language c;
create function ST_SRID(ST_Geometry) returns int
   with (not variant, percall_cost=10)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SRID)'
   language c;
create function ST_SymDifference(ST_Geometry,ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SymDifference)'
   language c;
create function ST_Union(ST_Geometry,ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Union)'
   language c;
create function ST_Transform(ST_Geometry,int) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Transform)'
   language c;
create function SE_Xmax(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Xmax)'
   language c;
create function SE_Xmin(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Xmin)'
   language c;
create function SE_Ymax(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Ymax)'
   language c;
create function SE_Ymin(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Ymin)'
   language c;
create function SE_Zmax(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Zmax)'
   language c;
create function SE_Zmin(ST_Geometry) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Zmin)'
   language c;

grant execute on function Compare (ST_Geometry,ST_Geometry) to public;
grant execute on function NotEqual (ST_Geometry,ST_Geometry) to public;
grant execute on function SE_Anno_Text (ST_Geometry) to public;
grant execute on function SE_Area (ST_Geometry) to public;
grant execute on function ST_AsBinary (ST_Geometry) to public;
grant execute on function SE_AsShape (ST_Geometry) to public;
grant execute on function SE_AsSde (ST_Geometry) to public;
grant execute on function ST_AsText (ST_Geometry) to public;
grant execute on function ST_Boundary (ST_Geometry) to public;
grant execute on function ST_Buffer (ST_Geometry,float) to public;
grant execute on function ST_ConvexHull (ST_Geometry) to public;
grant execute on function ST_CoordDim (ST_Geometry) to public;
grant execute on function ST_Difference (ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Dimension (ST_Geometry) to public;
grant execute on function ST_Disjoint (ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Distance (ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Envelope (ST_Geometry) to public;
grant execute on function SE_Generalize(ST_Geometry,float) to public;
grant execute on function ST_GeometryType (ST_Geometry) to public;
grant execute on function ST_Intersection (ST_Geometry,ST_Geometry) to public;
grant execute on function SE_Is3D (ST_Geometry) to public;
grant execute on function ST_IsEmpty (ST_Geometry) to public;
grant execute on function SE_IsMeasured (ST_Geometry) to public;
grant execute on function ST_IsSimple (ST_Geometry) to public;
grant execute on function ST_IsValid (ST_Geometry) to public;
grant execute on function SE_Length (ST_Geometry) to public;
grant execute on function SE_LocateAlong (ST_Geometry,float) to public;
grant execute on function SE_LocateBetween (ST_Geometry,float,float) to public;
grant execute on function SE_Mmax (ST_Geometry) to public;
grant execute on function SE_Mmin (ST_Geometry) to public;
grant execute on function ST_NumPoints (ST_Geometry) to public;
grant execute on function ST_Relate (ST_Geometry,ST_Geometry,lvarchar) to public;
grant execute on function SE_SdeEntity (ST_Geometry) to public;
grant execute on function SE_SpatialKey(ST_Geometry) to public;
grant execute on function ST_SRID (ST_Geometry) to public;
grant execute on function ST_SymDifference (ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Union (ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Transform (ST_Geometry,int) to public;
grant execute on function SE_Xmax (ST_Geometry) to public;
grant execute on function SE_Xmin (ST_Geometry) to public;
grant execute on function SE_Ymax (ST_Geometry) to public;
grant execute on function SE_Ymin (ST_Geometry) to public;
grant execute on function SE_Zmax (ST_Geometry) to public;
grant execute on function SE_Zmin (ST_Geometry) to public;

create implicit cast (ST_Curve as ST_Geometry);
create explicit cast (ST_Curve as ST_LineString);
create explicit cast (ST_Geometry as ST_Curve);
create explicit cast (ST_Geometry as ST_GeomCollection);
create explicit cast (ST_Geometry as ST_LineString);
create explicit cast (ST_Geometry as ST_MultiCurve);
create explicit cast (ST_Geometry as ST_MultiLineString);
create explicit cast (ST_Geometry as ST_MultiPoint);
create explicit cast (ST_Geometry as ST_MultiPolygon);
create explicit cast (ST_Geometry as ST_MultiSurface);
create explicit cast (ST_Geometry as ST_Point);
create explicit cast (ST_Geometry as ST_Polygon);
create explicit cast (ST_Geometry as ST_Surface);
create implicit cast (ST_GeomCollection as ST_Geometry);
create explicit cast (ST_GeomCollection as ST_MultiCurve);
create explicit cast (ST_GeomCollection as ST_MultiLineString);
create explicit cast (ST_GeomCollection as ST_MultiPoint);
create explicit cast (ST_GeomCollection as ST_MultiPolygon);
create explicit cast (ST_GeomCollection as ST_MultiSurface);
create implicit cast (ST_LineString as ST_Curve);
create implicit cast (ST_LineString as ST_Geometry);
create implicit cast (ST_MultiCurve as ST_Geometry);
create implicit cast (ST_MultiCurve as ST_GeomCollection);
create explicit cast (ST_MultiCurve as ST_MultiLineString);
create implicit cast (ST_MultiLineString as ST_Geometry);
create implicit cast (ST_MultiLineString as ST_GeomCollection);
create implicit cast (ST_MultiLineString as ST_MultiCurve);
create implicit cast (ST_MultiPoint as ST_Geometry);
create implicit cast (ST_MultiPoint as ST_GeomCollection);
create implicit cast (ST_MultiPolygon as ST_Geometry);
create implicit cast (ST_MultiPolygon as ST_GeomCollection);
create implicit cast (ST_MultiPolygon as ST_MultiSurface);
create implicit cast (ST_MultiSurface as ST_Geometry);
create implicit cast (ST_MultiSurface as ST_GeomCollection);
create explicit cast (ST_MultiSurface as ST_MultiPolygon);
create implicit cast (ST_Point as ST_Geometry);
create implicit cast (ST_Polygon as ST_Geometry);
create implicit cast (ST_Polygon as ST_Surface);
create implicit cast (ST_Surface as ST_Geometry);
create explicit cast (ST_Surface as ST_Polygon);

create function ST_Overlaps(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Overlaps)'
   language c;
create function ST_Equals(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Equals)'
   language c;
create function ST_Contains(ST_Geometry,ST_Geometry) returns boolean
   with (not variant, commutator = ST_Within)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Contains)'
   language c;
create function ST_Within(ST_Geometry,ST_Geometry) returns boolean
   with (not variant, commutator = ST_Contains)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Within)'
   language c;
create function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_EnvelopesIntersect)'
   language c;
create function ST_Touches(ST_Geometry,ST_Geometry) returns boolean
   with (not variant, percall_cost=5000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Touches)'
   language c;
create function ST_Crosses(ST_Geometry,ST_Geometry) returns boolean
   with (not variant, percall_cost=1000)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Crosses)'
   language c;
create function ST_Intersects(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_Intersects)'
   language c;
create function ST_OrderingEquals(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_OrderingEquals)'
   language c;
create function SE_Nearest(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_NearestStratFunc)'
   language c;
create function SE_Nearest(ST_Geometry,ST_Geometry,int) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Nearest)'
   language c;
create function SE_NearestBBox(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_NearestStratFunc)'
   language c;
create function SE_NearestBbox(ST_Geometry,ST_Geometry,int) returns float
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_NearestBBox)'
   language c;
create function Equal(ST_Geometry,ST_Geometry) returns boolean
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryEqual)'
   language c;

create function rtUnion(ST_Geometry,ST_Geometry,ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_Curve,ST_Curve,ST_Curve) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_GeomCollection,ST_GeomCollection,ST_GeomCollection) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_LineString,ST_LineString,ST_LineString) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_MultiCurve,ST_MultiCurve,ST_MultiCurve) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_MultiLineString,ST_MultiLineString,ST_MultiLineString) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_MultiPoint,ST_MultiPoint,ST_MultiPoint) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_MultiPolygon,ST_MultiPolygon,ST_MultiPolygon) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_MultiSurface,ST_MultiSurface,ST_MultiSurface) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_Point,ST_Point,ST_Point) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_Polygon,ST_Polygon,ST_Polygon) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtUnion(ST_Surface,ST_Surface,ST_Surface) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeUnion)'
   language c;
create function rtSize(ST_Geometry,float) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeSize)'
   language c;
create function rtInter(ST_Geometry,ST_Geometry,ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeInter)'
   language c;
create function rtSFCbits(ST_Geometry,pointer) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeSFCbits)'
   language c;
create function rtObjLength(ST_Geometry,pointer) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeObjLength)'
   language c;
create function rtSFCvalue(ST_Geometry,integer,pointer) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeSFCvalue)'
   language c;
create function rtSetUnion(ST_Geometry,integer,pointer) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeSetUnion)'
   language c;
create function rtreeInfo(ST_Geometry,pointer,pointer,pointer) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(RtreeInfo)'
   language c;

grant execute on function ST_Overlaps(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Equals(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Contains(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Within(ST_Geometry,ST_Geometry) to public;
grant execute on function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Intersects(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Touches(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_Crosses(ST_Geometry,ST_Geometry) to public;
grant execute on function ST_OrderingEquals (ST_Geometry,ST_Geometry) to public;
grant execute on function SE_Nearest(ST_Geometry,ST_Geometry) to public;
grant execute on function SE_Nearest(ST_Geometry,ST_Geometry,int) to public;
grant execute on function SE_NearestBBox(ST_Geometry,ST_Geometry) to public;
grant execute on function SE_NearestBBox(ST_Geometry,ST_Geometry,int) to public;
grant execute on function Equal(ST_Geometry,ST_Geometry) to public;

grant execute on function rtUnion(ST_Geometry,ST_Geometry,ST_Geometry) to public;
grant execute on function rtUnion(ST_Curve,ST_Curve,ST_Curve) to public;
grant execute on function rtUnion(ST_GeomCollection,ST_GeomCollection,ST_GeomCollection) to public;
grant execute on function rtUnion(ST_LineString,ST_LineString,ST_LineString) to public;
grant execute on function rtUnion(ST_MultiCurve,ST_MultiCurve,ST_MultiCurve) to public;
grant execute on function rtUnion(ST_MultiLineString,ST_MultiLineString,ST_MultiLineString) to public;
grant execute on function rtUnion(ST_MultiPoint,ST_MultiPoint,ST_MultiPoint) to public;
grant execute on function rtUnion(ST_MultiPolygon,ST_MultiPolygon,ST_MultiPolygon) to public;
grant execute on function rtUnion(ST_MultiSurface,ST_MultiSurface,ST_MultiSurface) to public;
grant execute on function rtUnion(ST_Point,ST_Point,ST_Point) to public;
grant execute on function rtUnion(ST_Polygon,ST_Polygon,ST_Polygon) to public;
grant execute on function rtUnion(ST_Surface,ST_Surface,ST_Surface) to public;
grant execute on function rtSize(ST_Geometry,float) to public;
grant execute on function rtInter(ST_Geometry,ST_Geometry,ST_Geometry) to public;
grant execute on function rtSFCbits(ST_Geometry,pointer) to public;
grant execute on function rtObjLength(ST_Geometry,pointer) to public;
grant execute on function rtSFCvalue(ST_Geometry,integer,pointer) to public;
grant execute on function rtSetUnion(ST_Geometry,integer,pointer) to public;
grant execute on function rtreeInfo(ST_Geometry,pointer,pointer,pointer) to public;

create opclass ST_Geometry_ops for rtree 
	strategies(ST_Overlaps,Equal,ST_Contains,ST_Within,SE_EnvelopesIntersect,ST_Intersects,ST_Touches,ST_Crosses,ST_OrderingEquals,SE_Nearest,SE_NearestBBox,ST_Equals)
	support(rtUnion,rtSize,rtInter,rtSFCbits,rtObjLength,rtSFCvalue,rtSetUnion);

create function SE_Release() returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Release)'
   language c;
create function SE_InitSRID(integer) returns boolean
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_InitSRID)'
   language c;
create function SE_Trace(lvarchar,integer) returns lvarchar
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Trace)'
   language c;
create function SE_Refcount(ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Refcount)'
   language c;
create function SE_Sbspace(ST_Geometry) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Sbspace)'
   language c;        
create function SE_CreateSrid(float,float,float,float,varchar(64)) returns integer
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_CreateSrid)'
   language c;        
create function SE_CreateSrtext(int) returns lvarchar
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_CreateSrtext)'
   language c;        
create function SE_UdtMigrate(pointer) returns pointer
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_UdtMigrate)'
   language c;
create function SE_InRowSize(ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_InRowSize)'
   language c;
create function SE_OutOfRowSize(ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_OutOfRowSize)'
   language c;
create function SE_TotalSize(ST_Geometry) returns integer
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_TotalSize)'
   language c;

grant execute on function SE_Release() to public;
grant execute on function SE_Trace(lvarchar,integer) to public;
grant execute on function SE_InitSRID(integer) to public;
grant execute on function SE_Refcount(ST_Geometry) to public;
grant execute on function SE_Sbspace(ST_Geometry) to public;
grant execute on function SE_CreateSrid(float,float,float,float,varchar(64)) to public;
grant execute on function SE_CreateSrtext(int) to public;
grant execute on function SE_InRowSize(ST_Geometry) to public;
grant execute on function SE_OutOfRowSize(ST_Geometry) to public;
grant execute on function SE_TotalSize(ST_Geometry) to public;

delete from informix.systraceclasses where name = 'SE_Trace';
insert into informix.systraceclasses(name) values ('SE_Trace');

create function SE_Instr (lvarchar,char) returns int
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Instr)'
  language c;

create function SE_StringCat (lvarchar,lvarchar) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StringCat)'
  language c;

create function SE_ToChar (float) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ToChar)'
  language c;

create function SE_ToNumber (lvarchar) returns float
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ToNumber)' 
  language c;

create function SE_Rtrim (lvarchar,lvarchar) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Rtrim)'
  language c;

create function SE_Ltrim (lvarchar,lvarchar) returns lvarchar
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Ltrim)'
  language c;

create function SE_Lineage_Delete (lvarchar,int) returns lvarchar
  with (not variant, handlesnulls)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Lineage_Delete)'
  language c;

create function SE_Lineage_Insert (lvarchar,int,char) returns lvarchar
  with (not variant, handlesnulls)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Lineage_Insert)'
  language c;

create function SE_Lineage_Update (lvarchar,int,char) returns lvarchar
  with (not variant, handlesnulls)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Lineage_Update)'
  language c;

create function SE_Lineage_Exists (lvarchar,int) returns boolean
  with (not variant, handlesnulls)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Lineage_Exists)'
  language c;

grant execute on function SE_Instr (lvarchar,char) to public;
grant execute on function SE_StringCat (lvarchar,lvarchar) to public;
grant execute on function SE_ToChar (float) to public;
grant execute on function SE_ToNumber (lvarchar) to public;
grant execute on function SE_Rtrim (lvarchar,lvarchar) to public;
grant execute on function SE_Ltrim (lvarchar,lvarchar) to public;
grant execute on function SE_Lineage_Delete (lvarchar,int) to public;
grant execute on function SE_Lineage_Insert (lvarchar,int,char) to public;
grant execute on function SE_Lineage_Update (lvarchar,int,char) to public;
grant execute on function SE_Lineage_Exists (lvarchar,int) to public;

create function SE_Dissolve_Init(ST_Geometry) returns pointer
  with (not variant,handlesnulls)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Dissolve_Init)'
  language c;

create function SE_Dissolve_Iter(pointer,St_Geometry) returns pointer
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Dissolve_Iter)'
  language c;

create function SE_Dissolve_Combine(pointer,pointer) returns pointer
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Dissolve_Combine)'
  language c;

create function SE_Dissolve_Final(pointer) returns ST_Geometry
  with (not variant)
  external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_Dissolve_Final)'
  language c;

create aggregate SE_Dissolve
  with (init = SE_Dissolve_Init,
        iter = SE_Dissolve_Iter,
        combine = SE_Dissolve_Combine,
        final = SE_Dissolve_Final);

grant execute on function SE_Dissolve_Init(ST_Geometry) to public;
grant execute on function SE_Dissolve_Iter(pointer,ST_Geometry) to public;
grant execute on function SE_Dissolve_Combine(pointer,pointer) to public;
grant execute on function SE_Dissolve_Final(pointer) to public;

CREATE PROCEDURE create_se_views()
   DEFINE tab_exists INT;

   SELECT count(*) INTO tab_exists FROM informix.systables
      WHERE tabname='se_views';

   IF (tab_exists = 0) THEN
      CREATE TABLE se_views
      (
          view_name    varchar(128) NOT NULL,
          view_col     varchar(128) NOT NULL,
          real_tabname varchar(128) NOT NULL,
          real_colname varchar(128) NOT NULL
      );
   END IF

END PROCEDURE;

EXECUTE PROCEDURE create_se_views();
DROP PROCEDURE create_se_views();

CREATE FUNCTION SE_BoundingBox (tab_name varchar(128),
                                col_name varchar(128)) RETURNS ST_Polygon

  DEFINE idx_name   varchar(128);
  DEFINE type_name  varchar(128);
  DEFINE retval     ST_Geometry;
  DEFINE nrows      integer;
  DEFINE tab_type   char(1);
  DEFINE real_tab   varchar(128);
  DEFINE real_col   varchar(128);

  LET idx_name  = NULL;
  LET type_name = NULL;
  LET retval    = NULL;
  LET nrows     = 0;
  LET real_tab  = NULL;
  LET real_col  = NULL;

  SELECT count(*) INTO nrows 
    FROM informix.systables st
    WHERE st.tabname = tab_name;

  IF (nrows = 0) THEN
    RAISE EXCEPTION -206, 0, tab_name;
  END IF

  SELECT count(*) INTO nrows 
    FROM informix.systables st, informix.syscolumns sc
    WHERE
      st.tabname = tab_name AND
      sc.tabid = st.tabid AND
      sc.colname = col_name;

  IF (nrows = 0) THEN
    RAISE EXCEPTION -217, 0, col_name;
  END IF

  SELECT tabtype INTO tab_type FROM informix.systables
    WHERE tabname = tab_name;

  IF (tab_type = 'V') THEN
     SELECT real_tabname, real_colname INTO real_tab, real_col
        FROM se_views WHERE view_name = tab_name AND view_col = col_name;
     IF (real_tab IS NULL) THEN
        RAISE EXCEPTION -206, 0, tab_name;
     END IF
     IF (real_col IS NULL) THEN
        RAISE EXCEPTION -217, 0, col_name;
     END IF
  ELSE
     LET real_tab = tab_name;
     LET real_col = col_name;
  END IF

  FOREACH
  SELECT si.idxname, sx.name INTO idx_name, type_name
    FROM informix.systables st, informix.syscolumns sc, informix.sysindices si, informix.sysams sa, informix.sysxtdtypes sx
    WHERE
      -- identify table with name <tab_name>
      st.tabname = real_tab AND
      -- identify column with name <col_name> on identified table
      sc.tabid = st.tabid AND
      sc.colname = real_col AND
      -- identify rtree index on identified column
      si.tabid = sc.tabid AND
      si.indexkeys::lvarchar like sc.colno || ' [%]' AND
      sa.am_id = si.amid AND
      sa.am_name = 'rtree' AND
      -- identify extended type of identified column
      sx.extended_id = sc.extended_id

  END FOREACH;

  IF (idx_name IS NULL) THEN
    RAISE EXCEPTION -319;
  END IF

  CALL ST_GeomIn(rtreeRootBB(idx_name, type_name)) RETURNING retval;  

  RETURN retval::ST_Polygon;

END FUNCTION;

GRANT EXECUTE ON FUNCTION SE_BoundingBox(varchar(128),varchar(128)) to public;

alter function ST_CurveIn(lvarchar) with (add parallelizable);
alter function ST_CurveOut(ST_Curve) with (add parallelizable);
alter function ST_CurveSend(ST_Curve) with (add parallelizable);
alter function ST_CurveRecv(sendrecv) with (add parallelizable);
alter function ST_CurveImpT(impexp) with (add parallelizable);
alter function ST_CurveExpT(ST_Curve) with (add parallelizable);
alter function ST_CurveImpB(impexpbin) with (add parallelizable);
alter function ST_CurveExpB(ST_Curve) with (add parallelizable);
alter function Assign(ST_Curve) with (add parallelizable);
alter procedure Destroy(ST_Curve) with (add parallelizable);
alter function LOhandles(ST_Curve) with (add parallelizable);
alter function ST_EndPoint(ST_Curve) with (add parallelizable);
alter function ST_IsClosed(ST_Curve) with (add parallelizable);
alter function ST_IsRing(ST_Curve) with (add parallelizable);
alter function ST_StartPoint(ST_Curve) with (add parallelizable);
alter function ST_CurveExpT(ST_Curve) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function DeepCopy(ST_Geometry) with (add parallelizable);
alter function DeepCopy(ST_Curve) with (add parallelizable);
alter function DeepCopy(ST_MultiCurve) with (add parallelizable);
alter function DeepCopy(ST_Surface) with (add parallelizable);
alter function DeepCopy(ST_MultiSurface) with (add parallelizable);
alter function DeepCopy(ST_Point) with (add parallelizable);
alter function DeepCopy(ST_MultiPoint) with (add parallelizable);
alter function DeepCopy(ST_LineString) with (add parallelizable);
alter function DeepCopy(ST_MultiLineString) with (add parallelizable);
alter function DeepCopy(ST_Polygon) with (add parallelizable);
alter function DeepCopy(ST_MultiPolygon) with (add parallelizable);
alter function DeepCopy(ST_GeomCollection) with (add parallelizable);

alter function SE_Dissolve_Init(ST_Geometry) with (add parallelizable);
alter function SE_Dissolve_Iter(pointer,St_Geometry) with (add parallelizable);
alter function SE_Dissolve_Combine(pointer,pointer) with (add parallelizable);
alter function SE_Dissolve_Final(pointer) with (add parallelizable);

alter function ST_GeomCollIn(lvarchar) with (add parallelizable);
alter function ST_GeomCollOut(ST_GeomCollection) with (add parallelizable);
alter function ST_GeomCollSend(ST_GeomCollection) with (add parallelizable);
alter function ST_GeomCollRecv(sendrecv) with (add parallelizable);
alter function ST_GeomCollImpT(impexp) with (add parallelizable);
alter function ST_GeomCollExpT(ST_GeomCollection) with (add parallelizable);
alter function ST_GeomCollImpB(impexpbin) with (add parallelizable);
alter function ST_GeomCollExpB(ST_GeomCollection) with (add parallelizable);
alter function Assign(ST_GeomCollection) with (add parallelizable);
alter procedure Destroy(ST_GeomCollection) with (add parallelizable);
alter function LOhandles(ST_GeomCollection) with (add parallelizable);
alter function ST_NumGeometries(ST_GeomCollection) with (add parallelizable);
alter function ST_GeometryN(ST_GeomCollection,int) with (add parallelizable);
alter function ST_GeomCollExpT(ST_GeomCollection) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_GeomIn(lvarchar) with (add parallelizable);
alter function ST_GeomOut(ST_Geometry) with (add parallelizable);
alter function ST_GeomSend(ST_Geometry) with (add parallelizable);
alter function ST_GeomRecv(sendrecv) with (add parallelizable);
alter function ST_GeomImpT(impexp) with (add parallelizable);
alter function ST_GeomExpT(ST_Geometry) with (add parallelizable);
alter function ST_GeomImpB(impexpbin) with (add parallelizable);
alter function ST_GeomExpB(ST_Geometry) with (add parallelizable);
alter function Assign(ST_Geometry) with (add parallelizable);
alter procedure Destroy(ST_Geometry) with (add parallelizable);
alter function LOhandles(ST_Geometry) with (add parallelizable);
alter function SE_GeomFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_GeomFromShape(lvarchar,int) with (add parallelizable);
alter function ST_GeomFromText(lvarchar,int) with (add parallelizable);
alter function ST_GeomFromWKB(lvarchar,int) with (add parallelizable);
alter function SE_ShapeToSQL(lvarchar) with (add parallelizable);
alter function ST_WKTToSQL(lvarchar) with (add parallelizable);
alter function ST_WKBToSQL(lvarchar) with (add parallelizable);
alter function ST_GeomExpT(ST_Geometry) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function Compare(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function NotEqual(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function SE_Anno_Text(ST_Geometry) with (add parallelizable);
alter function SE_Area(ST_Geometry) with (add parallelizable);
alter function ST_AsBinary(ST_Geometry) with (add parallelizable);
alter function ST_AsText(ST_Geometry) with (add parallelizable);
alter function SE_AsShape(ST_Geometry) with (add parallelizable);
alter function SE_AsSde(ST_Geometry) with (add parallelizable);
alter function ST_Boundary(ST_Geometry) with (add parallelizable);
alter function ST_Buffer(ST_Geometry,float) with (add parallelizable);
alter function ST_ConvexHull(ST_Geometry) with (add parallelizable);
alter function ST_CoordDim(ST_Geometry) with (add parallelizable);
alter function ST_Difference(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Dimension(ST_Geometry) with (add parallelizable);
alter function ST_Disjoint(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Distance(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Envelope(ST_Geometry) with (add parallelizable);
alter function SE_Generalize(ST_Geometry,float) with (add parallelizable);
alter function ST_GeometryType(ST_Geometry) with (add parallelizable);
alter function ST_Intersection(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_AsBinary(ST_Geometry) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_AsBinary)');
alter function ST_AsText(ST_Geometry) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_AsText)');
alter function SE_AsShape(ST_Geometry) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsShape)');
alter function SE_AsSde(ST_Geometry) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsSde)');

alter function SE_Is3D(ST_Geometry) with (add parallelizable);
alter function ST_IsEmpty(ST_Geometry) with (add parallelizable);
alter function SE_IsMeasured(ST_Geometry) with (add parallelizable);
alter function ST_IsSimple(ST_Geometry) with (add parallelizable);
alter function ST_IsValid(ST_Geometry) with (add parallelizable);
alter function SE_Length(ST_Geometry) with (add parallelizable);
alter function SE_LocateAlong(ST_Geometry,float) with (add parallelizable);
alter function SE_LocateBetween(ST_Geometry,float,float) with (add parallelizable);
alter function SE_Mmax(ST_Geometry) with (add parallelizable);
alter function SE_Mmin(ST_Geometry) with (add parallelizable);
alter function ST_NumPoints(ST_Geometry) with (add parallelizable);
alter function ST_Relate(ST_Geometry,ST_Geometry,lvarchar) with (add parallelizable);
alter function SE_SdeEntity(ST_Geometry) with (add parallelizable);
alter function SE_SpatialKey(ST_Geometry) with (add parallelizable);
alter function ST_SRID(ST_Geometry) with (add parallelizable);
alter function ST_SymDifference(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Union(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Transform(ST_Geometry,int) with (add parallelizable);
alter function ST_Transform(ST_Geometry,int) with (add stack=90000);
alter function SE_Xmax(ST_Geometry) with (add parallelizable);
alter function SE_Xmin(ST_Geometry) with (add parallelizable);
alter function SE_Ymax(ST_Geometry) with (add parallelizable);
alter function SE_Ymin(ST_Geometry) with (add parallelizable);
alter function SE_Zmax(ST_Geometry) with (add parallelizable);
alter function SE_Zmin(ST_Geometry) with (add parallelizable);

alter function ST_LineIn(lvarchar) with (add parallelizable);
alter function ST_LineOut(ST_LineString) with (add parallelizable);
alter function ST_LineSend(ST_LineString) with (add parallelizable);
alter function ST_LineRecv(sendrecv) with (add parallelizable);
alter function ST_LineImpT(impexp) with (add parallelizable);
alter function ST_LineExpT(ST_LineString) with (add parallelizable);
alter function ST_LineImpB(impexpbin) with (add parallelizable);
alter function ST_LineExpB(ST_LineString) with (add parallelizable);
alter function Assign(ST_LineString) with (add parallelizable);
alter procedure Destroy(ST_LineString) with (add parallelizable);
alter function LOhandles(ST_LineString) with (add parallelizable);
alter function SE_LineFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_LineFromShape(lvarchar,int) with (add parallelizable);
alter function ST_LineFromText(lvarchar,int) with (add parallelizable);
alter function ST_LineFromWKB(lvarchar,int) with (add parallelizable);
alter function ST_Length(ST_Curve) with (add parallelizable);
alter function ST_PointN(ST_LineString,int) with (add parallelizable);
alter function SE_Midpoint(ST_LineString) with (add parallelizable);
alter function ST_LineExpT(ST_LineString) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_MCurveIn(lvarchar) with (add parallelizable);
alter function ST_MCurveOut(ST_MultiCurve) with (add parallelizable);
alter function ST_MCurveSend(ST_MultiCurve) with (add parallelizable);
alter function ST_MCurveRecv(sendrecv) with (add parallelizable);
alter function ST_MCurveImpT(impexp) with (add parallelizable);
alter function ST_MCurveExpT(ST_MultiCurve) with (add parallelizable);
alter function ST_MCurveImpB(impexpbin) with (add parallelizable);
alter function ST_MCurveExpB(ST_MultiCurve) with (add parallelizable);
alter function Assign(ST_MultiCurve) with (add parallelizable);
alter procedure Destroy(ST_MultiCurve) with (add parallelizable);
alter function LOhandles(ST_MultiCurve) with (add parallelizable);
alter function ST_IsClosed(ST_MultiCurve) with (add parallelizable);
alter function ST_MCurveExpT(ST_MultiCurve) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_MLineIn(lvarchar) with (add parallelizable);
alter function ST_MLineOut(ST_MultiLineString) with (add parallelizable);
alter function ST_MLineSend(ST_MultiLineString) with (add parallelizable);
alter function ST_MLineRecv(sendrecv) with (add parallelizable);
alter function ST_MLineImpT(impexp) with (add parallelizable);
alter function ST_MLineExpT(ST_MultiLineString) with (add parallelizable);
alter function ST_MLineImpB(impexpbin) with (add parallelizable);
alter function ST_MLineExpB(ST_MultiLineString) with (add parallelizable);
alter function Assign(ST_MultiLineString) with (add parallelizable);
alter procedure Destroy(ST_MultiLineString) with (add parallelizable);
alter function LOhandles(ST_MultiLineString) with (add parallelizable);
alter function SE_MLineFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_MLineFromShape(lvarchar,int) with (add parallelizable);
alter function ST_MLineFromText(lvarchar,int) with (add parallelizable);
alter function ST_MLineFromWKB(lvarchar,int) with (add parallelizable);
alter function ST_Length(ST_MultiCurve) with (add parallelizable);
alter function ST_MLineExpT(ST_MultiLineString) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_MPointIn(lvarchar) with (add parallelizable);
alter function ST_MPointOut(ST_MultiPoint) with (add parallelizable);
alter function ST_MPointSend(ST_MultiPoint) with (add parallelizable);
alter function ST_MPointRecv(sendrecv) with (add parallelizable);
alter function ST_MPointImpT(impexp) with (add parallelizable);
alter function ST_MPointExpT(ST_MultiPoint) with (add parallelizable);
alter function ST_MPointImpB(impexpbin) with (add parallelizable);
alter function ST_MPointExpB(ST_MultiPoint) with (add parallelizable);
alter function Assign(ST_MultiPoint) with (add parallelizable);
alter procedure Destroy(ST_MultiPoint) with (add parallelizable);
alter function LOhandles(ST_MultiPoint) with (add parallelizable);
alter function SE_MPointFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_MPointFromShape(lvarchar,integer) with (add parallelizable);
alter function ST_MPointFromText(lvarchar,integer) with (add parallelizable);
alter function ST_MPointFromWKB(lvarchar,integer) with (add parallelizable);
alter function ST_MPointExpT(ST_MultiPoint) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_MPolyIn(lvarchar) with (add parallelizable);
alter function ST_MPolyOut(ST_MultiPolygon) with (add parallelizable);
alter function ST_MPolySend(ST_MultiPolygon) with (add parallelizable);
alter function ST_MPolyRecv(sendrecv) with (add parallelizable);
alter function ST_MPolyImpT(impexp) with (add parallelizable);
alter function ST_MPolyExpT(ST_MultiPolygon) with (add parallelizable);
alter function ST_MPolyImpB(impexpbin) with (add parallelizable);
alter function ST_MPolyExpB(ST_MultiPolygon) with (add parallelizable);
alter function Assign(ST_MultiPolygon) with (add parallelizable);
alter procedure Destroy(ST_MultiPolygon) with (add parallelizable);
alter function LOhandles(ST_MultiPolygon) with (add parallelizable);
alter function SE_MPolyFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_MPolyFromShape(lvarchar,int) with (add parallelizable);
alter function ST_MPolyFromText(lvarchar,int) with (add parallelizable);
alter function ST_MPolyFromWKB(lvarchar,int) with (add parallelizable);
alter function ST_MPolyExpT(ST_MultiPolygon) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_MSurfaceIn(lvarchar) with (add parallelizable);
alter function ST_MSurfaceOut(ST_MultiSurface) with (add parallelizable);
alter function ST_MSurfaceSend(ST_MultiSurface) with (add parallelizable);
alter function ST_MSurfaceRecv(sendrecv) with (add parallelizable);
alter function ST_MSurfaceImpT(impexp) with (add parallelizable);
alter function ST_MSurfaceExpT(ST_MultiSurface) with (add parallelizable);
alter function ST_MSurfaceImpB(impexpbin) with (add parallelizable);
alter function ST_MSurfaceExpB(ST_MultiSurface) with (add parallelizable);
alter function Assign(ST_MultiSurface) with (add parallelizable);
alter procedure Destroy(ST_MultiSurface) with (add parallelizable);
alter function LOhandles(ST_MultiSurface) with (add parallelizable);
alter function ST_Area(ST_MultiSurface) with (add parallelizable);
alter function ST_Centroid(ST_MultiSurface) with (add parallelizable);
alter function ST_Perimeter(ST_MultiSurface) with (add parallelizable);
alter function ST_PointOnSurface(ST_MultiSurface) with (add parallelizable);
alter function ST_MSurfaceExpT(ST_MultiSurface) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_Overlaps(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Equals(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Contains(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Within(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Touches(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Crosses(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_Intersects(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function ST_OrderingEquals(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function SE_Nearest(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function SE_Nearest(ST_Geometry,ST_Geometry,int) with (add parallelizable);
alter function SE_NearestBBox(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function SE_NearestBbox(ST_Geometry,ST_Geometry,int) with (add parallelizable);
alter function Equal(ST_Geometry,ST_Geometry) with (add parallelizable);
alter function rtUnion(ST_Geometry,ST_Geometry,ST_Geometry) with (add parallelizable);
alter function rtUnion(ST_Curve,ST_Curve,ST_Curve) with (add parallelizable);

alter function rtUnion(ST_GeomCollection,ST_GeomCollection,ST_GeomCollection) with (add parallelizable);
alter function rtUnion(ST_LineString,ST_LineString,ST_LineString) with (add parallelizable);
alter function rtUnion(ST_MultiCurve,ST_MultiCurve,ST_MultiCurve) with (add parallelizable);
alter function rtUnion(ST_MultiLineString,ST_MultiLineString,ST_MultiLineString) with (add parallelizable);
alter function rtUnion(ST_MultiPoint,ST_MultiPoint,ST_MultiPoint) with (add parallelizable);
alter function rtUnion(ST_MultiPolygon,ST_MultiPolygon,ST_MultiPolygon) with (add parallelizable);
alter function rtUnion(ST_MultiSurface,ST_MultiSurface,ST_MultiSurface) with (add parallelizable);
alter function rtUnion(ST_Point,ST_Point,ST_Point) with (add parallelizable);
alter function rtUnion(ST_Polygon,ST_Polygon,ST_Polygon) with (add parallelizable);
alter function rtUnion(ST_Surface,ST_Surface,ST_Surface) with (add parallelizable);
alter function rtSize(ST_Geometry,float) with (add parallelizable);
alter function rtInter(ST_Geometry,ST_Geometry,ST_Geometry) with (add parallelizable);
alter function rtSFCbits(ST_Geometry,pointer) with (add parallelizable);
alter function rtObjLength(ST_Geometry,pointer) with (add parallelizable);
alter function rtSFCvalue(ST_Geometry,int,pointer) with (add parallelizable);
alter function rtSetUnion(ST_Geometry,int,pointer) with (add parallelizable);
alter function rtreeInfo(ST_Geometry,pointer,pointer,pointer) with (add parallelizable);

alter function ST_PointIn(lvarchar) with (add parallelizable);
alter function ST_PointOut(ST_Point) with (add parallelizable);
alter function ST_PointSend(ST_Point) with (add parallelizable);
alter function ST_PointRecv(sendrecv) with (add parallelizable);
alter function ST_PointImpT(impexp) with (add parallelizable);
alter function ST_PointExpT(ST_Point) with (add parallelizable);
alter function ST_PointImpB(impexpbin) with (add parallelizable);
alter function ST_PointExpB(ST_Point) with (add parallelizable);
alter function Assign(ST_Point) with (add parallelizable);
alter procedure Destroy(ST_Point) with (add parallelizable);
alter function LOhandles(ST_Point) with (add parallelizable);
alter function ST_Point(float,float,integer) with (add parallelizable);
alter function SE_PointFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_PointFromShape(lvarchar,integer) with (add parallelizable);
alter function ST_PointFromText(lvarchar,integer) with (add parallelizable);
alter function ST_PointFromWKB(lvarchar,integer) with (add parallelizable);
alter function SE_M(ST_Point) with (add parallelizable);
alter function ST_X(ST_Point) with (add parallelizable);
alter function ST_Y(ST_Point) with (add parallelizable);
alter function SE_Z(ST_Point) with (add parallelizable);
alter function ST_PointExpT(ST_Point) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_PolyIn(lvarchar) with (add parallelizable);
alter function ST_PolyOut(ST_Polygon) with (add parallelizable);
alter function ST_PolySend(ST_Polygon) with (add parallelizable);
alter function ST_PolyRecv(sendrecv) with (add parallelizable);
alter function ST_PolyImpT(impexp) with (add parallelizable);
alter function ST_PolyExpT(ST_Polygon) with (add parallelizable);
alter function ST_PolyImpB(impexpbin) with (add parallelizable);
alter function ST_PolyExpB(ST_Polygon) with (add parallelizable);
alter function Assign(ST_Polygon) with (add parallelizable);
alter procedure Destroy(ST_Polygon) with (add parallelizable);
alter function LOhandles(ST_Polygon) with (add parallelizable);
alter function SE_PolyFromSde(lvarchar,lvarchar,int) with (add parallelizable);
alter function SE_PolyFromShape(lvarchar,int) with (add parallelizable);
alter function ST_PolyFromText(lvarchar,int) with (add parallelizable);
alter function ST_PolyFromWKB(lvarchar,int) with (add parallelizable);
alter function ST_Polygon(ST_LineString) with (add parallelizable);
alter function ST_ExteriorRing(ST_Polygon) with (add parallelizable);
alter function ST_InteriorRingN(ST_Polygon,int) with (add parallelizable);
alter function ST_NumInteriorRing(ST_Polygon) with (add parallelizable);
alter function ST_PolyExpT(ST_Polygon) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

alter function ST_SurfaceIn(lvarchar) with (add parallelizable);
alter function ST_SurfaceOut(ST_Surface) with (add parallelizable);
alter function ST_SurfaceSend(ST_Surface) with (add parallelizable);
alter function ST_SurfaceRecv(sendrecv) with (add parallelizable);
alter function ST_SurfaceImpT(impexp) with (add parallelizable);
alter function ST_SurfaceExpT(ST_Surface) with (add parallelizable);
alter function ST_SurfaceImpB(impexpbin) with (add parallelizable);
alter function ST_SurfaceExpB(ST_Surface) with (add parallelizable);
alter function Assign(ST_Surface) with (add parallelizable);
alter procedure Destroy(ST_Surface) with (add parallelizable);
alter function LOhandles(ST_Surface) with (add parallelizable);
alter function ST_Area(ST_Surface) with (add parallelizable);
alter function ST_Centroid(ST_Surface) with (add parallelizable);
alter function ST_Perimeter(ST_Surface) with (add parallelizable);
alter function ST_PointOnSurface(ST_Surface) with (add parallelizable);
alter function ST_SurfaceExpT(ST_Surface) with (modify external name='$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryExport)');

create function SE_AsKML(ST_Geometry) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsKML)'
   language c;

grant execute on function SE_AsKML(ST_Geometry) to public;

create function SE_AsGML(ST_Geometry) returns ST_Geometry
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_AsGML)'
   language c;

grant execute on function SE_AsGML(ST_Geometry) to public;

create function SE_VertexUpdate(ST_Geometry,ST_Point,ST_Point) returns ST_Geometry
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_VertexUpdate)'
   language c;
create function SE_VertexAppend(ST_LineString,ST_Point) returns ST_LineString
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_VertexAppend)'
   language c;
create function SE_VertexDelete(ST_Geometry,ST_Point) returns ST_Geometry
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_VertexDelete)'
   language c;
create function SE_PerpendicularPoint(ST_Linestring,ST_Point) returns ST_MultiPoint
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PerpendicularPoint)'
   language c;
create function SE_PerpendicularPoint(ST_MultiLinestring,ST_Point) returns ST_MultiPoint
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_PerpendicularPoint)'
   language c;

grant execute on function SE_VertexUpdate(ST_Geometry,ST_Point,ST_Point) to public;
grant execute on function SE_VertexAppend(ST_LineString,ST_Point) to public;
grant execute on function SE_VertexDelete(ST_Geometry,ST_Point) to public;
grant execute on function SE_PerpendicularPoint(ST_Linestring,ST_Point) to public;
grant execute on function SE_PerpendicularPoint(ST_MultiLinestring,ST_Point) to public;

create function statcollect(ST_Geometry,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_Curve,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_GeomCollection,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_LineString,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_MultiCurve,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_MultiLineString,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_MultiPoint,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_MultiPolygon,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_MultiSurface,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_Point,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_Polygon,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statcollect(ST_Surface,float,float) returns stat
   with (not variant, handlesnulls)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatCollect)'
   language c;
create function statprint(ST_Geometry,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_Curve,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_GeomCollection,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_LineString,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_MultiCurve,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_MultiLineString,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_MultiPoint,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_MultiPolygon,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_MultiSurface,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_Point,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_Polygon,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function statprint(ST_Surface,stat) returns lvarchar
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_StatPrint)'
   language c;
create function ST_StatDump(lvarchar,lvarchar,lvarchar) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_StatDump)'
   language c;

grant execute on function statcollect(ST_Geometry,float,float) to public;
grant execute on function statcollect(ST_Curve,float,float) to public;
grant execute on function statcollect(ST_GeomCollection,float,float) to public;
grant execute on function statcollect(ST_LineString,float,float) to public;
grant execute on function statcollect(ST_MultiCurve,float,float) to public;
grant execute on function statcollect(ST_MultiLineString,float,float) to public;
grant execute on function statcollect(ST_MultiPoint,float,float) to public;
grant execute on function statcollect(ST_MultiPolygon,float,float) to public;
grant execute on function statcollect(ST_MultiSurface,float,float) to public;
grant execute on function statcollect(ST_Point,float,float) to public;
grant execute on function statcollect(ST_Polygon,float,float) to public;
grant execute on function statcollect(ST_Surface,float,float) to public;
grant execute on function statprint(ST_Geometry,stat) to public;
grant execute on function statprint(ST_Curve,stat) to public;
grant execute on function statprint(ST_GeomCollection,stat) to public;
grant execute on function statprint(ST_LineString,stat) to public;
grant execute on function statprint(ST_MultiCurve,stat) to public;
grant execute on function statprint(ST_MultiLineString,stat) to public;
grant execute on function statprint(ST_MultiPoint,stat) to public;
grant execute on function statprint(ST_MultiPolygon,stat) to public;
grant execute on function statprint(ST_MultiSurface,stat) to public;
grant execute on function statprint(ST_Point,stat) to public;
grant execute on function statprint(ST_Polygon,stat) to public;
grant execute on function statprint(ST_Surface,stat) to public;
grant execute on function ST_StatDump(lvarchar,lvarchar,lvarchar) to public;

create function TempAssign(ST_Geometry) returns ST_Geometry
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_Curve) returns ST_Curve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_MultiCurve) returns ST_MultiCurve
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_Surface) returns ST_Surface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_MultiSurface) returns ST_MultiSurface
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_Point) returns ST_Point
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_MultiPoint) returns ST_MultiPoint
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_LineString) returns ST_LineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_MultiLineString) returns ST_MultiLineString
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_Polygon) returns ST_Polygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_MultiPolygon) returns ST_MultiPolygon
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;
create function TempAssign(ST_GeomCollection) returns ST_GeomCollection
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(GeometryTempAssign)'
   language c;

grant execute on function TempAssign (ST_Geometry) to public;
grant execute on function TempAssign (ST_Curve) to public;
grant execute on function TempAssign (ST_MultiCurve) to public;
grant execute on function TempAssign (ST_Surface) to public;
grant execute on function TempAssign (ST_MultiSurface) to public;
grant execute on function TempAssign (ST_Point) to public;
grant execute on function TempAssign (ST_MultiPoint) to public;
grant execute on function TempAssign (ST_LineString) to public;
grant execute on function TempAssign (ST_MultiLineString) to public;
grant execute on function TempAssign (ST_Polygon) to public;
grant execute on function TempAssign (ST_MultiPolygon) to public;
grant execute on function TempAssign (ST_GeomCollection) to public;

alter function TempAssign(ST_Geometry) with (add parallelizable);
alter function TempAssign(ST_Curve) with (add parallelizable);
alter function TempAssign(ST_MultiCurve) with (add parallelizable);
alter function TempAssign(ST_Surface) with (add parallelizable);
alter function TempAssign(ST_MultiSurface) with (add parallelizable);
alter function TempAssign(ST_Point) with (add parallelizable);
alter function TempAssign(ST_MultiPoint) with (add parallelizable);
alter function TempAssign(ST_LineString) with (add parallelizable);
alter function TempAssign(ST_MultiLineString) with (add parallelizable);
alter function TempAssign(ST_Polygon) with (add parallelizable);
alter function TempAssign(ST_MultiPolygon) with (add parallelizable);
alter function TempAssign(ST_GeomCollection) with (add parallelizable);

create function ST_OverlapsCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_OverlapsCost)'
   language c;
create function SE_EqualCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_EqualCost)'
   language c;
create function ST_ContainsCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_ContainsCost)'
   language c;
create function ST_WithinCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_WithinCost)'
   language c;
create function SE_EnvelopesIntersectCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_EnvelopesIntersectCost)'
   language c;
create function ST_IntersectsCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IntersectsCost)'
   language c;
create function ST_TouchesCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_TouchesCost)'
   language c;
create function ST_CrossesCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CrossesCost)'
   language c;
create function ST_EqualsCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_EqualsCost)'
   language c;
create function ST_DisjointCost(pointer,pointer) returns integer
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_DisjointCost)'
   language c;
create function ST_CostTest(lvarchar,lvarchar,lvarchar,ST_Geometry) returns integer
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CostTest)'
   language c;
grant execute on function ST_OverlapsCost(pointer,pointer) to public;
grant execute on function SE_EqualCost(pointer,pointer) to public;
grant execute on function ST_ContainsCost(pointer,pointer) to public;
grant execute on function ST_WithinCost(pointer,pointer) to public;
grant execute on function SE_EnvelopesIntersectCost(pointer,pointer) to public;
grant execute on function ST_IntersectsCost(pointer,pointer) to public;
grant execute on function ST_TouchesCost(pointer,pointer) to public;
grant execute on function ST_CrossesCost(pointer,pointer) to public;
grant execute on function ST_EqualsCost(pointer,pointer) to public;
grant execute on function ST_DisjointCost(pointer,pointer) to public;
grant execute on function ST_CostTest(lvarchar,lvarchar,lvarchar,ST_Geometry) to public;

alter function ST_Overlaps(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function Equal(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Contains(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Within(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Intersects(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Touches(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Crosses(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Equals(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Disjoint(ST_Geometry,ST_Geometry)
  with (drop percall_cost);
alter function ST_Overlaps(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_OverlapsCost);
alter function Equal(ST_Geometry,ST_Geometry)
  with (add costfunc = SE_EqualCost);
alter function ST_Contains(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_ContainsCost);
alter function ST_Within(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_WithinCost);
alter function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry)
  with (add costfunc = SE_EnvelopesIntersectCost);
alter function ST_Intersects(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_IntersectsCost);
alter function ST_Touches(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_TouchesCost);
alter function ST_Crosses(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_CrossesCost);
alter function ST_Equals(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_EqualsCost);
alter function ST_Disjoint(ST_Geometry,ST_Geometry)
  with (add costfunc = ST_DisjointCost);

create function ST_OverlapsSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_OverlapsSelectivity)'
   language c;
create function SE_EqualSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_EqualSelectivity)'
   language c;
create function ST_ContainsSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_ContainsSelectivity)'
   language c;
create function ST_WithinSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_WithinSelectivity)'
   language c;
create function SE_EnvelopesIntersectSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_EnvelopesIntersectSelectivity)'
   language c;
create function ST_IntersectsSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_IntersectsSelectivity)'
   language c;
create function ST_TouchesSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_TouchesSelectivity)'
   language c;
create function ST_CrossesSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_CrossesSelectivity)'
   language c;
create function ST_EqualsSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_EqualsSelectivity)'
   language c;
create function ST_DisjointSelectivity(pointer,pointer) returns float
   with (not variant, parallelizable)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_DisjointSelectivity)'
   language c;
create function ST_SelectivityTest(lvarchar,lvarchar,lvarchar,ST_Geometry) returns float
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(ST_SelectivityTest)'
   language c;
grant execute on function ST_OverlapsSelectivity(pointer,pointer) to public;
grant execute on function SE_EqualSelectivity(pointer,pointer) to public;
grant execute on function ST_ContainsSelectivity(pointer,pointer) to public;
grant execute on function ST_WithinSelectivity(pointer,pointer) to public;
grant execute on function SE_EnvelopesIntersectSelectivity(pointer,pointer) to public;
grant execute on function ST_IntersectsSelectivity(pointer,pointer) to public;
grant execute on function ST_TouchesSelectivity(pointer,pointer) to public;
grant execute on function ST_CrossesSelectivity(pointer,pointer) to public;
grant execute on function ST_EqualsSelectivity(pointer,pointer) to public;
grant execute on function ST_DisjointSelectivity(pointer,pointer) to public;
grant execute on function ST_SelectivityTest(lvarchar,lvarchar,lvarchar,ST_Geometry) to public;

alter function ST_Overlaps(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_OverlapsSelectivity);
alter function Equal(ST_Geometry,ST_Geometry)
  with (add selfunc = SE_EqualSelectivity);
alter function ST_Contains(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_ContainsSelectivity);
alter function ST_Within(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_WithinSelectivity);
alter function SE_EnvelopesIntersect(ST_Geometry,ST_Geometry)
  with (add selfunc = SE_EnvelopesIntersectSelectivity);
alter function ST_Intersects(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_IntersectsSelectivity);
alter function ST_Touches(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_TouchesSelectivity);
alter function ST_Crosses(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_CrossesSelectivity);
alter function ST_Equals(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_EqualsSelectivity);
alter function ST_Disjoint(ST_Geometry,ST_Geometry)
  with (add selfunc = ST_DisjointSelectivity);

create function SE_ParamSet(lvarchar,lvarchar) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ParamSet)'
   language c;
create function SE_ParamSet() returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ParamSetUsage)'
   language c;
create function SE_ParamGet(lvarchar) returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ParamGetOne)'
   language c;
create function SE_ParamGet() returns lvarchar
   with (not variant)
   external name '$INFORMIXDIR/extend/spatial.8.22.FC2/spatial.bld(SE_ParamGetAll)'
   language c;

grant execute on function SE_ParamSet(lvarchar,lvarchar) to public;
grant execute on function SE_ParamSet() to public;
grant execute on function SE_ParamGet(lvarchar) to public;
grant execute on function SE_ParamGet() to public;

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE01", "en_us.8859-1", "Unable to establish a connection in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE02", "en_us.8859-1", "Function %FUNCTION% is unable to allocate memory."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE03", "en_us.8859-1", "Invalid Geometry in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE04", "en_us.8859-1", "Function %FUNCTION% not applicable to type %TYPE%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE05", "en_us.8859-1", "This function is not yet implemented."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE06", "en_us.8859-1", "Unknown ESRI shape library error (%ERRCODE%) in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE11", "en_us.8859-1", "Invalid SRID %SRID% or NULL in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE14", "en_us.8859-1", "Unknown spatial reference identifier %SRID%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE16", "en_us.8859-1", "Unable to get the geometry data pointer from the server in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE17", "en_us.8859-1", "Geometry verification failed."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE18", "en_us.8859-1", "Buffer operation failed."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE19", "en_us.8859-1", "Coordinates out of bounds in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE20", "en_us.8859-1", "Invalid parameter in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE21", "en_us.8859-1", "Geometry integrity error in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE22", "en_us.8859-1", "Too many points in feature."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE23", "en_us.8859-1", "Spatial reference conflict, %SRID1% vs %SRID2%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE24", "en_us.8859-1", "Incompatible geometries in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE25", "en_us.8859-1", "Subscript %SUBSCRIPT% out of range in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE28", "en_us.8859-1", "Invalid text in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE30", "en_us.8859-1", "Overlapping polygon rings in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE31", "en_us.8859-1", "Too few points for geometry type in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE32", "en_us.8859-1", "Polygon does not close in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE29", "en_us.8859-1", "Unexpected system error in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE33", "en_us.8859-1", "Interior ring not enclosed by exterior ring in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE34", "en_us.8859-1", "The polygon has no area in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE35", "en_us.8859-1", "The polygon ring contains a spike in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE36", "en_us.8859-1", "Multipolygon exterior rings overlap in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE37", "en_us.8859-1", "The geometry boundary is self-intersecting in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE38", "en_us.8859-1", "The geometry has too many parts in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE39", "en_us.8859-1", "Mismatched text string parentheses in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE40", "en_us.8859-1", "Unknown or unsupported ESRI entity type (%TYPE%) found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE41", "en_us.8859-1", "The projection string for your SRID is invalid in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE07", "en_us.8859-1", "Internal SAPI error. %SAPIFUNC% returned %RETVAL%. Failure in %FUNCNAME%.
"
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE08", "en_us.8859-1", "Nearest-neighbor queries require an index scan."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE09", "en_us.8859-1", "Unknown or unsupported shape file type (%TYPE%) found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE10", "en_us.8859-1", "Unknown or unsupported OpenGIS WKB type (%TYPE%) found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE12", "en_us.8859-1", "Unknown or unsupported geometry type (%TYPE%) found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE26", "en_us.8859-1", "Subtype mismatch: received subtype=%TYPE1%, expected subtype=%TYPE2%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE27", "en_us.8859-1", "Unknown or unsupported geometry data structure version (%VERSION%) found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE42", "en_us.8859-1", "Nearest-neighbor queries are not supported by the current version of the server."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE13", "en_us.8859-1", "Spatial DataBlade not installed correctly: the spatial_references table does not exist."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE43", "en_us.8859-1", "%PARAM1% value must be less than %PARAM2% value."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE44", "en_us.8859-1", "Unknown OGIS WKB byte-order byte encountered in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE45", "en_us.8859-1", "OGIS WKB geometry collection type is not supported."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE46", "en_us.8859-1", "Incompatible coordinate reference systems in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE15", "en_us.8859-1", "Invalid coordinate reference system object in function %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE47", "en_us.8859-1", "Cannot create SE_Metadata lohandle file %FILE%.  Check directory permissions."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE48", "en_us.8859-1", "SE_Metadata lohandle file %FILE% not found, unreadable, or corrupt.  Execute function SE_MetadataInit() to reinitialize."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE49", "en_us.8859-1", "%NAME% is a read only table."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE50", "en_us.8859-1", "Vertex not found in %FUNCTION%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE51", "en_us.8859-1", "SE_Metadata smart blob is corrupt or unreadable.  Execute function SE_MetadataInit() to repair."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE52", "en_us.8859-1", "SE_Metadata memory cache is locked.  Execute function SE_MetadataInit() to reinitialize."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE53", "en_us.8859-1", "Spatial datablade assert failure.  File = %FILE%, line = %LINE%."
);

insert into informix.syserrors
	(level, seqno, sqlstate, locale, message)
values
(
	0, 1, "USE54", "en_us.8859-1", "You must define a %NAME% sbspace before you can register the Spatial DataBlade."
);

insert into sysbldiprovided
	(bldi_id, bld_id)
values
(
	"Ispatial",
	"spatial.8.22.FC2"
);

insert into sysbldirequired
	(bldi_id, bld_id)
values
(
	"ifxrltree1",
	"spatial.8.22.FC2"
);

commit work;

