
NAME
v.what.vect - Uploads vector values at positions of vector points to the table.
KEYWORDS
vector, database, attribute table
SYNOPSIS
v.what.vect
v.what.vect help
v.what.vect map=name layer=string column=name qmap=name qlayer=string qcolumn=name [dmax=float] [--verbose] [--quiet]
Parameters:
- map=name [required]
- Name of vector points map for which to edit attributes
- Or data source for direct OGR access
- layer=string [required]
- Layer number or name
- A single vector map can be connected to multiple database tables. This number determines which table to use. When used with direct OGR access this is the layer name.
- Default: 1
- column=name [required]
- Name of attribute column to be updated with the query result
- qmap=name [required]
- Name of vector map to be queried
- Or data source for direct OGR access
- qlayer=string [required]
- Layer number or name
- A single vector map can be connected to multiple database tables. This number determines which table to use. When used with direct OGR access this is the layer name.
- Default: 1
- qcolumn=name [required]
- Name of attribute column to be queried
- dmax=float
- Maximum query distance in map units
- Default: 0.0
DESCRIPTION
v.what.vect transfers attributes from the qvector's map
attribute table into the attribute table of points present in the
vector map. The script is based on v.distance.
NOTES
The upload column, into which the query results are stored, must be
present in the vector map. Use v.db.addcolumn to add one if needed.
Use dmax parameter to control query distance tolerance (how far points/centroids
can be from qvector features). For more options, use
v.distance instead.
In case of a multipoint input vector map, with several points having the
same category number, it can happen, that the query result is NULL, if the same
category number falls into different qvector polygons.
When transferring attributes from a point map to a polygon map, usually dmax
has to be larger than zero (determined by distance between query points and
polygon centroids).
EXAMPLES
In this example, the 'hospitals' point map in the North Carolina location is
copied to the current mapset, a new attribute column is added and the urban
names from the 'urbanarea' polygon map are transferred to the 'myhospitals'
map at the hospital points' locations:
g.copy vect=hospitals,myhospitals
v.db.addcolumn myhospitals column="urb_name varchar(25)"
v.what.vect myhospitals qmap=urbanarea column=urb_name qcolumn=NAME
# verification:
v.db.select myhospitals
In this example, city names, population data and more from
Geonames.org country files are
transferred to selected EU CORINE landuse/landcover classes
("Continuous urban fabric", 111, and "Discontinuous urban fabric", 112).
Note: Example in UTM projection to which the input maps have been projected
beforehand to have metric distances support:
# extract populated places from geonames
v.extract geonames_IT where="featurecla='P'" output=geonames_IT_cities
# add new column
v.db.addcol corine_code111_112_cities column="gnameid double precision"
# transfer geonameid (3000m maximal distance between points and centroids)
v.what.vect corine_code111_112_cities qmap=geonames_IT_cities column=gnameid \
qcolumn=geonameid dmax=3000
# now gnameid can be used for v.db.join to join further
# attributes in from geonames.org
SEE ALSO
v.db.addcolumn,
v.db.select,
v.distance,
v.rast.stats,
v.what.rast
AUTHOR
Markus Neteler
Last changed: $Date: 2011-11-08 13:24:20 -0800 (Tue, 08 Nov 2011) $
Main index - Vector index - Full index
© 2003-2012 GRASS Development Team