3
<em>v.what.vect</em> transfers attributes from the <b>query_map</b>'s map
4
attribute table into the attribute table of <u>points</u> present in the
5
<b>map</b> map. The script is based on <em>v.distance</em>.
9
The upload <b>column</b>, into which the query results are stored, must be
10
present in the <b>map</b> map. Use <em>v.db.addcolumn</em> to add one if needed.
11
<p>Use dmax parameter to control query distance tolerance (how far points/centroids
12
can be from <b>query_map</b> features). For more options, use
13
<em>v.distance</em> instead.
14
<p>In case of a multipoint input <b>map</b> map, with several points having the
15
same category number, it can happen, that the query result is NULL, if the same
16
category number falls into different <b>query_map</b> polygons.
17
<p>When transferring attributes from a point map to a polygon map, usually <b>dmax</b>
18
has to be larger than zero (determined by distance between query points and
23
In this example, the 'hospitals' point map in the North Carolina location is
24
copied to the current mapset, a new attribute column is added and the urban
25
names from the 'urbanarea' polygon map are transferred to the 'myhospitals'
26
map at the hospital points' locations:
28
<div class="code"><pre>
29
g.copy vect=hospitals,myhospitals
30
v.db.addcolumn myhospitals column="urb_name varchar(25)"
31
v.what.vect myhospitals query_map=urbanarea column=urb_name query_column=NAME
33
v.db.select myhospitals
36
In this example, city names, population data and more from
37
<a href="http://download.geonames.org/export/dump/">Geonames.org country files</a> are
38
transferred to selected EU CORINE landuse/landcover classes
39
("Continuous urban fabric", 111, and "Discontinuous urban fabric", 112).
40
Note: Example in UTM projection to which the input maps have been projected
41
beforehand to have metric distances support:
43
<div class="code"><pre>
44
# extract populated places from geonames
45
v.extract geonames_IT where="featurecla='P'" output=geonames_IT_cities
47
v.db.addcol corine_code111_112_cities column="gnameid double precision"
48
# transfer geonameid (3000m maximal distance between points and centroids)
49
v.what.vect corine_code111_112_cities query_map=geonames_IT_cities column=gnameid \
50
query_column=geonameid dmax=3000
51
# now gnameid can be used for v.db.join to join further
52
# attributes in from geonames.org
58
<a href="v.db.addcolumn.html">v.db.addcolumn</a>,
59
<a href="v.db.select.html">v.db.select</a>,
60
<a href="v.distance.html">v.distance</a>,
61
<a href="v.rast.stats.html">v.rast.stats</a>,
62
<a href="v.what.rast.html">v.what.rast</a>,
63
<a href="v.what.rast3.html">v.what.rast3</a>
71
<p><i>Last changed: $Date: 2014-11-28 17:25:40 +0100 (Fri, 28 Nov 2014) $</i>