[GRASS-dev] i.rectify still chokes on @mapset

Michael Barton michael.barton at asu.edu
Sun Apr 26 11:16:09 EDT 2009


OK. Thanks much for the clarification.

Michael


On 4/26/09 12:44 AM, "Hamish" <hamish_b at yahoo.com> wrote:

> 
> Michael wrote:
>> Perhaps I misunderstand, but I thought the idea was that all GRASS modules
>> were supposed to respect @mapset now. Shouldn't a fix be heading in that
>> direction rather than finding a way to strip off the @mapset specifier?
> 
> it strips it off but at the same time populates another variable with
> the value.
> 
> actually the function I am thinking of changes the map name variable
> (stripping off the @mapset part) and returns the name of the mapset
> (or NULL if not found). So information is not lost, that's just the
> way it works in most raster modules too...
> 
> 
> e.g. r.out.ascii/main.c:
> .....
>     name = parm.map->answer;
>     mapset = G_find_cell2(name, "");
> 
>     if (!mapset)
>         G_fatal_error(_("Raster map <%s> not found"), name);
> 
>     /* open raster map */
>     fd = G_open_cell_old(name, mapset);
>     if (fd < 0)
>         G_fatal_error(_("Unable to open raster map <%s>"), name);
> 
>     map_type = G_get_raster_map_type(fd);
> .....
> 
> 
> 
> here G_find_cell2() strips off the @mapset and returns the (confirmed)
> mapset name as it's result.
> 
> 
> 
> Hamish
> 
> 
> 
>       
> 

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton




More information about the grass-dev mailing list