Skip to content

Commit 3b355ea

Browse files
committed
manual: conversion of all HTML manual pages to markdown
Test submission of conversion of all HTML manual pages to markdown using the `pandoc` based converter script (see OSGeo#4620). For figure code conversion issues, see OSGeo#4864
1 parent 9fd2ceb commit 3b355ea

File tree

603 files changed

+72741
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

603 files changed

+72741
-0
lines changed

db/databaseintro.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
### Attribute management in general
2+
3+
GRASS can be linked to one or many database management systems (DBMS).
4+
The *db.\** set of commands provides basic SQL support for attribute
5+
management, while the *v.db.\** set of commands operates on the vector
6+
map (see [Vector introduction](vectorintro.md)).
7+
8+
### Available drivers
9+
10+
Available drivers are listed in [SQL support in GRASS GIS](sql.md).
11+
12+
**Notes**:
13+
The DBF driver provides only very limited SQL support (as DBF is not an
14+
SQL DB) while the other DBMS backends (such as SQLite, PostgreSQL, MySQL
15+
etc) provide full SQL support since the SQL commands are sent directly
16+
to the DBMS. For this reason, the SQLite driver is the default DBMI
17+
backend.
18+
19+
### DB connection management
20+
21+
The current database management settings are shown or modified with
22+
[db.connect](db.connect.md) for current mapset. Available DBMI drivers
23+
are listed with [db.drivers](db.drivers.md). Some DBMI backends require
24+
a user/password for driver/database to be set with
25+
[db.login](db.login.md). In order to test a driver, run
26+
[db.test](db.test.md).
27+
28+
### Attribute data import and export
29+
30+
Attribute data can be imported with [db.in.ogr](db.in.ogr.md) from
31+
various formats and exported with [db.out.ogr](db.out.ogr.md). To
32+
internally copy a a full table or selectively parts of it, use
33+
[db.copy](db.copy.md).
34+
35+
Further conversion tools:
36+
37+
- [MDB Tools](https://github.com/mdbtools/mdbtools): Convert MS-Access
38+
data to SQL, DBF, etc.
39+
- [Using OpenOffice.org with SQL
40+
Databases](https://grasswiki.osgeo.org/wiki/Openoffice.org_with_SQL_Databases)
41+
42+
### SQL commands
43+
44+
GRASS supports two main SQL operations, execution of an SQL statement
45+
([db.execute](db.execute.md)) and selection of data from a table
46+
([db.select](db.select.md)). See the [SQL help page](sql.md) for
47+
examples.
48+
49+
### Managing the default DBMI settings
50+
51+
Per default vector map attributes are stored in SQLite tables. This
52+
default definition can be modified with [db.connect](db.connect.md). If
53+
an external DBMS is used, [db.login](db.login.md) may be required.
54+
55+
### Creating a database
56+
57+
Specific commands are explained on the individual driver pages (these
58+
pages are only available if driver was compiled in this installation):
59+
60+
- DBF: see [DBF](grass-dbf.md) page
61+
- SQLite: [SQLite](grass-sqlite.md) page
62+
- mySQL: [mySQL](grass-mysql.md) and [meSQL](grass-mesql.md) pages
63+
- ODBC: [ODBC](grass-odbc.md) page (connect to Oracle, etc.)
64+
- PostgreSQL: [PostgreSQL](grass-pg.md) and PostGIS page
65+
66+
### Metadata
67+
68+
All columns for a given table are listed with
69+
[db.columns](db.columns.md). The command [db.describe](db.describe.md)
70+
describes a table in detail. To list all available tables for a given
71+
database, run [db.tables](db.tables.md).
72+
73+
### Table maintenance
74+
75+
To drop a column from a selected attribute table, use
76+
[db.dropcolumn](db.dropcolumn.md). With [db.droptable](db.droptable.md)
77+
an attribute table can be deleted.
78+
79+
### Database Schema
80+
81+
Currently schema support only works for PostgreSQL connections. Default
82+
schema can be set with [db.connect](db.connect.md). Note that the
83+
default schema will be used by all db.\* modules.
84+
85+
[db.tables](db.tables.md) returns 'schema.table' if schemas are
86+
available in the database.
87+
88+
### Migrating to a different database engine
89+
90+
To migrate a GRASS database table (or a GRASS vector map) to a different
91+
DBMI engine, the best solution is to create a new MAPSET, define the
92+
DBMI settings accordingly with [db.connect](db.connect.md) and if
93+
needed, [db.login](db.login.md). Then the table of interest can be
94+
copied over with [db.copy](db.copy.md) from the original MAPSET.
95+
Likewise, a vector map including its table(s) are copied from the
96+
original MAPSET to the current MAPSET with [g.copy](g.copy.md).
97+
98+
### See also
99+
100+
- [Introduction into raster data processing](rasterintro.md)
101+
- [Introduction into 3D raster data (voxel)
102+
processing](raster3dintro.md)
103+
- [Introduction into vector data processing](vectorintro.md)
104+
- [Introduction into image processing](imageryintro.md)
105+
- [Introduction into temporal data processing](temporalintro.md)
106+
- [Projections and spatial transformations](projectionintro.md)
107+
- [Graphical User Interface](wxguiintro.md)

db/db.columns/db.columns.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## DESCRIPTION
2+
3+
*db.columns* lists all columns for a give table. Connection to databases
4+
are supported through dbf, shp, odbc and pg drivers.
5+
6+
## NOTE
7+
8+
If parameters for database connection are already set with
9+
[db.connect](db.connect.md), they are taken as default values and do not
10+
need to be spcified each time.
11+
12+
## EXAMPLES
13+
14+
### List columns of a PostgreSQL attribute table
15+
16+
```bash
17+
db.columns table=zipcodes_wake driver=pg database=grassdb
18+
```
19+
20+
*If the database parameters are already set, the columns can be listed
21+
directly*
22+
23+
```bash
24+
db.columns table=zipcodes_wake
25+
```
26+
27+
### List columns from Shape file with DBF attribute table
28+
29+
```bash
30+
db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/
31+
```
32+
33+
### List columns of table in SQLite database
34+
35+
Note that the SQLite backend is the default setting.
36+
37+
```bash
38+
db.columns driver=sqlite table=archsites database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
39+
```
40+
41+
## SEE ALSO
42+
43+
*[db.connect](db.connect.md), [db.describe](db.describe.md),
44+
[db.drivers](db.drivers.md), [db.droptable](db.droptable.md),
45+
[db.execute](db.execute.md), [db.login](db.login.md),
46+
[db.tables](db.tables.md), [GRASS SQL interface](sql.md)*
47+
48+
[GRASS SQL interface](sql.md)
49+
50+
## AUTHOR
51+
52+
Radim Blazek, ITC-Irst, Trento, Italy

db/db.connect/db.connect.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
## DESCRIPTION
2+
3+
*db.connect* allows the user to set database connection parameters.
4+
These parameters are then taken as default values by modules so that the
5+
user does not need to enter the parameters each time.
6+
7+
The default database backend in GRASS GIS is [SQLite](grass-sqlite.md)
8+
(since version 7).
9+
10+
## NOTES
11+
12+
Values are stored in the mapset's `VAR` file; the connection is not
13+
tested for validity.
14+
15+
The **-p** flag will display the current connection parameters.
16+
17+
The **-c** flag will silently check if the connection parameters have
18+
been set, and if not will set them to use GRASS's default values.
19+
(useful in scripts before you attempt to create a new database table)
20+
21+
To connect a vector map to a database table, use
22+
*[v.db.connect](v.db.connect.md)* or
23+
*[v.db.addtable](v.db.addtable.md)*.
24+
25+
## EXAMPLES
26+
27+
### SQLite (default backend)
28+
29+
Local storage:
30+
31+
```bash
32+
db.connect -d
33+
db.connect -p
34+
db.tables -p
35+
```
36+
37+
The SQLite database file is created automatically when used the first
38+
time.
39+
40+
See [SQLite](grass-sqlite.md) database driver for details.
41+
42+
### PostgreSQL (local connection)
43+
44+
Local storage, database tables stored in database "mydb" (may require
45+
the use of *[db.login](db.login.md)*):
46+
47+
```bash
48+
db.connect driver=pg database=mydb
49+
db.login user=myname pass=secret
50+
db.connect -p
51+
db.tables -p
52+
```
53+
54+
See [PostgreSQL](grass-pg.md) database driver for details.
55+
56+
### PostgreSQL (network connection)
57+
58+
Network storage, database tables stored in database "mydb" (may require
59+
the use of *[db.login](db.login.md)*):
60+
61+
```bash
62+
db.connect driver=pg database=mydb
63+
db.login user=myname pass=secret host=myserver.com port=6666
64+
db.connect -p
65+
db.tables -p
66+
```
67+
68+
See [PostgreSQL](grass-pg.md) database driver for details.
69+
70+
### MySQL (local connection)
71+
72+
Local storage, database tables stored in database "mydb" (may require
73+
the use of *[db.login](db.login.md)*):
74+
75+
```bash
76+
db.connect driver=mysql database=mydb
77+
db.login user=myname pass=secret
78+
db.connect -p
79+
db.tables -p
80+
```
81+
82+
See [MySQL](grass-mysql.md) database driver for details.
83+
84+
### MySQL (network connection)
85+
86+
Network storage, database tables stored in database "mydb" (may require
87+
the use of *[db.login](db.login.md)*):
88+
89+
```bash
90+
db.connect driver=mysql database=mydb
91+
db.login user=myname pass=secret host=myserver.com
92+
db.connect -p
93+
db.tables -p
94+
```
95+
96+
See [MySQL](grass-mysql.md) database driver for details.
97+
98+
### ODBC
99+
100+
Network storage, database tables stored in database "mydb" (may require
101+
the use of *[db.login](db.login.md)*):
102+
103+
```bash
104+
db.connect driver=odbc database=mydb
105+
db.login user=myname pass=secret
106+
db.connect -p
107+
db.tables -p
108+
```
109+
110+
See [ODBC](grass-odbc.md) database driver for details.
111+
112+
### DBF (local, not recommended)
113+
114+
Local storage (the dbf/ subdirectory in the mapset must exist or must be
115+
created by the user):
116+
117+
```bash
118+
db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
119+
db.tables -p
120+
```
121+
122+
See [DBF](grass-dbf.md) database driver for details.
123+
124+
## SEE ALSO
125+
126+
*[db.columns](db.columns.md), [db.copy](db.copy.md),
127+
[db.drivers](db.drivers.md), [db.login](db.login.md),
128+
[db.tables](db.tables.md), [v.db.addtable](v.db.addtable.md),
129+
[v.db.connect](v.db.connect.md)*
130+
131+
[GRASS SQL interface](sql.md)
132+
133+
## AUTHORS
134+
135+
Main author: Radim Blazek, ITC-Irst, Trento, Italy
136+
GRASS 7 improvements: Martin Landa, Markus Metz

db/db.copy/db.copy.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## DESCRIPTION
2+
3+
*db.copy* allows the user to copy a table between two databases.
4+
Databases can be connected through different drivers (see examples
5+
below).
6+
7+
## NOTES
8+
9+
Attribute tables can be copied using *db.copy* and, when to be
10+
associated to a vector map, assigned to the map with
11+
*[v.db.connect](v.db.connect.md)*. Current connection settings are saved
12+
in the file *\$LOCATION/vector_map/dbln*.
13+
14+
## EXAMPLES
15+
16+
### From DBF to PostgreSQL
17+
18+
*Storing table 'geonames.dbf' (in current directory) into PostgreSQL
19+
through ODBC:*
20+
21+
```bash
22+
db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
23+
from_table=geonames to_driver=pg to_database="host=pgserver,dbname=testdb" \
24+
to_table=geonames
25+
```
26+
27+
### From PostgreSQL to DBF
28+
29+
```bash
30+
db.copy from_driver=pg from_database="host=pgserver.example.org,dbname=testdb" \
31+
from_table=origtable to_driver=dbf \
32+
to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf' to_table=origtable
33+
```
34+
35+
### From PostgreSQL to PostgreSQL with condition
36+
37+
```bash
38+
db.copy from_driver=pg from_database="host=localhost,dbname=testdb" \
39+
from_table=geonames to_driver=pg to_database="host=localhost,dbname=testdb" \
40+
to_table=selection where="cat < 500"
41+
```
42+
43+
### From DBF to SQLite
44+
45+
```bash
46+
db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
47+
from_table=geonames_features to_driver=sqlite \
48+
to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' to_table=geonames_features
49+
50+
# convenient viewer:
51+
sqlitebrowser $HOME/grassdata/nc_spm_08/user1/sqlite/sqlite.db
52+
```
53+
54+
### From SQLite to DBF
55+
56+
```bash
57+
db.copy from_driver=sqlite from_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' \
58+
from_table=ammprv to_driver=dbf to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \
59+
to_table=ammprv
60+
```
61+
62+
## SEE ALSO
63+
64+
*[db.connect](db.connect.md), [db.drivers](db.drivers.md),
65+
[db.login](db.login.md), [v.db.connect](v.db.connect.md),
66+
[v.clean](v.clean.md)*
67+
68+
[GRASS SQL interface](sql.md)
69+
70+
## AUTHOR
71+
72+
Radim Blazek, ITC-irst, Trento, Italy

0 commit comments

Comments
 (0)