[GRASS-user] some issues with python scripts

Martin Landa landa.martin at gmail.com
Mon Jan 17 11:41:50 EST 2011


Hi,

2011/1/17 Carlos Grohmann <carlos.grohmann at gmail.com>:
>> this corresponds with behaviour of g.findfile
>>
> Well, yes. I just thought that once the wx interface will always
> provide the full name when a map is selected,
> then the name should be parsed so that 'name' and 'full_name' don't be the same.

Probably g.findfile should be modified to return name as not qualified name(?)

>>>>> import grass.script as grass
>>>> a = grass.tempfile()
>>>> a
> '/home/guano/grassdata/amsul_wgs84/brasil/.tmp/guanodesk/16665.0'
>>>> grass.mapcalc("${out} = cos(${rast1})", out = 'cosine', rast1 = a)

os.path.basename(grass.tempfile())

Anyway grass.tempfile() is not dedicated for this usage, this name is
not a valid raster map name....

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-user mailing list