Hi,<div><br></div><div>I've been using GRASS and R for a few months now, and just ran into a snag. We added some new attribute columns to our vector file in GRASS, and now when I try to move the data into R the transfer fails.</div>
<div><br></div><div>The original vector map in grass was imported from a shapefile. I then used v.db.addcol and v.rast.stats to add more attributes to the vector map.</div><div><br></div><div>I first thought it had to do with null values, so I tried adding a column filled with a constant value. This didn't help.</div>
<div><br></div><div>I tried to reproduce the error in SPEARFISH, columns added with v.rast.stats were fine, but v.db.addcol wouldn't execute.</div><div><br></div><div><br></div><div>I don't know why the installation let me add columns in one location and not another, maybe this is the root cause or another issue all together?</div>
<div><br></div><div><div>v.db.addcolumn --verbose map=landuse@PERMANENT layer=1 columns=test </div><div>Adding column <test> to the table</div><div>DBMI-DBF driver error:</div><div>SQL parser error (syntax error, unexpected $end processing</div>
<div>'') in statement:</div><div>ALTER TABLE landuse ADD COLUMN test</div><div>Unable to execute statement.</div><div>ERROR: Error while executing: 'ALTER TABLE landuse ADD COLUMN test'</div><div>ERROR: Unable to add column <test>.</div>
</div><div><br></div><div><br></div><div>Any ideas for what I'm missing, or a workaround to get the data to R? (I was supposed to get an R data file ready today for others to work with that aren't used to GRASS...I had previously done the GRASS->R transfer via a script a number of times, and didn't expect any problems!)</div>
<div><br></div><div>Here are the R messages:</div><div><br></div><div><div>> source("/home/emomsen/Documents/loaddata.R")</div><div><br></div><div>first command in file:</div><div>field2007<-readVECT6("ACSC_2007_Field_Boundary")</div>
<div><br></div><div>Loading required package: rgdal</div><div>Geospatial Data Abstraction Library extensions to R successfully loaded</div>
<div>Loaded GDAL runtime: GDAL 1.9.0, released 2011/12/29</div><div>Path to GDAL shared files: /usr/local/share/gdal</div><div>Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]</div><div>Path to PROJ.4 shared files: (autodetected)</div>
<div>Available OGR Drivers:</div><div>Warning 1: Field COUNTY of width 1000 truncated to 255.</div><div>....snip... these are OK</div><div>ERROR 6: Failed to add field named 'HARVEST_DAY'</div><div>ERROR 6: Failed to add field named 'NDVI_04_B_DAY'</div>
</div><div>....snip...These were added with v.db.addcol</div><div><div>ERROR 6: Failed to add field named 'NDVI_04_B_mean'</div></div><div>...snip,... there are about 100 of these, extended statistics for 10 rasters.</div>
<div><br></div><div><br></div><div>The import does finish, all of the "original" columns for the shapefile are imported to R. v.db.select shows most of the attribute columns together (the last ones are lost from the line length), and querying the map gives all the attributes.</div>
<div><br></div><div>Thanks for any help!</div><div><br></div><div>Eric</div><div><br></div><div><div>> sessionInfo()</div><div>R version 2.14.1 (2011-12-22)</div><div>Platform: x86_64-pc-linux-gnu (64-bit)</div><div><br>
</div><div>locale:</div><div> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C </div><div> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 </div><div> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 </div>
<div> [7] LC_PAPER=C LC_NAME=C </div><div> [9] LC_ADDRESS=C LC_TELEPHONE=C </div><div>[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C </div><div><br></div>
<div>attached base packages:</div><div>[1] stats graphics grDevices utils datasets methods base </div><div><br></div><div>other attached packages:</div><div>[1] rgdal_0.7-8 spgrass6_0.7-10 XML_3.9-4 sp_0.9-98 </div>
<div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] grid_2.14.1 lattice_0.20-0</div></div><div><br></div><div><br></div><div><div>g.gisenv -n </div>
<div>LANG=en_US.UTF-8</div><div>GRASS_ADDON_PATH=/home/emomsen/v.krige</div><div>GISDBASE=/home/shared/research/GRASSDATA</div><div>LOCATION_NAME=transferField</div><div>ADDON_PATH=/home/emomsen/v.krige</div><div>GUI=wxpython</div>
<div>MAPSET=PERMANENT</div></div><div><br></div>