v.what.vect.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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>
  9. Use dmax parameter to control query distance tolerance (how far points/centroids
  10. can be from <b>qvector</b> features). For more options, use
  11. <em>v.distance</em> instead.
  12. <P>
  13. In case of a multipoint input <b>vector</b> map, with several points having the
  14. same category number, it can happen, that the query result is NULL, if the same
  15. category number falls into different <b>qvector</b> polygons.
  16. <P>
  17. 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. <h2>EXAMPLES</h2>
  21. In this example, the 'archsites' point map in the Spearfish location is copied
  22. to the current mapset, a new attribute column is added and the owner
  23. names from the 'fields' polygon map are transferred to the 'myarchsites'
  24. map at points' locations:
  25. <div class="code"><pre>
  26. g.copy vect=archsites,myarchsites
  27. v.db.addcolumn myarchsites col="owner varchar(25)"
  28. v.what.vect myarchsites qvect=fields column=owner qcolumn=label
  29. # verification:
  30. v.db.select myarchsites
  31. </pre></div>
  32. <P>
  33. In this example, city names, population data and more from
  34. <a href="http://download.geonames.org/export/dump/">Geonames.org country files</a> are
  35. transferred to selected EU CORINE landuse/landcover classes
  36. ("Continuous urban fabric", 111, and "Discontinuous urban fabric", 112).
  37. Note: Example in UTM projection to which the input maps have been projected
  38. beforehand to have metric distances support:
  39. <div class="code"><pre>
  40. # extract populated places from geonames
  41. v.extract geonames_IT where="featurecla='P'" out=geonames_IT_cities
  42. # add new column
  43. v.db.addcol corine_code111_112_cities col="gnameid double precision"
  44. # transfer geonameid (3000m maximal distance between points and centroids)
  45. v.what.vect corine_code111_112_cities qvect=geonames_IT_cities col=gnameid \
  46. qcol=geonameid dmax=3000
  47. # now gnameid can be used for v.db.join to join further
  48. # attributes in from Geonames.org
  49. </pre></div>
  50. <h2>SEE ALSO</h2>
  51. <em>
  52. <a HREF="v.db.addcolumn.html">v.db.addcolumn</a>,
  53. <a HREF="v.db.select.html">v.db.select</a>,
  54. <a HREF="v.distance.html">v.distance</a>,
  55. <a HREF="v.rast.stats.html">v.rast.stats</a>,
  56. <a HREF="v.what.rast.html">v.what.rast</a>
  57. </em>
  58. <h2>AUTHOR</h2>
  59. Markus Neteler
  60. <p>
  61. <i>Last changed: $Date$</i></p>