[GRASS-stats] Towards spgrass7

Rainer M Krug Rainer at krugs.de
Wed Jan 21 01:43:28 PST 2015


Roger Bivand <Roger.Bivand at nhh.no> writes:

> On Tue, 20 Jan 2015, Rainer M Krug wrote:
>
>> Sorry if this has been received before - but I don't seem to be able to
>> post via gmane?
>
> Sorry, don't know about gmane.
>
>>
>> Roger Bivand <Roger.Bivand-aX1nC9UfZf8 at public.gmane.org> writes:
>>
>>> On Thu, 15 Jan 2015, Markus Neteler wrote:
>>>
>>>> Dear Roger,
>>>>
>>>> On Thu, Jan 15, 2015 at 1:10 PM, Roger Bivand <Roger.Bivand-aX1nC9UfZf8 at public.gmane.org> wrote:
>>>>> Dear Markus,
>>>>>
>>>>> Good to hear you are well! Great that RC1 is ready!
>>>>
>>>> Yeah, it took us a while but the latest cleanup efforts where really
>>>> important. I expect that we will proceed from RC1 to final release
>>>> rather fast (finally!).
>>>>
>>>>> Yes, I guess it would be sensible to condition on version in these cases, so
>>>>> first add comments for hard-coded flags and options (there are also some
>>>>> changes in type, I think). In addition, bin_out_win in parseGRASS() needs
>>>>> updating and/or conditioning on version, and the logic for handling where
>>>>> Python scripts are found should be looked at.
>>>>
>>>> Yes, fine.
>>>>
>>>>> You do not (yet) have commit rights on:
>>>>> https://r-forge.r-project.org/projects/rspatial/ where spgrass6 lives.
>>>>
>>>> I have now registered on R-Forge.
>>>>
>>>>> Two alignments: should GRASS5 support (GRASS packages) be dropped (yes)?
>>>>
>>>> Yes, dropped.
>>>>
>>>>> Should spgrass6 be forked into (new) spgrass which supports >= 7, and leave
>>>>> spgrass6 for 6.*?
>>>>
>>>> I'd support to fork in order to not have too many conditions in the code.
>>>>
>>>>> If fork, is SVN on R-Forge OK?
>>>>
>>>> Yes.
>>>
>>> After forking, as of now:
>>>
>>> install.packages("spgrass", repos="http://R-Forge.R-project.org")
>>>
>>> installs the "new" package for GRASS 7. Function names are now without
>>> the trailing 6 to avoid confusion, and all examples run correctly in
>>> Spearfish in GRASS 7.0 RC1.
>>>
>>> Could someone please run the examples in Spearfish in GRASS 7.0 RC1 on
>>> Windows after installing the Windoes spgrass binary (R 3.1) from
>>> R-Forge, and report back?
>>>
>>> Could someone please install spgrass from source on OSX (pre-Yosemite
>>> and Yosemite), run the examples in Spearfish, and report back?
>>
>> I installed now spgrass and have the GRASS 7 Spearfish dataset. Which
>> examples are you referring to to be run?
>
> Thanks for looking. I provided commit rights on R-forge, so if you see
> things that need fixing, please do so!
>
> (Yosemite should have been Mavericks, of course). The examples are on
> the help pages, so running R inside GRASS 7 something like:

OK - here are now the results from the tests with rc1.

>
> library(spgrass)

Working

> example(execGRASS)

Warning:
running command 'r.stats -C -n input=fire_blocksgg 2>&1' had status 1

> example(gmeta)

Working

> example(spgrass)

Working

> example(readRAST)

Working

> example(readVECT)

There seems to be something wrong with finding the help here - no idea
why:

Warning message:
In example(readVect) : no help found for ‘readVect’

But running the example from ?readVECT manually does not produce any
errors.

SO it looks good for me.

The transcript can be found below.

Let me know if there is anything I should look into tomorrow.

Thanks,

Rainer

>
> interactively would be a possibility.
>
> I guess that the package will move to nc_basic to align better with
> GRASS 7.
>
> Best wishes,
>
> Roger
>


The transcript:

,----
| 10:33:58 ~$ grass70 ~/spearfish60_grass7/user1/
| Cleaning up temporary files...
| Starting GRASS GIS...
| 
|           __________  ___   __________    _______________
|          / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
|         / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
|        / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
|        \____/_/ |_/_/  |_/____/____/   \____/___//____/
| 
| Welcome to GRASS 7.0.0RC1
| GRASS homepage:                          http://grass.osgeo.org
| This version running through:            Bash Shell (/usr/local/bin/bash)
| Help is available with the command:      g.manual -i
| See the licence terms with:              g.version -c
| Start the GUI with:                      g.gui wxpython
| When ready to quit enter:                exit
| 
| GRASS 7.0.0RC1 (spearfish60_grass7):~ > R
| 
| R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
| Copyright (C) 2014 The R Foundation for Statistical Computing
| Platform: x86_64-apple-darwin14.1.0 (64-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(spgrass)
| Loading required package: sp
| Loading required package: XML
| GRASS GIS interface loaded with GRASS version: GRASS 7.0.0RC1 (2015)
| and location: spearfish60_grass7
| > example(execGRASS)
| 
| eGRASS> if (nchar(Sys.getenv("GISRC")) > 0) {
| eGRASS+   oechoCmd <- get.echoCmdOption()
| eGRASS+   set.echoCmdOption(TRUE)
| eGRASS+   print(parseGRASS("r.slope.aspect"))
| eGRASS+   doGRASS("r.slope.aspect", flags=c("overwrite"),
| eGRASS+     elevation="elevation.dem", slope="slope", aspect="aspect")
| eGRASS+   pars <- list(elevation="elevation.dem", slope="slope", aspect="aspect")
| eGRASS+   doGRASS("r.slope.aspect", flags=c("overwrite"), parameters=pars)
| eGRASS+   print(parseGRASS("r.buffer"))
| eGRASS+   doGRASS("r.buffer", flags=c("overwrite"), input="bugsites", output="bmap",
| eGRASS+     distances=seq(1000,15000,1000))
| eGRASS+   pars <- list(input="bugsites", output="bmap", distances=seq(1000,15000,1000))
| eGRASS+   doGRASS("r.buffer", flags=c("overwrite"), parameters=pars)
| eGRASS+   set.echoCmdOption(oechoCmd)
| eGRASS+   try(res <- execGRASS("r.stats", input = "fire_blocksgg", # no such file
| eGRASS+     flags = c("C", "n")), silent=FALSE)
| eGRASS+   res <- execGRASS("r.stats", input = "fire_blocksgg", flags = c("C", "n"),
| eGRASS+     legacyExec=TRUE)
| eGRASS+   print(res)
| eGRASS+   if (res != 0) {
| eGRASS+     resERR <- execGRASS("r.stats", input = "fire_blocksgg",
| eGRASS+       flags = c("C", "n"), redirect=TRUE, legacyExec=TRUE)
| eGRASS+     print(resERR)
| eGRASS+   }
| eGRASS+ }
| Command: r.slope.aspect
| Description: Generates raster maps of slope, aspect, curvatures and partial derivatives from an elevation raster map.
| Keywords: Aspect is calculated counterclockwise from east.
| Parameters:
|   name: elevation, type: string, required: yes, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name of input elevation raster map]
|   name: slope, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output slope raster map]
|   name: aspect, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output aspect raster map]
|   name: format, type: string, required: no, multiple: no
|   default: degrees
| [Format for reporting the slope]
|   name: precision, type: string, required: no, multiple: no
|   default: FCELL
| [Type of output aspect and slope maps]
|   name: pcurvature, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output profile curvature raster map]
|   name: tcurvature, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output tangential curvature raster map]
|   name: dx, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output first order partial derivative dx (E-W slope) raster map]
|   name: dy, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output first order partial derivative dy (N-S slope) raster map]
|   name: dxx, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output second order partial derivative dxx raster map]
|   name: dyy, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output second order partial derivative dyy raster map]
|   name: dxy, type: string, required: no, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output second order partial derivative dxy raster map]
|   name: zscale, type: float, required: no, multiple: no
|   default: 1.0
| [Multiplicative factor to convert elevation units to horizontal units]
|   name: min_slope, type: float, required: no, multiple: no
|   default: 0.0
| [Minimum slope value (in percent) for which aspect is computed]
| Flags:
|   name: a [Do not align the current region to the raster elevation map] {FALSE}
|   name: overwrite [Allow output files to overwrite existing files] {FALSE}
|   name: help [Print usage summary] {FALSE}
|   name: verbose [Verbose module output] {FALSE}
|   name: quiet [Quiet module output] {FALSE}
| GRASS command: r.slope.aspect --overwrite elevation=elevation.dem slope=slope aspect=aspect
| GRASS command: r.slope.aspect --overwrite elevation=elevation.dem slope=slope aspect=aspect
| Command: r.buffer
| Description: Creates a raster map showing buffer zones surrounding cells that contain non-NULL category values.
| Keywords: raster, buffer
| Parameters:
|   name: input, type: string, required: yes, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name of input raster map]
|   name: output, type: string, required: yes, multiple: no
|   keydesc: name, keydesc_count: 1
| [Name for output raster map]
|   name: distances, type: float, required: yes, multiple: yes
| [Distance zone(s)]
|   name: units, type: string, required: no, multiple: no
|   default: meters
| [Units of distance]
| Flags:
|   name: z [Ignore zero (0) data cells instead of NULL cells] {FALSE}
|   name: overwrite [Allow output files to overwrite existing files] {FALSE}
|   name: help [Print usage summary] {FALSE}
|   name: verbose [Verbose module output] {FALSE}
|   name: quiet [Quiet module output] {FALSE}
| GRASS command: r.buffer --overwrite input=bugsites output=bmap distances=1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000
| GRASS command: r.buffer --overwrite input=bugsites output=bmap distances=1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000
| Error in execGRASS("r.stats", input = "fire_blocksgg", flags = c("C",  :
|   The command:
| r.stats -C -n input=fire_blocksgg
| produced an error (1) during execution:
| ERROR: Raster map <fire_blocksgg> not found
| ERROR: Raster map <fire_blocksgg> not found
| [1] 1
| [1] "ERROR: Raster map <fire_blocksgg> not found"
| attr(,"status")
| [1] 1
| Warning message:
| running command 'r.stats -C -n input=fire_blocksgg 2>&1' had status 1
| >
| >
| >
| >
| > example(gmeta)
| 
| gmeta> if (nchar(Sys.getenv("GISRC")) > 0) {
| gmeta+   G <- gmeta()
| gmeta+   print(G)
| gmeta+   CRS(getLocationProj())
| gmeta+   grd <- gmeta2grd()
| gmeta+   print(grd)
| gmeta+   ncells <- prod(slot(grd, "cells.dim"))
| gmeta+   df <- data.frame(k=rep(1, ncells))
| gmeta+   mask_SG <- SpatialGridDataFrame(grd, data=df)
| gmeta+   print(summary(mask_SG))
| gmeta+ }
| gisdbase    /Users/rainerkrug
| location    spearfish60_grass7
| 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=/usr/local/Cellar/grass-70/7.0.0RC1/grass-7.0.0RC1/etc/proj/nad/conus
| +to_meter=1.0
|                       X1      X2
| cellcentre.offset 589995 4913715
| cellsize              30      30
| cells.dim            634     477
| Object of class SpatialGridDataFrame
| Coordinates:
|          min     max
| [1,]  589980  609000
| [2,] 4913700 4928010
| Is projected: NA
| proj4string : [NA]
| Grid attributes:
|   cellcentre.offset cellsize cells.dim
| 1            589995       30       634
| 2           4913715       30       477
| Data attributes:
|    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
|       1       1       1       1       1       1
| >
| >
| >
| > library(spgrass)
| > example(spgrass)
| 
| spgrss> if (nchar(Sys.getenv("GISRC")) > 0) {
| spgrss+   require(rgdal)
| spgrss+   soilsph <- readRAST("soils.ph", ignore.stderr=TRUE, plugin=FALSE)
| spgrss+   summary(soilsph)
| spgrss+   grd <- gmeta2grd(ignore.stderr=TRUE)
| spgrss+   grd
| spgrss+   set.seed(1)
| spgrss+   pts <- spsample(soilsph, 200, "random")
| spgrss+   smple <- SpatialPointsDataFrame(pts, data=over(pts, soilsph))
| spgrss+   summary(smple)
| spgrss+   writeVECT(smple, "sp_dem", v.in.ogr_flags="overwrite", ignore.stderr=TRUE)
| spgrss+   bugsDF <- readVECT("bugsites", ignore.stderr=TRUE, mapset="PERMANENT")
| spgrss+   summary(bugsDF)
| spgrss+   vInfo("streams", ignore.stderr=TRUE)
| spgrss+   vColumns("streams", ignore.stderr=TRUE)
| spgrss+   vDataCount("streams", ignore.stderr=TRUE)
| spgrss+   streams <- readVECT("streams", type="line,boundary",
| spgrss+     remove.duplicates=FALSE, ignore.stderr=TRUE, plugin=FALSE)
| spgrss+   summary(streams)
| spgrss+ }
| Loading required package: rgdal
| rgdal: version: 0.9-1, (SVN revision 518)
| Geospatial Data Abstraction Library extensions to R successfully loaded
| Loaded GDAL runtime: GDAL 1.11.1, released 2014/09/24
| Path to GDAL shared files: /usr/local/Cellar/gdal/1.11.1_3/share/gdal
| Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
| Path to PROJ.4 shared files: (autodetected)
| WARNING: Datum <unknown> not recognised by GRASS and no parameters found
| Check if OGR layer <sp_dem> contains polygons...
|  100%
| Importing 200 features (OGR layer <sp_dem>)...
|  100%
| -----------------------------------------------------
| Building topology for vector map <sp_dem at user1>...
| Registering primitives...
| 
| 200 primitives registered
| 200 vertices registered
| Building areas...
|  100%
| 0 areas built
| 0 isles built
| Attaching islands...
| Attaching centroids...
|  100%
| Number of nodes: 0
| Number of primitives: 200
| Number of points: 200
| Number of lines: 0
| Number of boundaries: 0
| Number of centroids: 0
| Number of areas: 0
| Number of isles: 0
| Exporting 90 features...
|  100%
| v.out.ogr complete. 90 features (Point type) written to <bugsites>
| (ESRI_Shapefile format).
| WARNING: 4 centroids found, but not requested to be exported. Verify 'type'
|          parameter.
| WARNING: 4 areas found, but not requested to be exported. Verify 'type'
|          parameter.
| Exporting 116 features...
|  100%
| 104 features without attributes were written
| WARNING: 12 features without category were skipped. Features without
|          category are written only when -c flag is given.
| v.out.ogr complete. 104 features (Line String type) written to <streams>
| (ESRI_Shapefile format).
| Object of class SpatialLinesDataFrame
| Coordinates:
|         min       max
| x  589443.1  609526.8
| y 4913935.5 4928059.2
| Is projected: TRUE
| proj4string :
| [+proj=utm +zone=13 +datum=NAD27 +units=m +no_defs +ellps=clrk66
| +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat]
| Data attributes:
|       cat         label
|  Min.   :1.000   NA's:104
|  1st Qu.:2.000
|  Median :2.000
|  Mean   :1.808
|  3rd Qu.:2.000
|  Max.   :3.000
| >
| >
| >
| >
| > example(readRAST)
| 
| rdRAST> if (nchar(Sys.getenv("GISRC")) > 0) {
| rdRAST+   require(rgdal)
| rdRAST+   ois <- get.ignore.stderrOption()
| rdRAST+   set.ignore.stderrOption(TRUE)
| rdRAST+   get.useGDALOption()
| rdRAST+   spear <- readRAST(c("geology", "elevation.dem"), cat=c(TRUE, FALSE),
| rdRAST+     useGDAL=FALSE)
| rdRAST+   spear <- readRAST(c("geology", "elevation.dem"), cat=c(TRUE, FALSE),
| rdRAST+     useGDAL=TRUE)
| rdRAST+   print(table(spear$geology))
| rdRAST+   execGRASS("r.stats", flags=c("c", "l", "quiet"), input="geology")
| rdRAST+   boxplot(spear$elevation.dem ~ spear$geology)
| rdRAST+   spear$sqdem <- sqrt(spear$elevation.dem)
| rdRAST+   if ("GRASS" %in% gdalDrivers()$name) {
| rdRAST+     execGRASS("g.region", rast="elevation.dem")
| rdRAST+     dem1 <- readRAST("elevation.dem", plugin=TRUE, mapset="PERMANENT")
| rdRAST+     print(summary(dem1))
| rdRAST+     execGRASS("g.region", rast="elevation.dem")
| rdRAST+   }
| rdRAST+   writeRAST(spear, "sqdemSP", zcol="sqdem")
| rdRAST+   execGRASS("r.info", map="sqdemSP")
| rdRAST+   execGRASS("g.remove", flags="f", name="sqdemSP", type="raster")
| rdRAST+   writeRAST(spear, "sqdemSP", zcol="sqdem", useGDAL=TRUE)
| rdRAST+   execGRASS("r.info", map="sqdemSP")
| rdRAST+   print(system.time(sqdemSP <- readRAST(c("sqdemSP", "elevation.dem"),
| rdRAST+     useGDAL=TRUE, return_SGDF=FALSE)))
| rdRAST+   print(system.time(sqdemSP <- readRAST(c("sqdemSP", "elevation.dem"),
| rdRAST+     useGDAL=TRUE, return_SGDF=TRUE)))
| rdRAST+   print(system.time(sqdemSP <- readRAST(c("sqdemSP", "elevation.dem"),
| rdRAST+     useGDAL=FALSE, return_SGDF=TRUE)))
| rdRAST+   print(system.time(sqdemSP <- readRAST(c("sqdemSP", "elevation.dem"),
| rdRAST+     useGDAL=FALSE, return_SGDF=FALSE)))
| rdRAST+   str(sqdemSP)
| rdRAST+   mat <- do.call("cbind", sqdemSP$dataList)
| rdRAST+   str(mat)
| rdRAST+   print(system.time(SGDF <- SpatialGridDataFrame(grid=sqdemSP$grid,
| rdRAST+     proj4string=sqdemSP$proj4string, data=as.data.frame(sqdemSP$dataList))))
| rdRAST+   summary(SGDF)
| rdRAST+   execGRASS("g.remove", flags="f", name="sqdemSP", type="raster")
| rdRAST+   execGRASS("r.mapcalc", expression="quads0 = quads - 1")
| rdRAST+   execGRASS("r.stats", flags="c", input="quads0")
| rdRAST+   quads0 <- readRAST("quads0")
| rdRAST+   print(table(quads0$quads0))
| rdRAST+   quads0 <- readRAST("quads0", plugin=FALSE)
| rdRAST+   print(table(quads0$quads0))
| rdRAST+   execGRASS("g.remove", flags="f", name="quads0", type="raster")
| rdRAST+   set.ignore.stderrOption(ois)
| rdRAST+ }
| Creating BIL support files...
| Exporting raster as integer values (bytes=4)
|  100%
| Creating BIL support files...
| Exporting raster as integer values (bytes=4)
|  100%
| 
| metamorphic  transition     igneous   sandstone   limestone       shale
|       11693         142       36534       74959       61355       46423
| sandy shale    claysand        sand
|       11266       14535       36561
| 1 metamorphic 11693
| 2 transition 142
| 3 igneous 36534
| 4 sandstone 74959
| 5 limestone 61355
| 6 shale 46423
| 7 sandy shale 11266
| 8 claysand 14535
| 9 sand 36561
| * no data 8950
| Hit <Return> to see next plot:
| WARNING: Datum <unknown> not recognised by GRASS and no parameters found
|  100%
| Raster map <sqdemSP> created.
| r.in.gdal complete.
|  +----------------------------------------------------------------------------+
|  | Map:      sqdemSP                        Date: Wed Jan 21 10:36:04 2015    |
|  | Mapset:   user1                          Login of Creator: rainerkrug      |
|  | Location: spearfish60_grass7                                               |
|  | DataBase: /Users/rainerkrug                                                |
|  | Title:     ( sqdemSP )                                                     |
|  | Timestamp: none                                                            |
|  |----------------------------------------------------------------------------|
|  |                                                                            |
|  |   Type of Map:  raster               Number of Categories: 0               |
|  |   Data Type:    FCELL                                                      |
|  |   Rows:         477                                                        |
|  |   Columns:      634                                                        |
|  |   Total Cells:  302418                                                     |
|  |        Projection: UTM (zone 13)                                           |
|  |            N:    4928010    S:    4913700   Res:    30                     |
|  |            E:     609000    W:     589980   Res:    30                     |
|  |   Range of data:    min = 32.64965  max = 42.89522                         |
|  |                                                                            |
|  |   Data Description:                                                        |
|  |    generated by r.in.gdal                                                  |
|  |                                                                            |
|  |   Comments:                                                                |
|  |    r.in.gdal input="/Users/rainerkrug/spearfish60_grass7/user1/.tmp/Rai\   |
|  |    ners-MacBook-Pro-4.local/X724" output="sqdemSP" memory=300 offset=0     |
|  |                                                                            |
|  +----------------------------------------------------------------------------+
| 
| Removing raster <sqdemSP>
| WARNING: Datum <unknown> not recognised by GRASS and no parameters found
|  100%
| Raster map <sqdemSP> created.
| r.in.gdal complete.
|  +----------------------------------------------------------------------------+
|  | Map:      sqdemSP                        Date: Wed Jan 21 10:36:04 2015    |
|  | Mapset:   user1                          Login of Creator: rainerkrug      |
|  | Location: spearfish60_grass7                                               |
|  | DataBase: /Users/rainerkrug                                                |
|  | Title:     ( sqdemSP )                                                     |
|  | Timestamp: none                                                            |
|  |----------------------------------------------------------------------------|
|  |                                                                            |
|  |   Type of Map:  raster               Number of Categories: 0               |
|  |   Data Type:    FCELL                                                      |
|  |   Rows:         477                                                        |
|  |   Columns:      634                                                        |
|  |   Total Cells:  302418                                                     |
|  |        Projection: UTM (zone 13)                                           |
|  |            N:    4928010    S:    4913700   Res:    30                     |
|  |            E:     609000    W:     589980   Res:    30                     |
|  |   Range of data:    min = 32.64965  max = 42.89522                         |
|  |                                                                            |
|  |   Data Description:                                                        |
|  |    generated by r.in.gdal                                                  |
|  |                                                                            |
|  |   Comments:                                                                |
|  |    r.in.gdal input="/Users/rainerkrug/spearfish60_grass7/user1/.tmp/Rai\   |
|  |    ners-MacBook-Pro-4.local/X940" output="sqdemSP" memory=300 offset=0     |
|  |                                                                            |
|  +----------------------------------------------------------------------------+
| 
|    user  system elapsed
|   0.267   0.100   0.412
|    user  system elapsed
|   0.273   0.092   0.393
| Creating BIL support files...
| Exporting raster as floating values (bytes=4)
|  100%
| Creating BIL support files...
| Exporting raster as integer values (bytes=4)
|  100%
|    user  system elapsed
|   0.150   0.073   0.252
| Creating BIL support files...
| Exporting raster as floating values (bytes=4)
|  100%
| Creating BIL support files...
| Exporting raster as integer values (bytes=4)
|  100%
|    user  system elapsed
|   0.146   0.073   0.249
| List of 3
|  $ grid       :Formal class 'GridTopology' [package "sp"] with 3 slots
|   .. ..@ cellcentre.offset: num [1:2] 589995 4913715
|   .. ..@ cellsize         : num [1:2] 30 30
|   .. ..@ cells.dim        : int [1:2] 634 477
|  $ dataList   :List of 2
|   ..$ sqdemSP      : num [1:302418] NA NA NA NA NA NA NA NA NA NA ...
|   ..$ elevation.dem: int [1:302418] NA NA NA NA NA NA NA NA NA NA ...
|  $ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
|   .. ..@ projargs: chr "+proj=utm +zone=13 +a=6378206.4 +rf=294.9786982 +no_defs +nadgrids=/usr/local/Cellar/grass-70/7.0.0RC1/grass-7.0.0RC1/etc/proj/"| __truncated__
|  - attr(*, "class")= chr "gridList"
|  num [1:302418, 1:2] NA NA NA NA NA NA NA NA NA NA ...
|  - attr(*, "dimnames")=List of 2
|   ..$ : NULL
|   ..$ : chr [1:2] "sqdemSP" "elevation.dem"
|    user  system elapsed
|   0.002   0.000   0.001
| Removing raster <sqdemSP>
| 0 145880
| 1 146660
| * 9878
|  100%
| 
|      0      1
| 145880 146660
| 
|      0      1
| 145880 146660
| Removing raster <quads0>
| [1] TRUE
| >
| >
| >
| > example(readVect)
| Warning message:
| In example(readVect) : no help found for ‘readVect’
| > ?readVECT
| > if (nchar(Sys.getenv("GISRC")) > 0) {
| +        require(rgdal)
| +        ois <- get.ignore.stderrOption()
| +        set.ignore.stderrOption(TRUE)
| +        if (execGRASS("g.version", intern=TRUE) > "GRASS 7") {
| +          execGRASS("v.info", map="bugsites", layer="1")
| +        } else {
| +          execGRASS("v.info", map="bugsites", layer=1L)
| +        }
| +        print(vInfo("bugsites"))
| +        bugs <- readVECT("bugsites", plugin=NULL)
| +        print(summary(bugs))
| +        bugs1 <- readVECT("bugsites", plugin=FALSE)
| +        print(summary(bugs1))
| +        writeVECT(bugs, "newbugs", v.in.ogr_flags=c("o", "overwrite"))
| +        if (execGRASS("g.version", intern=TRUE) > "GRASS 7") {
| +          execGRASS("v.info", map="newbugs", layer="1")
| +        } else {
| +          execGRASS("v.info", map="newbugs", layer=1L)
| +        }
| +        nbugs <- readVECT("newbugs")
| +        print(summary(nbugs))
| +        print(vInfo("roads"))
| +        roads <- readVECT("roads")
| +        print(summary(roads))
| +        set.ignore.stderrOption(ois)
| +      }
|  +----------------------------------------------------------------------------+
|  | Name:            bugsites                                                  |
|  | Mapset:          PERMANENT                                                 |
|  | Location:        spearfish60_grass7                                        |
|  | Database:        /Users/rainerkrug                                         |
|  | Title:                                                                     |
|  | Map scale:       1:1                                                       |
|  | Name of creator:                                                           |
|  | Organization:                                                              |
|  | Source date:                                                               |
|  | Timestamp (first layer): none                                              |
|  |----------------------------------------------------------------------------|
|  | Map format:      native                                                    |
|  |----------------------------------------------------------------------------|
|  |   Type of map: vector (level: 2)                                           |
|  |                                                                            |
|  |   Number of points:       90              Number of centroids:  0          |
|  |   Number of lines:        0               Number of boundaries: 0          |
|  |   Number of areas:        0               Number of islands:    0          |
|  |                                                                            |
|  |   Map is 3D:              No                                               |
|  |   Number of dblinks:      1                                                |
|  |                                                                            |
|  |   Projection: UTM (zone unspecified)                                       |
|  |                                                                            |
|  |               N:           4920512    S:           4914096                 |
|  |               E:            608471    W:            590232                 |
|  |                                                                            |
|  |   Digitization threshold: 0                                                |
|  |   Comment:                                                                 |
|  |                                                                            |
|  +----------------------------------------------------------------------------+
| 
|      nodes     points      lines boundaries  centroids      areas    islands
|          0         90          0          0          0          0          0
| primitives      map3d
|         90          0
| Exporting 90 features...
|  100%
| v.out.ogr complete. 90 features (Point type) written to <bugsites>
| (ESRI_Shapefile format).
| Object of class SpatialPointsDataFrame
| Coordinates:
|               min     max
| coords.x1  590232  608471
| coords.x2 4914096 4920512
| Is projected: TRUE
| proj4string :
| [+proj=utm +zone=13 +datum=NAD27 +units=m +no_defs +ellps=clrk66
| +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat]
| Number of points: 90
| Data attributes:
|       cat                 str1
|  Min.   : 1.00   Beetle site:90
|  1st Qu.:23.25
|  Median :45.50
|  Mean   :45.50
|  3rd Qu.:67.75
|  Max.   :90.00
| Exporting 90 features...
|  100%
| v.out.ogr complete. 90 features (Point type) written to <bugsites>
| (ESRI_Shapefile format).
| Object of class SpatialPointsDataFrame
| Coordinates:
|               min     max
| coords.x1  590232  608471
| coords.x2 4914096 4920512
| Is projected: TRUE
| proj4string :
| [+proj=utm +zone=13 +datum=NAD27 +units=m +no_defs +ellps=clrk66
| +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat]
| Number of points: 90
| Data attributes:
|       cat                 str1
|  Min.   : 1.00   Beetle site:90
|  1st Qu.:23.25
|  Median :45.50
|  Mean   :45.50
|  3rd Qu.:67.75
|  Max.   :90.00
| Over-riding projection check
| Check if OGR layer <newbugs> contains polygons...
|  100%
| Column name <cat> renamed to <cat_>
| Importing 90 features (OGR layer <newbugs>)...
|  100%
| -----------------------------------------------------
| Building topology for vector map <newbugs at user1>...
| Registering primitives...
| 
| 90 primitives registered
| 90 vertices registered
| Building areas...
|  100%
| 0 areas built
| 0 isles built
| Attaching islands...
| Attaching centroids...
|  100%
| Number of nodes: 0
| Number of primitives: 90
| Number of points: 90
| Number of lines: 0
| Number of boundaries: 0
| Number of centroids: 0
| Number of areas: 0
| Number of isles: 0
|  +----------------------------------------------------------------------------+
|  | Name:            newbugs                                                   |
|  | Mapset:          user1                                                     |
|  | Location:        spearfish60_grass7                                        |
|  | Database:        /Users/rainerkrug                                         |
|  | Title:                                                                     |
|  | Map scale:       1:1                                                       |
|  | Name of creator: rainerkrug                                                |
|  | Organization:                                                              |
|  | Source date:     Wed Jan 21 10:37:06 2015                                  |
|  | Timestamp (first layer): none                                              |
|  |----------------------------------------------------------------------------|
|  | Map format:      native                                                    |
|  |----------------------------------------------------------------------------|
|  |   Type of map: vector (level: 2)                                           |
|  |                                                                            |
|  |   Number of points:       90              Number of centroids:  0          |
|  |   Number of lines:        0               Number of boundaries: 0          |
|  |   Number of areas:        0               Number of islands:    0          |
|  |                                                                            |
|  |   Map is 3D:              No                                               |
|  |   Number of dblinks:      1                                                |
|  |                                                                            |
|  |   Projection: UTM (zone 13)                                                |
|  |                                                                            |
|  |               N:           4920512    S:           4914096                 |
|  |               E:            608471    W:            590232                 |
|  |                                                                            |
|  |   Digitization threshold: 0                                                |
|  |   Comment:                                                                 |
|  |                                                                            |
|  +----------------------------------------------------------------------------+
| 
| Exporting 90 features...
|  100%
| v.out.ogr complete. 90 features (Point type) written to <newbugs>
| (ESRI_Shapefile format).
| Object of class SpatialPointsDataFrame
| Coordinates:
|               min     max
| coords.x1  590232  608471
| coords.x2 4914096 4920512
| Is projected: TRUE
| proj4string :
| [+proj=utm +zone=13 +datum=NAD27 +units=m +no_defs +ellps=clrk66
| +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat]
| Number of points: 90
| Data attributes:
|       cat             cat_                str1
|  Min.   : 1.00   Min.   : 1.00   Beetle site:90
|  1st Qu.:23.25   1st Qu.:23.25
|  Median :45.50   Median :45.50
|  Mean   :45.50   Mean   :45.50
|  3rd Qu.:67.75   3rd Qu.:67.75
|  Max.   :90.00   Max.   :90.00
|      nodes     points      lines boundaries  centroids      areas    islands
|        676          0        825          0          0          0          0
| primitives      map3d
|        825          0
| Exporting 825 features...
|  100%
| v.out.ogr complete. 825 features (Line String type) written to <roads>
| (ESRI_Shapefile format).
| Object of class SpatialLinesDataFrame
| Coordinates:
|         min       max
| x  589434.9  609527.2
| y 4914006.3 4928063.4
| Is projected: TRUE
| proj4string :
| [+proj=utm +zone=13 +datum=NAD27 +units=m +no_defs +ellps=clrk66
| +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat]
| Data attributes:
|       cat                                  label
|  Min.   :1   interstate                       :1
|  1st Qu.:2   light-duty road, improved surface:1
|  Median :3   primary highway, hard surface    :1
|  Mean   :3   secondary highway, hard surface  :1
|  3rd Qu.:4   unimproved road                  :1
|  Max.   :5
| [1] TRUE
| >
`----




>>
>> Rainer
>>
>>>
>>> The existing spgrass6 does not work with GRASS 7 following recent
>>> changes in GRASS parameter names - it may be modified either to permit
>>> these, or to remove GRASS 7 conditions, leaving it just for GRASS 6.
>>>
>>> Best wishes,
>>>
>>> Roger
>>>
>>>>
>>>> Best wishes,
>>>> Markus
>>>>
>>
>>

-- 
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 :       +33 - (0)9 58 10 27 44

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

email:      Rainer at krugs.de

Skype:      RMkrug

PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-stats/attachments/20150121/b255d05a/attachment-0001.pgp>


More information about the grass-stats mailing list