Преглед изворни кода

marisn: Added query distance. Allows to upload values also from points
(merge from trunk, https://trac.osgeo.org/grass/changeset/32497)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32500 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa пре 17 година
родитељ
комит
e9b1a4fb8f
2 измењених фајлова са 10 додато и 4 уклоњено
  1. 2 2
      scripts/v.what.vect/description.html
  2. 8 2
      scripts/v.what.vect/v.what.vect

+ 2 - 2
scripts/v.what.vect/description.html

@@ -9,8 +9,8 @@ attribute table into the attribute table of <u>points</u> present in the
 The upload <b>column</b>, into which the query results are stored, must be
 present in the <b>vector</b> map. Use <em>v.db.addcol</em> to add one if needed.
 <p>
-This module only uploads attributes which exist at the exact positions of
-the input's <b>vector</b> points. For a "nearest feature" fit, use
+Use dmax parameter to control query distance tolerance (how far points can be from 
+<b>qvector</b> features). For more options, use
 <em>v.distance</em> instead.
 <P>
 In case of a multipoint input <b>vector</b> map, with several points having the

+ 8 - 2
scripts/v.what.vect/v.what.vect

@@ -61,6 +61,13 @@
 #% description: Column to be queried
 #% required : yes
 #%end
+#%option
+#% key: dmax
+#% type: double
+#% description: Maximum query distance in map units
+#% answer: 0.0
+#% required: no
+#%end
 
 
 if  [ -z "$GISBASE" ] ; then
@@ -72,12 +79,11 @@ if [ "$1" != "@ARGS_PARSED@" ] ; then
     exec g.parser "$0" "$@"
 fi
 
-
 exec v.distance from="$GIS_OPT_VECTOR" \
 	to="$GIS_OPT_QVECTOR" \
 	column="$GIS_OPT_COLUMN" \
 	to_column="$GIS_OPT_QCOLUMN" \
 	upload=to_attr \
-	dmax=0 \
+	dmax=$GIS_OPT_DMAX \
 	from_layer=$GIS_OPT_LAYER \
 	to_layer=$GIS_OPT_QLAYER