EnglishFrenchSpanish

OnWorks favicon

v.in.dbgrass - Online in the Cloud

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

This is the command v.in.dbgrass 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.in.db - Creates new vector (points) map from database table containing coordinates.

KEYWORDS


vector, import, database, points

SYNOPSIS


v.in.db
v.in.db --help
v.in.db [-t] table=name [driver=name] [database=name] x=name y=name [z=name]
[key=name] [where=sql_query] output=name [--overwrite] [--help] [--verbose]
[--quiet] [--ui]

Flags:
-t
Use imported table as attribute table for new map

--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:
table=name [required]
Input table name

driver=name
Name of database driver
Options: mysql, odbc, sqlite, pg, ogr, dbf
Default: sqlite

database=name
Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

x=name [required]
Name of column containing x coordinate

y=name [required]
Name of column containing y coordinate

z=name
Name of column containing z coordinate

key=name
Name of column containing category number
Must refer to an integer column

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

output=name [required]
Name for output vector map

DESCRIPTION


v.in.db creates a new vector point map from database table or file containing coordinates.

NOTES


If GRASS comes with OGR support than v.in.db allows importing data from different input
files, eg. CSV or MS Excel (assuming that GDAL/OGR library is compiled with this support).

v.in.db creates key column "cat" automatically when key option is not given. Note that
this operation is possible to perform only when -t flag is not given. Currently, automated
creation of key column is supported only when default DB driver for output vector map is
SQLite driver otherwise key option must be specified by the user. Default DB driver is
defined by db.connect.

EXAMPLES


Creating a map from PostgreSQL table
v.in.db driver=pg database="host=myserver.itc.it,dbname=mydb" \
table=pat_stazioni x=east y=north z=quota key=id output=pat_stazioni

If an ID column is not present in the PostgreSQL table, a new column should be added. See
PostgreSQL DB driver page for details.

Creating a map from PostGIS
To extract coordinate values from PostGIS, functions have to be used:
v.in.db driver=pg database="host=myserver.itc.it,dbname=mydb" \
table=station x="x(geom)" y="y(geom)" z="z(geom)" key=id out=meteostations

If an ID column is not present in the PostgreSQL table, a new column should be added. See
PostgreSQL DB driver page for details.

Alternatively a vector point map can be imported from PostGIS database using v.in.ogr.

Creating a map from Open Document spreadsheet (ODS) file
A new vector point map is created from given sheet in ODS file. The database option points
to the ODS file. Option table is the name of selected spreadsheet list, the key option is
the identifier column:
# preview table structure with OGR tool:
ogrinfo -so meteodata.ods mysheet
# import from ODS into map
v.in.db key=ID table=mysheet x=long y=lat z=height output=meteodata \
driver=ogr datatabase=meteodata.ods

Creating a map from MS Excel file
A new vector point map is created from given sheet in MS Excel file. The database option
points to the file in MS Excel format. Option table is name of the selected spreadsheet
list:
v.in.db table=List1 x=long y=lat z=height output=meteodata \
driver=ogr datatabase=meteodata.xls
Note that in this example the key option is omitted. In this case v.in.db tries to add key
column automatically. This requires SQLite to be a default DB driver.

Creating a map from DBF table
A new 3D point vector map is created from DBF table. Column ’idcol’ contains unique row
IDs. The database option is the directory where the DBF file is stored.
v.in.db driver=dbf database=/home/user/tables/ table=pointsfile x=x y=y z=z \
key=idcol out=dtmpoints
To check result:
v.info dtmpoints
v.info -c dtmpoints

If DB driver for output vector map is different from SQLite driver and an ID column is
missing in the DBF file, it has to be added beforehand, e.g. with OpenOffice.
Alternatively, import the table with db.in.ogr into GRASS and then with v.in.db from the
imported table (db.in.ogr optionally adds an unique ID column).

Creating a point map from DBF table for selected records only
The user can import only selected vector points from a table using the where parameter
(see above for general DBF handling):
v.in.db driver=dbf database=/home/user/tables/ table=pointsfile x=x y=y z=z \
key=idcol out=dtmpoints where="x NOT NULL and z > 100"

Creating a map from SQLite table
A new vector point map is created from table in SQLite database file. Column ’idcol’
contains unique row IDs. The database option is the the SQLite database file.
v.in.db driver=sqlite database=/home/user/tables/mysqlite.db table=pointsfile x=x y=y z=z \
key=idcol out=dtmpoints

Use v.in.dbgrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    GenX
    GenX
    GenX is a scientific program to refine
    x-ray refelcetivity, neutron
    reflectivity and surface x-ray
    diffraction data using the differential
    evolution algorithm....
    Download GenX
  • 2
    pspp4windows
    pspp4windows
    PSPP is a program for statistical
    analysis of sampled data. It is a free
    replacement for the proprietary program
    SPSS. PSPP has both text-based and
    graphical us...
    Download pspp4windows
  • 3
    Git Extensions
    Git Extensions
    Git Extensions is a standalone UI tool
    for managing Git repositories. It also
    integrates with Windows Explorer and
    Microsoft Visual Studio
    (2015/2017/2019). Th...
    Download Git Extensions
  • 4
    eSpeak: speech synthesis
    eSpeak: speech synthesis
    Text to Speech engine for English and
    many other languages. Compact size with
    clear but artificial pronunciation.
    Available as a command-line program with
    many ...
    Download eSpeak: speech synthesis
  • 5
    Sky Chart / Cartes du Ciel
    Sky Chart / Cartes du Ciel
    SkyChart is a software to draw chart of
    the night sky for the amateur astronomer
    from a bunch of stars and nebulae
    catalogs. See main web page for full
    download...
    Download Sky Chart / Cartes du Ciel
  • 6
    GSmartControl
    GSmartControl
    GSmartControl is a graphical user
    interface for smartctl. It allows you to
    inspect the hard disk and solid-state
    drive SMART data to determine its
    health, as w...
    Download GSmartControl
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqmktop
    coqmktop
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop
    coqtop
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    g.copygrass
    g.copygrass
    g.copy - Copies available data files in
    the current mapset search path to the
    user�s current mapset. KEYWORDS:
    general, map management ...
    Run g.copygrass
  • 6
    g.dirsepsgrass
    g.dirsepsgrass
    g.dirseps - Internal GRASS utility for
    converting directory separator
    characters. Converts any directory
    separator characters in the input string
    to or from na...
    Run g.dirsepsgrass
  • More »

Ad