[GRASS-stats] Mapset issue with vector data via OGR plugin

Markus Neteler neteler at osgeo.org
Fri Aug 14 05:48:49 EDT 2009


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.

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


More information about the grass-stats mailing list