--
-- POINTS
--
-- Create Point Table
CREATE  TABLE GIS_ADMIN.GIS_GRUEN_P
(
    GID              NUMBER(8, 0)                  DEFAULT 0    NOT NULL
  , GEO_ID           NUMBER(8, 0)                  DEFAULT 0    
  , THE_GEOM         MDSYS.SDO_GEOMETRY            DEFAULT NULL NULL
)
;

ALTER TABLE GIS_ADMIN.GIS_GRUEN_P ADD CONSTRAINT PK_GIS_GRUEN_P PRIMARY KEY  ( GID ) 
;




-- Sequences for the Triggers
CREATE SEQUENCE GIS_ADMIN.SEQ_GID_GIS_GRUEN_P MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
;




--Insert USER_SDO_GEOM_METADATA
INSERT INTO MDSYS.USER_SDO_GEOM_METADATA (
  TABLE_NAME 
, COLUMN_NAME 
, DIMINFO 
, SRID 
) VALUES ( 
  'GIS_GRUEN_P' 
, 'THE_GEOM' 
,  MDSYS.SDO_DIM_ARRAY( 
                         MDSYS.SDO_DIM_ELEMENT('X',-2147483648,2147483647,0.00005) 
                        ,MDSYS.SDO_DIM_ELEMENT('Y',-2147483648,2147483647,0.00005) 
                      ) 
, 25832
) 
;
 CREATE INDEX GIS_ADMIN.GIS_GRUEN_P_THE_GEOM_IDX ON GIS_ADMIN.GIS_GRUEN_P(THE_GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX 
;

--
--LINES
--
-- Create Line Table
CREATE  TABLE GIS_ADMIN.GIS_GRUEN_L
(
    GID              NUMBER(8, 0)                  DEFAULT 0    NOT NULL
  , GEO_ID           NUMBER(8, 0)                  DEFAULT 0    
  , THE_GEOM         MDSYS.SDO_GEOMETRY            DEFAULT NULL NULL
)
;

ALTER TABLE GIS_ADMIN.GIS_GRUEN_L ADD CONSTRAINT PK_GIS_GRUEN_L PRIMARY KEY  ( GID ) 
;



-- Sequences for the Triggers
CREATE SEQUENCE GIS_ADMIN.SEQ_GID_GIS_GRUEN_L MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
;



--Insert USER_SDO_GEOM_METADATA
INSERT INTO MDSYS.USER_SDO_GEOM_METADATA (
  TABLE_NAME 
, COLUMN_NAME 
, DIMINFO 
, SRID 
) VALUES ( 
  'GIS_GRUEN_L' 
, 'THE_GEOM' 
,  MDSYS.SDO_DIM_ARRAY( 
                         MDSYS.SDO_DIM_ELEMENT('X',-2147483648,2147483647,0.00005) 
                        ,MDSYS.SDO_DIM_ELEMENT('Y',-2147483648,2147483647,0.00005) 
                      ) 
, 25832
) 
;
 CREATE INDEX GIS_ADMIN.GIS_GRUEN_L_THE_GEOM_IDX ON GIS_ADMIN.GIS_GRUEN_L(THE_GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX 
;




--
-- POLYGONS
--
-- Create Polygon Table
CREATE  TABLE GIS_ADMIN.GIS_GRUEN_F
(
    GID              NUMBER(8, 0)                  DEFAULT 0    NOT NULL
  , GEO_ID           NUMBER(8, 0)                  DEFAULT 0    
  , THE_GEOM         MDSYS.SDO_GEOMETRY            DEFAULT NULL NULL
)
;

ALTER TABLE GIS_ADMIN.GIS_GRUEN_F ADD CONSTRAINT PK_GIS_GRUEN_F PRIMARY KEY  ( GID ) 
;



-- Sequences for the Triggers
CREATE SEQUENCE GIS_ADMIN.SEQ_GID_GIS_GRUEN_F MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
;



--Insert USER_SDO_GEOM_METADATA
INSERT INTO MDSYS.USER_SDO_GEOM_METADATA (
  TABLE_NAME 
, COLUMN_NAME 
, DIMINFO 
, SRID 
) VALUES ( 
  'GIS_GRUEN_F' 
, 'THE_GEOM' 
,  MDSYS.SDO_DIM_ARRAY( 
                         MDSYS.SDO_DIM_ELEMENT('X',-2147483648,2147483647,0.00005) 
                        ,MDSYS.SDO_DIM_ELEMENT('Y',-2147483648,2147483647,0.00005) 
                      ) 
, 25832
) 
;
 CREATE INDEX GIS_ADMIN.GIS_GRUEN_F_THE_GEOM_IDX ON GIS_ADMIN.GIS_GRUEN_F(THE_GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX 
;


