Returned objects
pourpoint.Subbasin
dataclass
Bases: Feature
A whole source catchment polygon or multipolygon, not a refined contribution.
id: int
property
Supplied source ID, not a target name or an index into a result list.
wkb: bytes
property
Original source geometry bytes; missing geometry raises ValueError.
geometry: BaseGeometry
property
Decode source WKB in EPSG:4326 without repair or simplification.
Empty geometry or a geometry type inappropriate for this feature raises
ValueError; malformed WKB raises a Shapely decoding error.
attributes: Attributes
property
Supplied non-geometry fields with original values, nulls and metadata.
pourpoint.River
dataclass
Bases: Feature
A source river line or multiline with supplied attributes, not inferred order.
id: int
property
Supplied source ID, not a target name or an index into a result list.
wkb: bytes
property
Original source geometry bytes; missing geometry raises ValueError.
geometry: BaseGeometry
property
Decode source WKB in EPSG:4326 without repair or simplification.
Empty geometry or a geometry type inappropriate for this feature raises
ValueError; malformed WKB raises a Shapely decoding error.
attributes: Attributes
property
Supplied non-geometry fields with original values, nulls and metadata.
pourpoint.SourceNode
dataclass
Bases: Feature
A supplied river-node point, distinct from a clipped river endpoint.
id: int
property
Supplied source ID, not a target name or an index into a result list.
wkb: bytes
property
Original source geometry bytes; missing geometry raises ValueError.
geometry: BaseGeometry
property
Decode source WKB in EPSG:4326 without repair or simplification.
Empty geometry or a geometry type inappropriate for this feature raises
ValueError; malformed WKB raises a Shapely decoding error.
attributes: Attributes
property
Supplied non-geometry fields with original values, nulls and metadata.
pourpoint.RiverNetwork
dataclass
River features and their supplied directed relationships and nodes.
Attributes:
| Name | Type | Description |
|---|---|---|
rivers |
list[River]
|
Individual source rivers or clipped river pieces. Clipped pieces retain source identity and attributes; source quantities are not recomputed. |
relationships |
Table
|
Arrow relationship rows for selected rivers, including references to unselected neighbors. Incidence is not a substitute for directed flow. |
nodes |
list[SourceNode]
|
Available source nodes; new clipping endpoints are not source nodes. |
node_relationships |
Table | None
|
Supplied node relationship rows, or |
declarations |
Mapping[str, object]
|
Publication declarations retaining relationship target domains and meanings. |
Notes
Neighbor IDs absent from rivers remain boundary references, not evidence
of natural termination. Materialized networks survive fabric closure.
geometry: BaseGeometry
property
Union of current river linework in EPSG:4326, empty for no rivers.
This display geometry does not replace individual identities or directed relationships and may dissolve overlapping linework.
boundary_river_ids: frozenset[int]
property
Supplied upstream/downstream neighbor IDs absent from rivers.
pourpoint.SubbasinContribution
dataclass
A contributing polygonal portion retaining its whole source unit.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
Subbasin
|
Original sub-basin with unchanged attributes, metadata and source WKB. |
geometry |
BaseGeometry
|
Derived contribution in EPSG:4326. Source area and other quantities are not recomputed for this geometry. Materialized portions survive closure. |
id: int
property
Original source sub-basin ID.
attributes: Attributes
property
Unchanged source attributes, including nulls and original quantities.
pourpoint.OutletCell
dataclass
A selected cell addressed on the original native raster grid.
Attributes:
| Name | Type | Description |
|---|---|---|
grid |
RasterGrid
|
Source grid identity, CRS, affine transform and dimensions. |
row, col |
Zero-based source-grid indices, not offsets within a read window. |
center: Point
property
Cell center in the native grid CRS; a display location, not a station correction.
geometry: Polygon
property
Cell boundary polygon derived from the native grid affine transform.
pourpoint.RasterSubset
dataclass
Materialized native raster window with the refinement mask.
Attributes:
| Name | Type | Description |
|---|---|---|
window |
RasterWindow
|
Retained paired-band values, validity, native CRS and affine transform. |
mask |
NDArray[bool_]
|
Boolean array aligned with the window; True admits cells in the whole vector delineation mask, not just cells in the final watershed. |
band |
Literal['direction', 'accumulation']
|
Selects direction or accumulation values for export. |
Notes
Export keeps source values at valid masked cells and uses source nodata elsewhere. The window is already read, not a deferred fabric request.
pourpoint.RefinementRasters
dataclass
Paired raster subsets over the same whole vector mask.
Attributes:
| Name | Type | Description |
|---|---|---|
direction, accumulation |
Native-grid subsets for the corresponding bands. Neither is restricted to the final contributing watershed. Source values and nodata are retained. |
pourpoint.GranularRefinement
dataclass
Point refinement partitioned at original sub-basin boundaries.
Attributes:
| Name | Type | Description |
|---|---|---|
subbasins |
list[SubbasinContribution]
|
Nonempty contributing portions in source input order, with unchanged source identity and attributes. Geometries use EPSG:4326. |
geometry |
Polygon | MultiPolygon
|
Dissolved watershed boundary in EPSG:4326, topologically equivalent to
merging |
outlet_cell |
OutletCell
|
Selected source-grid cell, whose geometry uses the native raster CRS. |
rasters |
RefinementRasters
|
Materialized band subsets over the complete combined vector mask. |
provenance |
Mapping[str, object]
|
Source manifest declarations; not proof of vector/raster equivalence. |
coverage |
UpstreamCoverage
|
Retained source-network coverage assessment when refining a
|
pourpoint.FootprintRefinement
dataclass
Point refinement returned as one merged footprint.
Attributes:
| Name | Type | Description |
|---|---|---|
geometry |
Polygon | MultiPolygon
|
Polygon or MultiPolygon contribution in EPSG:4326, not a fabricated source sub-basin. Equivalent to merging granular refinement of the same combined mask and target. |
outlet_cell |
OutletCell
|
Selected source-grid cell in the native raster CRS. |
rasters |
RefinementRasters
|
Materialized band subsets over the complete input vector mask. |
provenance |
Mapping[str, object]
|
Source manifest declarations; not proof of vector/raster equivalence. |
coverage |
UpstreamCoverage
|
Explicit source-network coverage assessment ( |
pourpoint.Target
dataclass
One accepted batch target, independent of source feature identity.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
int
|
Zero-based position in the original input order. |
name |
str
|
Dictionary key or UUID generated once for a list entry. Preserved by subsequent batch refinement and export; list calls get new names. |
geometry |
BaseGeometry
|
Original target geometry in EPSG:4326, including multipart targets. |
pourpoint.BatchIssue
dataclass
An expected failure attached to one batch input.
Attributes:
| Name | Type | Description |
|---|---|---|
index, name |
Original target position and name, matching the batch target metadata. |
|
code |
str
|
Machine-readable code with the same meaning as |
reason |
str
|
Human-readable failure explanation. |
pourpoint.BatchResult
dataclass
Ordered results and durable target-local failures.
Attributes:
| Name | Type | Description |
|---|---|---|
results |
list[T | None]
|
One slot per input. None means failure, not a valid empty selection.
Successful slots carry typed results such as |
targets |
list[Target]
|
Input identities in the same order as result slots. Duplicate geometries retain independent identities. |
issues |
list[BatchIssue]
|
Expected failures with input position, name, code and reason. Fatal configuration or integrity errors raise instead of returning this object. |
pourpoint.UpstreamCoverage
dataclass
Source-network connectivity completeness assessment for a selected closure.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
CoverageStatus
|
Source-network coverage classification across all visited units in the inclusive upstream closure:
|
declared_completeness |
DeclaredCompleteness | None
|
Manifest |
cuts_column |
str | None
|
Declared source catchment integer column used to inspect per-unit
upstream cuts, or |
cut_counts |
Mapping[int, int] | None
|
Immutable mapping of catchment ID to positive immediate upstream cut
count for affected visited units, sorted by ID. Empty when assessed with
no cuts; |
unverified_unit_ids |
tuple[int, ...] | None
|
Sorted unique catchment IDs whose declared cut count was null. Empty
when assessed with no unverified units; |
reason |
str | None
|
Human-readable explanation when |
Notes
This assessment describes source-network coverage of the selected vector closure relative to the HFX declarations, not vector/raster equivalence or real-world watershed area. It survives fabric closure and optional raster refinement without recertifying the raster output.
is_complete: bool
property
True only when source-network coverage is verified "complete".
cut_unit_ids: tuple[int, ...] | None
property
Sorted IDs of visited units with positive cut counts, or None when not assessed.
total_cuts: int | None
property
Sum of immediate upstream cut counts across affected units, or None when not assessed.
pourpoint.SelectionResult
dataclass
Whole-unit upstream catchment selection with attached source-network coverage.
Attributes:
| Name | Type | Description |
|---|---|---|
subbasins |
list[Subbasin]
|
Selected whole source units in traversal order (empty for an empty target geometry). Materialized vectors survive fabric closure. |
coverage |
UpstreamCoverage
|
Source-network completeness diagnostics across the inclusive upstream
closure. Passing this object to |
level |
int
|
Nonnegative catchment level queried for this selection. |
target |
BaseGeometry
|
EPSG:4326 target geometry used for selection. |
provenance |
Mapping[str, object]
|
Source manifest declarations, not a certification of raster equivalence or recomputed hydrological quantities. |
pourpoint.DelineationResult
dataclass
Materialized outputs of one convenience delineation.
Attributes:
| Name | Type | Description |
|---|---|---|
subbasins |
list[Subbasin | SubbasinContribution]
|
Whole source units without refinement; contributing portions otherwise. Source attributes on portions are not recomputed for their smaller area. |
geometry |
Polygon | MultiPolygon | None
|
EPSG:4326 polygon union when merging was requested, otherwise None. |
outlet_cell |
OutletCell | None
|
Selected native raster cell when refined, otherwise None. |
rasters |
RefinementRasters | None
|
Materialized raster subsets over the whole vector mask used in refinement, otherwise None. They are not cropped to the final watershed. |
original_target |
BaseGeometry
|
Input geometry in EPSG:4326 before optional vector snapping. |
target |
BaseGeometry
|
EPSG:4326 target after optional vector snapping. Raster outlet adjustment
is represented separately by |
provenance |
Mapping[str, object]
|
Source manifest declarations, not a certification of vector/raster equivalence or recomputed hydrological quantities. |
coverage |
UpstreamCoverage
|
Source-network coverage assessment of the selected upstream closure, retained unchanged through optional refinement and merging. |
pourpoint.OperationError
Bases: Exception
An expected target-local failure shared by single and batch calls.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
Stable machine-readable operation code; conditions are documented on the operation that raises it. |
|
reason |
Human-readable explanation, also used as the exception message. |
Notes
Batch operations collect this exception only. Configuration, integrity and unexpected errors propagate rather than becoming target issues.