Browse Source

v.distance: print-as-matrix not supported when dmin= or dmax= is given for now

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70621 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 8 years ago
parent
commit
18387586e7
1 changed files with 7 additions and 1 deletions
  1. 7 1
      vector/v.distance/main.c

+ 7 - 1
vector/v.distance/main.c

@@ -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 @@ int main(int argc, char *argv[])
 	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 */