<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear all<br>
<br>
I am working on windows 7.<br>
<br>
I have update my version of GRASS GIS 7.0.4 and R-3.2.5.<br>
<br>
I try to work with my old tools and I meet a problem with function
InitGrass. i just want to share this problem and if possible
understand if the problem depend on my installation of grass and r
or release of InitGrass.<br>
<br>
Before I can use:<br>
loc=initGRASS(gisBase = <br>
Chemin_de_l_exe_de_Grass,home=Chemin_des_donnees_Grass,gisDbase=Chemin_des_donnees_Grass,location=Localisation,mapset=Jeu_de_donnees,override=T)<br>
I have this problem:<br>
<span class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-size:
13px; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 15px; orphans: 2;
text-align: -webkit-left; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(242, 242, 242); ">
<div class="GEWYW5YBHDC GEWYW5YBAEB ace_constant" style="display:
inline; color: rgb(197, 6, 11); ">Error in if (class(t0) !=
"try-error" && is.character(t0) && nchar(t0)
> : missing value where TRUE/FALSE needed</div>
<br>
I thonk it is in this osurce code:<br>
<a class="moz-txt-link-freetext" href="https://github.com/cran/rgrass7/blob/master/R/xml1.R">https://github.com/cran/rgrass7/blob/master/R/xml1.R</a><br>
</span><br>
I solve the problem uisng a false folder<br>
loc=initGRASS(gisBase =
Chemin_de_l_exe_de_Grass,home=Chemin_des_donnees_Grass,gisDbase=Chemin_des_donnees_Grass,addon_base=Chemin_de_l_exe_de_Grass,location=Localisation,mapset=Jeu_de_donnees,override=T)<br>
<br>
Best regards<br>
<br>
File: C:\Program Files\R\R-3.2.5\Cerema<br>
#Chemin de l'exe de Grass<br>
C:\GRASS GIS 7.0.4<br>
#Monde Grass temporaire (1=oui, 0=non)<br>
0<br>
#Chemin des donnees Grass<br>
C:\GRASSDATA<br>
#Localisation<br>
Cerema<br>
#Jeu de donnees<br>
test<br>
#Projection (EPSG)<br>
2154<br>
#Chemin des routines R<br>
C:/PROGRA~1/R/R-32~1.5/cerema<br>
<br>
<br>
Code:<br>
# DICARTO_00_LectureMondeGrass<br>
# Version 2.0 06/10/2015<br>
# Cerema<br>
# Frederic Pons, Celine Trmal<br>
<br>
DICARTO_00_LectureMondeGrass =
function(chem_routine,Numero_de_calcul)<br>
{<br>
# Lecture de l'initialisation et création du monde Grass<br>
fichier_init=paste(chem_routine,"\\Init_Routine_Cerema",as.character(Numero_de_calcul),".txt",sep="")<br>
fid=file(fichier_init, open = "r")<br>
lignes <- readLines(fid)<br>
close(fid)<br>
<br>
Chemin_de_l_exe_de_Grass=as.character(lignes[2])<br>
Chemin_des_donnees_Grass=as.character(lignes[6])<br>
Localisation=as.character(lignes[8])<br>
Jeu_de_donnees=as.character(lignes[10])<br>
Projection=as.numeric(lignes[12])<br>
Monde_grass_temp=as.numeric(lignes[4])<br>
<br>
if (Monde_grass_temp==0) {<br>
loc=initGRASS(gisBase =
Chemin_de_l_exe_de_Grass,home=Chemin_des_donnees_Grass,gisDbase=Chemin_des_donnees_Grass,addon_base=Chemin_de_l_exe_de_Grass,location=Localisation,mapset=Jeu_de_donnees,override=T)<br>
## convert default coordinate system x,y to epsg code 3347 (can
be altered later)<br>
#execGRASS("g.mapset",flags=c("c"),parameters=list(mapset="PERMANENT"))<br>
#execGRASS("g.proj",flags=c("c"),epsg=as.integer(Projection))<br>
#execGRASS("g.mapset",flags=c("c"),parameters=list(mapset=Jeu_de_donnees))<br>
} else {<br>
loc=initGRASS(Chemin_de_l_exe_de_Grass,
home=tempdir(),addon_base=Chemin_de_l_exe_de_Grass,override=T)<br>
}<br>
<br>
return(cbind(Chemin_de_l_exe_de_Grass,loc$GISDBASE,loc$LOCATION,loc$MAPSET,Projection))<br>
}<br>
<div class="moz-signature">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<title></title>
<font size="2,5" face="Arial"><b>
Frédéric Pons
</b></font><br>
<div class="moz-signature">
<div class="moz-signature"> <font size="1" color="#666666"
face="Arial"><b>
Expert hydraulique sur les inondations et aléas côtiers
<br>
</b></font><font size="1" color="#666666" face="Arial"><b>
DREC/Service Risques Inondations Littoraux et Hydraulique
</b></font><font size="1" color="#666666" face="Arial"><b> -
Tél.: (33)4 42 24 76 68
</b></font><br>
<font size="1" color="#666666" face="Arial"><b>
Direction Territoriale Méditerranée<br>
</b></font>
<img alt="" src="cid:part1.07070407.00020804@cerema.fr"
height="45" width="183"><br>
<div class="moz-signature"><font size="1" color="#ee7f00"
face="Arial">Centre d’études et d’expertise sur les
risques, l’environnement, la mobilité et l’aménagement
</font><br>
<a href="http://www.cerema.fr" class="moz-signature"><font
size="4" color="#ee7f00" face="Arial">www.cerema.fr</font></a><br>
</div>
</div>
</div>
</div>
<br>
</body>
</html>