[GRASS-dev] should G_raster_map_type() use G_find_cell2() ?

Glynn Clements glynn at gclements.plus.com
Fri Oct 27 16:31:47 EDT 2006


Hamish wrote:

> > > G_raster_map_type() calls G_find_cell(), which chops off the
> > > @othermapset part of a map's name.
> > > 
> > > should it call G_find_cell2(), which leaves the map name alone?
> 
> Glynn wrote:
> > Maybe, but you would need to examine everything which uses
> > G_raster_map_type() (71 files) in case something expects this
> > behaviour.
> 
> That sounds dangerous. I've added a new fn called G_raster_map_type2()
> which checks the map type in a non-name modifying way. (akin to
> G_find_cell2(), G_find_vector2(), G_find_file2(): these already exist
> for the same reason)

I'm in the process of adding a version which uses the descriptor:

	RASTER_MAP_TYPE G_get_raster_map_type(int fd)
	{
	    struct fileinfo *fcb = &G__.fileinfo[fd];
	    return fcb->map_type;
	}

In the case where the map is already open, this would be preferable to
using the name/mapset.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list