[GRASS-SVN] r70621 - grass/trunk/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 18 08:13:58 PST 2017


Author: hcho
Date: 2017-02-18 08:13:58 -0800 (Sat, 18 Feb 2017)
New Revision: 70621

Modified:
   grass/trunk/vector/v.distance/main.c
Log:
v.distance: print-as-matrix not supported when dmin= or dmax= is given for now

Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c	2017-02-18 16:11:52 UTC (rev 70620)
+++ grass/trunk/vector/v.distance/main.c	2017-02-18 16:13:58 UTC (rev 70621)
@@ -13,7 +13,7 @@
  *               
  * PURPOSE:      Calculates distance from a point to nearest feature in vector layer. 
  *               
- * COPYRIGHT:    (C) 2002-2015 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2002-2017 by the GRASS Development Team
  *
  *               This program is free software under the 
  *               GNU General Public License (>=v2). 
@@ -265,6 +265,12 @@
 	do_all && !opt.table->answer && i == 1)
 	print_as_matrix = TRUE;
 
+    /* TODO: Known issue. Segmentation fault on print_as_matrix with dmin= or
+     * dmax= because count may not be nfrom^2. Needs to populate Near[] fully
+     * even if some near features are not found */
+    if (print_as_matrix && (min >= 0 || max >= 0))
+	G_fatal_error(_("Printng distance matrix not supported with dmin= or dmax="));
+
     /* alloc */
     Upload = (UPLOAD *) G_calloc(i + 1, sizeof(UPLOAD));
     /* read upload */



More information about the grass-commit mailing list