|
NGen
|
Reads the catchment and nexus features of a hydrofabric, whatever format it is stored in. More...
#include <HydrofabricReader.hpp>
Inheritance diagram for ngen::hydrofabric::HydrofabricReader:
Collaboration diagram for ngen::hydrofabric::HydrofabricReader:Public Member Functions | |
| virtual | ~HydrofabricReader ()=default |
| virtual geojson::GeoJSON | read_divides (const std::vector< std::string > &ids={})=0 |
| Read the hydrofabric's divides. | |
| virtual geojson::GeoJSON | read_nexus (const std::vector< std::string > &ids={})=0 |
| Read the hydrofabric's nexuses. | |
Reads the catchment and nexus features of a hydrofabric, whatever format it is stored in.
A hydrofabric is a pair of roles – the divides (catchments) and the nexuses they drain to – and those roles may live in one file or two. Implementations own whatever handles that takes and present the pair here, so a caller loading a hydrofabric neither opens files nor knows which format it was handed.
The interface deliberately names roles rather than layers. A GeoPackage hydrofabric keeps its roles in named tables, but a GeoJSON hydrofabric has no layers at all – its roles are two whole files – so a layer-keyed interface could only be honored by one of the two. Reading some other table of a GeoPackage is a different job, served directly by ngen::geopackage::GeoPackageReader.
|
virtualdefault |
|
pure virtual |
Read the hydrofabric's divides.
| [in] | ids | Optional subset of divide IDs to capture; if empty, all divides are read. IDs that the hydrofabric does not contain are silently ignored, so the result is the intersection of the hydrofabric and ids. |
| std::runtime_error | if the divides cannot be read |
Implemented in ngen::hydrofabric::GeoJSONHydrofabricReader, ngen::hydrofabric::GeoPackageHydrofabricReader, and ngen::hydrofabric::V4_0Beta1GeoPackageHydrofabricReader.
|
pure virtual |
Read the hydrofabric's nexuses.
| [in] | ids | Optional subset of nexus IDs to capture; if empty, all nexuses are read. IDs that the hydrofabric does not contain are silently ignored. |
| std::runtime_error | if the nexuses cannot be read |
Implemented in ngen::hydrofabric::GeoJSONHydrofabricReader, and ngen::hydrofabric::GeoPackageHydrofabricReader.