Quellcode durchsuchen

manual: some examples updated; HTML cosmetics

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63231 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler vor 10 Jahren
Ursprung
Commit
03c9d77f1c

+ 20 - 13
db/db.columns/db.columns.html

@@ -5,33 +5,38 @@ databases are supported through dbf, shp, odbc and pg drivers.
 
 <h2>NOTE</h2>
 
-If parameters for database connection are already set with 
-<a href="db.connect.html">db.connect</a>, they are taken as default values and
-do not need to be spcified each time.
+If parameters for database connection are already set with
+<a href="db.connect.html">db.connect</a>, they are taken as default values
+and do not need to be spcified each time.
 
 <h2>EXAMPLES</h2>
 
-<em>List columns of a PostgreSQL attribute table</em><br>
+<h3>List columns of a PostgreSQL attribute table</h3>
+
 <div class="code"><pre>
-db.columns table=markveggy driver=pg database=grass60test
+db.columns table=zipcodes_wake driver=pg database=grassdb
 </pre></div>
 
 <p>
-<em>If the database parameters are already set, the columns can be listed directly</em><br>
+<em>If the database parameters are already set, the columns can be listed
+directly</em><br>
+
 <div class="code"><pre>
-db.columns table=markveggy
+db.columns table=zipcodes_wake
 </pre></div>
 
-<p>
-<em>List columns from Shape file with DBF attribute table</em><br>
+<h3>List columns from Shape file with DBF attribute table</h3>
+
 <div class="code"><pre>
-db.columns table=network driver=dbf database=/daten/grassdata/fire/PERMANENT/dbf/
+db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/
 </pre></div>
 
-<p>
-<em>List columns of table in SQLite database (note that this is the default setting)</em><br>
+<h3>List columns of table in SQLite database</h3>
+
+Note that the SQLite backend is the default setting.
+
 <div class="code"><pre>
-db.columns driver=sqlite table=myarchsites database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
+db.columns driver=sqlite table=archsites database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
 </pre></div>
 
 <h2>SEE ALSO</h2>
@@ -45,6 +50,8 @@ db.columns driver=sqlite table=myarchsites database='$GISDBASE/$LOCATION_NAME/$M
 <a href="db.tables.html">db.tables</a>,
 <a href="sql.html">GRASS SQL interface</a>
 </em>
+<p>
+<a href="sql.html">GRASS SQL interface</a>
 
 <h2>AUTHOR</h2>
 

+ 3 - 3
db/db.connect/db.connect.html

@@ -4,7 +4,7 @@
 These parameters are then taken as default values by modules so that the
 user does not need to enter the parameters each time.
 <p>
-The default database backend in GRASS 7 is SQLite.
+The default database backend in GRASS GIS 7 is SQLite.
 
 <h2>NOTES</h2>
 
@@ -71,7 +71,7 @@ db.tables -p
 </pre></div>
 
 
-<h3>MySQL (local)</h3>
+<h3>MySQL (local connection)</h3>
 
 Local storage (<em><a href=db.login.html>db.login</a></em> may not be needed):
 <br>
@@ -95,7 +95,7 @@ db.connect -p
 db.tables -p
 </pre></div>
 
-<h3>DBF (not recommended)</h3>
+<h3>DBF (local, not recommended)</h3>
 
 Local storage (the dbf/ subdirectory in the mapset must exist or must be
 created by the user):

+ 12 - 8
db/db.copy/db.copy.html

@@ -1,7 +1,7 @@
 <h2>DESCRIPTION</h2>
 
 <em>db.copy</em> allows the user to copy a table between two databases.
-Databases can be connected through different drivers (see example).
+Databases can be connected through different drivers (see examples below).
 
 <h2>NOTES</h2>
 
@@ -12,7 +12,7 @@ settings are saved in the file <em>$LOCATION/vector_map/dbln</em>.
 
 <h2>EXAMPLES</h2>
 
-<h3>DBF -> PG</h3>
+<h3>From DBF to PostgreSQL</h3>
 
 <em>Storing table 'geonames.dbf' (in current directory) into PostgreSQL
 through ODBC:</em><br>
@@ -24,7 +24,7 @@ db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
 </pre></div>
 
 
-<h3>PG -> DBF</h3>
+<h3>From PostgreSQL to DBF</h3>
 
 <div class="code"><pre>
 db.copy from_driver=pg  from_database="host=pgserver.example.org,dbname=testdb" \
@@ -33,7 +33,7 @@ db.copy from_driver=pg  from_database="host=pgserver.example.org,dbname=testdb"
 </pre></div>
 
 
-<h3>PG -> PG with condition</h3>
+<h3>From PostgreSQL to PostgreSQL with condition</h3>
 
 <div class="code"><pre>
 db.copy from_driver=pg  from_database="host=localhost,dbname=testdb" \
@@ -41,7 +41,8 @@ db.copy from_driver=pg  from_database="host=localhost,dbname=testdb" \
   to_table=selection where="cat &lt; 500" 
 </pre></div>
 
-<h3>DBF -> SQLite</h3>
+
+<h3>From DBF to SQLite</h3>
 
 <div class="code"><pre>
 db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
@@ -52,7 +53,9 @@ db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
 sqlitebrowser $HOME/grassdata/nc_spm_08/user1/sqlite/sqlite.db
 </pre></div>
 
-<h3>SQLite -> DBF</h3>
+
+<h3>From SQLite to DBF</h3>
+
 <div class="code"><pre>
 db.copy from_driver=sqlite from_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' \
    from_table=ammprv to_driver=dbf to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \
@@ -67,9 +70,10 @@ db.copy from_driver=sqlite from_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlit
 <a href="db.drivers.html">db.drivers</a>,
 <a href="db.login.html">db.login</a>,
 <a href="v.db.connect.html">v.db.connect</a>,
-<a href="v.clean.html">v.clean</a>,
-<a href="sql.html">GRASS SQL interface</a>
+<a href="v.clean.html">v.clean</a>
 </em>
+<p>
+<a href="sql.html">GRASS SQL interface</a>
 
 <h2>AUTHOR</h2>
 

+ 3 - 3
db/db.createdb/db.createdb.html

@@ -23,19 +23,19 @@ Create a new PostgreSQL database (if PostgreSQL connection is
 established through <em>odbc</em> driver):
 
 <div class="code"><pre>
-db.createdb driver=odbc database=grasstest
+db.createdb driver=odbc database=grassdb
 </pre></div>
 
 Create a new PostgreSQL database (if PostgreSQL connection is established
 through <em>pg</em> driver):
 
 <div class="code"><pre>
-db.createdb driver=pg database=grasstest
+db.createdb driver=pg database=grassdb
 </pre></div>
 
 <h2>TODO</h2>
 
-Support other database drivers too.
+Support other database drivers, too.
 
 <h2>SEE ALSO</h2>
 

+ 4 - 1
db/db.databases/db.databases.html

@@ -21,12 +21,14 @@ List SQLite databases in the current mapset:
 db.databases driver=sqlite
 </pre></div>
 
+<p>
 List SQLite databases in the given directory:
 
 <div class="code"><pre>
 db.databases driver=sqlite location=/opt/sqlite
 </pre></div>
 
+<p>
 List PostgreSQL databases from database server running on given port:
 
 <div class="code"><pre>
@@ -35,7 +37,8 @@ db.databases driver=pg location="host=server_name port=5333"
 
 <h2>SEE ALSO</h2>
 
-<em><a href="db.columns.html">db.columns</a>,
+<em>
+<a href="db.columns.html">db.columns</a>,
 <a href="db.describe.html">db.describe</a>,
 <a href="db.drivers.html">db.drivers</a>,
 <a href="db.execute.html">db.execute</a>,

+ 21 - 11
db/db.describe/db.describe.html

@@ -1,7 +1,7 @@
 <h2>DESCRIPTION</h2>
 
-<em>db.describe</em> displays table information. If parameter <b>-c</b> is used 
- only column names instead of full column descriptions is given. 
+<em>db.describe</em> displays table information. If parameter <b>-c</b>
+is used only column names instead of full column descriptions is given. 
 
 <h2>NOTE</h2>
 
@@ -11,9 +11,11 @@ do not need to be spcified each time.
  
 <h2>EXAMPLES</h2>
 
-<em>List column descriptions of table in SQLite database (note that this is the default setting)</em><br>
+<em>List column descriptions of table in SQLite database (note that this
+is the default setting)</em><br>
+
 <div class="code"><pre>
-db.describe driver=sqlite table=myarchsites \
+db.describe driver=sqlite table=hospitals \
    database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
 
 # or simply
@@ -22,21 +24,25 @@ db.describe myarchsites
 
 <h3>DBF example</h3>
 <div class="code"><pre>
-db.describe -c table=roads database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \
+db.describe -c table=hospitals database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \
             driver=dbf
-ncols:2
-Column 1:cat:INTEGER:11
-Column 2:label:CHARACTER:43
+ncols: 16
+nrows: 160
+Column 1: cat:INTEGER:11
+Column 2: OBJECTID:INTEGER:11
+Column 3: AREA:DOUBLE PRECISION:20
+[...]
 </pre></div>
 
 <div class="code"><pre>
-db.describe table=roads database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \
+db.describe table=hospitals database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \
             driver=dbf
-table:roads
+table:hospitals
 description:
 insert:yes
 delete:yes
-ncols:2
+ncols:16
+nrows:160
 
 column:cat
 description:
@@ -48,6 +54,10 @@ default:
 nullok:yes
 select:yes
 update:yes
+
+column:OBJECTID
+description:
+type:INTEGER
 [...]
 </pre></div>
 

+ 6 - 1
db/db.drivers/db.drivers.html

@@ -1,12 +1,17 @@
 <h2>DESCRIPTION</h2>
 
-<em>db.drivers</em> lists all database drivers. 
+<em>db.drivers</em> lists all database drivers (DBMI backends).
 
 <h2>EXAMPLE</h2>
 
 Show all installed GRASS database drivers:
+
 <p><div class="code"><pre>
 db.drivers -p
+pg
+ogr
+sqlite
+dbf
 </pre></div>
 
 <h2>SEE ALSO</h2>

+ 5 - 6
db/db.dropdb/db.dropdb.html

@@ -1,14 +1,13 @@
 <h2>DESCRIPTION</h2>
 
-<em>db.dropdb</em> removes an existing database using given
-database <b>driver</b>. Currently
-only <a href="grass-sqlite.html">SQLite</a>
+<em>db.dropdb</em> removes an existing database using given database
+<b>driver</b>. Currently only <a href="grass-sqlite.html">SQLite</a>
 and <a href="grass-pg.html">PostgreSQL</a> database drivers are
 supported.
 
 <h2>EXAMPLES</h2>
 
-<h3>Drop an existing database connected through SQLite driver</h3>
+<h3>Drop (delete) an existing database connected through SQLite driver</h3>
 
 <div class="code"><pre>
 db.dropdb driver=sqlite database=/opt/sqlite.db
@@ -17,12 +16,12 @@ db.dropdb driver=sqlite database=/opt/sqlite.db
 <h3>Drop an existing database connected through PostgreSQL driver</h3>
 
 <div class="code"><pre>
-db.dropdb driver=pg database=grasstest
+db.dropdb driver=pg database=grassdb
 </pre></div>
 
 <h2>TODO</h2>
 
-Support other database drivers too.
+Support other database drivers, too.
 
 <h2>SEE ALSO</h2>
 

+ 14 - 11
db/db.execute/db.execute.html

@@ -5,11 +5,12 @@
 <h2>NOTES</h2>
 
 <em>db.execute</em> only executes SQL statements and does not return 
-any data. If you need data returned from the database, use <em><a href="db.select.html">db.select</a></em>.
+any data. If you need data returned from the database, use 
+<em><a href="db.select.html">db.select</a></em>.
 <p>
 If parameters for database connection are already set with
-<em><a href="db.connect.html">db.connect</a></em>, they are taken as default values and
-do not need to be specified each time.
+<em><a href="db.connect.html">db.connect</a></em>, they are taken as default
+values and do not need to be specified each time.
 <p>
 If you have a large number of SQL commands to process, it is much much
 faster to place all the SQL statements into a text file and
@@ -29,12 +30,12 @@ db.execute sql="CREATE TABLE soils (cat integer, soiltype varchar(10))"
 
 Create a new table using a file with SQL statements
 <div class="code"><pre>
-db.execute driver=odbc database=g60test input=file.sql
+db.execute driver=odbc database=grassdb input=file.sql
 </pre></div>
 
 Insert new row into attribute table:
 <div class="code"><pre>
-db.execute sql="INSERT INTO nobugs (id,name,east_gb,north_gb) values (30,'Ala',1657340,5072301)"
+db.execute sql="INSERT INTO mysites (id,name,east,north) values (30,'Ala',1657340,5072301)"
 </pre></div>
 
 Update attribute entries to new value based on SQL rule:
@@ -57,7 +58,8 @@ Add new column to attribute table:
 db.execute sql="ALTER TABLE roads ADD COLUMN length double"
 </pre></div>
 
-Column type conversion - update new column from existing column (all drivers except for DBF):
+Column type conversion - update new column from existing column (all
+drivers except for DBF):
 <div class="code"><pre>
 # 'z_value' is varchar and 'z' is double precision:
 echo "UPDATE geodetic_pts SET z = CAST(z_value AS numeric)" | db.execute input=-
@@ -82,17 +84,14 @@ UPDATE roads SET travelcost=2 WHERE cat=2;
 db.execute input=file.sql
 </pre></div>
 
-Join table 'myroads' into table 'extratab' based on common 'cat' column values (not supported by DBF driver):
+Join table 'myroads' to table 'extratab' based on common 'cat' column
+values (not supported by DBF driver):
 <div class="code"><pre>
 db.execute sql="UPDATE extratab SET names=(SELECT label FROM myroads WHERE extratab.cat=myroads.cat)"
 </pre></div>
 
 <h2>SEE ALSO</h2>
-<em>
-<a href="sql.html">GRASS SQL interface</a>
-<em>
 
-<p>
 <em>
 <a href="db.columns.html">db.columns</a>,
 <a href="db.describe.html">db.describe</a>,
@@ -102,6 +101,10 @@ db.execute sql="UPDATE extratab SET names=(SELECT label FROM myroads WHERE extra
 <a href="db.select.html">db.select</a>,
 <a href="db.tables.html">db.tables</a>,
 </em>
+<p>
+<em>
+<a href="sql.html">GRASS SQL interface</a>
+<em>
 
 <h2>AUTHOR</h2>
 

+ 2 - 1
db/db.login/db.login.html

@@ -8,7 +8,7 @@ the connection to the selected <b>database</b> through the DB <b>driver</b>.
 This is only related to SQL database backends
 like <a href="grass-pg.html">PostgreSQL</a>, <a href="grass-mysql.html">MySQL</a>
 or <a href="grass-odbc.html">ODBC</a>. The passwords are stored in a
-hidden unencrypted file in the user account ('home' directory)
+hidden, unencrypted file in the user account ('home' directory)
 called <em>.grass7/dblogin</em>. Only the file owner can access this
 file.
 
@@ -37,6 +37,7 @@ db.login user=bacava password=""
 </pre></div>
 
 <h2>SEE ALSO</h2>
+
 <em>
 <a href="db.connect.html">db.connect</a>,
 <a href="db.test.html">db.test</a>

+ 14 - 12
db/db.select/db.select.html

@@ -14,7 +14,7 @@ be displayed to standard output or can be directed to a file
 
 <h2>EXAMPLES</h2>
 
-Basic usage:
+<h3>Basic usage</h3>
 <div class="code"><pre>
 db.select sql="select * from roads"
 </pre></div>
@@ -34,7 +34,7 @@ cat file.sql | db.select input=-
 <p>
 Select all from table roads:
 <div class="code"><pre>
-db.select -c driver=odbc database=mydb table=roads \
+db.select -c driver=odbc database=mydb table=hospitals \
           input=file.sql output=result.csv
 </pre></div>
 
@@ -56,7 +56,7 @@ Select coordinates from PostGIS table:
 db.select sql="SELECT x(geo),y(geo) FROM localizzazione"
 </pre></div>
 
-<p>Execute multiple SQL statements:
+<h3>Execute multiple SQL statements</h3>
 
 <div class="code"><pre>
 cat file.sql
@@ -68,9 +68,12 @@ db.select input=file.sql
 
 <p>
 
-<em>Count number of cases falling into same position:</em><br>
-When multiple observation have the spatial coordinates, they can still be counted
-(if needed, coordinates can be uploaded to the attribute table by <em>v.to.db</em>:
+<h3>Count number of cases falling into same position</h3>
+
+When multiple observation have the spatial coordinates, they can still
+be counted (if needed, coordinates can be uploaded to the attribute
+table by <em>v.to.db</em>:
+
 <div class="code"><pre> 
 db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases \
                FROM diseases GROUP BY long,lat"
@@ -79,11 +82,6 @@ db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases
 <h2>SEE ALSO</h2>
 
 <em>
-  <a href="sql.html">GRASS SQL interface</a>
-</em>
-
-<p>
-<em>
 <a href="db.connect.html">db.connect</a>,
 <a href="db.describe.html">db.describe</a>,
 <a href="db.drivers.html">db.drivers</a>,
@@ -92,8 +90,12 @@ db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases
 <a href="db.login.html">db.login</a>,
 <a href="db.tables.html">db.tables</a>
 </em>
+<p>
+<em>
+<a href="sql.html">GRASS SQL interface</a>
+</em>
 
-<h2>AUTHOR</h2>
+<h2>AUTHORS</h2>
 
 Original author unknown (probably CERL)<br>
 Modifications by Radim Blazek, ITC-Irst, Trento, Italy<br>

+ 8 - 6
db/db.tables/db.tables.html

@@ -10,24 +10,26 @@ do not need to be spcified each time.
 
 <h2>EXAMPLES</h2>
 
-<em>List all tables if database connection is already set</em><br>
+<h3>List all tables if database connection is already set</h3>
+
 <div class="code"><pre>
 db.tables -p
 </pre></div>
 
-<p>
-<em>List all DBF tables</em><br>
+<h3>List all DBF tables</h3>
+
 <div class="code"><pre>
-db.tables driver=dbf database=/home/user/grassdata/fire/PERMANENT/dbf
+db.tables driver=dbf database=/grassdata/nc_spm_08/user1/PERMANENT/dbf
 </pre></div>
 
-<p>
-<em>List all tables in SQLite database (note that this is the default setting)</em><br>
+<h3>List all tables in SQLite database (note that this is the default setting)</h3>
+
 <div class="code"><pre>
 db.tables -p driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
 </pre></div>
 
 <h2>SEE ALSO</h2>
+
 <em>
 <a href="db.columns.html">db.columns</a>,
 <a href="db.droptable.html">db.droptable</a>,

+ 2 - 1
display/d.geodesic/d.geodesic.html

@@ -30,7 +30,8 @@ the great circle distance is not displayed.
 g.region vect=world_political -p
 d.mon wx0
 d.vect world_political type=area
-d.geodesic coor=55:58W,33:18S,26:43E,60:37N lcolor=yellow tcolor=red
+d.geodesic coordinates=55:58W,33:18S,26:43E,60:37N \
+  line_color=yellow text_color=red
 </pre></div>
 
 <p><center>

+ 24 - 20
display/d.grid/d.grid.html

@@ -56,33 +56,37 @@ at one interval <b>size</b>, and again with
 
 <h2>EXAMPLES</h2>
 
-To draw a red geographic grid with 30 minute grid spacing run 
+To draw a red geographic grid with 30 minute grid spacing, run 
 either of the following:
-<pre>
-  d.grid -g size=00:30:00 color=red
-</pre>
+
+<div class="code"><pre>
+d.grid -g size=00:30:00 color=red
+</pre></div>
+
 or
-<pre>
-  d.grid -g size=0.5 color=255:0:0
-</pre>
-To draw a blue standard rectangular grid at a 500 (meter) spacing run the following:
-<pre>
-  d.grid size=500 color=blue
-</pre>
-<br>
 
+<div class="code"><pre>
+d.grid -g size=0.5 color=255:0:0
+</pre></div>
 
-<h2>SEE ALSO</h2>
+To draw a blue standard rectangular grid at a 500 (meter) spacing run the following:
+
+<div class="code"><pre>
+d.grid size=500 color=blue
+</pre></div>
 
-<em><a href="d.barscale.html">d.barscale</a></em><br>
-<em><a href="d.legend.html">d.legend</a></em><br>
-<em><a href="d.geodesic.html">d.geodesic</a></em><br>
-<em><a href="d.rhumbline.html">d.rhumbline</a></em><br>
-<em><a href="d.erase.html">d.erase</a></em><br>
-<em><a href="d.frame.html">d.frame</a></em><br>
-<em><a href="d.rast.html">d.rast</a></em><br>
 
+<h2>SEE ALSO</h2>
 
+<em>
+<a href="d.barscale.html">d.barscale</a>,
+<a href="d.legend.html">d.legend</a>,
+<a href="d.geodesic.html">d.geodesic</a>,
+<a href="d.rhumbline.html">d.rhumbline</a>,
+<a href="d.erase.html">d.erase</a>,
+<a href="d.frame.html">d.frame</a>,
+<a href="d.rast.html">d.rast</a>
+</em>
 
 <h2>AUTHORS</h2>
 

+ 8 - 7
display/d.path/d.path.html

@@ -16,18 +16,19 @@ window when running the command.
 <p>To calculate shortest path non-interactively and save the path to a new vector
 map, use the <em>v.net.path</em> module.
 
-<h2>EXAMPLE</h2>
+<h2>EXAMPLES</h2>
 
-Interactive shortest path routing on road network (Spearfish region):
+Interactive shortest path routing on road network (North Carolina sample dataset):
 <div class="code"><pre>
-g.region vector=roads
-d.vect roads
-d.path roads
+g.region vect=roadsmajor
+d.vect roadsmajor
+d.path roadsmajor coordinates=668646.15,224447.16,668348.83,235894.02
 </pre></div>
 
-Non-interactive shortest path routing on road network (Spearfish region):
+<p>
+Non-interactive shortest path routing on road network (North Carolina sample dataset):
 <div class="code"><pre>
-d.path -b roads coor=601653.5,4922869.2,593330.8,4924096.6
+d.path -b roadsmajor coordinates=668646.15,224447.16,668348.83,235894.02 
 </pre></div>
 
 <h2>SEE ALSO</h2>

+ 1 - 1
lib/cairodriver/cairodriver.html

@@ -114,7 +114,7 @@ export GRASS_RENDER_HEIGHT=800
 g.region vect=roadsmajor
 # activate vector font
 d.font Vera
-d.vect map=roadsmajor layer=1 display=shape,attr attrcolumn=ROAD_NAME lcolor=0:90:255
+d.vect map=roadsmajor layer=1 display=shape attrcolumn=ROAD_NAME lcolor=0:90:255
 </pre></div>
 -->
 

+ 1 - 0
scripts/db.univar/db.univar.html

@@ -15,6 +15,7 @@ If the database and driver are not specified, the default values set in
 
 In this example, random points are sampled from the elevation map
 (North Carolina sample dataset) and univariate statistics performed:
+
 <div class="code"><pre>
 g.region rast=elevation -p
 v.random output=samples n=100