EnglishFrenchSpanish

OnWorks favicon

v.db.updategrass - Online in the Cloud

Run v.db.updategrass in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command v.db.updategrass 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


v.db.update - Updates a column in the attribute table connected to a vector map.

KEYWORDS


vector, attribute table, database

SYNOPSIS


v.db.update
v.db.update --help
v.db.update map=name layer=string column=name [value=string] [query_column=name]
[where=sql_query] [--help] [--verbose] [--quiet] [--ui]

Flags:
--help
Print usage summary

--verbose
Verbose module output

--quiet
Quiet module output

--ui
Force launching GUI dialog

Parameters:
map=name [required]
Name of vector map
Or data source for direct OGR access

layer=string [required]
Layer number or name
Vector features can have category values in different layers. This number determines
which layer to use. When used with direct OGR access this is the layer name.
Default: 1

column=name [required]
Name of attribute column to update

value=string
Literal value to update the column with

query_column=name
Name of other attribute column to query, can be combination of columns (e.g. co1+col2)

where=sql_query
WHERE conditions of SQL statement without ’where’ keyword
Example: income < 1000 and inhab >= 10000

DESCRIPTION


v.db.update assigns a new value to a column in the attribute table connected to a given
map. The value parameter allows updating with a literal value. Alternatively, with the
qcol parameter values can be copied from another column in the table or be the result of a
combination or transformation of other columns.

NOTES


v.db.update is just a front-end to db.execute to allow easier usage.

For complex SQL UPDATE statements, db.execute should be used.

EXAMPLES


Replacing of NULL values
In this example, selectively display lakes without (blue) and with NULL (red) are shown to
find out which type is undefined. In the original map there are lakes missing FTYPE
attribute which are wetlands along streams. These NULL attributes are replaced with the
landuse type WETLAND:
g.copy vect=lakes,mylakes
v.db.select mylakes
v.db.select mylakes where="FTYPE IS NULL"
# display the lakes, show undefined FTYPE lakes in red
g.region vector=mylakes
d.mon wx0
d.vect mylakes where="FTYPE NOT NULL" type=area col=blue
d.vect mylakes where="FTYPE IS NULL" type=area col=red
# replace NULL with FTYPE WETLAND
v.db.update mylakes col=FTYPE value=WETLAND \
where="FTYPE IS NULL"
v.db.select mylakes

Updating of columns with on the fly calculation
Spearfish example: adding new column, copying values from another table column with on the
fly calculation:
g.copy vect=fields,myfields
v.db.addcolumn myfields col="polynum integer"
v.db.update myfields col=polynum qcol="cat*2"
v.db.select myfields

Type casting
Type cast (type conversion) of strings to double precision (unsupported by DBF driver):
g.copy vect=geodetic_pts,mygeodetic_pts
v.db.update mygeodetic_pts col=zval qcol="CAST(z_value AS double precision)" \
where="z_value <> ’N/A’"

Use v.db.updategrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Phaser
    Phaser
    Phaser is a fast, free, and fun open
    source HTML5 game framework that offers
    WebGL and Canvas rendering across
    desktop and mobile web browsers. Games
    can be co...
    Download Phaser
  • 2
    VASSAL Engine
    VASSAL Engine
    VASSAL is a game engine for creating
    electronic versions of traditional board
    and card games. It provides support for
    game piece rendering and interaction,
    and...
    Download VASSAL Engine
  • 3
    OpenPDF - Fork of iText
    OpenPDF - Fork of iText
    OpenPDF is a Java library for creating
    and editing PDF files with a LGPL and
    MPL open source license. OpenPDF is the
    LGPL/MPL open source successor of iText,
    a...
    Download OpenPDF - Fork of iText
  • 4
    SAGA GIS
    SAGA GIS
    SAGA - System for Automated
    Geoscientific Analyses - is a Geographic
    Information System (GIS) software with
    immense capabilities for geodata
    processing and ana...
    Download SAGA GIS
  • 5
    Toolbox for Java/JTOpen
    Toolbox for Java/JTOpen
    The IBM Toolbox for Java / JTOpen is a
    library of Java classes supporting the
    client/server and internet programming
    models to a system running OS/400,
    i5/OS, o...
    Download Toolbox for Java/JTOpen
  • 6
    D3.js
    D3.js
    D3.js (or D3 for Data-Driven Documents)
    is a JavaScript library that allows you
    to produce dynamic, interactive data
    visualizations in web browsers. With D3
    you...
    Download D3.js
  • More »

Linux commands

Ad