Send grass-windows mailing list submissions to grass-windows@lists.osgeo.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-windows or, via email, send a message with subject or body 'help' to grass-windows-requ...@lists.osgeo.org You can reach the person managing the list at grass-windows-ow...@lists.osgeo.org When replying, please edit your Subject line so it is more specific than "Re: Contents of grass-windows digest..." Today's Topics: 1. Re: grass.run_command issue for display a vector and its labels (Glynn Clements) 2. Re: grass.run_command issue for display a vector and its labels (Markus Neteler) ---------------------------------------------------------------------- Message: 1 Date: Tue, 6 Nov 2012 23:49:32 +0000 From: Glynn Clements <gl...@gclements.plus.com> To: "Liu, Huili" <h...@ap.org> Cc: "grass-windows@lists.osgeo.org" <grass-windows@lists.osgeo.org> Subject: Re: [GRASS-windows] grass.run_command issue for display a vector and its labels Message-ID: <20633.41484.737027.324...@cerise.gclements.plus.com> Content-Type: text/plain; charset=us-ascii Liu, Huili wrote: > I am running an issue to display a vector and overlay its label on > the top by using grass.run_command (WinGrass-6.4). > For example, > grass.run_command('d.vect', map='my_shape') > grass.run_command('d.labels', labels='my_shape_labels') > > First one created a default.png but second command overwrote > default.png with the labels only. > Can anyone point to me if one grass.run_command can handle multiple > commands like > grass.run_command(('d.vect', map='my_shape'; 'd.labels', > labels='my_shape_labels') to generate one default.png with two > layers information such as vector and its labels? Or is there any > better way to do it? I was thinking about v.overlay but I look for > the above possibility. If the environment contains the setting GRASS_PNG_READ=TRUE, d.* commands should overlay their output on an existing image. So the following should work: grass.run_command('d.vect', map='my_shape') env = os.environ.copy() env['GRASS_PNG_READ'] = 'TRUE' grass.run_command('d.labels', labels='my_shape_labels', env = env) -- Glynn Clements <gl...@gclements.plus.com> ------------------------------ Message: 2 Date: Wed, 7 Nov 2012 08:57:35 +0100 From: Markus Neteler <nete...@osgeo.org> To: Glynn Clements <gl...@gclements.plus.com> Cc: "grass-windows@lists.osgeo.org" <grass-windows@lists.osgeo.org> Subject: Re: [GRASS-windows] grass.run_command issue for display a vector and its labels Message-ID: <calfmhhu2ajwsqbvk8akqf3gw1bmsrnfcducsaksoec4v+r6...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On Wed, Nov 7, 2012 at 12:49 AM, Glynn Clements <gl...@gclements.plus.com> wrote: > Liu, Huili wrote: >> I am running an issue to display a vector and overlay its label on >> the top by using grass.run_command ... > If the environment contains the setting GRASS_PNG_READ=TRUE, d.* > commands should overlay their output on an existing image. So the > following should work: > > grass.run_command('d.vect', map='my_shape') > env = os.environ.copy() > env['GRASS_PNG_READ'] = 'TRUE' > grass.run_command('d.labels', labels='my_shape_labels', env = env) Added to the Wiki as http://grass.osgeo.org/wiki/GRASS_Python_Scripting_Library#Display:_overlayed_map_display_with_labels Markus ------------------------------ _______________________________________________ grass-windows mailing list grass-windows@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-windows End of grass-windows Digest, Vol 67, Issue 2 ********************************************