|
NGen
|
Classes | |
| struct | area_from_geometry_visitor |
| Measures whichever geometries enclose an area; anything else has none to give. More... | |
Enumerations | |
| enum class | AreaSource { attribute , geometry } |
| Where a catchment's areal extent is taken from when both are available. More... | |
Functions | |
| std::optional< double > | area_from_attribute (const geojson::Feature &feature) |
| The area attribute in km^2, where the feature carries it under either spelling. | |
| std::optional< double > | area_from_geometry (const geojson::geometry &geometry) |
| The area a feature's geometry encloses, in square kilometers, where it encloses one. | |
| double | area_sqkm (const geojson::Feature &feature, AreaSource preferred=AreaSource::attribute) |
| The areal extent of a catchment feature, in square kilometers. | |
Variables | |
| static const std::string | area_v2 = "area_sqkm" |
| Reading the hydrofabric attributes a feature is realized from. | |
| static const std::string | area_v1 = "areasqkm" |
| The area attribute as hydrofabric v1 spells it. | |
|
strong |
|
inline |
The area attribute in km^2, where the feature carries it under either spelling.
References area_v1, and area_v2.
Referenced by area_sqkm().
|
inline |
The area a feature's geometry encloses, in square kilometers, where it encloses one.
Read through the feature rather than copied out of it: a divide is large, and nothing measuring one needs to own it.
A non-positive result means the polygon is degenerate or wound the wrong way, which is no more an extent than no polygon at all.
References geometry.
Referenced by area_sqkm().
|
inline |
The areal extent of a catchment feature, in square kilometers.
A hydrofabric gives this twice over: as an attribute, and as the divide whose area can be measured. Either answers, so preferred decides only which is consulted first and the other still serves when it is absent. Nothing guarantees they are equal, so which one to use is a choice.
| feature | The hydrofabric feature a catchment is realized from. |
| preferred | Which source to consult first. Defaults to attribute. |
| std::invalid_argument | If the feature carries neither an area attribute nor a divide. |
References area_from_attribute(), area_from_geometry(), area_v1, area_v2, and attribute.
|
static |
The area attribute as hydrofabric v1 spells it.
Referenced by area_from_attribute(), and area_sqkm().
|
static |
Reading the hydrofabric attributes a feature is realized from.
The area attribute as hydrofabric v2 spells it; tried first, being the current one.
Referenced by area_from_attribute(), and area_sqkm().