Skip to content

Commit

Permalink
rgrass and gdal issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gisma committed Oct 30, 2023
1 parent 2ae91f8 commit 29db6ee
Show file tree
Hide file tree
Showing 18 changed files with 372 additions and 602 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: link2GI
Type: Package
Title: Linking Geographic Information Systems, Remote Sensing and Other Command Line Tools
Version: 0.5-2
Date: 2023-01-27
Version: 0.5-3
Date: 2023-10-30
Authors@R: c(person("Chris", "Reudenbach", email = "[email protected]", role = c("cre", "aut")),
person("Tim", "Appelhans", email = "[email protected]>", role = c("ctb"))
)
Expand All @@ -22,13 +22,13 @@ Imports:
terra,
methods,
utils,
xml2
xml2,
xfun
SystemRequirements: GNU make
RoxygenNote: 7.2.3
Suggests: knitr,
rmarkdown,
sp,
rgrass7,
rgrass,
stars,
curl,
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## link2GI 0.5-3
bugfixes:
* issue #59
* fix rgrass7 dependencies

## link2GI 0.5-2
new feature:
* add return of vector data in OTB calls
Expand Down
16 changes: 15 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## link2GI 0.5-1
## link2GI 0.5-3
bugfixes:
* issue #59
* fix rgrass7 dependencies

## link2GI 0.5-2
new feature:
* add return of vector data in OTB calls
Expand All @@ -16,6 +20,16 @@ new feature:
* integration of stars and terra raster objects for linking GRASS
* update of documentation

## link2GI 0.5-1

bugfixes:
* prelim fix of issue #57
* fix of issue #56
* minor fixes

new feature:
* integration of stars and terra raster objects for linking GRASS
* update of documentation

## link2GI 0.5-0

Expand Down
10 changes: 2 additions & 8 deletions R/link2GI-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,5 @@
#' \cr
#' \emph{Maintainer:} Chris Reudenbach \email{reudenbach@@uni-marburg.de}
#'
#'
NULL
#' @docType data
#' @name rgb
#' @title RGB ortho-image from an arbitrary Marburg Open Forest (MOF) plot
#' @description Example data set containing a RGB ortho-image of a small plot sampled in the Maburg University Forest aka Marburg Open Forest (MOF). The resolution is 10 cm, projection ETRS89 UTM32
#' @format \code{"terra::rast"}
NULL


10 changes: 3 additions & 7 deletions R/parseOTB.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ parseOTBFunction <- function(algo=NULL,gili=NULL) {
#'
#' if (otblink$exist) {
#' projRootDir<-tempdir()
#' data('rgb', package = 'link2GI')
#' terra::plotRGB(rgb)
#' r<-terra::writeRaster(rgb,
#' filename=file.path(projRootDir,"test.tif"),
#' overwrite=TRUE)
#' fn <- system.file("ex/elev.tif", package = "terra")
#'
#' ## for an image output example we use the Statistic Extraction,
#' algoKeyword<- "LocalStatisticExtraction"
Expand All @@ -213,7 +209,7 @@ parseOTBFunction <- function(algo=NULL,gili=NULL) {
#' listviewer::jsonedit(cmd$help)
#'
#' ## define the mandatory arguments all other will be default
#' cmd$input_in <- file.path(tempdir(),"test.tif")
#' cmd$input_in <- fn
#' cmd$out <- file.path(tempdir(),"test_otb_stat.tif")
#' cmd$radius <- 7
#'
Expand Down Expand Up @@ -314,7 +310,7 @@ runOTB <- function(otbCmdList=NULL,
else {
if (quiet){
if (!identical(grep(path_OTB,pattern = "OTB-8."), integer(0) ))
system(file.path(dirname(path_OTB),"otbenv.profile"))
system(file.path(dirname(as.character(path_OTB)),"otbenv.profile"))


res = system(command,ignore.stdout =TRUE,ignore.stderr = TRUE,intern = FALSE)
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ require(listviewer)
otblink<-link2GI::linkOTB()
projRootDir<-tempdir()

data('rgb', package = 'link2GI')
terra::plotRGB(rgb)
r<-terra::writeRaster(rgb,
filename=file.path(projRootDir,"test.tif"),
format="GTiff", overwrite=TRUE)
fn <- system.file("ex/elev.tif", package = "terra")


## for the example we use the edge detection,
algoKeyword<- "EdgeExtraction"

Expand All @@ -64,7 +62,7 @@ cmd<-parseOTBFunction(algo = algoKeyword, gili = otblink)
listviewer::jsonedit(cmd$help)

## define the mandantory arguments all other will be default
cmd$input <- file.path(projRootDir,"test.tif")
cmd$input <- fn
cmd$filter <- "touzi"
cmd$channel <- 2
cmd$out <- file.path(projRootDir,paste0("out",cmd$filter,".tif"))
Expand Down
Binary file removed data/rgb.rda
Binary file not shown.
36 changes: 0 additions & 36 deletions man/link2GI.Rd

This file was deleted.

12 changes: 0 additions & 12 deletions man/rgb.Rd

This file was deleted.

8 changes: 2 additions & 6 deletions man/runOTB.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 18 additions & 21 deletions vignettes/link2GI2.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # find all SAGA GIS installations at the default search location
# require(link2GI)
# saga <- link2GI::findSAGA()
# saga

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # find all SAGA GIS installations at the default search location
# require(link2GI)
# grass <- link2GI::findGRASS()
# grass
# otb <- link2GI::findOTB()
# otb

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # find all SAGA GIS installations at the default search location
# require(link2GI)
# link2GI::initProj(projRootDir = tempdir(),
Expand All @@ -30,12 +30,12 @@
# require(link2GI)
# require(RSAGA)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# saga1<-link2GI::linkSAGA(ver_select = 1)
# saga1
# sagaEnv1<- RSAGA::rsaga.env(path = saga1$sagaPath)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # get meuse data as sp object and link it temporary to GRASS
# require(link2GI)
# require(sp)
Expand All @@ -53,7 +53,7 @@
#
# linkGRASS(meuse)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# require(link2GI)
# require(sf)
#
Expand All @@ -67,7 +67,7 @@
#
# grass<-linkGRASS(nc,returnPaths = TRUE)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# library(link2GI)
# require(sf)
#
Expand Down Expand Up @@ -98,11 +98,11 @@
# spatial_params = c(-84.32385, 33.88199,-75.45698,36.58965,proj4_string))
#

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # Link the GRASS installation and define the search location
# linkGRASS(nc, search_path = "~")

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# findGRASS()
# instDir version installation_type
# 1 /opt/grass 7.8.1 grass78
Expand All @@ -113,19 +113,19 @@
# # corresponding linkage running windows
# linkGRASS(nc,c("C:/Program Files/GRASS GIS7.0.5","GRASS GIS 7.0.5","NSIS"))

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# linkGRASS(nc, ver_select = TRUE)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# linkGRASS(x = nc,
# gisdbase = "~/temp3",
# location = "project1")

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# linkGRASS(gisdbase = "~/temp3", location = "project1",
# gisdbase_exist = TRUE)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# linkGRASS(spatial_params = c(178605,329714,181390,333611,
# "+proj=sterea +lat_0=52.15616055555555
# +lon_0=5.38763888888889 +k=0.9999079
Expand All @@ -135,15 +135,15 @@
# -0.398957,0.343988,-1.8774,4.0725
# +to_meter=1"))

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# # link to the installed OTB
# otblink<-link2GI::linkOTB()
#
#
# # get the list of modules from the linked version
# algo<-parseOTBAlgorithms(gili = otblink)

## ---- eval=FALSE--------------------------------------------------------------
## ----eval=FALSE---------------------------------------------------------------
# ## for the example we use the edge detection,
# algoKeyword<- "EdgeExtraction"
#
Expand All @@ -161,11 +161,8 @@
# otblink<-link2GI::linkOTB()
# projRootDir<-tempdir()
#
# data('rgb', package = 'link2GI')
# terra::plotRGB(rgb)
# r<-terra::writeRaster(rgb,
# filename=file.path(projRootDir,"test.tif"),
# format="GTiff", overwrite=TRUE)
# fn <- system.file("ex/elev.tif", package = "terra")
#
# ## for the example we use the edge detection,
# algoKeyword<- "EdgeExtraction"
#
Expand All @@ -176,7 +173,7 @@
# listviewer::jsonedit(cmd$help)
#
# ## define the mandantory arguments all other will be default
# cmd$input <- file.path(projRootDir,"test.tif")
# cmd$input <- fn
# cmd$filter <- "touzi"
# cmd$channel <- 2
# cmd$out <- file.path(projRootDir,paste0("out",cmd$filter,".tif"))
Expand Down
9 changes: 3 additions & 6 deletions vignettes/link2GI2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,8 @@ require(listviewer)
otblink<-link2GI::linkOTB()
projRootDir<-tempdir()
data('rgb', package = 'link2GI')
terra::plotRGB(rgb)
r<-terra::writeRaster(rgb,
filename=file.path(projRootDir,"test.tif"),
format="GTiff", overwrite=TRUE)
fn <- system.file("ex/elev.tif", package = "terra")
## for the example we use the edge detection,
algoKeyword<- "EdgeExtraction"
Expand All @@ -298,7 +295,7 @@ cmd<-parseOTBFunction(algo = algoKeyword, gili = otblink)
listviewer::jsonedit(cmd$help)
## define the mandantory arguments all other will be default
cmd$input <- file.path(projRootDir,"test.tif")
cmd$input <- fn
cmd$filter <- "touzi"
cmd$channel <- 2
cmd$out <- file.path(projRootDir,paste0("out",cmd$filter,".tif"))
Expand Down
Loading

0 comments on commit 29db6ee

Please sign in to comment.