Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.txt with Linux build notes #219

Merged
merged 14 commits into from
Mar 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#################
## Eclipse

.idea
*.pydevproject
.project
.metadata
Expand Down
17 changes: 10 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ For the latest release and detailed documentation please refer to the website: h
Building on Linux
-----------------
Both make and Cmake options are available to accommodate different preferences and system demands
Using make
cd src
make
Using make:
> cd TauDEM
> mkdir bin
> cd src
> make
The executables are written to bin directory

Using Cmake
cd src && mkdir build && cd build
cmake ..
make && make install
Using Cmake:
> cd src && mkdir build && cd build
> cmake ..
> make && make install
The executables are written to /usr/local/taudem directory. This can be changed at the second last line (following DESTINATION) if desired.

Dependencies
Expand All @@ -28,6 +30,7 @@ On Linux dependencies can be tricky. I've added the following scripts to help,
GDAL: GDAL.sh installs from GDAL source. You could also try
apt-get install gdal-bin libgdal-dev
apt-get install gdal-bin=2.1.3+dfsg-1~xenial2
apt-get install libmpich-dev (on Bionic 18.04 LTS)

C++: The script GCC.sh contains some commands I've used to get the required compiler.

Expand Down
Binary file added bin/aread8
Binary file not shown.
Binary file added bin/areadinf
Binary file not shown.
Binary file added bin/catchhydrogeo
Binary file not shown.
Binary file added bin/catchoutlets
Binary file not shown.
Binary file added bin/connectdown
Binary file not shown.
Binary file added bin/d8flowdir
Binary file not shown.
Binary file added bin/d8flowpathextremeup
Binary file not shown.
Binary file added bin/d8hdisttostrm
Binary file not shown.
Binary file added bin/d8vdisttostrm
Binary file not shown.
Binary file added bin/dinfavalanche
Binary file not shown.
Binary file added bin/dinfconclimaccum
Binary file not shown.
Binary file added bin/dinfdecayaccum
Binary file not shown.
Binary file added bin/dinfdistdown
Binary file not shown.
Binary file added bin/dinfdistup
Binary file not shown.
Binary file added bin/dinfflowdir
Binary file not shown.
Binary file added bin/dinfrevaccum
Binary file not shown.
Binary file added bin/dinftranslimaccum
Binary file not shown.
Binary file added bin/dinfupdependence
Binary file not shown.
Binary file added bin/dropanalysis
Binary file not shown.
Binary file added bin/editraster
Binary file not shown.
Binary file added bin/flowdircond
Binary file not shown.
Binary file added bin/gagewatershed
Binary file not shown.
Binary file added bin/gridnet
Binary file not shown.
Binary file added bin/inunmap
Binary file not shown.
Binary file added bin/lengtharea
Binary file not shown.
Binary file added bin/moveoutletstostrm
Binary file not shown.
Binary file added bin/peukerdouglas
Binary file not shown.
Binary file added bin/pitremove
Binary file not shown.
Binary file added bin/retlimflow
Binary file not shown.
Binary file added bin/setregion
Binary file not shown.
Binary file added bin/sinmapsi
Binary file not shown.
Binary file added bin/slopearea
Binary file not shown.
Binary file added bin/slopearearatio
Binary file not shown.
Binary file added bin/slopeavedown
Binary file not shown.
Binary file added bin/streamnet
Binary file not shown.
Binary file added bin/threshold
Binary file not shown.
Binary file added bin/twi
Binary file not shown.
Binary file added doc/TauDEM53CommandLineGuide.pdf
Binary file not shown.
Binary file added examples/Logan/LoganOutlet.dbf
Binary file not shown.
8 changes: 8 additions & 0 deletions examples/Logan/LoganOutlet.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "FeatureCollection",
"name": "LoganOutlet",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::26912" } },
"features": [
{ "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Point", "coordinates": [ 434791.762310470396187, 4621609.43730350676924 ] } }
]
}
Binary file added examples/Logan/LoganOutlet.sbn
Binary file not shown.
Binary file added examples/Logan/LoganOutlet.sbx
Binary file not shown.
Binary file added examples/Logan/LoganOutlet.shp
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/Logan/LoganOutlet.shp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<!--<!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">-->
<metadata xml:lang="en"><Esri><CreaDate>20100327</CreaDate><CreaTime>14054800</CreaTime><SyncOnce>TRUE</SyncOnce><MetaID>{1C82CCC0-BD2C-4762-A648-F554FBF332A1}</MetaID></Esri><idinfo><citation><citeinfo><onlink Sync="TRUE">\\MOUSE\C$\Scratch\LoganStart\OutletCopywithlongnameerrreadarahjnaknelk</onlink></citeinfo></citation></idinfo><distInfo><distributor><distorTran><onLineSrc><linkage Sync="TRUE">file://\\MOUSE\C$\Scratch\LoganStart\OutletCopywithlongnameerrreadarahjnaknelk</linkage><protocol Sync="TRUE">Local Area Network</protocol></onLineSrc></distorTran></distributor></distInfo><dataqual><lineage><procstep><procdesc Sync="TRUE">Dataset copied.</procdesc><srcused Sync="TRUE">C:\Scratch\Logan\Outlet</srcused><procdate Sync="TRUE">20100327</procdate><proctime Sync="TRUE">13312800</proctime></procstep><procstep><procdesc Sync="TRUE">Dataset copied.</procdesc><srcused Sync="TRUE">C:\Scratch\Logan\OutletCopywithlongnameerrreadarahjnaknelk</srcused><procdate Sync="TRUE">20100327</procdate><proctime Sync="TRUE">14054800</proctime></procstep></lineage></dataqual></metadata>
Binary file added examples/Logan/LoganOutlet.shx
Binary file not shown.
8 changes: 8 additions & 0 deletions examples/Logan/LoganOutlet.wgs.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "FeatureCollection",
"name": "LoganOutlet",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Point", "coordinates": [ -111.784228758779406, 41.743629188805421 ] } }
]
}
172 changes: 172 additions & 0 deletions examples/Logan/TauDEMRScript.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# R script to run TauDEM

# Packages used
# install rgdal
# install raster
# install shapefiles
install.packages("rgdal")
install.packages("raster")
install.packages("shapefiles")

# This also assumes that MPICH2 is properly installed on your machine and that TauDEM command line executables exist
# MPICH2. Obtain from http://www.mcs.anl.gov/research/projects/mpich2/
# Install following instructions at http://hydrology.usu.edu/taudem/taudem5.0/downloads.html.
# It is important that you install this from THE ADMINISTRATOR ACCOUNT.

# TauDEM command line executables.
# If on a PC download from http://hydrology.usu.edu/taudem/taudem5.0/downloads.html
# The install package will install to c:\program files\taudem or c:\program files (x86)\taudem set a
# system path. If you want to do this manually you can download the command line executables and place where you wish.
# If on a different system, download the source code and compile for your system.

library(raster)
library(shapefiles)

# Set working directory to your location
setwd("C:/Users/dtarb/Scratch/Logan")

z=raster("logan.tif")
plot(z)

# Pitremove
system("mpiexec -n 8 pitremove -z logan.tif -fel loganfel.tif")
fel=raster("loganfel.tif")
plot(fel)


# D8 flow directions
system("mpiexec -n 8 D8Flowdir -p loganp.tif -sd8 logansd8.tif -fel loganfel.tif",show.output.on.console=F,invisible=F)
p=raster("loganp.tif")
plot(p)
sd8=raster("logansd8.tif")
plot(sd8)

# Contributing area
system("mpiexec -n 8 AreaD8 -p loganp.tif -ad8 loganad8.tif")
ad8=raster("loganad8.tif")
plot(log(ad8))
zoom(log(ad8))


# Grid Network
system("mpiexec -n 8 Gridnet -p loganp.tif -gord logangord.tif -plen loganplen.tif -tlen logantlen.tif")
gord=raster("logangord.tif")
plot(gord)
zoom(gord)

# DInf flow directions
system("mpiexec -n 8 DinfFlowdir -ang loganang.tif -slp loganslp.tif -fel loganfel.tif",show.output.on.console=F,invisible=F)
ang=raster("loganang.tif")
plot(ang)
slp=raster("loganslp.tif")
plot(slp)


# Dinf contributing area
system("mpiexec -n 8 AreaDinf -ang loganang.tif -sca logansca.tif")
sca=raster("logansca.tif")
plot(log(sca))
zoom(log(sca))

# Threshold
system("mpiexec -n 8 Threshold -ssa loganad8.tif -src logansrc.tif -thresh 100")
src=raster("logansrc.tif")
plot(src)
zoom(src)

# a quick R function to write a shapefile
makeshape.r=function(sname="shape",n=1)
{
xy=locator(n=n)
points(xy)

#Point
dd <- data.frame(Id=1:n,X=xy$x,Y=xy$y)
ddTable <- data.frame(Id=c(1),Name=paste("Outlet",1:n,sep=""))
ddShapefile <- convert.to.shapefile(dd, ddTable, "Id", 1)
write.shapefile(ddShapefile, sname, arcgis=T)
}

makeshape.r("ApproxOutlets")

# Move Outlets
system("mpiexec -n 8 moveoutletstostreams -p loganp.tif -src logansrc.tif -o approxoutlets.shp -om Outlet.shp")
outpt=read.shp("outlet.shp")
approxpt=read.shp("ApproxOutlets.shp")

plot(src)
points(outpt$shp[2],outpt$shp[3],pch=19,col=2)
points(approxpt$shp[2],approxpt$shp[3],pch=19,col=4)

zoom(src)


# Contributing area upstream of outlet
system("mpiexec -n 8 Aread8 -p loganp.tif -o Outlet.shp -ad8 loganssa.tif")
ssa=raster("loganssa.tif")
plot(ssa)


# Threshold
system("mpiexec -n 8 threshold -ssa loganssa.tif -src logansrc1.tif -thresh 2000")
src1=raster("logansrc1.tif")
plot(src1)
zoom(src1)

# Stream Reach and Watershed
system("mpiexec -n 8 Streamnet -fel loganfel.tif -p loganp.tif -ad8 loganad8.tif -src logansrc1.tif -o outlet.shp -ord loganord.tif -tree logantree.txt -coord logancoord.txt -net logannet.shp -w loganw.tif")
plot(raster("loganord.tif"))
zoom(raster("loganord.tif"))
plot(raster("loganw.tif"))

# Plot streams using stream order as width
snet=read.shapefile("logannet")
ns=length(snet$shp$shp)
for(i in 1:ns)
{
lines(snet$shp$shp[[i]]$points,lwd=snet$dbf$dbf$Order[i])
}

# Peuker Douglas stream definition
system("mpiexec -n 8 PeukerDouglas -fel loganfel.tif -ss loganss.tif")
ss=raster("loganss.tif")
plot(ss)
zoom(ss)

# Accumulating candidate stream source cells
system("mpiexec -n 8 Aread8 -p loganp.tif -o outlet.shp -ad8 loganssa.tif -wg loganss.tif")
ssa=raster("loganssa.tif")
plot(ssa)

# Drop Analysis
system("mpiexec -n 8 Dropanalysis -p loganp.tif -fel loganfel.tif -ad8 loganad8.tif -ssa loganssa.tif -drp logandrp.txt -o outlet.shp -par 5 500 10 0")

# Deduce that the optimal threshold is 300
# Stream raster by threshold
system("mpiexec -n 8 Threshold -ssa loganssa.tif -src logansrc2.tif -thresh 300")
plot(raster("logansrc2.tif"))

# Stream network
system("mpiexec -n 8 Streamnet -fel loganfel.tif -p loganp.tif -ad8 loganad8.tif -src logansrc2.tif -ord loganord2.tif -tree logantree2.dat -coord logancoord2.dat -net logannet2.shp -w loganw2.tif -o Outlet.shp",show.output.on.console=F,invisible=F)

plot(raster("loganw2.tif"))
snet=read.shapefile("logannet2")
ns=length(snet$shp$shp)
for(i in 1:ns)
{
lines(snet$shp$shp[[i]]$points,lwd=snet$dbf$dbf$Order[i])
}

# Wetness Index
system("mpiexec -n 8 SlopeAreaRatio -slp loganslp.tif -sca logansca.tif -sar logansar.tif", show.output.on.console=F, invisible=F)
sar=raster("logansar.tif")
wi=sar
wi[,]=-log(sar[,])
plot(wi)

# Distance Down
system("mpiexec -n 8 DinfDistDown -ang loganang.tif -fel loganfel.tif -src logansrc2.tif -m ave v -dd logandd.tif",show.output.on.console=F,invisible=F)
plot(raster("logandd.tif"))



Binary file added examples/Logan/logan.aux
Binary file not shown.
Binary file added examples/Logan/logan.tif
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/Logan/logan.tif.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<!--<!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">-->
<metadata xml:lang="en"><Esri><MetaID>{04677E34-8EE2-4BAD-A9B6-854030986096}</MetaID><CreaDate>20100523</CreaDate><CreaTime>06561500</CreaTime><SyncOnce>TRUE</SyncOnce><DataProperties><lineage><Process ToolSource="C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Data Management Tools.tbx\CalculateStatistics" Date="20100523" Time="065615">CalculateStatistics C:\Scratch\Logan\logan.tif 1 1 # C:\Scratch\Logan\logan.tif</Process></lineage></DataProperties></Esri></metadata>
Loading