Setting up the package requirements on Linux
Source:vignettes/linux_system_setup.Rmd
linux_system_setup.Rmd
Installation of the required GIS tools
If you do not have installed any of the GIS tools, please, install
before using hydrographr
. If you use Ubuntu you can
copy-paste the commands below. If you use another Linux distribution,
please, see the linked software webpage below for installation
instruction.
Warning! Sometimes the installation does not work within a VPN connection. If you fail to fetch data from online repositories during the installation, please try deactivating your VPN connection.
Add the Ubuntugis repository
First, you have to add the “Ubuntugis” Personal Package Archive (PPA) to your system’s software sources to be able to install the GIS tools available from there.
Next, you need to tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added:
Now you are ready to installGDAL
, GRASS GIS
and GNU parallel
. Copy and paste the commands below into
your console and follow the instructions to install the tools.
GDAL
GDAL is a translator library for raster and vector geospatial data formats and comes with a variety of useful command line utilities for data translation and processing. For more information check the GDAL website.
GRASS GIS
GRASS GIS is a powerful raster, vector, and geospatial processing engine including tools for terrain and ecosystem modeling, hydrology and the processing of satellite and aerial imagery. For more detailed installation instructions check the GRASS GIS users wiki or the GRASS GIS website. Please, make sure that you have grass8.2 installed.
GRASS GIS addons
Copy-paste the commands below to install the required addons for GRASS GIS.
sudo apt install make
# Install GRASS GIS addons
export GRASSEXEC="grass --exec"
$GRASSEXEC g.extension extension=r.stream.distance
$GRASSEXEC g.extension extension=r.stream.order
$GRASSEXEC g.extension extension=r.stream.snap
$GRASSEXEC g.extension extension=r.stream.basins
GNU parallel
GNU parallel is a shell tool for executing jobs in parallel on
multiple cores. For a faster processing, some of the
hydrographr
functions such as
snap_to_subc_segment()
and
extract_zonal_stat()
have GNU parallel implemented. For
more information check the GNU parallel
website.
# Download the latest version of GNU parallel
wget http://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2
# Unzip the the .tar file and create a new folder parallel-yyyymmdd
sudo tar xjf parallel-latest.tar.bz2
# Check folders and files in the directory and see the date of
# latest version e.g. parallel-20221122
ls
# Move to the new created folder parallel-yyyymmdd
cd parallel-20221122
sudo ./configure && make
sudo make install
parallel --citation
#> Academic tradition requires you to cite works you base your article on.
#> If you use programs that use GNU Parallel to process data for an article in a
#> scientific publication, please cite:
#>
#> @software{tange_2022_7347980,
#> author = {Tange, Ole},
#> title = {GNU Parallel 20221122 ('Херсо́н')},
#> month = Nov,
#> year = 2022,
#> note = {{GNU Parallel is a general parallelizer to run
#> multiple serial command line programs in parallel
#> without changing them.}},
#> publisher = {Zenodo},
#> doi = {10.5281/zenodo.7347980},
#> url = {https://doi.org/10.5281/zenodo.7347980}
#> }
#> (Feel free to use \nocite{tange_2022_7347980})
#> This helps funding further development; AND IT WON'T COST YOU A CENT.
#> If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
#> More about funding GNU Parallel and the citation notice:
#> https://lists.gnu.org/archive/html/parallel/2013-11/msg00006.html
#> https://www.gnu.org/software/parallel/parallel_design.html#citation-notice
#> https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt
#> If you send a copy of your published article to tange@gnu.org, it will be
#> mentioned in the release notes of next version of GNU Parallel.
#>
#> Type: 'will cite' and press enter.
will cite
#> Thank you for your support: You are the reason why there is funding to
#> continue maintaining GNU Parallel. On behalf of future versions of
#> GNU Parallel, which would not exist without your support:
#> THANK YOU SO MUCH
#> It is really appreciated. The citation notice is now silenced.
Now type ctrl+z to exit the GNU parallel environment.
GNU bc
GNU bc (Basic Calculator) is an arbitrary precision numeric
processing language, which is used in the function
snap_to_subc_segment()
. For more information check the GNU bc website.
We recommend to reboot your computer after the installation.