<div dir="ltr"><div>Here's the return from the latest version:<br><br><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><span class="" style="color:blue;white-space:pre">> </span><span class="" style="color:blue">zm.fnl <- readVECT(zm.gnrl)
</span>Exporting 29 areas (may take some time)...

VOUTOG~1 complete. 29 features (Polygon type) written to <k4610e1>
(ESRI_Shapefile format).
OGR data source with driver: ESRI Shapefile 
Source: "C:/Users/ediez1/AppData/Local/Temp/Rtmp0MDfLZ/file2b9e445e7487a/file2b9e47fcf5925/.tmp/unknown", layer: "k4610e1"
with 29 features
It has 3 fields
<span class="" style="color:rgb(197,6,11)">Warning message:
</span><span class="" style="color:rgb(197,6,11)">In vColumns(vname) :</span><span class="" style="color:rgb(197,6,11)"> vColumns: <a href="http://v.info">v.info</a> -c output not in two columns:
Displaying column types/names for database connection of layer <1>:</span></pre><br></div>Regards<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-11 16:49 GMT-03:00 Roger Bivand <span dir="ltr"><<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, 11 Oct 2015, Eduardo Diez wrote:<br>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
With today's development version it works with the warning you mentioned.<br>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
zm.fnl <- readVECT(zm.gnrl)Exporting 29 areas (may take some time)...<br>
</blockquote><span class="">
<br>
VOUTOG~1 complete. 29 features (Polygon type) written to <dc2ad04><br>
(ESRI_Shapefile format).<br>
OGR data source with driver: ESRI Shapefile<br>
Source: "C:/Users/ediez1/AppData/Local/Temp/RtmpW8PKp3/file2b88c7f0f107d/file2b88c71f92564/.tmp/unknown",<br>
layer: "dc2ad04"<br>
with 29 features<br></span>
It has 3 fieldsWarning message:In vColumns(vname) : vColumns: <a href="http://v.info" rel="noreferrer" target="_blank">v.info</a><span class=""><br>
-c output not all in two columns<br>
</span></blockquote>
<br>
Please try:<br>
<br>
<a href="http://win-builder.r-project.org/miws6tzuLCCJ" rel="noreferrer" target="_blank">http://win-builder.r-project.org/miws6tzuLCCJ</a><br>
<br>
for a new version that should report the !=2 columns lines, and accommodates a safety fix to use Markus' suggestion to retrieve the db type, and drop the fix for long file names if the GRASS db driver is nor sqlite.<span class="HOEnZb"><font color="#888888"><br>
<br>
Roger</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks a lot for all the time invested in developing and mantaining these<br>
wonderful  tools everyone can use.<br>
<br>
A side question: is there a way of performing the same thing i'm trying to<br>
do from GRASS (i.e. removing specific sized polygons by including them into<br>
larger ones) from plain R without needing to call external functions?<br>
<br>
Thanks again<br>
Eduardo<br>
<br>
<br>
2015-10-11 11:28 GMT-03:00 Roger Bivand <<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, 10 Oct 2015, Roger Bivand wrote:<br>
<br>
On Sat, 10 Oct 2015, Eduardo Diez wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This is what i got:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
vinfo0 <- execGRASS("<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a>", flags="c", map=zm.gnrl)INTEGER|cat<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
INTEGER|ID<br>
INTEGER|GRIDCODE<br>
Displaying column types/names for database connection of layer <1>:<br>
<br>
<br>
And trying to read back the original polygon (without v.clean):<br>
<br>
zm.fnl <- readVECT(zm.pol)Error in scan(file, what, nmax, sep, dec,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
quote,<br>
<br>
</blockquote>
skip, nlines, na.strings,  :<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 line 4 did not have 2 elements<br>
<br>
<br>
</blockquote>
This is coming from:<br>
<br>
    G_message(_("Displaying column types/names for database connection of<br>
layer <%s>:"), field_opt);<br>
<br>
line 134 in vector/<a href="http://v.info/print.c" rel="noreferrer" target="_blank">v.info/print.c</a>.<br>
<br>
For me in nc_basic, for schools, I do not see the message with:<br>
<br>
vinfo0 <- execGRASS("<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a>", flags="c", map="schools", layer="1",<br>
 intern=TRUE)<br>
<br>
which is what is being used in vColumns. Is there an alternative to<br>
<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a> that may be less error-prone?<br>
<br>
</blockquote>
<br>
The development Windows binary of rgrass7 at:<br>
<br>
<a href="http://win-builder.r-project.org/9YK08bQi1ldt" rel="noreferrer" target="_blank">http://win-builder.r-project.org/9YK08bQi1ldt</a><br>
<br>
is an attempt to address a problem I cannot reproduce (with GRASS 7.0.1<br>
Windows standalone) - instead of assuming two-column output, it drops lines<br>
with != 2 columns and issues a warning if they were found.<br>
<br>
There is a further weakness in the readVECT code involving a conditional<br>
assumption that the db driver is sqlite - is there any way to check from<br>
outside which driver is being used?<br>
<br>
Roger<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Roger<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
2015-10-10 13:12 GMT-03:00 Roger Bivand <<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>>:<br>
<br>
On Sat, 10 Oct 2015, Eduardo Diez wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Apparently "<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a>" through execGRASS is expecting the "layer"<br>
argument to<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
be a string rather than an integer.<br>
<br>
<br>
</blockquote>
Yes, please re-run with "1"; this resulted from GRASS6 to GRASS7<br>
over-enthusiastic changing everything just for fun - this isn't the<br>
problem. Run (assuming that zm.gnrl contains a character string):<br>
<br>
vinfo0 <- execGRASS("<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a>", flags="c", map=zm.gnrl)<br>
<br>
My guess is that <a href="http://v.info" rel="noreferrer" target="_blank">v.info</a> is saying that this map is broken, or suffering<br>
from something that vColumns does not know about.<br>
<br>
<a href="http://v.info" rel="noreferrer" target="_blank">v.info</a> -c map=<br>
<br>
should simply respond with "<storage type>|<name>" lines for the fields<br>
in<br>
the layer. Here, its fourth line (unlike the first three) does not have<br>
<br>
</blockquote>
two<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
elements (the type/name pairs).<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Does readVECT() work if you do not use v.clean? Is v.clean having a side<br>
effect of causing <a href="http://v.info" rel="noreferrer" target="_blank">v.info</a> -c to "say" something else? How should the<br>
input<br>
columns of the object to be cleaned be turned into output columns<br>
(simply<br>
copy across the retained areas?)?<br>
<br>
Roger<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
</blockquote>
--<br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: +47 55 95 93 55; fax +47 55 95 91 00<br>
e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a><br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
-- <br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: +47 55 95 93 55; fax +47 55 95 91 00<br>
e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a><br>
<br>
</div></div></blockquote></div><br></div>