[GRASS-SVN] r53384 - grass/trunk/vector/v.what

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 13 04:34:12 PDT 2012


Author: mmetz
Date: 2012-10-13 04:34:11 -0700 (Sat, 13 Oct 2012)
New Revision: 53384

Modified:
   grass/trunk/vector/v.what/main.c
   grass/trunk/vector/v.what/what.c
Log:
v.what: init variables, add comments

Modified: grass/trunk/vector/v.what/main.c
===================================================================
--- grass/trunk/vector/v.what/main.c	2012-10-13 11:15:38 UTC (rev 53383)
+++ grass/trunk/vector/v.what/main.c	2012-10-13 11:34:11 UTC (rev 53384)
@@ -101,13 +101,27 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
+    /* initialize variables */
+    vect = NULL;
+    Map = NULL;
+    nvects = 0;
+    field = NULL;
+
     if (opt.map->answers && opt.map->answers[0])
 	vect = opt.map->answers;
+    else
+	G_fatal_error(_("No input vector maps!"));
 
     maxd = atof(opt.maxdist->answer);
     type = Vect_option_to_types(opt.type);
 
     if (maxd == 0.0) {
+	/* this code is a translation from d.what.vect which uses display
+	 * resolution to figure out a querying distance
+	 * display resolution is not available here
+	 * using raster resolution instead to determine vector querying 
+	 * distance does not really make sense
+	 * maxd = 0 can make sense */
 	G_get_window(&window);
 	x = window.proj;
 	G_format_resolution(window.ew_res, ewres, x);

Modified: grass/trunk/vector/v.what/what.c
===================================================================
--- grass/trunk/vector/v.what/what.c	2012-10-13 11:15:38 UTC (rev 53383)
+++ grass/trunk/vector/v.what/what.c	2012-10-13 11:34:11 UTC (rev 53384)
@@ -8,6 +8,8 @@
 #include <grass/dbmi.h>
 #include <grass/glocale.h>
 #include "what.h"
+
+/* TODO: remove leftover from interactive querying */
 static int nlines = 50;
 
 #define WDTH 5



More information about the grass-commit mailing list