[GRASS-user] problem using grass.write_comman, db.execute
Nikos Alexandris
nikos.alexandris at felis.uni-freiburg.de
Thu Oct 1 23:34:50 EDT 2009
Pythonians,
I never really got messed up with Python. Several months ago I had to
give up due to lack of free time. Now, I am trying to move on but I have
no idea on how solve the following "db.execute" problem:
# basic info about the point vector/ db
driver = 'sqlite'
database = '/geo/grassdb/peloponnese/evaluation_utm/PERMANENT/sqlite.db'
# note: I am running python from within grass from within a
user-mapset (not PERMANENT)
# use variables
POINTS = 'points_map'
sql_coi_percent = "UPDATE %s SET coi_percent = (coi_pix * 1. / total_pix
*1. ) * 100" % POINTS
# updating fails!
grass.write_command('db.execute', input = '-', stdin = sql_coi_percent,
database = database, driver = driver)
-: No such file or directory
1
The map is there. So why does it return a non-zero value?
Regards, Nikos
More information about the grass-user
mailing list