Changes between Initial Version and Version 1 of Model Results Spain


Ignore:
Timestamp:
Mar 16, 2012 4:32:38 PM (13 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Model Results Spain

    v1 v1  
     1back to the first page[..][[BR]] 
     2 
     3CREATE TABLE rht.model_mod 
     4( 
     5  mod_id serial NOT NULL, 
     6  mod_name character varying(30) NOT NULL, 
     7  mod_date date, 
     8  mod_description text NOT NULL, 
     9  mod_location character varying(25), -- Geographical area to which the model is applied, should be consistent with europe.wso 
     10  mod_formula text, 
     11  CONSTRAINT model_mod_pkey PRIMARY KEY (mod_id), 
     12  CONSTRAINT model_mod_mod_name_key UNIQUE (mod_name) 
     13); 
     14 
     15DROP TABLE IF EXISTS rht.resultmodel; 
     16CREATE TABLE rht.resultmodel 
     17( 
     18  res_id serial NOT NULL, 
     19  res_id_drain integer, 
     20  res_value double precision, 
     21  res_mod_id integer, 
     22  CONSTRAINT resultmodel_pkey PRIMARY KEY (res_id), 
     23  CONSTRAINT c_fk_res_mod_id FOREIGN KEY (res_mod_id) 
     24      REFERENCES rht.model_mod (mod_id) MATCH SIMPLE 
     25      ON UPDATE NO ACTION ON DELETE NO ACTION 
     26); 
     27 
     28drop table if exists rht.resultmodelBasque; 
     29create table ccm21.resultmodelBasque as ( 
     30select sub1.*, 
     31        sub2.res_value as mpa 
     32          from 
     33        (select wso1_id,dmer,dsource,res_value as mpa, the_geom from ccm21.riversegments join ccm21.resultmodel on res_wso1_id=wso1_id where  
     34        res_mod_id=12) as sub1 
     35join 
     36        (select wso1_id, res_value from ccm21.riversegments join ccm21.resultmodel on res_wso1_id=wso1_id where  
     37        res_mod_id=15) as sub2 
     38        on sub1.wso1_id=sub2.wso1_id 
     39); 
     40 
     41create index indextableresultmod on ccm21.resultmodelBasque using gist(the_geom);