EnglishFrenchSpanish

OnWorks favicon

r.to.vectgrass - Online in the Cloud

Run r.to.vectgrass in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command r.to.vectgrass that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


r.to.vect - Converts a raster map into a vector map.

KEYWORDS


raster, conversion, geometry, vectorization

SYNOPSIS


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

DESCRIPTION


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.

EXAMPLES


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

KNOWN ISSUES


For type=line the input raster map MUST be thinned by r.thin; if not, r.to.vect may crash.

Use r.to.vectgrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 2
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • 3
    SuiteCRM
    SuiteCRM
    SuiteCRM is the award-winning Customer
    Relationship Management (CRM)
    application brought to you by authors
    and maintainers, SalesAgility. It is the
    world�s mos...
    Download SuiteCRM
  • 4
    Poweradmin
    Poweradmin
    Poweradmin is a web-based DNS
    administration tool for PowerDNS server.
    The interface has full support for most
    of the features of PowerDNS. It has full
    support...
    Download Poweradmin
  • 5
    Gin Web Framework
    Gin Web Framework
    Gin is an incredibly fast web framework
    written in Golang that can perform up to
    40 times faster, thanks to its
    martini-like API and custom version of
    httprout...
    Download Gin Web Framework
  • 6
    CEREUS LINUX
    CEREUS LINUX
    CEREUS LINUX basado en MX LINUX con
    varios entornos de escritorios. This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/cereu...
    Download CEREUS LINUX
  • More »

Linux commands

  • 1
    aa-clickquery
    aa-clickquery
    aa-clickquery - program for querying
    click-apparmor DESCRIPTION: This program
    is used to query click-apparmor for
    information. USAGE: aa-clickquery
    --click-fra...
    Run aa-clickquery
  • 2
    aa-exec-click
    aa-exec-click
    aa-exec-click - program for executing
    click packages under confinement
    DESCRIPTION: This program is used to
    execute click package under AppArmor
    confinement. I...
    Run aa-exec-click
  • 3
    cpio
    cpio
    cpio - copy files to and from archives ...
    Run cpio
  • 4
    cpipe
    cpipe
    cpipe - copy stdin to stdout while
    counting bytes and reporting progress ...
    Run cpipe
  • 5
    FvwmSave
    FvwmSave
    FvwmSave - the Fvwm desktop-layout
    saving module ...
    Run FvwmSave
  • 6
    FvwmSave1
    FvwmSave1
    FvwmSave - the FVWM desktop-layout
    saving module ...
    Run FvwmSave1
  • More »

Ad