grass-windows Digest, Vol 67, Issue 2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

grass-windows Digest, Vol 67, Issue 2

grass-windows-request
Send grass-windows mailing list submissions to
        [hidden email]

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
        [hidden email]

You can reach the person managing the list at
        [hidden email]

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 <[hidden email]>
To: "Liu, Huili" <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [GRASS-windows] grass.run_command issue for display a
        vector and its labels
Message-ID: <[hidden email]>
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 <[hidden email]>


------------------------------

Message: 2
Date: Wed, 7 Nov 2012 08:57:35 +0100
From: Markus Neteler <[hidden email]>
To: Glynn Clements <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [GRASS-windows] grass.run_command issue for display a
        vector and its labels
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 7, 2012 at 12:49 AM, Glynn Clements
<[hidden email]> 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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows


End of grass-windows Digest, Vol 67, Issue 2
********************************************