CGI-NRM / GPS-convert

Convert GPS coordinates
1 stars 1 forks source link

If you want to try this code you need to install the following packages.

NB! The conversion is now made with the sf instead of the sp package.

+BEGIN_SRC R

install.packages(c("shiny","DT","tidyverse", "readxl","leaflet", "rgdal","sf", "xlsx"))

+END_SRC

Depending on environment used there are sometimes not possible to install rgdal as above and you need install gdal outside R. On mac os x you can solve the problem by installing gdal via brew.

+BEGIN_SRC sh

brew install gdal

+END_SRC

On Linux based system one can install gdal via package managers. If using apt-get the following will do

+BEGIN_SRC sh

sudo apt-get install libgdal1-dev libproj-dev

+END_SRC

and on fedora one can try

+BEGIN_SRC sh

sudo dnf install rgdal expat proj

+END_SRC

if it fails you will normally get a readable error message from dnf.

The xlsx package is for creating excel files directly from R and need rJava to work. The rJava packages is at times difficult to install as it is dependent on the java version on the computer you are running. In case you can not get it to work, download the code here and just comment out the xlsx package and the only functionality that is lost is the option to download tables as excel files.

After this you can launch the app with

+BEGIN_SRC R

shiny::runGitHub("GPS-Convert", "CGI-NRM")

+END_SRC

Note that this procedure requires an active internet connection at launch.

You can also download the app and just open the app.R file in r-studio and just press the "Run app" to start it. If prefer to run it outside r-studio just copy the app.R code and paste it to your r-session to launch the web app.