NGen
Loading...
Searching...
No Matches
ngen::hydrofabric::HydrofabricReader Class Referenceabstract

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~HydrofabricReader()

virtual ngen::hydrofabric::HydrofabricReader::~HydrofabricReader ( )
virtualdefault

Member Function Documentation

◆ read_divides()

virtual geojson::GeoJSON ngen::hydrofabric::HydrofabricReader::read_divides ( const std::vector< std::string > & ids = {})
pure virtual

Read the hydrofabric's divides.

Parameters
[in]idsOptional 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.
Returns
geojson::GeoJSON Collection of divide features
Exceptions
std::runtime_errorif the divides cannot be read

Implemented in ngen::hydrofabric::GeoJSONHydrofabricReader, ngen::hydrofabric::GeoPackageHydrofabricReader, and ngen::hydrofabric::V4_0Beta1GeoPackageHydrofabricReader.

◆ read_nexus()

virtual geojson::GeoJSON ngen::hydrofabric::HydrofabricReader::read_nexus ( const std::vector< std::string > & ids = {})
pure virtual

Read the hydrofabric's nexuses.

Parameters
[in]idsOptional subset of nexus IDs to capture; if empty, all nexuses are read. IDs that the hydrofabric does not contain are silently ignored.
Returns
geojson::GeoJSON Collection of nexus features
Exceptions
std::runtime_errorif the nexuses cannot be read

Implemented in ngen::hydrofabric::GeoJSONHydrofabricReader, and ngen::hydrofabric::GeoPackageHydrofabricReader.


The documentation for this class was generated from the following file: