pytuflow.GPKGRL

pytuflow.GPKGRL#

class GPKGRL(fpath)#

Bases: GPKG2D

Class for handling RL GeoPackage time series results (.gpkg - typically ending with _RL.gpkg). The GPKG time series format is a specific format published by TUFLOW built on the GeoPackage standard.

This class can be used to initialise stand-alone GPKG result files, however it is not required to be used if loading GPKG results via the TPC class which will load all domains automatically (i.e. GPKG1D, GPKG2D, GPKGRL).

The GPKGRL class will only load basic properties on initialisation. These are typically properties that are easy to obtain from the file without having to load any of the time-series results. Once a method requiring more detailed information is called, the full results will be loaded. This makes the GPKGRL class very cheap to initialise.

Parameters:

fpath (PathLike) – The path to the output (.gpkg) file.

Raises:

ResultTypeError – Raises pytuflow.results.ResultTypeError if the file does not look like a GPKGRL file.

Examples

>>> from pytuflow import GPKGRL
>>> res = GPKGRL('path/to/GPKG_RL.gpkg')

Querying all the available data types:

>>> res.data_types()
['flow', 'water level', 'volume']

Querying all RL IDs:

>>> res.ids()
['rl_point', 'rl_line', 'rl_poly']

Getting the water level time series from the RL point rl_point:

>>> res.time_series('rl_point', 'water level')
time      rl/water level/rl_point
0.000000                      NaN
0.016667                      NaN
0.033333                      NaN
0.050000                      NaN
0.066667                      NaN
...                           ...
2.933333                   40.147
2.950000                   40.133
2.966667                   40.116
2.983334                   40.101
3.000000                   40.084
__init__(fpath)#
Parameters:

fpath (Path | str)

Methods

connect

curtain

Not supported for GPKGRL results.

data_types

Returns all the available data types (result types) for the given filter.

ids

Returns all the available IDs for the given filter.

maximum

Returns a DataFrame containing the maximum values for the given data types.

profile

Not supported for GPKGRL results.

section

Not supported for GPKGRL results.

time_series

Returns a time-series DataFrame for the given location(s) and data type(s).

times

Returns all the available times for the given filter.

Attributes

ATTRIBUTE_TYPES

DOMAIN_TYPES

GEOMETRY_TYPES

ID_COLUMNS

fpath

The path to the source output file.

units

The unit system used in the output file.

format_version

the format version

name

The result name

reference_time

The reference time for the output

po_objs

PO/2D output objects.

rl_objs

RL output objects.

po_point_count

Number of 2d points

po_line_count

Number of 2d lines

po_poly_count

Number of 2d polys

rl_point_count

Number of reporting location points

rl_line_count

Number of reporting location lines

rl_poly_count

Number of reporting location polys