[GRASS-stats] Mapset issue with vector data via OGR plugin
Markus Neteler
neteler at osgeo.org
Fri Aug 14 13:13:31 EDT 2009
Dear Roger,
On Fri, Aug 14, 2009 at 6:22 PM, Roger Bivand<Roger.Bivand at nhh.no> wrote:
> 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!
Great, it works now:
# Test 1, now ok:
> data <- readVECT6("rand5k_elev_filt at neteler", type= 'point')
OGR data source with driver: GRASS
Source: "/home/neteler/grassdata/spearfish60/neteler/vector/rand5k_elev_filt/head",
layer: "1"
with 4885 features and 5 fields
Feature type: wkbPoint with 2 dimensions
# Test2, ok as before
> data <- readVECT6("rand5k_elev_filt", type= 'point')
OGR data source with driver: GRASS
Source: "/home/neteler/grassdata/spearfish60/neteler/vector/rand5k_elev_filt/head",
layer: "1"
with 4885 features and 5 fields
Feature type: wkbPoint with 2 dimensions
# Test 3: nonsense input
> data <- readVECT6("rand5k_elev_filt at neteler", type= 'point', mapset="benno")
Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding =
input_field_name_encoding) :
Cannot open file
Thanks for the quick fix,
Markus
More information about the grass-stats
mailing list