[GRASS5] raster filename length problem

Markus Neteler neteler at itc.it
Tue Jul 12 16:57:01 EDT 2005


On Tue, Jul 12, 2005 at 08:05:21PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > there is a problem with long filenames somewhere:
> > 
> > r.reclass.area modis_evi_class_forest out=modis_evi_class_forest_nosmall greater=100
> > d.rast modis_evi_class_forest_nosmall
> > WARNING: unable to open [modis_evi_class_forest_nosmall] in [bluetongue]
> >          since it is a reclass of
> >          [modis_evi_class_forest.clump.modis_evi_class_foresbluetongue] in
> >                                                             ^-PROBLEM
> >          [bluetongue] which does not exist
> > WARNING: unable to open raster map [modis_evi_class_forest_nosmall in
> >          bluetongue]
> > ERROR: Not able to open cellfile for [modis_evi_class_forest_nosmall]
> > 
> > I searched around in r.stats, r.clump, r.reclass, d.rast but didn't
> > find the problem. The desired filename interally created by r.reclass.area
> > will be of around 60 chars.
> 
> In gis.h:
> 
> 	struct Reclass
> 	{
> 	    char name[50];  	    /* name of cell file being reclassed    */
> 	    char mapset[50]; 	    /* mapset in which "name" is found      */
> [snip]

Right, that's the beast.

 
> More generally, it would help if we had standardised NAME_MAX and
> MAPSET_MAX constants, rather than having arbitrary integer literals
> scattered all over the code.

I'll try whenever I come across NAME/MAPSET definitions to set them
to NAME_MAX,MAPSET_MAX. Before adding those to gis.h, how long?
Is 100 ok during the migration to NAME_MAX,MAPSET_MAX? I'm not
sure how to capture string overflows.

Markus




More information about the grass-dev mailing list