This repository contains the code that implements the Shiny app for the Predicting bat dispersion through urban environments project. Most of the calculations are performed by R to set up the inputs to the Circuitscape calculation that is implemented in Julia. The app queries a PostGIS database for the vector and raster data required to perform the calculations.
Install the following Centos packages with yum
:
sudo yum install udunits2-devel
sudo yum install geos geos-devel
sudo yum install postgresql-devel
Run the following commands in the R console to install the required packages:
install.packages("glue")
install.packages("JuliaCall")
install.packages("leaflet")
install.packages("R6")
install.packages("raster")
install.packages("rpostgis")
install.packages("sf")
install.packages("shiny")
install.packages("shinyBS")
install.packages("shinyjs")
install.packages("stringr")
install.packages("uuid")
install.packages("vroom")
Run the following commands in the Julia console to install the required Circuitscape package:
using Pkg
Pkg.add("Circuitscape")
The default values for the PostgreSQL database name and the PostgreSQL port are:
DATABASE_NAME="os"
DATABASE_PORT=5432
Configure any of these values by creating a .env
file with different values, e.g.:
DATABASE_PORT=5555
DATABASE_NAME="my-bat-data"
The app runs with the following software versions:
Software | Version |
---|---|
R | 4.0.4 |
Julia | 1.5.4 |
Postgres | 13.2 |
PostGIS | 3.1.1 |
The data is all open source. The shapefiles for buildings, rivers and roads are from Ordnance Survey:
- https://www.ordnancesurvey.co.uk/business-government/products/open-map-rivers
- https://www.ordnancesurvey.co.uk/business-government/products/open-map-roads
- https://www.ordnancesurvey.co.uk/business-government/products/open-map-local
The landcover is from the CEH landcover map:
Lidar DTM/DSM is also used to figure out where hedgerows/forest is, which is available from the government:
- https://data.gov.uk/dataset/fba12e80-519f-4be2-806f-41be9e26ab96/lidar-composite-dsm-2017-2m
- https://data.gov.uk/dataset/002d24f0-0056-4176-b55e-171ba7f0e0d5/lidar-composite-dtm-2017-2m
Some useful articles: