[GRASS-stats] Mapset issue with vector data via OGR plugin
Roger Bivand
Roger.Bivand at nhh.no
Fri Aug 14 12:22:40 EDT 2009
On Fri, 14 Aug 2009, Markus Neteler wrote:
> On Fri, Aug 14, 2009 at 11:40 AM, Roger Bivand<Roger.Bivand at nhh.no> wrote:
>> On Fri, 14 Aug 2009, Markus Neteler wrote:
>>> I have some troubles when the vector map name contains the
>>> @mapset part:
>>
>> This is a consequence of the plugin only searching in the current user's
>> mapset, so using extra code to scan other mapsets:
>>
>> if (is.null(mapset)) mapset <- .g_findfile(vname[1], type="vector")
>> dsn <- paste(gg$GISDBASE, gg$LOCATION_NAME, mapset,
>> "vector", vname, "head", sep="/")
>>
>> where .g_findfile() runs g.findfile. This seems to fail when @mapset is
>> given.
Could you try out the revisions on sourceforge CVS:
cvs -z3 \
-d:pserver:anonymous at r-spatial.cvs.sourceforge.net:/cvsroot/r-spatial co \
-P spgrass6
I think it works, but checking wouldn't hurt!
Best wishes,
Roger
>
> I have made a test:
>
> GRASS 6.5.svn (spearfish60):~ > g.findfile element=vector
> file=rand5k_elev_filt at neteler mapset=neteler
> name='rand5k_elev_filt at neteler'
> mapset='neteler'
> fullname='rand5k_elev_filt at neteler'
> file='/home/neteler/grassdata/spearfish60/neteler/vector/rand5k_elev_filt'
>
> GRASS 6.5.svn (spearfish60):~ > g.findfile element=vector
> file=rand5k_elev_filt at claus mapset=neteler
> ERROR: Parameter 'file' contains reference to <claus> mapset, but mapset
> parameter <neteler> does not correspond
>
> At least it does not crash...
>
>> I guess that the work-around is to use the argument mapset="neteler"
>> in readVECT6() and readRAST6() for now, but I could look at trying to detect
>> the @ and use it (in the plugin case only) to assign to a null mapset,
>> throwing an error if mapset is non-null and @ is used.
>
> This would be nice. I am currently testing "v.krige.py" from Anne
> and it (I guess the underlying GRASS wxGUI part) adds automatically
> the @mapset part to the map even when it is in the current mapset.
>
> I am not sure how to solve that in order to make the R code overly
> complex.
>
>> Hope this helps,
>
> Thanks for you explanations (and potential error trapping),
> Markus
>
--
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