Metadata Setup Example
Updated 855 Days AgoPublic

metadata.sql
--
-- Base Metadata File for a WDB instance
-- Run these commands on the database after a clean install of WDB has completed
-- 
-- psql -d wdb -f base-metadata.sql
-- 
-- For later additions to the metadata, we suggest creating timestamped files and run them on the database.
-- (For a later clean install, you can then recreate the operational database by running base-metadata first, and then the timestamped files in sequence)
--

-- Define Base Namespace
select wci.begin( 'wdb' );

-- Reference Organization
SELECT wci.addOrganization( 'MyMET', 'met.me', 'government organization', '2000-01-01', '2999-12-31', 'MyMET' );

-- Reference Person
SELECT wci.addPerson( 'Jane', 'Doe', '', '', 'MET', NULL, 'female', NULL, NULL, '2000-01-01', '2999-12-31', NULL );

SELECT wci.addNameSpace( 1, 'MyMET standard namespace', 'The standard namespace used for MyMET applications that do not utilize the default WDB namespace', 'production', 'met.me', 'MET', '2000-01-01' );

-- Set the Default Namespace of this WDB instance
SELECT wci.setDefaultNameSpace( '', 1, 1, 1 );


-- Switch to new Namespace
SELECT wci.begin('wdb', 1, 1, 1 );


--
-- Add Data Providers
--

SELECT wci.adddataprovider( 'mymodel', 'computer system', 'grid', '1 day', 'MyModel model' );


--
-- Add Grid Spatial Reference IDs
--

select wci.addsrid( 'Raw Lambert Conformal SRID', '+proj=lcc +lat_0=53.5 +lon_0=5 +lat_1=53.5 +lat_2=53.5 +no_defs +R=6.371e+06' );
select wci.addsrid( 'Hirlam Rotated SRID', '+proj=ob_tran +o_proj=longlat +lon_0=-30 +o_lat_p=30 +R=6.371e+06 +no_defs' );

-- 
-- Place Grids
--

SELECT wci.addplaceregulargrid('Raw Lambert Conformal', 529, 489, 2500, 2500, -1.48246e+06, -537624, '+proj=lcc +lat_0=53.5 +lon_0=5 +lat_1=53.5 +lat_2=53.5 +no_defs +R=6.371e+06' );
SELECT wci.addplaceregulargrid('Hirlam Rotated 500m Temperature', 757, 1090,  0.00449944, 0.00449991, 11.3, -6.9, '+proj=ob_tran +o_proj=longlat +lon_0=-30 +o_lat_p=30 +R=6.371e+06 +no_defs');


--
-- Place Points
--
SELECT wci.addorupdateplacepoint ( 'My Observatory', st_geomfromtext('POINT(10.2433 51.9381)',4030 ), '1970-01-01Z','infinity');


-- 
-- Parameters
-- 

-- Copy parameters from default namespace to 1
SELECT wci.copyParameterNameSpace( 0 );

-- Add special parameters
SELECT wci.addparameter( 'kalman air temperature', null, null, null, null, null, null, 'K' );
SELECT wci.addcfmethods('low estimate', 'lower estimate', 'low estimate of' );
SELECT wci.addparameter( 'precipitation amount', null, null, null, null, null, 'low estimate', 'kg/m2' );
SELECT wci.addcfmethods('middle estimate', 'middle estimate', 'middle estimate of' );
SELECT wci.addparameter( 'precipitation amount', null, null, null, null, null, 'middle estimate', 'kg/m2' );
SELECT wci.addcfmethods('high estimate', 'higher estimate', 'high estimate of' );
SELECT wci.addparameter( 'precipitation amount', null, null, null, null, null, 'high estimate', 'kg/m2' );
SELECT wci.addparameter( 'probability of precipitation', null, null, null, null, null, null, '%' );
Last Author
michaeloa
Subscribers
None
Projects
None