[GRASS-windows] syntax for v.db.select run by grass.run_command
Liu, Huili
HLiu at ap.org
Fri Mar 9 09:46:09 EST 2012
Thanks Markus. That is a great example to generate a report.
DBF driver doesn't support for join tables so I have to add a color column in the table to shade polygon. But
grass.run_command('v.db.addcol', map='from_shape', columns='WINNER_COLOR, VARCHAR()') requires awk. After I installed awk, it still show the same error. awk is in environment variable and ran fine by cmd. Not sure if it is a bug on Windows.
Regards,
Willie
-----Original Message-----
From: grass-windows-bounces at lists.osgeo.org [mailto:grass-windows-bounces at lists.osgeo.org] On Behalf Of Markus Neteler
Sent: Thursday, March 08, 2012 4:47 PM
To: Liu, Huili
Cc: grass-windows at lists.osgeo.org
Subject: Re: [GRASS-windows] syntax for v.db.select run by grass.run_command
On Thu, Mar 8, 2012 at 6:31 PM, Liu, Huili <HLiu at ap.org> wrote:
...
>
> I am trying to shade polygons for the COUNTY with the population when
> MALE > FEMALE from the shape file.
...
> grass.run_command('v.db.select from_shape where="MALE > FEMALE"')
Please check here for a working implementation :
http://trac.osgeo.org/grass/browser/grass/trunk/scripts/v.report/v.report.py#L92
It uses
p = grass.pipe_command('v.db.select', quiet = True, flags='c', map = mapname, layer = layer)
Markus
_______________________________________________
grass-windows mailing list
grass-windows at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-windows
The information contained in this communication is intended for the use
of the designated recipients named above. If the reader of this
communication is not the intended recipient, you are hereby notified
that you have received this communication in error, and that any review,
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify The Associated Press immediately by telephone at +1-212-621-1898
and delete this email. Thank you.
[IP_US_DISC]
msk dccc60c6d2c3a6438f0cf467d9a4938
More information about the grass-windows
mailing list