On Fri, 28 Oct 2011, toke wrote:


I think that I might have found a bug in spgrass6 or I might be doing
something wrong. When I call v.distance within R it seems to calculate but
it do not update the column of interest.

Im using the the following software:

platform    x86_64-pc-linux-gnu 10.10
language   R
version.string R version 2.13.2 (2011-09-30)

Here are my script

R

#calling library
library(spgrass6)
# checking GRASS setup
gmeta6()

output:
gisdbase    /home/toke/Desktop/PHD/databehandling/artikel_3/gis/grassdb
location    mapset
mapset      aalborg
rows        1200
columns     1100
north       6328400
south       6316400
west        551800
east        562800
nsres       10
ewres       10
projection  +proj=utm +no_defs +zone=32 +a=6378137 +rf=298.257222101
+to_meter=1

# reading spatial files from GRASS database
recrea_h <-readVECT6("recrea_h")
area_b1 <-readVECT6("area_b1")

execGRASS("v.distance", flags=c("overwrite"), from="recrea_h", to="area_b1",
from_type="centroid", to_type="area", dmax=as.integer(1),
+ upload="to_attr", column="area_b1", to_column="value")
100%
100%
84 categories - no nearest feature found
235 categories read from the map
235 categories exist in the table
235 categories read from the map exist in the table
235 records updated
v.distance complete.

The column is not updated even though it seems that it is actually are
calculating.

The same calculation in GRASS works.

Please show your exact GRASS command line - otherwise we can only conclude that you are asking for different things. You are asking for a maximum distance of integer 1 metres here, so you should look carefully at the 84 categories - no nearest feature found message - did that also appear in the output from running the command directly in GRASS?

Roger


Cheers Toke


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Problem-with-v-distance-in-spgrass6-package-in-R-tp6939286p6939286.html
Sent from the Grass - Stats mailing list archive at Nabble.com.
_______________________________________________
grass-stats mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-stats


--
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [email protected]

_______________________________________________
grass-stats mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-stats

Reply via email to