v.what.vect.html 2.7 KB

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