[STATSGRASS] CRS(): PROJ4 argument-value pairs must begin with +

rsadler at cyllene.uwa.edu.au rsadler at cyllene.uwa.edu.au
Thu Sep 29 01:32:04 EDT 2005


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=" ")

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






More information about the grass-stats mailing list