Skip to content

spgrass6 and null values

2 messages · Facundo Muñoz, Roger Bivand

#
Hello list,

while exporting vector maps form GRASS to R using readVECT6(spgrass6), 
null values in attributes become zeroes in R, and makes them 
undistinguishable from real zero-valued attributes.

I'm making a work-around, by previously replacing zeroes by 0.5 in GRASS 
(wich is an impossible value) and then reverting once in R.

But i wonder if there is a correct way of doing this that i didn't find. 
If not, i suggest to add the feature of passing null values to NAs and 
viceversa.

Greetings
       Facundo Mu?oz
       Universidad de Valencia
       Spain
#
On Fri, 7 Mar 2008, Facundo Mu?oz wrote:

            
This is a "feature" of shapefiles - the format used for the intermediate 
file. There is no known workaround, as as far as I know, there is no 
general workaround using v.out.ogr and v.in.ogr in the other direction. 
This is now noted on the readVECT6 function help page.
I think that this lies on the v.out.ogr side - does anyone know of 
null-aware generic DB drivers on the GRASS side - the db.* SQL references 
refer to null handling, but can the nulls be exported? It would be 
unfortunate to restrict use of null-aware interface mechanisms to a 
particular driver.

Ideas?

Roger