Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
wdb:manuals:wdb_metadata [2012-04-04 19:39:20]
michaeloa
wdb:manuals:wdb_metadata [2013-09-11 17:25:50]
michaeloa [Spatial Reference ID]
Line 160: Line 160:
 ==== Add place Definitions ==== ==== Add place Definitions ====
  
-There are various differing functions to add a place definition to the database, depending on the type of place definition to be added. The function wci.addplacepoint is used for adding point data, while wci.addplaceregulargrid is used to define regular grids as follows.+There are various differing functions to add a place definition to the database, depending on the type of place definition to be added. The function wci.addplacepoint is used for adding point data, while wci.addplaceregulargrid is used to define regular grids as follows:
  
-  select wci.addplacepoint( 'oslo', +  select wci.addplacepoint('oslo', 
-                            'POINT(10.7564 59.9494)' );+                           st_geomfromtext('POINT(10.7464 59.9111)',4030));
  
-The first parameter in the function is the place name, while the second is the geographical position of the place definition in the default coordinate system of the WDB instance.+The first parameter in the function is the place name, while the second is the geographical position of the place definition in the default coordinate system of the WDB instance (as a binary geometry). Note that the SRID provided must be the same as the default PostGIS SRID used to build WDB (by default, this tends to be PostGIS ID 4030).
  
   select wci.addplaceregulargrid( 'ecmwf 0.5 grid',   select wci.addplaceregulargrid( 'ecmwf 0.5 grid',
Line 179: Line 179:
  
 The fifth parameter is a comment field. Ideally, it contains a few brief lines of text that describe and explain the data provider entity. The fifth parameter is a comment field. Ideally, it contains a few brief lines of text that describe and explain the data provider entity.
- 
 ==== Adding a Place Definition ==== ==== Adding a Place Definition ====
  
Line 188: Line 187:
 ==== Spatial Reference ID ====  ==== Spatial Reference ID ==== 
  
 +All SRIDs should always be defined with +no_defs.
 ==== Setting a Place Name ==== ==== Setting a Place Name ====
  
 +
 +
 +
 +
 +===== Parameters =====
 +
 +This section defines the metadata for parameters. 
 +
 +==== Definition ====
 +
 +The Parameter in WDB identifies the characteristic or measurable factor of the value being parameterized. Parameters provide a definitive description of what the data represents, including spatial and temporal properties. The parameter names are based around the NetCDF climate and forecast (CF) metadata conventions. Unfortunately, CF standard names are not well suited for the purposes of WDB, as they lack uniqueness; consequently, the WDB parameter system is only based on, rather than a direct adaption of the CF metadata convention. Every CF standard name should be possible to map directly to a WDB parameter, but the converse may not always be the case.
 +
 +Parameter names exist with a parameter namespace. A namespace can be defined by the WDB administrator, in order to permit the user or an application to retrieve data in an accustomed language or code set. The default namespace of WDB is the ParameterNameSpaceId 0, and is always based on English language names and maps CF standard names. The parameter namespace being used in a querying session can be defined by the user when starting up the session.
 +
 +==== Browse Parameters ====
 +
 +To retrieve all of the value parameters that are currently stored in the database for the currently specified namespace, the following wci.browse function call could be used:
 +
 +  SELECT * FROM wci.browse( NULL::wci.valueparameter );
 +
 +For the level parameters, use 
 +
 +  SELECT * FROM wci.browse( NULL::wci.levelparameter );
 +
 +To retrieve all of the ValueParameterNames and LevelParameterNames that the database currently has the capacity to store and display in the currently specified namespace, the following wci.info function call could be used:
 +
 +  SELECT * FROM wci.getparameter( NULL );
 +
 +==== Add Parameters ====
 +
 +To add a parameter to the database, the wci.addvalueparameter function is used. The default parameter name structure is constructed based on the [[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines|Guidelines for Constructing CF Standard Names]]. The function call for adding a parameter is as follows:
 +
 +  select wci.addparameter( 'standard-name',
 +            'surface',
 +            'component',
 +    'medium',
 +    'process',
 +    'condition',
 +            'methods',
 +    'unit of measure' )
 +
 +This gives a default parameter in the default namespace of:
 +
 +  single-word-surface component standard-name //at// multi-word-surface //in// medium //due to// process //assuming// condition [methods]
 +
 +Standard name is one of the CF standard names.
 +
 +[[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines#surface|Surface]] is defined as a function of a horizontal position. A new surface is added to the database using the wci.addcfsurface function, for example:
 +
 +  select wci.addcfsurface( 'sea level', 'MSL - mean sea level' )
 +
 +[[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines#component|Component]] defines the spatial component of the parameter. A new component is added to the database using the wci.addcfcomponent function, for example:
 +
 +  select wci.addcfcomponent( 'upward', 'Upward component' );
 +
 +[[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines#medium|Medium]] indicated the local medium or layer of the parameter. A new medium is added to the database using the wci.addcfmedium function. Example:
 +
 +  select wci.addcfmedium( 'atmosphere layer', 'Atmosphere layer medium' )
 +
 +[[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines#process|Process]] specifies a physical process. A new process is added to the database using the wci.addcfprocess function. Example:
 +
 +  select wci.addcfprocess( 'large scale precipitation', 'Due to large scale precipitation' )
 +
 +[[http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines#condition|Condition]] indicates special circumstances of the parameter. A new condition is added to the database using the wci.addcfcondition function. Example:
 +
 +  select wci.addcfcondition( 'deep snow', 'Assumption of deep snow' )
 +
 +Methods indicate the calculations used for the parameter. A new method is added to the database using the wci.addcfmethods function. Example:
 +
 +  select wci.addcfmethods('maximum within days', 'Maximum value', 'max' );
 +
 +Unit of measure is the standard unit of measure used by the parameter. WDB uses SI units defined using context-sensitive [[http://unitsofmeasure.org/|UCUM]].
 +
 +The default (canonical) parameter name is constructed using the various components described above.
 +
 +For examples of adding new parameters to WDB, see the [[https://github.com/wdb/wdb/blob/master/etc/metadata/wdb_parameter.in.sql|wdb_parameters]] install files.
 +
 +==== Set Parameter Names in Namespace ====
 +
 +The canonical parameter name is valid for the default (0) parameter name space only. To set the parameter name in other namespaces, the wci.setparametername function should be used. Example:
 +
 +  select wci.setparametername( 'air temperature', 'TEMP' );
 +
 +This sets a parameter name 'TEMP' in the currently defined namespace, which is equivalent to the canonical parameter 'air temperature'.
 +
 +If you are satisfied with using CF-like parameters, then the function wci.copyParameterNameSpace( 0 ) can be used to copy all of the parameters in the default namespace into the currently defined parameter namespace. 
 +
 +  select wci.copyParameterNameSpace( 0 )
 +
 +Parameters created using this method are similar to the CF standard name, except that the short form of the CF methods precedes the CF standard name in order to generate a more natural language parameter description. Thus 'air temperature [maximum over days]' becomes 'max air temperature'.
 +
 +For an example of adapting and adding parameters to a private parameter namespace, see the [[https://github.com/metno/wdb-metadata/blob/master/etc/wdb_parameter.in.sql|Met.no WDB metadata files]].
  • wdb/manuals/wdb_metadata.txt
  • Last modified: 2022-05-31 09:29:32
  • (external edit)