<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi Manuel,</div>

<div> </div>

<div>yes, this is the old error message. I guess QGIS/GRASS did not produce any output. Since you specified the load_output argument, the function tries to load it into R. First it tries to read a shapefile, if this not works, it tries to read a raster file. That's also the reason why the error message talks of a raster problem. Using the RQGIS developer version from github the function would tell you now that QGIS did not produce any output.</div>

<div> </div>

<div>Without the shapefile I can't tell you what went wrong. You can send it to me or you could also try to first use QGIS interactively to see if while using the GUI an output will be produced. Please note also that is does not make much sense to load the line shapefile into R when it is already saved on disk. Because now you read in the shapefile and run_qgis saves it again to the temporary folder. So it would be more efficient to indicate the file path to the shapefile in the input-argument</div>

<div> </div>

<div>Kind regards,</div>

<div> </div>

<div>Jannes</div>

<div> </div>
 

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Donnerstag, 24. November 2016 um 16:00 Uhr<br/>
<b>Von:</b> "Manuel Spínola" <mspinola10@gmail.com><br/>
<b>An:</b> "Jannes Münchow" <malNamalJa@gmx.de><br/>
<b>Cc:</b> "r-sig-geo@r-project.org" <r-sig-geo@r-project.org><br/>
<b>Betreff:</b> Re: Re: [R-sig-Geo] v.split.length (GRASS) in R</div>

<div>
<div>Thank you Jannes,
<div> </div>

<div>I installed the QGIS LTR, but I got the following error:</div>

<div> </div>

<div>qgis_env <- set_env("C:/Program Files/QGIS 2.14")</div>

<div> </div>

<div>ruta <- readOGR(dsn = ".", layer = "Ruta32_CRTM05_FINAL")</div>

<div> </div>

<div>args <- get_args_man("grass7:v.split.length", qgis_env = qgis_env, options = TRUE)</div>

<div> </div>

<div>args$input <- ruta</div>

<div> </div>

<div>args$length <- 500</div>

<div> </div>

<div>args$output <- "ruta_s.shp"</div>

<div> </div>

<div>
<div>out <- run_qgis(alg = "grass7:v.split.length", params = args, load_output = args$output, qgis_env = qgis_env)</div>

<div> </div>
</div>

<div>
<div>Error in .local(.Object, ...) : </div>

<div> </div>

<div> Show Traceback</div>

<div>Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. (file does not exist)</div>
</div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>
</div>

<div class="gmail_extra"> 
<div class="gmail_quote">2016-11-24 3:43 GMT-06:00 "Jannes Münchow" <span><<a href="mailto:malNamalJa@gmx.de" onclick="parent.window.location.href='malNamalJa@gmx.de'; return false;" target="_blank">malNamalJa@gmx.de</a>></span>:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div>Hi Manuel,</div>

<div> </div>

<div>overall we recommend to use RQGIS with the long-term release of QGIS (2.14). Nevertheless, RQGIS works also with QGIS 2.18. However, there is a bug in the QGIS Python code. Therefore, one needs to manually change the Python code. Here you find how you can do that:</div>

<div> </div>

<div><a href="https://github.com/jannes-m/RQGIS#qgis-216-modifications" target="_blank">https://github.com/jannes-m/RQGIS#qgis-216-modifications</a>.</div>

<div> </div>

<div>Regarding this issue, we have already notified the QGIS developers, and they told us that they fixed the issue. Hence, with the release of the next QGIS patch release, the manual adjustment of the Python code should no longer be necessary.</div>

<div> </div>

<div>Best regards,</div>

<div> </div>

<div>Jannes</div>

<div> </div>

<div><br/>
 </div>

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Mittwoch, 23. November 2016 um 20:49 Uhr<br/>
<b>Von:</b> "Manuel Spínola" <<a href="mailto:mspinola10@gmail.com" onclick="parent.window.location.href='mspinola10@gmail.com'; return false;" target="_blank">mspinola10@gmail.com</a>><br/>
<b>An:</b> "Jannes Münchow" <<a href="mailto:malNamalJa@gmx.de" onclick="parent.window.location.href='malNamalJa@gmx.de'; return false;" target="_blank">malNamalJa@gmx.de</a>><br/>
<b>Cc:</b> "<a href="mailto:r-sig-geo@r-project.org" onclick="parent.window.location.href='r-sig-geo@r-project.org'; return false;" target="_blank">r-sig-geo@r-project.org</a>" <<a href="mailto:r-sig-geo@r-project.org" onclick="parent.window.location.href='r-sig-geo@r-project.org'; return false;" target="_blank">r-sig-geo@r-project.org</a>><br/>
<b>Betreff:</b> Re: [R-sig-Geo] v.split.length (GRASS) in R</div>

<div>
<div class="h5">
<div>
<div>Thank you very much Jannes.
<div> </div>

<div>Does the example works with QGIS 2.18 or should I do some setting in QGIS before running the code?</div>

<div> </div>

<div>Manuel</div>
</div>

<div class="gmail_extra"> 
<div class="gmail_quote">2016-11-23 8:45 GMT-06:00 "Jannes Münchow" <span><<a href="mailto:malNamalJa@gmx.de" onclick="parent.window.location.href='malNamalJa@gmx.de'; return false;" target="_blank">malNamalJa@gmx.de</a>></span>:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">To achieve this, you can also use the RQGIS-package in conjunction with GRASS given you have installed QGIS along with GRASS (for more information have a look at vignette("install_guide", package = "RQGIS"):<br/>
<br/>
# construct a SpatialPointsDataFrame (which will be accepted as input by<br/>
# run_qgis)<br/>
library("sp")<br/>
# from the sp vignette:<br/>
l1 <- cbind(c(1, 2, 3), c(3, 2, 2))<br/>
rownames(l1) <- letters[1:3]<br/>
l1a <- cbind(l1[, 1] + 0.05, l1[, 2] + 0.05)<br/>
rownames(l1a) <- letters[1:3]<br/>
l2 <- cbind(c(1, 2, 3), c(1, 1.5, 1))<br/>
rownames(l2) <- letters[1:3]<br/>
Sl1 <- Line(l1)<br/>
Sl1a <- Line(l1a)<br/>
Sl2 <- Line(l2)<br/>
S1 <- Lines(list(Sl1, Sl1a), ID = "a")<br/>
S2 <- Lines(list(Sl2), ID = "b")<br/>
Sl <- SpatialLines(list(S1, S2))<br/>
# convert it to a SpatialLinesDataFrame<br/>
Sl <- SpatialLinesDataFrame(Sl, data = data.frame(1:2), match.ID = FALSE)<br/>
proj4string(Sl) <- CRS("+proj=longlat +datum=WGS84")<br/>
<br/>
# Now use RQGIS<br/>
library("RQGIS")<br/>
# indicate where QGIS is installed on your computer<br/>
qgis_env <- set_env("C:/OSGeo4W64/")<br/>
args <- get_args_man("grass7:v.split.length", qgis_env = qgis_env,<br/>
                     options = TRUE)<br/>
# have a look at the GRASS online help<br/>
open_help("grass7:v.split.length", qgis_env = qgis_env)<br/>
<br/>
# specify the necessary arguments<br/>
args$input <- Sl<br/>
# here length corresponds to one decimal degree<br/>
args$length <- "1"<br/>
args$output <- file.path(tempdir(), "out.shp")<br/>
# load the output directly into R again<br/>
out <- run_qgis(alg = "grass7:v.split.length", params = args,<br/>
                load_output = args$output,<br/>
                qgis_env = qgis_env)<br/>
length(Sl)  # 2 line objects<br/>
length(out)  #  9 line objects<br/>
# Have a look at the output<br/>
plot(out, col = rep(c("blue", "green", "black"), 3))<br/>
 <br/>
Cheers,<br/>
<br/>
Jannes<br/>
<br/>
_______________________________________________<br/>
R-sig-Geo mailing list<br/>
<a href="mailto:R-sig-Geo@r-project.org" onclick="parent.window.location.href='R-sig-Geo@r-project.org'; return false;" target="_blank">R-sig-Geo@r-project.org</a><br/>
<a href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a></blockquote>
</div>
 

<div> </div>
--

<div class="m_-2402236628175268669gmail_signature">
<div>
<div><b>Manuel Spínola, Ph.D.</b><br/>
Instituto Internacional en Conservación y Manejo de Vida Silvestre<br/>
Universidad Nacional<br/>
Apartado 1350-3000<br/>
Heredia<br/>
COSTA RICA<br/>
<a href="mailto:mspinola@una.ac.cr" onclick="parent.window.location.href='mspinola@una.ac.cr'; return false;" target="_blank">mspinola@una.cr</a><br/>
<a href="mailto:mspinola10@gmail.com" onclick="parent.window.location.href='mspinola10@gmail.com'; return false;" target="_blank">mspinola10@gmail.com</a><br/>
Teléfono: (506) 8706 - 4662<br/>
Personal website: <a href="https://sites.google.com/site/lobitoderio/" target="_blank">Lobito de río</a><br/>
Institutional website: <a href="http://www.icomvis.una.ac.cr/" target="_blank">ICOMVIS</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail_signature">
<div>
<div><b>Manuel Spínola, Ph.D.</b><br/>
Instituto Internacional en Conservación y Manejo de Vida Silvestre<br/>
Universidad Nacional<br/>
Apartado 1350-3000<br/>
Heredia<br/>
COSTA RICA<br/>
<a href="mailto:mspinola@una.ac.cr" onclick="parent.window.location.href='mspinola@una.ac.cr'; return false;" target="_blank">mspinola@una.cr</a><br/>
<a href="mailto:mspinola10@gmail.com" onclick="parent.window.location.href='mspinola10@gmail.com'; return false;" target="_blank">mspinola10@gmail.com</a><br/>
Teléfono: (506) 8706 - 4662<br/>
Personal website: <a href="https://sites.google.com/site/lobitoderio/" target="_blank">Lobito de río</a><br/>
Institutional website: <a href="http://www.icomvis.una.ac.cr/" target="_blank">ICOMVIS</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>