pytuflow.GPKG2D#
- class GPKG2D(fpath)#
Bases:
GPKGBase
,TimeSeries
,ITimeSeries2D
Class for handling 2D GeoPackage time series results (
.gpkg
- typically ending with_2D.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
GPKG2D
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 theGPKG2D
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 aGPKG2D
file.
Examples
>>> from pytuflow import GPKG2D >>> res = GPKG2D('path/to/file_2D.gpkg')
Querying all the available data types:
>>> res.data_types() ['flow', 'velocity', 'water level']
Querying all PO line data types:
>>> res.data_types('line') ['flow']
Querying all PO IDs:
>>> res.ids() ['po_point', 'po_line']
Querying all PO point IDs:
>>> res.ids('point') ['po_point']
Getting the water level time series from the PO point
po_point
:>>> res.time_series('po_point', 'water level') time po/water level/po_point 0.000000 39.073 0.016667 39.073 0.033333 39.073 0.050000 39.073 0.066667 39.073 ... ... 2.933333 40.566 2.950000 40.546 2.966667 40.526 2.983333 40.506 3.000000 40.485
- __init__(fpath)#
- Parameters:
fpath (Path | str)
Methods
Not supported for
GPKG2D
results.Returns all the available data types (result types) for the given filter.
Returns all the available IDs for the given filter.
Returns a DataFrame containing the maximum values for the given data types.
Not supported for
GPKG2D
results.Not supported for
GPKG2D
results.Returns a time-series DataFrame for the given location(s) and data type(s).
Returns all the available times for the given filter.
Attributes
The path to the source output file.
The unit system used in the output file.
the format version
The result name
The reference time for the output
PO/2D output objects.
RL output objects.
Number of 2d points
Number of 2d lines
Number of 2d polys
Number of reporting location points
Number of reporting location lines
Number of reporting location polys