LSDTopoTools
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Protected Attributes | List of all members
LSDIndexChannel Class Reference

This object contains the node indexes as well as the row and col indices for individual channel segments. More...

#include <LSDIndexChannel.hpp>

Inheritance diagram for LSDIndexChannel:
LSDChannel

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.
 

Detailed Description

This object contains the node indexes as well as the row and col indices for individual channel segments.

Constructor & Destructor Documentation

LSDIndexChannel::LSDIndexChannel ( int  StartNode,
int  EndNode,
LSDFlowInfo FlowInfo 
)
inline

Create LSDIndexChannel object between a start and end node.

Parameters
StartNodeInteger starting node.
EndNodeInteger ending node.
FlowInfoLSDFlowInfo object.
LSDIndexChannel::LSDIndexChannel ( int  StartJunction,
int  StartNode,
int  EndJunction,
int  EndNode,
LSDFlowInfo FlowInfo 
)
inline

Create LSDIndexChannel object between starting junction and node and ending junction and node.

Parameters
StartJunctionInteger starting junction.
StartNodeInteger starting node.
EndJunctionInteger ending junction.
EndNodeInteger ending node.
FlowInfoLSDFlowInfo object.

Member Function Documentation

void LSDIndexChannel::append_index_channel_to_index_raster ( LSDIndexRaster old_raster)

This function appends a channel onto an existing LSDIndexRaster.

Author
SMM
Date
26/09/2013
vector<int> LSDIndexChannel::get_ColSequence ( ) const
inline
Returns
Get vector of column indexes.
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.

Parameters
n_nodeindex of target node.
FlowInfoLSDFlowInfo object.
Returns
Contributing pixels.
Author
SMM
Date
01/01/12
int LSDIndexChannel::get_contributing_pixels_at_outlet ( LSDFlowInfo FlowInfo)
inline

This gets the contriubting pixels at the outlet of the channel.

Parameters
FlowInfoLSDFlowInfo object.
Returns
Contriubting pixels at the outlet of the channel.
Author
SMM
Date
01/01/12
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.

Parameters
FlowInfoLSDFlowInfo object.
Returns
Pixels at the penultimate node.
Author
SMM
Date
01/01/12
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.

Parameters
X_coordinatesvector to write X_coords
Y_coordinatesvector to write Y_coords
Author
FJC
Date
17/02/17
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.

Parameters
X_coordinatesvector to write X_coords
Y_coordinatesvector to write Y_coords
Author
FJC
Date
17/02/17
float LSDIndexChannel::get_DataResolution ( ) const
inline
Returns
Data resolution as an integer.
int LSDIndexChannel::get_EndJunction ( ) const
inline
Returns
Ending junciton ID.
int LSDIndexChannel::get_EndNode ( ) const
inline
Returns
Ending Node ID.
map<string,string> LSDIndexChannel::get_GeoReferencingStrings ( ) const
inline
Returns
Georeferencing information
int LSDIndexChannel::get_n_nodes_in_channel ( ) const
inline
Returns
This tells how many nodes are in the channel.
int LSDIndexChannel::get_NCols ( ) const
inline
Returns
Number of columns as an integer.
int LSDIndexChannel::get_NoDataValue ( ) const
inline
Returns
No Data Value as an integer.
int LSDIndexChannel::get_node_in_channel ( int  n_node)

This gets the node index at a given node in the index channel.

Parameters
n_nodeindex of target node.
Returns
Node index.
Author
SMM
Date
01/01/12
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.

Parameters
n_nodeindex of target node.
nodeBlank variable for output node.
rowBlank variable for output row index.
colBlank variable for output column index.
Returns
Node, row, and column index.
Author
SMM
Date
01/01/12
vector<int> LSDIndexChannel::get_NodeSequence ( ) const
inline
Returns
Get vector of node indexes.
int LSDIndexChannel::get_NRows ( ) const
inline
Returns
Number of rows as an integer.
void LSDIndexChannel::get_row_column_of_end_node ( LSDFlowInfo FlowInfo,
int &  row,
int &  col 
)

gets the row and column of the end node

Parameters
FlowInfothe LSDFlowInfo object
rowthe row that will be replaced
colthe col that will be replaced with the correct value
Author
SMM
Date
06/05/2015
vector<int> LSDIndexChannel::get_RowSequence ( ) const
inline
Returns
Get vector of row indexes.
int LSDIndexChannel::get_StartJunction ( ) const
inline
Returns
Starting junction ID.
int LSDIndexChannel::get_StartNode ( ) const
inline
Returns
Starting node ID.
float LSDIndexChannel::get_XMinimum ( ) const
inline
Returns
Minimum X coordinate as an integer.
float LSDIndexChannel::get_YMinimum ( ) const
inline
Returns
Minimum Y coordinate as an integer.
LSDIndexRaster LSDIndexChannel::print_index_channel_to_index_raster ( )
Returns
This prints the channel to an LSDIndexRaster in order to see where the channel is.
Author
SMM
Date
01/01/12
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

Author
SMM
Date
05/11/2013
void LSDIndexChannel::write_channel_to_csv ( string  path,
string  filename 
)

Function to get write index channel to csv.

Parameters
paththe path name
filenameprefix for the csv file
Author
FJC
Date
17/02/17
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.

Parameters
paththe path name
filenameprefix for the csv file
FlowInfo
FlowDistance
Author
SMM
Date
20/03/18

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