[GRASS-user] problems importing vector and raster data via python script

Glynn Clements glynn at gclements.plus.com
Thu Jan 28 08:25:03 EST 2010


Sonja Jankowfsky wrote:

> So, the forward slash does not work in windows. (and I know I should not 
> use literal pathnames, but it's just for testing). So either two forward 
> or backward slashs, or one  backward.

No: two backward (\\) or one forward (/) slash. Backslashes are used
to represent unprintable characters such as newline (\n), tab (\t)
etc.

> One other question concerning the flags: How can I put two flags at the 
> same time, as for example -o --o for overwriting the projection check 
> and an already existing file?

The quiet (--q), verbose (--v) and overwrite (--o) flags have their
own options, so:

	grass.run_command(..., flags='o', overwrite=True)

for -o and --o.

The GRASS parser allows normal flags to be concatenated, so "-abc" is
equivalent to "-a -b -c", but the flags beginning with two dashes have
to be given separately.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list