[GRASS-SVN] r46926 - grass/trunk/visualization/nviz2/cmd
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 1 15:26:43 EDT 2011
Author: annakrat
Date: 2011-07-01 12:26:43 -0700 (Fri, 01 Jul 2011)
New Revision: 46926
Modified:
grass/trunk/visualization/nviz2/cmd/args.c
grass/trunk/visualization/nviz2/cmd/vector.c
Log:
nviz_cmd: loading more vectors fixed
Modified: grass/trunk/visualization/nviz2/cmd/args.c
===================================================================
--- grass/trunk/visualization/nviz2/cmd/args.c 2011-07-01 19:24:27 UTC (rev 46925)
+++ grass/trunk/visualization/nviz2/cmd/args.c 2011-07-01 19:26:43 UTC (rev 46926)
@@ -903,6 +903,13 @@
G_fatal_error(_("Inconsistent number of attributes (<%s> %d: <%s> %d)"),
params->vlines->key, nvlines, params->vline_height->key,
nconsts);
+
+ /* position */
+ nconsts = opt_get_num_answers(params->vline_pos);
+ if (nvlines > 0 && nconsts != 3 * nvlines)
+ G_fatal_error(_("Inconsistent number of attributes (<%s> %d: <%s> %d)"),
+ params->vlines->key, nvlines, params->vline_pos->key,
+ nconsts);
return;
Modified: grass/trunk/visualization/nviz2/cmd/vector.c
===================================================================
--- grass/trunk/visualization/nviz2/cmd/vector.c 2011-07-01 19:24:27 UTC (rev 46925)
+++ grass/trunk/visualization/nviz2/cmd/vector.c 2011-07-01 19:26:43 UTC (rev 46926)
@@ -87,9 +87,9 @@
0.0, data);
/* set position */
- x = atof(position->answers[i]);
- y = atof(position->answers[i+1]);
- z = atof(position->answers[i+2]);
+ x = atof(position->answers[i*3+0]);
+ y = atof(position->answers[i*3+1]);
+ z = atof(position->answers[i*3+2]);
if (map_obj_type == MAP_OBJ_VECT)
GV_set_trans(id, x, y, z);
@@ -208,12 +208,12 @@
marker = params->vpoint_marker_column;
}
for (i = 0; map->answers[i]; i++) {
- if (1 > Vect_open_old(&Map, map->answer, ""))
- G_fatal_error(_("Unable to open vector map <%s>"), map->answer);
- Fi = Vect_get_field2(&Map, layer->answer);
+ if (1 > Vect_open_old(&Map, map->answers[i], ""))
+ G_fatal_error(_("Unable to open vector map <%s>"), map->answers[i]);
+ Fi = Vect_get_field2(&Map, layer->answers[i]);
if (!Fi)
G_fatal_error(_("Database connection not defined for layer %s"),
- layer->answer);
+ layer->answers[i]);
driver = db_start_driver_open_database(Fi->driver, Fi->database);
if (!driver)
More information about the grass-commit
mailing list