v.what.vect.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <h2>DESCRIPTION</h2>
  2. <em>v.what.vect</em> transfers attributes from the <b>query_map</b>'s
  3. attribute table into the <b>map</b>'s attribute table. The module can
  4. be used to transfer attributes from the table of a polygon map into the
  5. attribute table of a point vector map, as well as the other way around,
  6. i.e., from a point map into the attribute table of a polygon map (See
  7. examples). The script is based on <em>v.distance</em>.
  8. <h2>NOTES</h2>
  9. The upload <b>column</b> into which the query results are stored must be
  10. present in <b>map</b>. Use <em>v.db.addcolumn</em> to add one if needed.
  11. <p>Use the <b>dmax</b> parameter to control the query distance tolerance, i.e.,
  12. how far <b>map</b>'s points/centroids can be from the <b>query_map</b> features.
  13. For further options, use <em>v.distance</em>.
  14. <p>In case of a multipoint input <b>map</b> 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 into a polygon map,
  18. <b>dmax</b> has to be larger than zero, i.e., it will be determined by the
  19. distance between query points and polygon centroids. Importantly, distance
  20. is in meters for latitude-longitude locations.
  21. <p>In case that one or both input vector maps are 3D, features need to
  22. touch also in the 3rd dimension (z coordinate) in order to transfer
  23. attributes.
  24. <h2>EXAMPLES</h2>
  25. In this example, the 'hospitals' point map in the North Carolina location is
  26. copied to the current mapset, a new attribute column is added and the urban
  27. names from the 'urbanarea' polygon map are transferred to hospital points
  28. locations in 'myhospitals' map:
  29. <div class="code"><pre>
  30. g.copy vect=hospitals,myhospitals
  31. v.db.addcolumn myhospitals column="urb_name varchar(25)"
  32. v.what.vect myhospitals query_map=urbanarea column=urb_name query_column=NAME
  33. # verification:
  34. v.db.select myhospitals
  35. </pre></div>
  36. <p>
  37. In this example, city names, population data and others from
  38. <a href="http://download.geonames.org/export/dump/">Geonames.org country files</a> are
  39. transferred to selected EU CORINE landuse/landcover classes
  40. ("Continuous urban fabric", 111, and "Discontinuous urban fabric", 112).
  41. Note: The example is in UTM projection to which the input maps have been
  42. projected beforehand.
  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 from geonames.org
  53. </pre></div>
  54. <h2>SEE ALSO</h2>
  55. <em>
  56. <a href="v.db.addcolumn.html">v.db.addcolumn</a>,
  57. <a href="v.db.select.html">v.db.select</a>,
  58. <a href="v.distance.html">v.distance</a>,
  59. <a href="v.rast.stats.html">v.rast.stats</a>,
  60. <a href="v.what.rast.html">v.what.rast</a>,
  61. <a href="v.what.rast3.html">v.what.rast3</a>,
  62. <a href="v.vect.stats.html">v.vect.stats</a>
  63. </em>
  64. <h2>AUTHOR</h2>
  65. Markus Neteler
  66. <p><i>Last changed: $Date$</i>