This object contains the node indexes as well as the row and col indices for individual channel segments. More...
#include <LSDIndexChannel.hpp>
Public Member Functions | |
LSDIndexChannel () | |
The create function. This is default and throws an error. | |
LSDIndexChannel (int StartNode, int EndNode, LSDFlowInfo &FlowInfo) | |
Create LSDIndexChannel object between a start and end node. More... | |
LSDIndexChannel (int StartJunction, int StartNode, int EndJunction, int EndNode, LSDFlowInfo &FlowInfo) | |
Create LSDIndexChannel object between starting junction and node and ending junction and node. More... | |
LSDIndexChannel (vector< float > &X_coords, vector< float > &Y_coords, LSDFlowInfo &FlowInfo, float threshold_area, float threshold_distance) | |
int | get_StartJunction () const |
int | get_EndJunction () const |
int | get_StartNode () const |
int | get_EndNode () const |
int | get_NRows () const |
int | get_NCols () const |
float | get_XMinimum () const |
float | get_YMinimum () const |
float | get_DataResolution () const |
int | get_NoDataValue () const |
map< string, string > | get_GeoReferencingStrings () const |
vector< int > | get_RowSequence () const |
vector< int > | get_ColSequence () const |
vector< int > | get_NodeSequence () const |
int | get_n_nodes_in_channel () const |
void | get_row_column_of_end_node (LSDFlowInfo &FlowInfo, int &row, int &col) |
gets the row and column of the end node More... | |
int | get_node_in_channel (int n_node) |
This gets the node index at a given node in the index channel. More... | |
void | truncate_final_node () |
This removes the final node in a channel. More... | |
int | get_contributing_pixels_at_node (int n_node, LSDFlowInfo &FlowInfo) |
Get the number of contributing pixels at a given node in the channel. More... | |
void | get_node_row_col_in_channel (int n_node, int &node, int &row, int &col) |
This gets the node, row, and column index. More... | |
int | get_contributing_pixels_at_outlet (LSDFlowInfo &FlowInfo) |
This gets the contriubting pixels at the outlet of the channel. More... | |
int | get_contributing_pixels_at_penultimate_node (LSDFlowInfo &FlowInfo) |
Gets the pixels at the penultimate node. More... | |
LSDIndexRaster | print_index_channel_to_index_raster () |
void | append_index_channel_to_index_raster (LSDIndexRaster &old_raster) |
This function appends a channel onto an existing LSDIndexRaster. More... | |
void | get_coordinates_of_channel_nodes (vector< double > &X_coordinates, vector< double > &Y_coordinates, LSDFlowInfo &FlowInfo) |
Function to get vectors with the X and Y coordinates of nodes in the channel. More... | |
void | get_coordinates_of_channel_nodes (vector< float > &X_coordinates, vector< float > &Y_coordinates) |
Function to get vectors with the X and Y coordinates of nodes in the channel. More... | |
void | write_channel_to_csv (string path, string filename) |
Function to get write index channel to csv. More... | |
void | write_channel_to_csv (string path, string filename, LSDFlowInfo &FlowInfo, LSDRaster &FlowDistance, LSDRaster &Elevation) |
Function to get write index channel to csv Similar to above but mimics code in other objects to ensure you get the same channels. More... | |
Protected Attributes | |
int | NRows |
Number of rows. | |
int | NCols |
Number of columns. | |
float | XMinimum |
Minimum X coordinate. | |
float | YMinimum |
Minimum Y coordinate. | |
float | DataResolution |
Data resolution. | |
int | NoDataValue |
No data value. | |
map< string, string > | GeoReferencingStrings |
A map of strings for holding georeferencing information. | |
int | StartJunction |
The starting junction (numbered within LSDJunctionNetwork object). | |
int | StartNode |
The node index of the starting Junction (numbered in the FlowInfo object). | |
int | EndJunction |
The ending junction (numbered within LSDJunctionNetwork object). | |
int | EndNode |
The node index of the ending Junction (numbered in the FlowInfo object). | |
vector< int > | RowSequence |
Vector of row indices. | |
vector< int > | ColSequence |
Vector of column indices. | |
vector< int > | NodeSequence |
Vector of node indices. | |
This object contains the node indexes as well as the row and col indices for individual channel segments.
|
inline |
Create LSDIndexChannel object between a start and end node.
StartNode | Integer starting node. |
EndNode | Integer ending node. |
FlowInfo | LSDFlowInfo object. |
|
inline |
Create LSDIndexChannel object between starting junction and node and ending junction and node.
StartJunction | Integer starting junction. |
StartNode | Integer starting node. |
EndJunction | Integer ending junction. |
EndNode | Integer ending node. |
FlowInfo | LSDFlowInfo object. |
void LSDIndexChannel::append_index_channel_to_index_raster | ( | LSDIndexRaster & | old_raster | ) |
This function appends a channel onto an existing LSDIndexRaster.
|
inline |
int LSDIndexChannel::get_contributing_pixels_at_node | ( | int | n_node, |
LSDFlowInfo & | FlowInfo | ||
) |
Get the number of contributing pixels at a given node in the channel.
n_node | index of target node. |
FlowInfo | LSDFlowInfo object. |
|
inline |
This gets the contriubting pixels at the outlet of the channel.
FlowInfo | LSDFlowInfo object. |
int LSDIndexChannel::get_contributing_pixels_at_penultimate_node | ( | LSDFlowInfo & | FlowInfo | ) |
Gets the pixels at the penultimate node.
Useful when calculating area of basins where the tributary junction is at the EndNode.
FlowInfo | LSDFlowInfo object. |
void LSDIndexChannel::get_coordinates_of_channel_nodes | ( | vector< double > & | X_coordinates, |
vector< double > & | Y_coordinates, | ||
LSDFlowInfo & | FlowInfo | ||
) |
Function to get vectors with the X and Y coordinates of nodes in the channel.
X_coordinates | vector to write X_coords |
Y_coordinates | vector to write Y_coords |
void LSDIndexChannel::get_coordinates_of_channel_nodes | ( | vector< float > & | X_coordinates, |
vector< float > & | Y_coordinates | ||
) |
Function to get vectors with the X and Y coordinates of nodes in the channel.
X_coordinates | vector to write X_coords |
Y_coordinates | vector to write Y_coords |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int LSDIndexChannel::get_node_in_channel | ( | int | n_node | ) |
This gets the node index at a given node in the index channel.
n_node | index of target node. |
void LSDIndexChannel::get_node_row_col_in_channel | ( | int | n_node, |
int & | node, | ||
int & | row, | ||
int & | col | ||
) |
This gets the node, row, and column index.
n_node | index of target node. |
node | Blank variable for output node. |
row | Blank variable for output row index. |
col | Blank variable for output column index. |
|
inline |
|
inline |
void LSDIndexChannel::get_row_column_of_end_node | ( | LSDFlowInfo & | FlowInfo, |
int & | row, | ||
int & | col | ||
) |
gets the row and column of the end node
FlowInfo | the LSDFlowInfo object |
row | the row that will be replaced |
col | the col that will be replaced with the correct value |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
LSDIndexRaster LSDIndexChannel::print_index_channel_to_index_raster | ( | ) |
void LSDIndexChannel::truncate_final_node | ( | ) |
This removes the final node in a channel.
Used when channel ends in a receiver junction but user wants penultamite node
void LSDIndexChannel::write_channel_to_csv | ( | string | path, |
string | filename | ||
) |
Function to get write index channel to csv.
path | the path name |
filename | prefix for the csv file |
void LSDIndexChannel::write_channel_to_csv | ( | string | path, |
string | filename, | ||
LSDFlowInfo & | FlowInfo, | ||
LSDRaster & | FlowDistance, | ||
LSDRaster & | Elevation | ||
) |
Function to get write index channel to csv Similar to above but mimics code in other objects to ensure you get the same channels.
path | the path name |
filename | prefix for the csv file |
FlowInfo | |
FlowDistance |