~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to scripts/v.what.vect/v.what.vect.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>DESCRIPTION</h2>
 
2
 
 
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>.
 
6
 
 
7
<h2>NOTES</h2>
 
8
 
 
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
 
19
polygon centroids).
 
20
 
 
21
<h2>EXAMPLES</h2>
 
22
 
 
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:
 
27
 
 
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
 
32
# verification:
 
33
v.db.select myhospitals
 
34
</pre></div>
 
35
<p>
 
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:
 
42
 
 
43
<div class="code"><pre>
 
44
# extract populated places from geonames
 
45
v.extract geonames_IT where="featurecla='P'" output=geonames_IT_cities
 
46
# add new column 
 
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
 
53
</pre></div>
 
54
 
 
55
<h2>SEE ALSO</h2>
 
56
 
 
57
<em>
 
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>
 
64
</em>
 
65
 
 
66
 
 
67
<h2>AUTHOR</h2>
 
68
 
 
69
Markus Neteler
 
70
 
 
71
<p><i>Last changed: $Date: 2014-11-28 17:25:40 +0100 (Fri, 28 Nov 2014) $</i>