[GRASS-SVN] r62145 - in grass/trunk: raster/r.random vector/v.random
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 1 08:59:49 PDT 2014
Author: neteler
Date: 2014-10-01 08:59:48 -0700 (Wed, 01 Oct 2014)
New Revision: 62145
Modified:
grass/trunk/raster/r.random/random.c
grass/trunk/vector/v.random/main.c
Log:
r.random/v.random: create DB index
Modified: grass/trunk/raster/r.random/random.c
===================================================================
--- grass/trunk/raster/r.random/random.c 2014-10-01 15:20:25 UTC (rev 62144)
+++ grass/trunk/raster/r.random/random.c 2014-10-01 15:59:48 UTC (rev 62145)
@@ -248,6 +248,14 @@
Rast_close(cinfd);
if (theState->outvector) {
db_commit_transaction(driver);
+ if (db_create_index2(driver, fi->table, GV_KEY_COLUMN) != DB_OK)
+ G_warning(_("Unable to create index"));
+ if (db_grant_on_table
+ (driver, fi->table, DB_PRIV_SELECT,
+ DB_GROUP | DB_PUBLIC) != DB_OK) {
+ G_fatal_error(_("Unable to grant privileges on table <%s>"),
+ fi->table);
+ }
db_close_database_shutdown_driver(driver);
if (theState->notopol != 1)
Vect_build(&Out);
Modified: grass/trunk/vector/v.random/main.c
===================================================================
--- grass/trunk/vector/v.random/main.c 2014-10-01 15:20:25 UTC (rev 62144)
+++ grass/trunk/vector/v.random/main.c 2014-10-01 15:59:48 UTC (rev 62145)
@@ -144,7 +144,7 @@
parm.seed->type = TYPE_INTEGER;
parm.seed->required = NO;
parm.seed->description =
- _("The seed to initialize the random generator. If not set the process id is used.");
+ _("The seed to initialize the random generator. If not set the process ID is used");
parm.zcol = G_define_standard_option(G_OPT_DB_COLUMN);
parm.zcol->label = _("Name of column for z values");
@@ -252,6 +252,10 @@
db_get_string(&sql));
}
+ /* Create index */
+ if (db_create_index2(driver, Fi->table, Fi->key) != DB_OK)
+ G_warning(_("Unable to create index"));
+
/* Grant */
if (db_grant_on_table
(driver, Fi->table, DB_PRIV_SELECT,
More information about the grass-commit
mailing list