r.to.vect.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <h2>DESCRIPTION</h2>
  2. <em>r.to.vect</em> scans the named <b>input</b> raster map
  3. layer, extracts points, lines or area edge features from it, converts data
  4. to GRASS vector format.
  5. <h3>Point conversion</h3>
  6. The <em>r.to.vect</em> program extracts data from a GRASS raster map
  7. layer and stores output in a new GRASS <em>vector</em> file.
  8. <h3>Line conversion</h3>
  9. <em>r.to.vect</em> assumes that the <em>input</em> map has been thinned
  10. using <em><a href="r.thin.html">r.thin</a></em>.
  11. <p>
  12. <em>r.to.vect</em> extracts vectors (aka, "arcs") from a
  13. raster map. These arcs may represent linear features
  14. (like roads or streams), or may represent area edge
  15. features (like political boundaries, or soil mapping
  16. units).
  17. <p>
  18. <em><a href="r.thin.html">r.thin</a></em> and <em>r.to.vect</em>
  19. may create excessive nodes at every junction, and may create small spurs
  20. or "dangling lines" during the thinning and vectorization process.
  21. These excessive nodes and spurs may be removed using
  22. <em><a href="v.clean.html">v.clean</a></em>.
  23. <h3>Area conversion</h3>
  24. <em>r.to.vect</em> first traces the perimeter of each unique
  25. area in the raster map layer and creates vector data to
  26. represent it. The cell category values for the raster map
  27. layer will be used to create attribute information for the
  28. resultant vector area edge data.
  29. <p>
  30. A true vector tracing of the area edges might appear
  31. blocky, since the vectors outline the edges of raster data
  32. that are stored in rectangular cells. To produce a
  33. better-looking vector map, <em>r.to.vect</em> smoothes the
  34. corners of the vector data as they are being extracted. At
  35. each change in direction (i.e., each corner), the two
  36. midpoints of the corner cell (half the cell's height and
  37. width) are taken, and the line segment connecting them is
  38. used to outline this corner in the resultant vector map.
  39. (The cell's cornermost node is ignored.) Because vectors
  40. are smoothed by this program, the resulting vector map will
  41. not be "true" to the raster map from which it was created.
  42. The user should check the resolution of the geographic
  43. region (and the original data) to estimate the possible
  44. error introduced by smoothing.
  45. <p>
  46. <em>r.to.vect</em> extracts only area edges from the named raster
  47. input file. If the raster map contains other data (i.e., line edges,
  48. or point data) the output may be wrong.
  49. <h2>EXAMPLES</h2>
  50. The examples are based on the North Carolina sample dataset:
  51. <p>
  52. <b>Conversion of raster points to vector points:</b>
  53. <p>
  54. Random sampling of points:
  55. <div class="code"><pre>
  56. g.region raster=elevation -p
  57. # random sampling of points (note that r.random also writes vector points)
  58. r.random elevation raster_output=elevrand1000 n=1000
  59. r.to.vect input=elevrand1000 output=elevrand1000 type=point
  60. # univariate statistics of sample points
  61. v.univar elevrand1000 column=value type=point
  62. # compare to univariate statistics on original full raster map
  63. r.univar elevation
  64. </pre></div>
  65. <p>
  66. <b>Conversion of raster lines to vector lines:</b>
  67. <p>
  68. Vectorization of streams in watershed basins map:
  69. <div class="code"><pre>
  70. g.region raster=elevation -p
  71. r.watershed elev=elevation stream=elev.streams thresh=50000
  72. r.to.vect -s input=elev.streams output=elev_streams type=line
  73. # drop "label" column which is superfluous in this example
  74. v.db.dropcolumn map=elev_streams column=label
  75. v.db.renamecolumn map=elev_streams column=value,basin_id
  76. # report length per basin ID
  77. v.report map=elev_streams option=length units=meters sort=asc
  78. </pre></div>
  79. <p>
  80. <b>Conversion of raster polygons to vector polygons:</b>
  81. <p>
  82. Vectorization of simplified landuse class map:
  83. <div class="code"><pre>
  84. g.region raster=landclass96 -p
  85. # we smooth corners of area features
  86. r.to.vect -s input=landclass96 output=my_landclass96 type=area
  87. v.colors my_landclass96 color=random
  88. </pre></div>
  89. <h2>KNOWN ISSUES</h2>
  90. For type=line the input raster map MUST be thinned by
  91. <em><a href="r.thin.html">r.thin</a></em>;
  92. if not, <em>r.to.vect</em> may crash.
  93. <h2>SEE ALSO</h2>
  94. <em>
  95. <a href="g.region.html">g.region</a>,
  96. <a href="r.thin.html">r.thin</a>,
  97. <a href="v.clean.html">v.clean</a>
  98. </em>
  99. <h2>AUTHORS</h2>
  100. <b>Point support</b><br>
  101. Bill Brown<br>
  102. <br>
  103. <b>Line support</b><br>
  104. Mike Baba<br>
  105. DBA Systems, Inc.<br>
  106. 10560 Arrowhead Drive<br>
  107. Fairfax, Virginia 22030<br>
  108. <br>
  109. <b>Area support</b><br>
  110. <em>Original</em> version of <em>r.poly</em>:
  111. <br>
  112. Jean Ezell and Andrew Heekin,
  113. <br>
  114. U.S. Army Construction Engineering
  115. Research Laboratory
  116. <p><em>Modified</em> program for smoothed lines:
  117. <br>
  118. David Satnik,
  119. Central Washington University
  120. <br>
  121. Updated 2001 by Andrea Aime, Modena, Italy<br>
  122. <br>
  123. <b>Update</b><br>
  124. Original r.to.sites, r.line and r.poly merged and updated to 5.7 by Radim Blazek
  125. <p><i>Last changed: $Date$</i>