[GRASS-stats] Re: Problem with v.distance in spgrass6 package in R

Rainer M Krug r.m.krug at gmail.com
Thu Nov 3 07:18:16 EDT 2011


On Thu, Nov 3, 2011 at 11:57 AM, toke <tepp at life.ku.dk> wrote:

> Hi tanks for your interest
>
> Im still not able to make it work. It must be the programs I am using which
> do not comply.
>
> Im using
> R version 2.14.0
> And
> Grass 6.4.1
> And
> Ubunutu 11.10
>
> All installed recently installed. I will let you know if I find the
> problem.
>

Sorry - came late to the discussion, but it seems to work here to - but
please check:

Same configuration - Ubuntu Oneiric, here is the transcript:

 GRASS 6.4.1 (spearfish60):~ > R

R version 2.14.0 (2011-10-31)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> library(spgrass6)
Loading required package: sp
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.8.1, released 2011/07/09
Path to GDAL shared files: /home/rkrug/share/gdal
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files: (autodetected)
Loading required package: XML
GRASS GIS interface loaded with GRASS version: GRASS 6.4.1 (2011)
and location: spearfish60
> gmeta6()
gisdbase    /home/rkrug/Downloads
location    spearfish60
mapset      user1
rows        477
columns     634
north       4928010
south       4913700
west        589980
east        609000
nsres       30
ewres       30
projection  +proj=utm +zone=13 +a=6378206.4 +rf=294.9786982 +no_defs
+nadgrids=/home/rkrug/grass-6.4.1/etc/nad/conus +to_meter=1.0
> fields1<-readVECT6("fields1")
Available OGR Drivers:
WARNING: The map contains islands. To preserve them in the output map, use
         the -c flag
Exporting 65 areas (may take some time)...
 100%
67 features written
OGR data source with driver: ESRI Shapefile
Source: "/home/rkrug/Downloads/spearfish60/user1/.tmp/ecolmod", layer:
"fields1"
with 67 features and 2 fields
Feature type: wkbPolygon with 2 dimensions
> archsites1<-readVECT6("archsites1")
Available OGR Drivers:
Exporting 25 points/lines...
 100%
25 features written
OGR data source with driver: ESRI Shapefile
Source: "/home/rkrug/Downloads/spearfish60/user1/.tmp/ecolmod", layer:
"archsite"
with 25 features and 3 fields
Feature type: wkbPoint with 2 dimensions
> archsites1
         coordinates cat                 str1 fields
1  (593493, 4914730)   1       Signature Rock     NA
2  (591950, 4923000)   2              No Name     NA
3  (589860, 4922000)   3       Canyon Station     NA
4  (590400, 4922820)   4      Spearfish Creek     NA
5  (593549, 4925500)   5              No Name     NA
6  (600375, 4925240)   6         Prairie Site     NA
7  (606635, 4920770)   7          Jensen Pass     NA
8  (595755, 4925300)   8              No Name     NA
9  (601000, 4926310)   9              No Name     NA
10 (602550, 4917370)  10 Slaughterhouse Gulch     NA
11 (591635, 4924340)  11              No Name     NA
12 (603000, 4925250)  12         Elkhorn Peak     NA
13 (592100, 4921200)  13              No Name     NA
14 (592600, 4922000)  14              No Name     NA
15 (604194, 4925980)  15              No Name     NA
16 (608200, 4915900)  16  Boulder Creek Cabin     NA
17 (601400, 4925450)  17                Ridge     NA
18 (591000, 4916000)  18      Cole Creek Mine     NA
19 (607150, 4916650)  19              No Name     NA
20 (593690, 4914480)  20              No Name     NA
21 (608355, 4926490)  21      Whitewood Flats     NA
22 (597945, 4918950)  22           Bob Miller     NA
23 (607159, 4917000)  23              No Name     NA
24 (591583, 4925280)  24         Hanson Ranch     NA
25 (602580, 4918480)  25              No Name     NA
> set.echoCmdOption(TRUE)
[1] FALSE
> set.echoCmdOption(TRUE)
[1] TRUE
> execGRASS("v.distance", from="archsites1", to="fields1",
from_type="point", to_type="point,line,area", dmax=as.integer(1),
upload="to_attr", column="fields", to_column="cat")
GRASS command: v.distance from=archsites1 to=fields1 from_type=point
to_type=point,line,area dmax=1 upload=to_attr column=fields to_column=cat
 100%
 100%
 100%
25 categories read from the map
25 categories exist in the table
25 categories read from the map exist in the table
25 records updated
v.distance complete.
> execGRASS("v.distance", flags="p", from="archsites1",
+ to="fields1", from_type="point", to_type="point,line,area",
+ dmax=as.integer(1),
+ upload="to_attr", column="fields", to_column="cat")
GRASS command: v.distance -p from=archsites1 to=fields1 from_type=point
to_type=point,line,area dmax=1 upload=to_attr column=fields to_column=cat
 100%
 100%
 100%
from_cat|fields
1|63
2|63
3|63
4|63
5|null
6|null
7|null
8|null
9|25
10|63
11|null
12|null
13|63
14|63
15|null
16|63
17|null
18|63
19|63
20|63
21|null
22|63
23|63
24|null
25|63
v.distance complete.
>     execGRASS("v.distance", flags="p", from="archsites1", to="fields1",
+
+ from_type="point", to_type="point,line,area", dmax=as.integer(1),
upload="to_attr", column="fields", to_column="cat")
GRASS command: v.distance -p from=archsites1 to=fields1 from_type=point
to_type=point,line,area dmax=1 upload=to_attr column=fields to_column=cat
 100%
 100%
 100%
from_cat|fields
1|63
2|63
3|63
4|63
5|null
6|null
7|null
8|null
9|25
10|63
11|null
12|null
13|63
14|63
15|null
16|63
17|null
18|63
19|63
20|63
21|null
22|63
23|63
24|null
25|63
v.distance complete.
> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=C                 LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] spgrass6_0.7-4 XML_3.4-3      rgdal_0.7-1    sp_0.9-91

loaded via a namespace (and not attached):
[1] grid_2.14.0     lattice_0.19-33
> q()
Save workspace image? [y/n/c]: n
GRASS 6.4.1 (spearfish60):~ >



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



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-stats/attachments/20111103/cfec471d/attachment-0001.html


More information about the grass-stats mailing list