Currently the GeneralCsv and Database import require a table layout description configured by the user. Non-standard imports (plug-ins) can also require a table layout. See the third party documentation of the specific import.
There are different types of table structures supported.
- Every parameter has its own column
- Every location has its own column.
- Every qualifier has its own column.
- Every parameter/location/qualifier combination has its own column
- Single value column and a parameter, location, qualifier and unit column to describe the value in the value column.
- All values for a single month a listed in a single row, for every day of month there is separate column.
- All values for a single day listed in a single row, for every time of day there is separate column.
- Variants and combinations of the above are sometimes allowed
The column names are required for the GeneralCsv and Database import. The table name is ignored by the GeneralCsv import. Non-standard imports can ignore the column name. They expect that the order of the columns in the configuration is the same as in the file. For columns that should be ignored add a skippedColumn element in this case. When the column name is used by the import the order of the columns in the configuration has no meaning and there is no need to add a skippedColumn for the unwanted columns. For the Database import you can specify multiple tables. This has the advantage that you can reuse a database connection to import multiple tables.
A value column can have a fixed location id or every row can have a different location id when there is a location column. The same is true for the parameter id and qualifiers.
A value column can have a fixed unit or every row can have a different unit when there is a unit column.
The date/time is available in a combined data/time column or in two separated date and time columns. It is required to configure the data and time patterns when date/time is stored in a text column instead of timestamp column. The value columns can also contain a day of month or hour of day attribute. This attribute overrules the day or time provided by the date/time column. These attributes are used when all data for whole month or day is combined in a single row.
When the imported table contains grid files you have to specify the parser to parse these grids. Any grid format supported by the import module can be used.
Only one flag and comment column is allowed also when you have multiple value columns. All values in single row share the same flag and comment.
data time pattern
The date time patterns are handled by the JDK class SimpleDateFormat
Date or Time
Month in year
July; Jul; 07
Week in year
Week in month
Day in year
Day in month
Day of week in month
Day name in week
Day number of week (1 = Monday, ..., 7 = Sunday)
Hour in day (0-23)
Hour in day (1-24)
Hour in am/pm (0-11)
Hour in am/pm (1-12)
Minute in hour
Second in minute
General time zone
Pacific Standard Time; PST; GMT-08:00
RFC 822 time zone
ISO 8601 time zone
-08; -0800; -08:00
date pattern is not required because the date column is a SQL time stamp column
An example on how to add flagSourceColumns is shown below. This is possible since FEWS version 2015.02.
Sample, properties and qualifiers example
Since 2014.02 it is possible to use sampleIdColumn (normal ComplexColumnType with just name attribute), propertyColumn (with mandatory key attribute) and attribute column (with mandatory id attribute) which can only be used for export since attributes can not be imported but only configured. qualifierColumn is extended with the optional prefix attribute which will be added in front of the external qualifier id, this can be useful for id mapping.
Below configuration is shown which can import sample data, with properties and multiple qualifiers. In case sample data is imported the properties will be automatically used for the sample instead of the time step.
Below configuration is shown which can export sample data, with properties, multiple qualifiers and attributes.
The qualifier columns use the prefix to recognise from the external id which qualifier should be put in the column. When the qualifier is found, the prefix will be stripped from the external id.
The attribute column will check the location, parameter and qualifiers for an attribute with the configured id and export the value to the column.