GPKG Time Series Format Specification

From Tuflow
Revision as of 02:58, 10 November 2023 by Ellis Symons (talk | contribs)
Jump to navigation Jump to search

The below section lists the TUFLOW GPKG time series format specification. The specification sits ontop of the GPKG v1.2 Specification with two additional required tables. The below lists the details of the additional tables with examples. The examples are based a the 1D/2D linked TUFLOW-SWMM example model based on TUFLOW's module 6 tutorial model - M06_5m_003.tcf.

TUFLOW Time Series Version

An additional table called TUFLOW_timeseries_version should be present in the GPKG. This table contains the version number of the TUFLOW GPKG time series format and should be set to 1.0.0. The table should have the following columns:

Column Name Type Description
Version TEXT Major.Minor.Patch version number

Time Series Info

An additional table called Timeseries_info should be present in the GPKG. The purpose of this table is to list the available result types and relevant information for each type. The table should have the following columns:

Column Name Type Description
row INTEGER Primary key
Table_name TEXT Reference to the GIS table that the result sits within
Count INTEGER Number of unique elements
Reference_time TEXT Reference time in the form of: [UNITS] since YYYY-MM-DD hh:mm:ss
dt FLOAT Output timestep (units defined in Reference_time)
Column_name TEXT Name of the column in the GIS table containing the result
Series_name TEXT Name of the result type
Series_units TEXT Result type units

GIS Layers

The results are stored in GPKG layers, typically between 1 - 3 layers are stored in the result file depending on the output (one for point results, one for line results, one for polygon results). There is no requirement against storing results from multiple model runs in a single GPKG, this is just not typically how outputs are written.

The column names of the GPKG layers should follow the convention below:

Column Name Type Description
fid INTEGER Primary key
geometry GEOMETRY GeoPackage Geometry
ID TEXT Element ID (e.g. Pipe1)
Type TEXT Element Type (e.g. CONDUIT)
Source TEXT Result Source (e.g. SWMM)
TimeId INTEGER Unique id for each timestep
Time_relative FLOAT Output relative time (reference time and units in Timeseries_info)
Datetime DATETIME Output time in datetime
...[column for each result type for that given geometry type - examples below]
Flow FLOAT Result flow
Velocity FLOAT Result velocity