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

Hamish hamish_b at yahoo.com
Sun Apr 26 03:44:40 EDT 2009


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



      



More information about the grass-dev mailing list