[GRASSweb-list]markus: web/grass51/tutorial attrib_storage.html,1.16,1.17 demo.html,1.8,1.9 ex_basic.html,1.5,1.6 ex_complex.html,1.4,1.5 examples.html,1.24,1.25 geom_storage.html,1.13,1.14 network.html,1.2,1.3
grass at intevation.de
grass at intevation.de
Tue Apr 22 07:27:02 EDT 2003
Author: markus
Update of /grassrepository/web/grass51/tutorial
In directory doto:/tmp/cvs-serv2154
Modified Files:
attrib_storage.html demo.html ex_basic.html ex_complex.html
examples.html geom_storage.html network.html
Log Message:
html fixes
Index: attrib_storage.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/attrib_storage.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- attrib_storage.html 3 Apr 2003 12:03:05 -0000 1.16
+++ attrib_storage.html 22 Apr 2003 11:27:00 -0000 1.17
@@ -58,7 +58,7 @@
To get debug information, set variable (set to 0 for debug silence) to 1..5:
<div class="code"><pre>
g.gisenv set="DEBUG=3"
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
@@ -88,7 +88,7 @@
<div class="code"><pre>
v.db.connect -p vectmap
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
@@ -103,7 +103,7 @@
<div class="code"><pre>
v.database
-</div></pre>
+</pre></div>
<P>
Possible settings are (examples):
@@ -127,7 +127,7 @@
<div class="code"><pre>
db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
@@ -144,7 +144,7 @@
<div class="code"><pre>
v.db.connect -p markveggy.shp
-</div></pre>
+</pre></div>
which should print the database connection to the related DBF file.
<P>
@@ -154,7 +154,7 @@
<div class="code"><pre>
db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf'
db.tables -p
-</div></pre>
+</pre></div>
... which prints the available tables.
@@ -212,7 +212,7 @@
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
- FileUsage = 1</div></pre>
+ FileUsage = 1</pre></div>
<li> Create DSN (data source name). The DSN is used as database name in db.*
modules. Then DSN must be defined in $HOME/.odbc.ini (for this user only) or in
@@ -236,7 +236,7 @@
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
- ConnSettings =</div></pre>
+ ConnSettings =</pre></div>
Configuration of an DSN without GUI is described on <a href="http://www.unixodbc.org/odbcinst.html">http://www.unixodbc.org/odbcinst.html</a>,
but odbc.ini and .odbc.ini may be created by the 'ODBCConfig' tool. You can
@@ -252,7 +252,7 @@
Now create a new database if not yet existing:
<div class="code"><pre>
db.createdb driver=odbc database=grass51test
-</div></pre>
+</pre></div>
<li>Now store the table 'markveggy.dbf' (in current directory) into PostgreSQL
through ODBC:
@@ -260,7 +260,7 @@
db.connect driver=odbc database=grass51test
db.copy from_driver=dbf from_database=./ from_table=markveggy \
to_driver=odbc to_database=grass51test to_table=markveggy
-</div></pre>
+</pre></div>
<li> Next link map to attribute table:
@@ -268,7 +268,7 @@
v.db.connect map=markveggy.shp table=markveggy key=VEGCNP_ID \
database=grass51test driver=odbc
v.db.connect -p
-</div></pre>
+</pre></div>
<li>
Finally a test: Here we should see the table columns (if the ODBC
@@ -276,7 +276,7 @@
<div class="code"><pre>
db.tables -p
db.columns table=markveggy
-</div></pre>
+</pre></div>
Now the table name 'markveggy' should appear.
<P>
Doesn't work? Check with 'isql <databasename>' if the ODBC-PostgreSQL
@@ -290,7 +290,7 @@
<div class="code"><pre>
v.db.connect -p markveggy.shp
-</div></pre>
+</pre></div>
which should print the database connection through ODBC to the defined RDBMS.
@@ -313,27 +313,27 @@
db.connect driver=pg database="host=pgserver,dbname=grass51test,user=neteler"
createdb -h pgserver grass51test
<!-- not yet: db.createdb driver=pg database=grass51test -->
-</div></pre>
+</pre></div>
Now store the table 'markveggy.dbf' into PostgreSQL:
<div class="code"><pre>
db.copy from_driver=dbf from_database=./ from_table=markveggy \
to_driver=pg to_database="host=pgserver,dbname=grass51test,user=neteler" \
to_table=markveggy
-</div></pre>
+</pre></div>
This will open a password dialog for the PostgreSQL database.
<p>
Next we link the vector geometry to the attributes table:
<div class="code"><pre>
v.db.connect map=markveggy.shp table=markveggy key=VEGCNP_ID \
database='pgserver,dbname=grass51test,user=neteler' driver=pg
-</div></pre>
+</pre></div>
Connect GRASS 5.1 to the table:
<div class="code"><pre>
db.tables -p
db.describe -c markveggy
-</div></pre>
+</pre></div>
If, depending on the security settings of the PG database 'grass51test' a
password is required, a pop-up dialog window will ask you (alternatively you
@@ -354,7 +354,7 @@
<div class="code"><pre>
v.db.connect -p markveggy.shp
-</div></pre>
+</pre></div>
which should print the database connection to PostgreSQL.
@@ -389,7 +389,7 @@
Directory -> [Browse, select directory]
* Tables -> check if the table is visible
-> OK button
-</div></pre>
+</pre></div>
Now you reach the Database tool which provides "Forms", "Reports", "Queries"
and "Tables". To change column types,
@@ -398,7 +398,7 @@
-> Double click "Tables": then you should see your table as icon
-> right mouse button on the table icon
-> select "Table Design" from the right mouse button menu
-</div></pre>
+</pre></div>
Then select the ID column and change it's type to "Number" (alias Integer).
Save the table. Now GRASS 5.1 can use the ID column as it is of Integer
@@ -433,7 +433,7 @@
* your table
* click right mouse button on table
-> Edit table
-</div></pre>
+</pre></div>
Select the column and change the type to "Number" (alias Integer). Save the
table. Now GRASS 5.1 can use the ID column as it is of Integer type.
Index: demo.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/demo.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- demo.html 28 Feb 2003 20:00:04 -0000 1.8
+++ demo.html 22 Apr 2003 11:27:00 -0000 1.9
@@ -62,7 +62,7 @@
<div class="code"><pre>
grass51 /home/username/grassdata51/g51test-8/test/
-</div></pre>
+</pre></div>
After entering GRASS, change into the LOCATION directory and start the demo
tour:
@@ -71,7 +71,7 @@
cd /home/username/grassdata51/g51test-8/
g.region -dp
./tour
-</div></pre>
+</pre></div>
The README file in this directory contains descriptions of the sample maps.
<p>
@@ -107,13 +107,13 @@
nviz el=dem vect=net
v.db.connect -p net
v.info net
- </div></pre></li>
+ </pre></div></li>
<li><tt>./gen.big</tt><br>
- generate big ascii file. Usage:
<div class="code"><pre>
./gen.big output=name [n=value] [type=] [attr=value] [ver=value] [shape=value]
- </div></pre>
+ </pre></div>
with: <br>
<i> n: number of rows and columns (def.: 10) <br>
type: primitive type (def.: "plbc", point, line, boundary, centroid) <br>
@@ -131,13 +131,13 @@
d.vect bigmap
d.zoom
d.vect bigmap display=shape,cat lcolor=green
- </div></pre></li>
+ </pre></div></li>
<li><tt>./gen.long</tt><br>
- generates a long line (curve)
<div class="code"><pre>
./gen.long output=name [npoints=value]
- </div></pre>
+ </pre></div>
with: <br>
<i> npoints: number of vertices (def.: 1000000)
</i>
@@ -152,7 +152,7 @@
d.erase
d.vect longcurve
d.zoom
- </div></pre></li>
+ </pre></div></li>
<li><tt>./bench</tt><br>
@@ -173,7 +173,7 @@
v.info big
d.vect big
postgisdb -c pgis -h pgserver.itc.it -U postgres -G ./
-</div></pre>
+</pre></div>
Next we have to define the PostGRASS connection:
<div class="code"><pre>
@@ -182,7 +182,7 @@
cd `g.gisenv MAPSET`
mkdir -p vector/big.post
cd vector/big.post
-</div></pre>
+</pre></div>
There generate an ASCII file 'frmt' containing (update HOST and USER
appropriate):
@@ -193,7 +193,7 @@
DATABASE: pgis
GEOM_TABLE: bigg
CAT_TABLE: bigc
-</div></pre>
+</pre></div>
And add an ASCII file 'head' containing:
<div class="code"><pre>
@@ -206,18 +206,18 @@
OTHER INFO: Big map
ZONE: 0
MAP THRESH: 0.500000
-</div></pre>
+</pre></div>
Finally we run the benchmark script:
<div class="code"><pre>
./bench
-</div></pre>
+</pre></div>
will print a table similar to this example:
<div class="code"><pre>
-</div></pre>
+</pre></div>
Benchmark native contra PostGIS with following number of vectors:
Number of points: 200000
Number of lines: 160000
Index: ex_basic.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/ex_basic.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ex_basic.html 5 Mar 2003 13:33:49 -0000 1.5
+++ ex_basic.html 22 Apr 2003 11:27:00 -0000 1.6
@@ -79,7 +79,7 @@
g.region -p vect=vectormap
d.vect vectormap
d.m
-</div></pre>
+</pre></div>
Vector maps from 5.0 and 5.1 do not interfere (different directories),
so you can use the same names.
@@ -90,7 +90,7 @@
<div class="code"><pre>
v.out.ascii -o newmap.clean out=newmap.clean
-</div></pre>
+</pre></div>
Then go to 5.0 and run v.in.ascii + v.support.
@@ -148,7 +148,7 @@
<div class="code"><pre>
v.in.dwg in=WATRTOWR.DXF out=watertowerXY
-</div></pre>
+</pre></div>
The topology should be build for 'faces' which are (filled) 3D vector
polygons. The individual vector colors and DXF/DWG types are imported
@@ -157,7 +157,7 @@
To know a bit more about the map, we run:
<div class="code"><pre>
v.info watertowerXY
-</div></pre>
+</pre></div>
To look at the imported XY vector map (the DXF/DWG file is usually
unprojected) with NVIZ, we have to generate a raster DEM for this XY region.
@@ -172,7 +172,7 @@
g.region vect=watertowerXY -p
r.mapcalc "dem_flat=-1874"
nviz el=dem_flat vect=watertowerXY
-</div></pre>
+</pre></div>
<P>
<b>Transformation to UTM coordinates:</b>
@@ -196,7 +196,7 @@
580 585 598020 4920770
580 -600 598020 4920750
-584 -600 598000 4920750
-</div></pre>
+</pre></div>
These values are stored in the ASCII file 'wt.points'. Then the
transformation can be performed directly within the Spearfish location. The
@@ -215,7 +215,7 @@
v.transform -t in=watertowerXY out=watertowerUTM points=wt.points zscale=0.04 zshift=1320
g.region rast=elevation.dem
nviz el=elevation.dem vect=watertowerUTM
-</div></pre>
+</pre></div>
You will have to zoom heavily to find the water tower as it appears to
be very small compared to the surrounding mountains.
@@ -251,7 +251,7 @@
# from which column labels to display:
db.columns tab=markveggy
d.vect markveggy.1 att=vegtype display=attr lcolor=red
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
@@ -271,7 +271,7 @@
<div class="code"><pre>
v.in.ogr d=wdb2_unep.mif out=wdb2 lay=wdb2_unep
-</div></pre>
+</pre></div>
<p>
If the map contains areas, we must clean off collinear boundary vectors as
@@ -283,14 +283,14 @@
<div class="code"><pre>
v.clean in=wdb2 out=wdb2_clean tool=rmdac
-</div></pre>
+</pre></div>
Duplicate boundaries are corrected with:
<div class="code"><pre>
v.clean in=wdb2_clean out=wdb2_clean2 tool=rmdupl
d.vect wdb2_clean2
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
@@ -305,13 +305,13 @@
<div class="code"><pre>
v.out.ogr input=multi typ=line dsn=/tmp layer=testogr
-</div></pre>
+</pre></div>
<p>
#Export to GML format (generates /tmp/testogr..gml file with layer 'testogr'):
<div class="code"><pre>
v.out.ogr input=multi typ=line dsn=/tmp/testogr.gml layer=testogr format=GML
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
@@ -334,7 +334,7 @@
d.erase
d.vect markveggy.vegtype where="VEGTYPE = 'IFA'"
d.what.vect -a
-</div></pre>
+</pre></div>
<b>Example: we want to read attributes from a PostgreSQL table connected through
ODBC (see above how to connect attribute tables):</b><p>
@@ -346,7 +346,7 @@
d.erase
d.vect markveggy.vegtype where="VEGTYPE = 'Wiii'"
d.what.vect -a
-</div></pre>
+</pre></div>
You see that it is the same! After connecting a GRASS 5.1 vector map, all
db.* modules work in the same way independent from the connected RDBMS.
@@ -372,7 +372,7 @@
<div class="code"><pre>
db.connect driver=shp database=/ssi0/ssi/neteler/grassdata/botswanaLL/shp
db.columns BOTSD90
-</div></pre>
+</pre></div>
should display the columns. there must be of course an X and a Y column with
coordinates inside. Then try to query the table to check if it's really
@@ -380,38 +380,38 @@
<div class="code"><pre>
echo "select X_COORD, Y_COORD, shp_fid from BOTSD90" | db.select -h
-</div></pre>
+</pre></div>
<p>
Note that "shp_fid" column is generated on the fly. Now we can generate the
vector points map (which was the sites file in GRASS 5.0):
<div class="code"><pre>
echo "select X_COORD, Y_COORD, shp_fid from BOTSD90" | db.select -h |v.in.ascii output=BOTSD90map
-</div></pre>
+</pre></div>
There we are!
<div class="code"><pre>
d.vect BOTSD90map
-</div></pre>
+</pre></div>
<p>
Finally we have to connect the table to the new vector map. Edit the DB file
(if not there, generate it in the MAPSET directory) and add something like:
<div class="code"><pre>
BOTSD90map 1 BOTSD90 shp_fid /ssi0/ssi/neteler/grassdata/botswanaLL/shp shp
-</div></pre>
+</pre></div>
(map field_1 table IDcolumn directory driver)
<p>
Query some points:
<div class="code"><pre>
d.what.vect -a BOTSD90map
-</div></pre>
+</pre></div>
For amusement we export the map as SHAPE map:
<div class="code"><pre>
v.out.ogr BOTSD90map type=point dsn=./ layer=BOTSD90map
-</div></pre>
+</pre></div>
Cheers.
@@ -429,7 +429,7 @@
db.copy from_driver=dbf from_database=./ from_table=census1990wet \
to_driver=pg to_database="host=pgserver,dbname=grass51test" \
to_table=census1990wetB
-</div></pre>
+</pre></div>
Simultaneously we can watch the data arriving in PostgreSQL (launch select
command several times):
@@ -437,7 +437,7 @@
<div class="code"><pre>
psql -h pgserver
grass51test=> select count(*) from census1990wetB;
-</div></pre>
+</pre></div>
This may take some time depending on network speed and table size.
Index: ex_complex.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/ex_complex.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ex_complex.html 28 Feb 2003 20:00:04 -0000 1.4
+++ ex_complex.html 22 Apr 2003 11:27:00 -0000 1.5
@@ -73,7 +73,7 @@
<div class="code"><pre>
postgisdb -c spearfish -h grass.itc.it -U postgres -G ./
v.convert input=streams at PERMANENT output=streams
-</div></pre>
+</pre></div>
The category labels are automatically written to a new DBF file.
<br>
Note that there are two small (!) leftover vector lines in the original 5.0
@@ -89,7 +89,7 @@
cd $HOME/grassdata/spearfish/user1/vector
mkdir streams_pg
cd streams_pg
-</div></pre>
+</pre></div>
Here generate the ASCII file 'frmt':
<div class="code"><pre>
@@ -99,7 +99,7 @@
USER:postgres
GEOM_TABLE:streams_pgg
CAT_TABLE:streams_pgc
-</div></pre>
+</pre></div>
Next we need a 'head' file (you may re-use another 'head' file from another
vector map):
@@ -113,14 +113,14 @@
OTHER INFO: Map imported from Spearfish 5.0
ZONE: 0
MAP THRESH: 0.500000
-</div></pre>
+</pre></div>
Then we import the map to PostGRASS:
<div class="code"><pre>
v.out.ascii input=streams out=streams_pg
v.in.ascii input=streams_pg out=streams_pg
-</div></pre>
+</pre></div>
Now we may also want to store the attributes in PostgreSQL. The 'v.convert'
which we used above, had already written a DBF file. This we can copy now to
@@ -131,14 +131,14 @@
from_table=streams to_driver=pg \
to_database="host=pgserver.itc.it,dbname=spearfish,user=postgres" \
to_table=streams_atts
-</div></pre>
+</pre></div>
To check the existing tables in PostGIS, we run:
<div class="code"><pre>
db.connect driver=pg database="host=pgserver.itc.it,dbname=spearfish,user=postgres"
db.tables -p
db.describe -c streams_atts
-</div></pre>
+</pre></div>
We have the geometry and the attributes table ready now. Finally missing is
the link of the vector geometry to the attribute table:
@@ -147,14 +147,14 @@
v.db.connect map=streams_pg table=streams_atts driver=pg \
database='pgserver.itc.it,dbname=spearfish,user=postgres'
v.db.connect -p streams_pg
-</div></pre>
+</pre></div>
Now we should be able to look at and query the map with:
<div class="code"><pre>
d.vect streams_pg col=green
d.what.vect streams_pg
-</div></pre>
+</pre></div>
<P>
<b>MapServer preparations</b><p>
@@ -173,13 +173,13 @@
SRID INTEGER NOT NULL,
TYPE VARCHAR(30) NOT NULL
);
-</div></pre>
+</pre></div>
and generate this this table in PostGIS within the 'spearfish' database:
<div class="code"><pre>
psql -h pgserver.itc.it -U postgres spearfish < geometry_columns.sql
-</div></pre>
+</pre></div>
<!-- select * from geometry_columns;
\d geometry_columns
@@ -189,7 +189,7 @@
psql -h pgserver.itc.it -U postgres spearfish
INSERT INTO geometry_columns VALUES ('','spearfish','streams_pgg','geom','2','-1','GEOMETRY');
\q
-</div></pre>
+</pre></div>
The entry order is:<br>
CATALOG empty , SCHEMA database, NAME geomtable, COLUMN geometry_column,
@@ -220,7 +220,7 @@
END
END
END
-</div></pre>
+</pre></div>
And here you can see how it looks like: <br>
<a href=http://grass.itc.it/cgi-bin/mapserv?map=/var/www/map-script/mapserverjs.map&layer=dem>Demo Online MapServer
@@ -239,7 +239,7 @@
from streams_pgg,streams_pgc WHERE streams_pgg.id = streams_pgc.id AND \
streams_pgc.field = 1;
INSERT into geometry_columns values ( ' ', ' ', 'test2', 'geom', 2, -1, 'GEOMETRY' );
-</div></pre>
+</pre></div>
Then change the table name in the 'mapfile' (DATA entry) to the view.
Should work... As the 'streams' map does not have exciting attributes, you
@@ -269,7 +269,7 @@
<div class="code"><pre>
d.vect roads
d.path map=roads
-</div></pre>
+</pre></div>
More realistic shortest path queries may consider the maximum speed
according to the road type. If desired to use different traveling costs for
@@ -286,7 +286,7 @@
<div class="code"><pre>
echo "select * from roads" | db.select
-</div></pre>
+</pre></div>
... shows that the travelcost column is filled with 0.0. To assign
new travel costs, we run:<br>
@@ -297,12 +297,12 @@
echo "update roads set travelcost=60 where cat=4" | db.execute
echo "update roads set travelcost=80 where cat=5" | db.execute
echo "select * from roads" | db.select
-</div></pre>
+</pre></div>
Then we can run the 'd.path' with our assigned travel costs:
<div class="code"><pre>
d.path map=roads afcol=travelcost abcol=travelcost
-</div></pre>
+</pre></div>
To see the forward directions of the vector lines, use the 'dir' for the
'display' parameter in 'd.vect'. It will add small arrows indicating the
@@ -345,7 +345,7 @@
d.erase
d.vect newmap
d.what.vect newmap
-</div></pre>
+</pre></div>
TODO: check if meanwhile g.copy does the same, probably followed by v.clean
with rmdupl.
Index: examples.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/examples.html,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- examples.html 18 Apr 2003 14:37:54 -0000 1.24
+++ examples.html 22 Apr 2003 11:27:00 -0000 1.25
@@ -73,7 +73,7 @@
1..5:
<div class="code"><pre>
g.gisenv set="DEBUG=3"
-</div></pre>
+</pre></div>
<hr>
Index: geom_storage.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/geom_storage.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- geom_storage.html 3 Apr 2003 12:03:05 -0000 1.13
+++ geom_storage.html 22 Apr 2003 11:27:00 -0000 1.14
@@ -56,7 +56,7 @@
To get debug information, set variable (set to 0 for debug silence) to 1..5:
<div class="code"><pre>
g.gisenv set="DEBUG=3"
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
@@ -91,7 +91,7 @@
<div class="code"><pre>
v.format
-</div></pre>
+</pre></div>
<P>
Possible settings are for "Output Format":
@@ -180,7 +180,7 @@
#look at the map:
d.mon x0
d.vect markveggy.shp
-</div></pre>
+</pre></div>
For SHAPE format, DBF table do not have to be registered in the DB file.
Read also <a href="attrib_storage.html#DBF">Attributes stored in DBF table</a>.
@@ -189,7 +189,7 @@
#query map:
d.what.vect
d.what.vect -a
-</div></pre>
+</pre></div>
<p><table width="100%" cellpadding="3" border="0">
@@ -216,7 +216,7 @@
<div class="code"><pre>
postgisdb -c botswanaUTM34 -h pgserver.itc.it -U postgres -G ./
-</div></pre>
+</pre></div>
Next we have to create a 'frmt' file which defines the PostGRASS connection
and a 'head' file which defines the basic vector metadata:
@@ -224,7 +224,7 @@
cd $HOME/grassdata/botswanaUTM34/PERMANENT/vector
mkdir pgmap
cd pgmap
-</div></pre>
+</pre></div>
Here generate the ASCII file 'frmt':
<div class="code"><pre>
@@ -234,7 +234,7 @@
USER:postgres
GEOM_TABLE:pgmapg
CAT_TABLE:pgmapc
-</div></pre>
+</pre></div>
Next we need a 'head' file (you may re-use another 'head' file from another
vector map):
@@ -248,14 +248,14 @@
OTHER INFO: -
ZONE: 0
MAP THRESH: 0.500000
-</div></pre>
+</pre></div>
Finally we import the map to PostGRASS:
<div class="code"><pre>
v.out.ascii input=census1990wet.shp out=pgmap
v.in.ascii input=pgmap out=pgmap
-</div></pre>
+</pre></div>
For the attributes storage in PostgreSQL, please <a
href="attrib_storage.html#PostgreSQL">read on here</a> ('db.copy' will
@@ -314,14 +314,14 @@
v.db.connect map=pat_centraline table=pat_centraline key=codice \
database="host=pgserver,dbname=grass51test,user=neteler" driver=pg
v.db.connect -p pat_centraline
-</div></pre>
+</pre></div>
Now we have linked the new vector map (native format now) to the attributes
table in PostgreSQL. We can display and query some points:
<div class="code"><pre>
d.vect pat_centraline
d.what.vect
-</div></pre>
+</pre></div>
It will open a window showing the attributes for the selected point. If you have permissions
to modify the table, you could even modify the attributes now in this popup-window.
Index: network.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/network.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- network.html 18 Apr 2003 14:37:54 -0000 1.2
+++ network.html 22 Apr 2003 11:27:00 -0000 1.3
@@ -83,7 +83,7 @@
<div class="code"><pre>
v.in.ogr dsn=/ssi0/ssi/neteler/grassdata/osnabrueck/maps output=strassen layer=strassen
v.in.ogr dsn=/ssi0/ssi/neteler/grassdata/osnabrueck/maps output=poi layer=poi
-</div></pre>
+</pre></div>
<P>
#area layer:
@@ -92,14 +92,14 @@
-> WARNING: 2. centroid found in area 30...etc
-> "WARNING: Area boundaries are not cleaned by this module. Run v.clean on
imported vector on new map <gewaesserflaechen>."
-</div></pre>
+</pre></div>
The module 'v.in.ogr' imports non-topological GIS formats into the topological
GRASS. This is relevant for areas, where boundaries are duplicated in the SHAPE
file. As suggested, we run 'v.clean' to make the imported map fully topological:
<div class="code"><pre>
v.clean input=gewaesserflaechen output=gewaesserflaechen_clean tool=rmdupl,bpol
-</div></pre>
+</pre></div>
No more errors appear.
@@ -115,7 +115,7 @@
#verify:
v.category poi_2f field=1,2 op=print
-> field 1 == field 2
-</div></pre>
+</pre></div>
<!-- MAYBE:
[delete 1st unused field]
@@ -136,7 +136,7 @@
d.vect strassen
d.vect schools disp=attr attr=poiName bgcolor=white bcolor=black
d.vect schools col=red icon=basic/diamond
-</div></pre>
+</pre></div>
Now we have the schools extracted from the poi map.
@@ -149,7 +149,7 @@
d.erase
d.vect streets_schools
d.vect streets_schools type=point col=red
-</div></pre>
+</pre></div>
But the tables are not linked yet (v.patch won't do it for various reasons).
@@ -171,7 +171,7 @@
Column 5: strSpuren
Column 6: strEbene
-> the 'cat' column was added by 'v.in.ogr'
-</div></pre>
+</pre></div>
<div class="code"><pre>
v.db.connect streets_schools dr=dbf data='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \
@@ -180,20 +180,20 @@
v.db.connect streets_schools dr=dbf data='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \
table=schools field=2 key=cat
v.db.connect -p streets_schools
-</div></pre>
+</pre></div>
<P>
Display the patched map with the linked two tables:
<div class="code"><pre>
d.erase
d.vect streets_schools
-</div></pre>
+</pre></div>
Display attributes of second table (lfield=2):
<div class="code"><pre>
d.vect streets_schools type=point col=red disp=attr attrcol=poiName lfield=2
d.what.vect streets_schools
-</div></pre>
+</pre></div>
<P>
<h2>Connecting schools to street network</h2>
@@ -213,7 +213,7 @@
d.vect strassen col=grey
d.vect schools col=red
d.vect streets_schools_connect col=blue
-</div></pre>
+</pre></div>
<P>
Then we merge these line connections into the schools_streets map (we have
to snap nodes and break street lines at intersection of the connecting
@@ -228,7 +228,7 @@
d.erase
d.vect schools_net_clean
-</div></pre>
+</pre></div>
<P>
Now the map containing schools and streets is prepared for network analysis.
@@ -243,7 +243,7 @@
#show all schools with their cats:
d.vect schools_net ty=point icon="basic/circle" size=5 col=blue
d.vect schools_net ty=point disp=cat
-</div></pre>
+</pre></div>
Now we want to know the reachability of the schools with cats 201, 204, 209.
These cats are defined as 'ccats' in 'v.net.iso' (if you want to calculate
@@ -253,7 +253,7 @@
#next is very slow due to an unsolved bug in graphlib (therefore cache disabled):
#We check for three schools as we give a ccats range:
v.net.iso input=schools_net_clean output=schools_isoalloc ccats=200-210 costs=1000,2500,5000,10000
-</div></pre>
+</pre></div>
This calculates the reachability map based on the vector length for 1km,
2.5km, 5km and 10km. Another option were to use vector line attributes from
@@ -272,7 +272,7 @@
d.vect schools_net ty=point cat=200-210 col=red icon="basic/circle" size=5
d.grid -g s=1000
d.barscale -t bc=white tc=black at=60,5
-</div></pre>
+</pre></div>
<P>
City of Osnabrück - reachability of selected schools (click to
More information about the grass-web
mailing list