<div dir="ltr"><div dir="ltr">Hi again,<div>At moment the solution I found it is this but is not very great.</div><div><br></div><div>So I add two R packages more (GmAMisc to import raster and vector, and tkcl to print a message box)</div><div><br></div><div>below the code:</div><div><div><br></div><div>##load_vector_using_rgdal</div><div>##load_raster_using_rgdal</div><div>##movecost script=group</div><div>##DTM=raster</div><div>##Origin=vector point</div><div>##Destination=vector point</div><div>##Movecost=name</div><div>##Move=number 8</div><div>##Breaks=number 0.5</div><div>##Function=selection t;tofp;mp;icmonp;icmoffp;icfonp;ug;alb;gkrs;r;ree;hrz;wcs;p;vl;ls;b;icfoffp ;</div><div>##Time=selection h;m ;</div><div>##Outp=selection r;c ;</div><div>##Return_Base=selection TRUE;FALSE ;</div><div>##Cognitive_Slope=selection FALSE;TRUE ;</div><div>##Critical_Slope=number 1</div><div>##Walker_Body_Weight=number 70</div><div>##Carried_Load_Weight=number 0</div><div>##N=number 1</div><div>##Speed=number 1</div><div>##Zoom_Level=number 9</div><div>##RL=number 2</div><div>##CL=selection  TRUE;FALSE ;</div><div>##DL=selection  TRUE;FALSE ;</div><div>##CB=number 0.6</div><div>##CLL=number 0.6</div><div>##Output=output folder</div><div>##Output_Isoline=output vector</div><div>##Output_LCP=output vector</div><div>##Output_Isoline=output vector</div><div>##Output_Cost_Surface=output raster</div><div>##Output_Accum_Cost_Surface=output raster</div><div>##showplots</div><div>setwd(Output)</div><div><br></div><div>library(tcltk)</div><div>library(sp)</div><div>library(movecost)</div><div>library(GmAMisc)</div><div>library(raster)</div><div>library(rgdal)</div><div>DTM<-raster(DTM)</div><div>if(Function==0)</div><div><span style="white-space:pre">      </span>Function=c("t")</div><div>if(Function==1)</div><div><span style="white-space:pre">       </span>Function=c("tofp")</div><div>if(Function==2)</div><div><span style="white-space:pre">    </span>Function=c("mp")</div><div>if(Function==3)</div><div><span style="white-space:pre">      </span>Function=c("icmonp")</div><div>if(Function==4)</div><div><span style="white-space:pre">  </span>Function=c("icmoffp")</div><div>if(Function==5)</div><div><span style="white-space:pre"> </span>Function=c("icfonp")</div><div>if(Function==6)</div><div><span style="white-space:pre">  </span>Function=c("ug")</div><div>if(Function==7)</div><div><span style="white-space:pre">      </span>Function=c("alb")</div><div>if(Function==8)</div><div><span style="white-space:pre">     </span>Function=c("gkrs")</div><div>if(Function==9)</div><div><span style="white-space:pre">    </span>Function=c("r")</div><div>if(Function==10)</div><div><span style="white-space:pre">      </span>Function=c("ree")</div><div>if(Function==11)</div><div><span style="white-space:pre">    </span>Function=c("hrz")</div><div>if(Function==12)</div><div><span style="white-space:pre">    </span>Function=c("wcs")</div><div>if(Function==13)</div><div><span style="white-space:pre">    </span>Function=c("p")</div><div>if(Function==14)</div><div><span style="white-space:pre">      </span>Function=c("vl")</div><div>if(Function==15)</div><div><span style="white-space:pre">     </span>Function=c("ls")</div><div>if(Function==16)</div><div><span style="white-space:pre">     </span>Function=c("b")</div><div>if(Function==17)</div><div><span style="white-space:pre">      </span>Function=c("icfoffp")</div><div>if(Time==0)</div><div><span style="white-space:pre">     </span>Time=c("h")</div><div>if(Time==1)</div><div><span style="white-space:pre">       </span>Time=c("m")</div><div>if(Outp==0)</div><div><span style="white-space:pre">       </span>Outp=c("r")</div><div>if(Outp==1)</div><div><span style="white-space:pre">       </span>Outp=c("c")</div><div><span style="white-space:pre"> </span></div><div>if(Return_Base==0)<span style="white-space:pre">    </span></div><div><span style="white-space:pre">      </span>Return_Base=c(TRUE)</div><div>if(Return_Base==1)<span style="white-space:pre"> </span></div><div><span style="white-space:pre">      </span>Return_Base=c(FALSE)</div><div><span style="white-space:pre">  </span></div><div>if(Cognitive_Slope==0)<span style="white-space:pre">        </span></div><div><span style="white-space:pre">      </span>Cognitive_Slopee=c(TRUE)</div><div>if(Cognitive_Slope==1)<span style="white-space:pre">        </span></div><div><span style="white-space:pre">      </span>Cognitive_Slope=c(FALSE)<span style="white-space:pre">     </span></div><div><br></div><div>if(CL==0)<span style="white-space:pre">    </span></div><div><span style="white-space:pre">      </span>CL=c(TRUE)</div><div>if(CL==1)<span style="white-space:pre">   </span></div><div><span style="white-space:pre">      </span>CL=c(FALSE)<span style="white-space:pre">  </span></div><div><br></div><div>if(DL==0)<span style="white-space:pre">    </span></div><div><span style="white-space:pre">      </span>DL=c(TRUE)</div><div>if(DL==1)<span style="white-space:pre">   </span></div><div><span style="white-space:pre">      </span>DL=c(FALSE)<span style="white-space:pre">          </span></div><div>result<-movecost(dtm=DTM, origin=Origin, destin=Destination, funct=Function, time=Time, outp=Outp, move=Move, breaks=Breaks,return.base=Return_Base, cogn.slp=Cognitive_Slope, sl.crit=Critical_Slope,W=Walker_Body_Weight,L=Carried_Load_Weight,N=N,V=Speed,z=Zoom_Level,rb.lty=RL,cont.lab=CL,destin.lab=DL,cex.breaks=CB,cex.lcp.lab=CLL, export=TRUE)</div><div><br></div><div>msgBox <- tkmessageBox(title = "Import Vector",</div><div>                       message = "Import vector isolines .shp!", icon = "info", type = "ok")</div><div>Output_Isoline=impShp()</div><div>msgBox2 <- tkmessageBox(title = "Import Vector",</div><div>                       message = "Import vector LCPs .shp!", icon = "info", type = "ok")</div><div>Output_LCP=impShp()</div><div>msgBox3 <- tkmessageBox(title = "Import Raster",</div><div>                       message = "Import raster cost surface!", icon = "info", type = "ok")</div><div>raster1<-impRst()</div><div>raster1.sp <- as(raster1, "SpatialPixelsDataFrame") # Converting the RasterLayer object to a SpatialPixelsDataFrame object</div><div>Output_Cost_Surface=raster1.sp</div><div>msgBox4 <- tkmessageBox(title = "Import Raster",</div><div>                       message = "Import raster accum cost surface !", icon = "info", type = "ok")</div><div><br></div><div>raster2<-impRst()</div><div>raster2.sp <- as(raster2, "SpatialPixelsDataFrame") # Converting the RasterLayer object to a SpatialPixelsDataFrame object</div><div>Output_Accum_Cost_Surface=raster2.sp</div></div><div><br></div><div>If some one has some tricks better, should very approciate.</div><div><br></div><div>thanks</div><div>E</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 1 lug 2021 alle ore 11:07 Enzo Cocca <<a href="mailto:enzo.ccc@gmail.com">enzo.ccc@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi peoples,<div>I have a question: </div><div>In my r script I save (some raster and some vector file) in an a folder. Is it a method to load my output into qgis?</div><div>I can't use output vector and output raster for some reason regarding the R packages that I use.</div><div><br></div><div>so this one is my script:</div><div><br></div><div><div>##load_vector_using_rgdal</div><div>##load_raster_using_rgdal</div><div>##movecost script=group</div><div>##Movecost=name<br></div><div>##DTM=raster</div><div>##Origin=vector point</div><div>##Destination=vector point</div><div>##Move=number 8</div><div>##Breaks=number 0.5</div><div>##Function=selection t;tofp;mp;icmonp;icmoffp;icfonp;ug;alb;gkrs;r;ree;hrz;wcs;p;vl;ls;b;icfoffp</div><div>##Time=selection h;m </div><div>##Outp=selection r;c </div><div>##Return_Base=selection TRUE;FALSE</div><div>##Cognitive_Slope=selection TRUE;FALSE</div><div>##Critical_Slope=number 1</div><div>##Walker_Body_Weight=number 70</div><div>##Carried_Load_Weight=number 0</div><div>##N=number 1</div><div>##Speed=number 1</div><div>##Zoom_Level=number 9</div><div>##RL=number 2</div><div>##CL=selection TRUE;FALSE</div><div>##DL=selection TRUE;FALSE</div><div>##CB=number 0.6</div><div>##CLL=number 0.6</div><div>##Output=output folder</div><div>##showplots</div><div>setwd(Output)</div><div>library(sp)</div><div>library(movecost)</div><div>library(raster)</div><div>library(rgdal)</div><div>DTM<-raster(DTM)</div><div>if(Function==0)</div><div><span style="white-space:pre-wrap">      </span>Function=c("t")</div><div>if(Function==1)</div><div><span style="white-space:pre-wrap">  </span>Function=c("tofp")</div><div>if(Function==2)</div><div><span style="white-space:pre-wrap">       </span>Function=c("mp")</div><div>if(Function==3)</div><div><span style="white-space:pre-wrap"> </span>Function=c("icmonp")</div><div>if(Function==4)</div><div><span style="white-space:pre-wrap">     </span>Function=c("icmoffp")</div><div>if(Function==5)</div><div><span style="white-space:pre-wrap">    </span>Function=c("icfonp")</div><div>if(Function==6)</div><div><span style="white-space:pre-wrap">     </span>Function=c("ug")</div><div>if(Function==7)</div><div><span style="white-space:pre-wrap"> </span>Function=c("alb")</div><div>if(Function==8)</div><div><span style="white-space:pre-wrap">        </span>Function=c("gkrs")</div><div>if(Function==9)</div><div><span style="white-space:pre-wrap">       </span>Function=c("r")</div><div>if(Function==10)</div><div><span style="white-space:pre-wrap"> </span>Function=c("ree")</div><div>if(Function==11)</div><div><span style="white-space:pre-wrap">       </span>Function=c("hrz")</div><div>if(Function==12)</div><div><span style="white-space:pre-wrap">       </span>Function=c("wcs")</div><div>if(Function==13)</div><div><span style="white-space:pre-wrap">       </span>Function=c("p")</div><div>if(Function==14)</div><div><span style="white-space:pre-wrap"> </span>Function=c("vl")</div><div>if(Function==15)</div><div><span style="white-space:pre-wrap">        </span>Function=c("ls")</div><div>if(Function==16)</div><div><span style="white-space:pre-wrap">        </span>Function=c("b")</div><div>if(Function==17)</div><div><span style="white-space:pre-wrap"> </span>Function=c("icfoffp")</div><div>if(Time==0)</div><div><span style="white-space:pre-wrap">        </span>Time=c("h")</div><div>if(Time==1)</div><div><span style="white-space:pre-wrap">  </span>Time=c("m")</div><div>if(Outp==0)</div><div><span style="white-space:pre-wrap">  </span>Outp=c("r")</div><div>if(Outp==1)</div><div><span style="white-space:pre-wrap">  </span>Outp=c("c")</div><div><span style="white-space:pre-wrap">    </span></div><div>if(Return_Base==0)<span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap"> </span>Return_Base=c(TRUE)</div><div>if(Return_Base==1)<span style="white-space:pre-wrap">    </span></div><div><span style="white-space:pre-wrap"> </span>Return_Base=c(FALSE)</div><div><span style="white-space:pre-wrap">     </span></div><div>if(Cognitive_Slope==0)<span style="white-space:pre-wrap">   </span></div><div><span style="white-space:pre-wrap"> </span>Cognitive_Slopee=c(TRUE)</div><div>if(Cognitive_Slope==1)<span style="white-space:pre-wrap">   </span></div><div><span style="white-space:pre-wrap"> </span>Cognitive_Slope=c(FALSE)<span style="white-space:pre-wrap">        </span></div><div><br></div><div>if(CL==0)<span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap"> </span>CL=c(TRUE)</div><div>if(CL==1)<span style="white-space:pre-wrap">      </span></div><div><span style="white-space:pre-wrap"> </span>CL=c(FALSE)<span style="white-space:pre-wrap">     </span></div><div><br></div><div>if(DL==0)<span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap"> </span>DL=c(TRUE)</div><div>if(DL==1)<span style="white-space:pre-wrap">      </span></div><div><span style="white-space:pre-wrap"> </span>DL=c(FALSE)<span style="white-space:pre-wrap">             </span></div><div>result<-movecost(dtm=DTM, origin=Origin, destin=Destination, funct=Function, time=Time, outp=Outp, move=Move, breaks=Breaks,return.base=Return_Base, cogn.slp=Cognitive_Slope, sl.crit=Critical_Slope,W=Walker_Body_Weight,L=Carried_Load_Weight,N=N,V=Speed,z=Zoom_Level,rb.lty=RL,cont.lab=CL,destin.lab=DL,cex.breaks=CB,cex.lcp.lab=CLL, export=TRUE)</div></div><div><br></div><div>thanks in advance</div><div><br></div><div>E</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Enzo Cocca PhD</div><div dir="ltr">in "Science and Technology for Archaeology and Cultural Heritage"</div><div dir="ltr"><br></div><div dir="ltr"><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;background-color:transparent"><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible">ISMEO</span></div><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible">International Association of Mediterranean and Oriental Studies </div></div><br></div><div dir="ltr"><img width="200" height="75" style="font: 400 13.33px / 19.99px Arial, Helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: visible; text-decoration: none; word-spacing: 0px; white-space: normal; background-color: transparent;" src="https://docs.google.com/uc?export=download&id=1ho_PBK4C-4cl8Ubqw4oyvusZOhM5P92l&revid=0B2EWPB0itz-iQ3dwZVBaaTVKcEN4VUpwa09scDNRNmNvQkw0PQ"></div><div dir="ltr"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br><div>mail: <a href="mailto:enzo.ccc@gmail.com" target="_blank">enzo.ccc@gmail.com</a></div><div>cell: +393495087014</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Enzo Cocca PhD</div><div dir="ltr">in "Science and Technology for Archaeology and Cultural Heritage"</div><div dir="ltr"><br></div><div dir="ltr"><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;background-color:transparent"><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible">ISMEO</span></div><div style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;overflow:visible">International Association of Mediterranean and Oriental Studies </div></div><br></div><div dir="ltr"><img width="200" height="75" style="font: 400 13.33px / 19.99px Arial, Helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: visible; text-decoration: none; word-spacing: 0px; white-space: normal; background-color: transparent;" src="https://docs.google.com/uc?export=download&id=1ho_PBK4C-4cl8Ubqw4oyvusZOhM5P92l&revid=0B2EWPB0itz-iQ3dwZVBaaTVKcEN4VUpwa09scDNRNmNvQkw0PQ"></div><div dir="ltr"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br><div>mail: <a href="mailto:enzo.ccc@gmail.com" target="_blank">enzo.ccc@gmail.com</a></div><div>cell: +393495087014</div><div><br></div></div></div></div></div></div></div></div></div>