2011/1/16 Carlos Grohmann <[email protected]>: > 2 - dealing with maps names. if I use find_file, I end up with the > full name of the map (that is, map name plus mapset) in the > dictionary. The wx interface created by g.parser includes the mapset > in the map name, and all that goes as a string to find_file: > >>>> import grass.script as grass > > # this is what should happen >>>> elevmap = 'cass' >>>> find_elev = grass.find_file(elevmap, element = 'cell') >>>> find_elev > {'fullname': 'cass@brasil', 'mapset': 'brasil', 'name': 'cass', > 'file': '/home/guano/grassdata/amsul_wgs84/brasil/cell/cass'} > > # this is what actually happens when using the wx interface >>>> elevmap = 'cass@brasil' >>>> find_elev = grass.find_file(elevmap, element = 'cell') >>>> find_elev > {'fullname': 'cass@brasil', 'mapset': 'brasil', 'name': 'cass@brasil', > 'file': '/home/guano/grassdata/amsul_wgs84/brasil/cell/cass'} >>>>
this corresponds with behaviour of g.findfile GRASS 7.0.svn (nc_spm_08):~/src/grass_trunk > g.findfile element=cell file=dummy name='dummy' mapset='landa' fullname='dummy@landa' file='/home/martin/grassdata/nc_spm_08/landa/cell/dummy' GRASS 7.0.svn (nc_spm_08):~/src/grass_trunk > g.findfile element=cell file=dummy@landa name='dummy@landa' mapset='landa' fullname='dummy@landa' file='/home/martin/grassdata/nc_spm_08/landa/cell/dummy' > 3 - temp files. > In my bash scripts I used temp files. I found out that using > g.tempfile() gives me a filename with a full path, which cannot be > used in r.mapcalc, for instance. > So I just used normal files that I delete in the end of the script. Is > there a better way? Sample code? Martin -- Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
