[GRASS-windows] syntax for v.db.select run by grass.run_command

Markus Neteler neteler at osgeo.org
Thu Mar 8 16:46:53 EST 2012


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


More information about the grass-windows mailing list