Function overview

June 11, 2025 ยท View on GitHub

GRIDobj

NameDescription
GRIDOBJCreate instance of a GRIDobj
GRIDOBJ2ASCIIWrite/export GRIDobj to ESRI ArcGIS ASCII file
GRIDOBJ2GEOTABLEConvert categorical GRIDobj to geotable (polygon)
GRIDOBJ2GEOTIFFExports an instance of GRIDobj to a geotiff file
GRIDOBJ2IMCreate image from GRIDobj
GRIDOBJ2MATConvert GRIDobj to matrix and coordinate vectors
GRIDOBJ2PMCombine several GRIDobjs into a predictor matrix
GRIDOBJ2POLYGONConversion from drainage basin grid to polygon or polyline
GRIDOBJ2RGBConvert GRIDobj to RGB image
ACVAnisotropic coefficient of variation (ACV)
AGGREGATEResampling a GRIDobj using aggregation/binning
ARCSLOPESlope from a digital elevation model sensu ArcGIS
ASPECTDirection of the steepest slope
CASTSHADOWCast shadow calculated from digital terrain
CELLAREACalculate cell areas of a GRIDobj in geographic coordinate system
CLIPClip a GRIDobj with a polygon or another GRIDobj
CONTOURContour plot of an instance of GRIDobj
COORD2INDConvert x and y coordinates to linear index
COORD2SUBConvert x and y coordinates to subscripts into a GRIDobj
CREATEMASKCreate a binary mask using polygon mapping
CROPCrop an instance of GRIDobj with axis-aligned minimum bounding box
CURVATURECurvature of a digital elevation model
DEMAREACalculate the corrected surface area of a DEM
DEMPROFILEGet profile along path
DIFFUSIONSolve the diffusion equation
DILATEMorphological dilation
DIST2CURVELabels pixels in a GRIDobj by their directed distance to a curved line
DIST2LINELabels pixels in a GRIDobj by their distance to a straight line
DISTANCEDistance transform
ELEVATEMINIMAElevate regional minima in a DEM to their lowest neighbor
ERODEMorphological erosion
EVANSSLOPECalculate surface slope using Evans method
EXCESSTOPOGRAPHYReconstruct surface with threshold-slope surface
FILLSINKSFill/remove pits, sinks or topographic depressions
FILTER2D-filtering of DEMs with different kernels
FINDFind indices of nonzero elements in GRIDobj
FINDCOORDFind coordinates of nonzero elements in GRIDobj
GETCOORDINATESGet coordinate vectors of an instance of GRIDobj
GETEXTENTReturn extent of a GRIDobj
GETOUTLINEGet outline of GRIDobj
GRADIENT88-connected neighborhood gradient of a digital elevation model
GRIDDEDCONTOURPlot contours on grid
HEXGRIDCreates an array of haxagonal points
HILLSHADECalculate hillshading from a digital elevation model
HISTOGRAMPlot frequency distribution of values in GRIDobj
HYDROGRAMGenerate an hydrogram
HYPSCURVEPlot hypsometric curve of a digital elevation model
IDENTIFYFLATSIdentify flat terrain in a digital elevation model
IMAGESCScale data in GRIDobj and display as image object
IMAGESCHSPlot hillshade image with overlay
IND2COORDConvert linear index to x and y coordinates
INFODetailed information on GRIDobj instance
INPAINTNANSInterpolate or fill missing values in a grid (GRIDobj)
INTERPInterpolate to query locations
INTERP2GRIDOBJInterpolate scattered data to GRIDobj
INTERPWITHBARRIERSLaplace interplation with barriers
ISUNDERLYINGINTEGERCreate instance of a GRIDobj
ISUNDERLYINGNUMERICCreate instance of a GRIDobj
ISUNDERLYINGTYPECreate instance of a GRIDobj
ISNANReturns array elements that are NaNs as logical grid
KSDENSITYKernel density estimator for GRIDobj
LARGESTINSCRIBEDGRIDFind and crop the largest grid with no nans
LINE2GRIDOBJConvert line to a grid
LOCALTOPOGRAPHYLocal topography
MAXMaximum value in GRIDobj
MEASURETake interactive measurements along a polyline
MINMinimum value in GRIDobj
MINMAXNORMMin-max normalization with optional percent clipping
MOSAICMerge multiple GRIDobjs into a larger GRIDobj
MPOWEROverloaded power for GRIDobj
MRDIVIDEOverloaded right division for GRIDobj
MTIMESOverloaded multiplication for GRIDobj
MUSTBEUNDERLYINGINTEGERCreate instance of a GRIDobj
MUSTBEUNDERLYINGNUMERICCreate instance of a GRIDobj
MUSTBEUNDERLYINGTYPECreate instance of a GRIDobj
NCOLSReturn the number of columns in a DEM
NROWSReturn the number of rows in a DEM
PADAdd or remove a border of pixels around a GRIDobj
POLYGON2GRIDOBJConvert polygon to a grid
POSTPROCFLATSPostprocess flat terrain for visualization purpose
PRCCLIPPercentile clipping
PROJECTWarps a GRIDobj to a different coordinate system
PROMINENCECalculate the prominence of mountain peaks
RANDCompute a GRIDobj with random, spatially uncorrelated numbers
RANDOMSAMPLEUniform random sampling of a GRIDobj
RECLABELLabels GRIDobj by rectangular fields
RECLASSIFYGenerate univariate class intervals for an instance of GRIDobj
REPROJECT2UTMReproject DEM with WGS84 coordinate system to UTM-WGS84
RESAMPLEChange spatial resolution of a GRIDobj
ROUGHNESSTerrain ruggedness, position and roughness indices of DEMs
SHUFFLELABELShufflelabel randomly relabels a label matrix
SNAP2STREAMSnap gauges or pour points to stream raster
SUB2COORDConvert subscripts to x and y coordinates
SURFSurface plot for GRIDobj
TANAKACONTOURRelief depiction using Tanaka contours
TOPOSHIELDINGTopographic shielding from cosmic rays
UNDERLYINGTYPECreate instance of a GRIDobj
VALIDATEALIGNMENTChecks validity that two GRIDobj are spatially aligned
ZSCOREStandardized z-scores for GRIDobj

FLOWobj

NameDescription
FLOWOBJCreate flow direction object
FLOWOBJ2GRIDOBJCreate ESRI ArcGIS flow direction grid from FLOWobj
FLOWOBJ2MConvert instance of FLOWobj to flow direction matrix
FLOWOBJ2CELLReturn cell array of FLOWobjs for individual drainage basins
CLIPClip FLOWobj
COORD2INDConvert linear indices to world coordinates
CROPCrop an instance of FLOWobj
DBASYMMETRYDrainage basin asymmetry
DBENTROPYEntropy of drainage basin delineation
DEPENDENCEMAPDelineate upslope area for specific locations in a DEM
DRAINAGEBASINSDrainage basin delineation/catchments
DRAINAGEBASINSTATSZonal statistics on drainage basins
FINDFind indices and values of edges in the flow direction graph
FLIPDIRFlip direction of flow
FLOWACCFlow accumulation (upslope area, contributing area)
FLOWCONVERGENCECompute flow convergence of a digital elevation model
FLOWDISTANCEFlow distance in upstream and downstream direction
FLOWDIVERGENCECalculate the number of downstream neighbors
FLOWPATHEXTRACTExtract linear indices of a single flowpath in a DEM
FLOWTIMEFlow time (and distance) in upstream direction
FLOWVECVelocity vectors from FLOWobj
GRADIENTGradient along flow direction
IMPOSEMINMinima imposition (carving) along drainage network
IND2COORDConvert linear index to x and y coordinates
INFLUENCEMAPDownslope area for specific locations in a digital elevation model
ISMULTIDetermine whether FD is multi or single flow direction
MAPFROMNALMap values from node-attribute list to nearest upstream grid
MELTONRUGGEDNESSMelton ruggedness
MULTI2SINGLEConverts multiple to single flow direction
MULTI_NORMALIZECreate flow direction object
PLOTDBFRINGEPlot semitransparent fringe around each drainage basin
PROPAGATEVALUESUPSTREAMPropagates values upstream in a FLOWobj
QUANTCARVEQuantile carving
RANDOMIZERandomize multiple flow directions
REMOVESMALLFRACTIONSRemove links with small fractions in FLOWobj
SAVEOBJCreate flow direction object
SLOPEAREATOOLInteractively create slope area plots and fit power laws
STREAMORDERCalculate stream order based on a FLOWobj and stream grid
TFACTORTransverse topographic symmetry (T-)factor
UPDATETOPOSORTUpdate topological sorting
UPSLOPESTATSUpslope statistics computed in flow directions
VALIDATEALIGNMENTValidates whether instances of FLOWobj and GRIDobj are spatially aligned
VERTDISTANCE2STREAMVertical distance to streams (height above nearest drainage)

STREAMobj

NameDescription
STREAMOBJCreate stream object (STREAMobj)
STREAMOBJ2GRIDOBJConvert STREAMobj to GRIDobj
STREAMOBJ2SWATHOBJCreate swath profile (SWATHobj) from stream network
STREAMOBJ2XYConvert instance of STREAMobj to NaN-separated X and Y coordinates
STREAMOBJ2CELLConvert instance of STREAMobj to cell array of stream objects
STREAMOBJ2GEOTABLEConvert STREAMobj to a geotable
STREAMOBJ2KMLConvert STREAMobj to kml (Google Earth)
STREAMOBJ2LATLONConvert instance of STREAMobj to NaN-separated geographic coordinates
STREAMOBJ2MAPSTRUCTConvert instance of STREAMobj to mapstruct
AGGREGATESummarizing values within segments of the stream network
BIFURCATIONRATIOCalculate the bifurcation ratio of a STREAMobj
BINARIZEMake a stream network a strictly binary tree
CHIPLOTChi analysis for bedrock river analysis
CHITRANSFORMCoordinate transformation using the integral approach
CLEANCreate stream object (STREAMobj)
CONNCOMPSLabels of connected components (individual trees) in a stream network
CRSConstrained regularized smoothing of the channel length profile
CRSLINConstrained regularized smoothing of the channel length profile
CUMMAXUPSTREAMCumulative maximum in upstream direction
CUMSUMCumulative sum on stream network
CUMTRAPZCumulative trapezoidal numerical integration along a stream network
CURVATURECurvature or 2nd derivative of a STREAMobj
DENSIFYIncrease number of vertices in stream network using splines
DIFFDifferences between adjacent pixels in a stream network
DISTANCECompute distances along the stream network
DRAINAGEDENSITYDrainage density of a stream network
EXTEND2DIVIDEGrow STREAMobj upstream to extend to the divide
EXTRACTCONNCOMPSInteractive stream network selection
EZGETNALEasy handling and retrieval of node-attribute lists
FASTSCAPESimulate river incision using the stream power incision model
GETLOCATIONGet locations along a stream network
GETNALGet node-attribute list
GETVALUERetrieve value from node-attribute list
GRADIENTAlong-stream gradient
HILLSLOPEAREAUpslope hillslope area for each stream pixel
IDENTIFYFLATSIdentify flat sections in a river profile
IMPOSEMINMinima imposition (carving) along stream network
INFOMeta information about STREAMobj
INPAINTNANSInpaint missing values (nans) in a node attribute list
INTERPInterpolate data on STREAMobj (single river only)
INTERSECTIntersect different instances of STREAMobj
INTERSECTLOCSDerive locations where two STREAMobj start to have a common network
ISEMPTYDetermine whether a STREAMobj is empty
ISEQUALDetermine whether two STREAMobjs are equal
ISNALTest whether a vector is a node attribute list of a STREAMobj
ISSUBGRAPHCreate stream object (STREAMobj)
ISTRUNKDetermines whether STREAMobj consists of trunk streams
KLARGESTCONNCOMPSKeep k largest connected components in an instance of STREAMobj
KNICKPOINTFINDERFind knickpoints in river profiles
KSNNormalized steepness index
LABELREACHCreate node-attribute list with labelled reaches
LOESSKSNLoess-smoothed river steepness
LOWERENVLower envelope of a channel length profile
MAPLATERALMap values of regions adjacent to streams to stream network
MCHIGradient of stream profile in chi space (M_chi = Ksn)
MEANUPSTREAMMean (weighted) upstream values
MINCOSTHYDROCONMinimum cost hydrological conditioning
MNOPTIMBayesian optimization of the mn ratio
MNOPTIMVAROptimize the mn ratio using minimum variance method
MODIFYModify instance of STREAMobj to meet user-defined criteria
NAL2NALMap one node-attribute list to another
NETDISTDistance transform on a stream network
NETWORKSEGMENTIdentify river segments and compute segment geometry
ORIENTATIONStream orientation
PLOTPlot instance of STREAMobj
PLOT33D-line plot of a STREAMobj
PLOT3D3D plot of a stream network
PLOTCPlot a colored stream network
PLOTCATEGORICALPlot categorical variable along a single river
PLOTDZPlot upstream distance version elevation of a stream network
PLOTDZSHADEDPlot upstream distance version elevation of a stream network
PLOTSEGMENTGEOMETRYPlot segment geometry obtained from the function networksegment
PLOTSTREAMORDERCalculate stream order from STREAMobj
QUANTCARVEQuantile carving
RANDLOCSRandom locations along the stream network
REMOVEEDGEEFFECTSRemove potential edge effects due to incomplete basins
REMOVESHORTSTREAMSRemove first order streams with a length less than specified
RMEDGECreate stream object (STREAMobj)
RMNODECreate stream object (STREAMobj)
SHAREDSTREAMPOWERSimulation of the shared stream-power model
SIDEBRANCHINGSide branching classification according to Tokunaga (1978)
SINUOSITYSinuosity coefficient
SLOPEAREASlope-area relation of a stream network
SMOOTHSmoothing of node-attribute lists
SNAP2STREAMSnap locations to nearest stream location
SPLITSplit drainage network at predefined locations
SPLITBYATTRIBUTECreate a cell array of STREAMobjs using an attribute
STACKEDPLOTDZPlot several stacked variables along the stream networks
STREAMORDERCalculate stream order from STREAMobj
STREAMPOIPoints of interest on the stream network
STREAMPROJProject stream elevations based on slope-area scaling
SUBGRAPHCreate stream object (STREAMobj)
TRANSFORMCOORDSTransform coordinates of stream network
TRIBDIRDirection of inflow of tributary
TRUNCATEShrink river network by removing links at channelheads or outlets
TRUNKExtract trunk stream (longest stream)
UNIONMerge different instances of STREAMobj into a new instance
VALIDATEALIGNMENTIs an instance of STREAMobj is spatially aligned with another object of TopoToolbox
WIDENSTREAMLevel elevations adjacent to the stream network
WMPLOTPlot stream network in the webmap browser
ZEROBASELEVELSet base level of stream elevation to zero

SWATHobj

NameDescription
SWATHOBJCreate swath profile object (SWATHobj)
SWATHOBJ2GRIDOBJCreate a GRIDobj with swath-specific information
SWATHOBJ2GDSCreate a geographic data structure from a SWATHobj
SWATHOBJ2TABLEConvert SWATHobj to table
CONVERT2LATLONConverts spatial fields in SWATHobj to lat,lon
GETOUTLINEGet outline of swath
GETTRACEGet trace of swath
MAPSWATHObtains Z values along a SWATHobj from an arbitrary GRIDobj
PLOTPlot instance of SWATHobj
PLOTDZCreates distance-elevation plot of a SWATHobj
PLOTDZMCreate color-coded distance-elevation plot from SWATHobj and GRIDobj
PROFILESCalculate profiles from a SWATHobj
STATCalculate statistics for swath profile object (SWATHobj)
SWATH2LATLONConvert spatial fields in SWATHobj to geographic coordinates
TIDYRemove overlapping points from SWATHobj

PPS

NameDescription
KFUNK-function of a point pattern on a stream network
PPSPoint patterns on stream networks
AGGREGATEAggregate points in PPS to new point pattern
ASConvert PPS object into various data formats
BAYESLOGLINEARBayesian analysis of a loglinear point process model
CDFTESTKolmogorov-Smirnov test based on the CDF of a covariate
CLUSTERHierarchical clustering of points in PPS
CONNECTIVITYRiver network connectivity according to Flecker et al. (2022)
CONVHULLConvex hull around points in PPS
CVLOGLINEARCross-validate a loglinear point process model
DENSITYNonparametric density estimation on network
DIAMETERReturns the maximum possible distance in a stream network
ECDFEmpirical cumulative distribution function of a covariate
EXTENDEDNETWORKExtend network to account for duplicate points
EXTRACTVALUESAROUNDPOINTSExtract values around points
FITLOGLINEARFit loglinear model to point pattern
GENERATEPOINTSGenerate non-random points on stream network
GETMARKSExtract point marks
GFUNG-function (nearest inter-point distance distribution)
HASDUPLICATESDetermines whether there are duplicate points
HISTOGRAMHistogram of point pattern on stream network
IDWInverse distance weighted interpolation on stream networks
INTENSITYCalculate intensity (density) of points on the stream network
MNOPTIMKPFind optimal mn ratio based on knickpoint locations
MODIFYModify instance of PPS to meet user-defined criteria
NETDISTShortest network distance
NPOINTSNumber of points in the point pattern
PLOTPlot instance of PPS
PLOTCPlot a colored stream network and points
PLOTDZPlot upstream distance version elevation or covariate of a PPS
PLOTEFFECTSPlot of slices through a loglinear point process model
PLOTPOINTSPlot points of PPS
POINTDISTANCESInter-point distance calculated on stream network
POINTSExtract a list of points from the point pattern
QUADRATCOUNTQuadrat count and chi2 test
RANDOMRandom realisation of a (inhomogeneous) point process
REMOVEDUPLICATESRemove duplicate points
REMOVEPOINTSRemove points in point pattern
RHOHATNonparametric estimation of point pattern dependence on covariate
ROCReceiver-operating characteristics of point pattern
SHAPEWRITEWrite point pattern to shapefile
SIMULATESimulate point pattern using random thinning
TLENGTHTotal length of the stream network
VORONOINearest neighbor search on a stream network
WMPLOTPlot instance of PPS in webmap browswer

DIVIDEobj

NameDescription
DIVIDEOBJCreate divide object (DIVIDEobj)
DIVIDEOBJ2MAPSTRUCTObtain divide properties from GRIDobj
ASYMMETRYASYMMETRY directional asymmetry of divide segments
CLEANEDGESDelete divides on the edges of DEM
COORD2INDConvert x and y coordinates to linear index
DIST2NODENetwork distance to nodes
DIVDISTDIVDIST Assign distance to divide segments
DIVNETCreate divide object (DIVIDEobj)
DIVORDERAssign order to divide segments
GETVALUEGet grid values adjacent to divides
IND2COORDConvert linear index to x and y coordinates
JCTANGLEAngles between divide segments at junctions
JCTCONCompute junction connectivity
PLOTPlot the divide network
PLOTCCreate colored plot of drainage divide network
REMOVESHORTDIVIDESRemove short first-order divides
SHRINKShrink divide network
SORTSort divide segments by network structure.