[STATSGRASS] New release of spgrass6, now works on CygWin

Roger Bivand Roger.Bivand at nhh.no
Fri Sep 30 03:11:45 EDT 2005


Following Rohan's question below, I have completed some more steps on
spgrass6, and have just released version 0.1-5 on r-spatial. This version
replaces v.in.ascii/v.out.ascii for moving sites (vector points) by
v.in.ogr and v.out.ogr, and the package now depends on the maptools
package, which should also be installed. The raster reading functions now
allow multiple rasters to be read into the same SpatialGridDataFrame
object.

Finally, the package now works (for me) under CygWin, so a Windows binary 
package is also released (at last). The package now uses g.tempfile and 
converts the path to Windows fron CygWin using cygpath -w, giving R access 
to the same file/directory as GRASS under CygWin (R thinks it is running 
on Windows, GRASS is running on CygWin which is running on Windows). I 
would be very grateful for feedback on these changes.

Roger

PS. Install instructions from R:

rSpatial <- "http://r-spatial.sourceforge.net/R"
install.packages("spgrass6", repos=rSpatial)


On Thu, 29 Sep 2005, rsadler at cyllene.uwa.edu.au wrote:

> Your updated code works fine.
> 
> Now, its time for me to see to what is not working in the rest of my
> code!!
> 
> Rohan
> 
> > On running readCELL6sp we have an error
> >
> > >system("r.mapcalc test.product5=test51*test52")
> > >  test.junk<-readCELL6sp("test.product5")
> >  Error in readCELL6sp("test.product5") : Object "projargs" not found
> >
> > This arises on line 12 & 13 of readCELL6sp (and readFLOAT6sp) where
> > projargs is used but not previously defined.
> >
> > if (is.na(projargs)) uprojargs <- projstr
> >     else uprojargs <- paste(unique(unlist(strsplit(projargs, " "))),
> >                                     collapse=" ")
> 
> Sorry, I added some extra checks to prevent the creation of the CRS object
> throwing an error, setting the projection string to NA instead, without
> checking. The attached works for me on spearfish and on a vanilla XY
> location (where the projection is set to NA).
> 
> Roger
> 
> >
> > sp and maptools upgraded
> >
> > Rohan
> >
> >
> > >> I have just installed grass6.0 on a new machine, and come up with a
> new
> > >> error (for me!).
> > >
> > >
> > >>  test5x<-readCELL6sp("test.product5")
> > >> Error in CRS(system("g.proj -j -f", intern = TRUE)) :
> > >>         PROJ4 argument-value pairs must begin with +: XY location
> > >> (unprojected)
> >
> > >Thanks, the current code assumes that g.proj -j -f always returns a
> valid
> > >PROJ.4 string, which isn't the case for XY locations. The next release
> > >will check more carefully, and will set the coordinate reference system
> > to
> > >NA if it doesn't look like a valid string.
> >
> > >>
> > >> It looks like the CRS function in readCELL6sp is not liking the
> > projection
> > >> information (or lack thereof), hence can't provide a projection when
> > >> reading in ascii.grid format.  When I exclude P4<-CRS(...) and just
> use
> > >> CRS(as.char(NA)) my later functions that process the coverage bug
> out.
> > >>
> >
> > >Since I can't see where the "later functions that process the coverage"
> > >might hit trouble, I'm attaching a file with the modified code to
> > source()
> > >- could you then report details of what happens next (you will also
> need
> > >to install the maptools package and upgrade sp to >= 0.8)?
> >
> > >Roger
> >
> >
> >
> > _______________________________________________
> > statsgrass mailing list
> > statsgrass at grass.itc.it
> > http://grass.itc.it/mailman/listinfo/statsgrass
> >
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the grass-stats mailing list