[GRASSweb-list]markus: web/grass51/tutorial geom_storage.html,1.9,1.10

grass at intevation.de grass at intevation.de
Tue Feb 18 09:22:11 EST 2003


Author: markus

Update of /grassrepository/web/grass51/tutorial
In directory doto:/tmp/cvs-serv16532

Modified Files:
	geom_storage.html 
Log Message:
added how to generate map from points spreadsheet table

Index: geom_storage.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/geom_storage.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- geom_storage.html	10 Feb 2003 17:32:26 -0000	1.9
+++ geom_storage.html	18 Feb 2003 14:22:09 -0000	1.10
@@ -45,7 +45,8 @@
 SHAPE format</a>
 <li><a href="#PostGRASS">Geometry stored in external database (PostGRASS)
 using PostGIS</a>
-<li><a href="#OGR">Geometry stored with OGR</a>
+<li><a href="#OGR">Geometry access through OGR</a>
+<li><a href="#sites">Generating vector geometry from spreadsheet table</a>
 </ol>
 
 To get debug information, set variable (set to 0 for debug silence) to 1..5:<div class="code"><pre>
@@ -217,12 +218,65 @@
 <p><table width="100%" cellpadding="3" border="0">
 <tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
 <a name="OGR"></a>
-Geometry stored with OGR
+Geometry access through OGR
 <DIV ALIGN=right><a href="#toc">[UP]</a></DIV>
 </b></big></font></td></tr></table>
 
-One day this will be implemented in GRASS 5.1.
+One day this will be implemented in GRASS 5.1. Then full MapServer/PostGIS
+support is possible.
+
+<p><table width="100%" cellpadding="3" border="0">
+<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
+<a name="sites"></a>
+Generating vector geometry from spreadsheet table
+<DIV ALIGN=right><a href="#sites">[UP]</a></DIV>
+</b></big></font></td></tr></table>
+
+It may happen that you receive a list of points with attributes in
+a spreadsheet table (DBF, CSV, Excel, etc). It's fairly easy to
+generate a map from such a table, provided that coordinates columns are
+present.
+<P>
+
+Here we assume to have a PostgreSQL table. The db.* modules allow us to
+select columns which are then piped into v.in.ascii. That's it for
+generating the map. Then, currently by hand, the 'dbln' file must be created to link the
+map to the table (to see the attributes):
+
+<div class="code"><pre>
+#define the connection:
+db.connect  driver=pg database="host=pgserver,dbname=grass51test,user=neteler"
+
+#check if connection is established:
+echo "select * from pat_centraline " | db.select
+
+#now be selective (-c suppresses the column names):
+echo "select east_gb,north_gb,quota_gb,codice from pat_centraline " | db.select -c
+
+#... and generate the map (3D points here):
+echo "select east_gb,north_gb,quota_gb,codice from pat_centraline " | db.select -c \
+     | v.in.ascii -z out=pat_centraline
+
+v.info pat_centraline
 
+#create 'dbln' file to connect map to attribute table
+cd `g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`/vector
+</div></pre>
+
+The 'dbln' file may contain the line:
+<div class="code"><pre>
+1 pat_centraline codice host=pgserver,dbname=grass51test,user=neteler pg
+</div></pre>
+
+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>
+
+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.
 
 <hr>
 <P>
@@ -231,7 +285,7 @@
 <!-- FOOTER -->
 <p>
 <hr>
-<DIV ALIGN=right>&copy; 2002 Markus Neteler<br>
+<DIV ALIGN=right>&copy; 2002-2003 Markus Neteler<br>
 <a href="mailto:weblist at grass.itc.it">Comments</a> about this page | <a href="../../faq/index.html">FAQ</a> | <a href="../../download.html">Download</a> | <a href="../../support.html">Support</a> | <a href="../../gdp/index.html">Docs</a>  | <a href="../../grassdevel.html">Programming</a> | Back <a href=index.html>5.1 Tutorial Home</a><br>
 <i>Last change:
 $Date$





More information about the grass-web mailing list