r.to.vect - Converts a raster map into a vector map.
raster, conversion, geometry, vectorization
r.to.vect r.to.vect --help r.to.vect [-svzbt] input=name output=name type=string [column=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui] Flags: -s Smooth corners of area features -v Use raster values as categories instead of unique sequence (CELL only) -z Write raster values as z coordinate Table is not created. Currently supported only for points. -b Do not build vector topology Recommended for massive point conversion -t Do not create attribute table --overwrite Allow output files to overwrite existing files --help Print usage summary --verbose Verbose module output --quiet Quiet module output --ui Force launching GUI dialog Parameters: input=name [required] Name of input raster map output=name [required] Name for output vector map type=string [required] Output feature type Options: point, line, area column=name Name of attribute column to store value Name must be SQL compliant Default: value
r.to.vect scans the named input raster map layer, extracts points, lines or area edge features from it, converts data to GRASS vector format. Point conversion The r.to.vect program extracts data from a GRASS raster map layer and stores output in a new GRASS vector file. Line conversion r.to.vect assumes that the input map has been thinned using r.thin. r.to.vect extracts vectors (aka, "arcs") from a raster map. These arcs may represent linear features (like roads or streams), or may represent area edge features (like political boundaries, or soil mapping units). r.thin and r.to.vect may create excessive nodes at every junction, and may create small spurs or "dangling lines" during the thinning and vectorization process. These excessive nodes and spurs may be removed using v.clean. Area conversion r.to.vect first traces the perimeter of each unique area in the raster map layer and creates vector data to represent it. The cell category values for the raster map layer will be used to create attribute information for the resultant vector area edge data. A true vector tracing of the area edges might appear blocky, since the vectors outline the edges of raster data that are stored in rectangular cells. To produce a better-looking vector map, r.to.vect smoothes the corners of the vector data as they are being extracted. At each change in direction (i.e., each corner), the two midpoints of the corner cell (half the cell's height and width) are taken, and the line segment connecting them is used to outline this corner in the resultant vector map. (The cell's cornermost node is ignored.) Because vectors are smoothed by this program, the resulting vector map will not be "true" to the raster map from which it was created. The user should check the resolution of the geographic region (and the original data) to estimate the possible error introduced by smoothing. r.to.vect extracts only area edges from the named raster input file. If the raster map contains other data (i.e., line edges, or point data) the output may be wrong.
The examples are based on the North Carolina sample dataset: Conversion of raster points to vector points: Random sampling of points: g.region raster=elevation -p # random sampling of points (note that r.random also writes vector points) r.random elevation raster_output=elevrand1000 n=1000 r.to.vect input=elevrand1000 output=elevrand1000 type=point # univariate statistics of sample points v.univar elevrand1000 column=value type=point # compare to univariate statistics on original full raster map r.univar elevation Conversion of raster lines to vector lines: Vectorization of streams in watershed basins map: g.region raster=elevation -p r.watershed elev=elevation stream=elev.streams thresh=50000 r.to.vect -s input=elev.streams output=elev_streams type=line # drop "label" column which is superfluous in this example v.db.dropcolumn map=elev_streams column=label v.db.renamecolumn map=elev_streams column=value,basin_id # report length per basin ID v.report map=elev_streams option=length units=meters sort=asc Conversion of raster polygons to vector polygons: Vectorization of simplified landuse class map: g.region raster=landclass96 -p # we smooth corners of area features r.to.vect -s input=landclass96 output=my_landclass96 type=area v.colors my_landclass96 color=random
For type=line the input raster map MUST be thinned by r.thin; if not, r.to.vect may crash.
g.region, r.thin, v.clean
Point support Bill Brown Line support Mike Baba DBA Systems, Inc. 10560 Arrowhead Drive Fairfax, Virginia 22030 Area support Original version of r.poly: Jean Ezell and Andrew Heekin, U.S. Army Construction Engineering Research Laboratory Modified program for smoothed lines: David Satnik, Central Washington University Updated 2001 by Andrea Aime, Modena, Italy Update Original r.to.sites, r.line and r.poly merged and updated to 5.7 by Radim Blazek Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $
Available at: r.to.vect source code (history) Main index | Raster index | Topics index | Keywords index | Graphical index | Full index 2003-2016 GRASS Development Team, GRASS GIS 7.2.0 Reference Manual
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.