[GRASSweb-list]markus: web/grass51/tutorial usa_demo.html,NONE,1.1 index.html,1.19,1.20

grass at intevation.de grass at intevation.de
Tue Aug 19 12:17:28 EDT 2003


Author: markus

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

Modified Files:
	index.html 
Added Files:
	usa_demo.html 
Log Message:
new examples

--- NEW FILE: usa_demo.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
   <DEFANGED_meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <DEFANGED_meta name="Author" content="Markus Neteler">
   <DEFANGED_link rel="stylesheet" type="text/css" href="../../sitestyle.css">
   <title>GRASS 5.1: Examples from US National Atlas</title>
</head>
<body>

<!-- HEADER -->
<table width=100%><tr><td width=80>
<A HREF="index.html">
<DEFANGED_IMG src="../../images/grass.smlogo.gif" alt="HOME" border="0" align=middle></A>
</td><td><H1>
GRASS 5.1: Examples from US National Atlas
</H1></td></tr></table>
<!-- END OF HEADER -->

<hr>
<a name="toc"></a>
<a href="index.html">Tutorial HOME</a> |
<a href="index.html#toc">Table of contents</a>
<hr>

<i><b>README:</b>
GRASS 5.1 is currently under development. It is neither complete (it still
contains only a few modules) nor it is intended for productional usage. 
Development releases are provided for people who want to help test, debug,
and improve GRASS 5.1. Knowing this, please read on.</i><br>
<i>
These examples described here may work or not. You are kindly invited to
send us further examples and/or code bugfixes/enhancements.</i>

<p><table width="100%" cellpadding="3" border="0">
<tr><td align="left" bgcolor="#B0F0B0"><font color="#00000"><big><b>
<a name="overlay"></a>
Getting the data
<DIV ALIGN=right><a href="#toc">[UP]</a></DIV>
</b></big></font></td></tr></table>

In this section we want to play abit with the (new) GRASS vector capabilities. This section is
inspired by the paper 
"<a href="http://www-users.cs.umn.edu/~djugash/cs8701/final.html">A Benchmark for Spatial 
Database Teaching</a>" by Judy Djugash and Wei-Hsin Fu which focuses on the Open GIS Consortium's (OGC) 
Simple Features Implementation Specification.
<P>
The data sets are available from the 
<a href="http://nationalatlas.gov/mapit.html">National Atlas of the United States</a>, in
particular from the <a href="http://www.nationalatlas.gov/atlasftp.html">Map Layers Warehouse</a>
(this site is a dream for European GIS users).
<br>
We have to download following map layers:
<ul>
<li>Cities and Towns (Point data)
<li>States
<li>
<li>
<li>
<li>
<li>
</ul>

First we have to create a GRASS location in decimal degrees on datum NAD83:
<div class="code"><pre>
LOCATION: nationalatlas
mapset: user1
database: /usr/local/share/grassdata

Please specify the coordinate system for location <nationalatlas>
   B   Latitude-Longitude
   
Please enter a one line description for location <nationalatlas>
> nationalatlas

Do you wish to specify a geodetic datum for this location?(y/n) [y] y

Please specify datum name
>nad83

Now select Datum Transformation Parameters
>6
# 6 Used in Default nad83 region

                         DEFINE THE DEFAULT REGION
                       ====== DEFAULT REGION =======
                       | NORTH EDGE:74:50N____     |
                       |                           |
            WEST EDGE  |                           |EAST EDGE
            169:15E___ |                           |62:00W____
                       | SOUTH EDGE:13:20N____     |
                       =============================
           PROJECTION: 3 (Latitude-Longitude)         ZONE: 0

                             GRID RESOLUTION
                                 East-West:     0:05______
                               North-South:     0:05______

</pre></div>

<P>
The data sets are provided in SHAPE format as well as SDTS format. GRASS can read both:

A) Import of "Cities and Towns" as SHAPE file:
<div class="code"><pre>
v.in.ogr dsn=citiesx020.shp output=cities
v.db.connect -p cities
d.vect cities icon=basic/circle fcolor=red
</pre></div>
One attribute table is connected to the geometry.

B) Import of "Cities and Towns" as SDTS file:
<div class="code"><pre>
v.in.ogr dsn=CITXCATD.DDF output=CITX
v.db.connect -p CITX
d.vect CITX icon=basic/circle fcolor=red
</pre></div>
Four attribute tables are connected to the geometry (accessible via 'field').
<P>
NOTE: Due to the map/tables size zooming before running a query with 'd.what.vect' is recommended.
<P>

We continue to work with the SHAPE files. Import of the "States" map:
<div class="code"><pre>
v.in.ogr dsn=statesp020.shp output=states
d.vect map=states fcolor=255:255:220
</pre></div>

<div class="code"><pre>
v.in.ogr dsn=statesp020.shp output=roads
d.vect map=roads where="FEATURE='Limited Access Highway   Toll Road' or FEATURE='Limited Access Highway'" col=blue
</pre></div>

<P>
The maps imported so far look like this:<br>
<a href=images/usa_nationalatlas.png><DEFANGED_IMG src=images/usa_nationalatlas_small.jpg alt="GRASS USA National Atlas example"></a>
<P>


Ex 1) List the name and area of all the states that are adjacent to Minnesota in the State table.
<div class="code"><pre>
d.what.vect states
#see attribute table

v.extract input=states output=minnesota where=STATE='Minnesota'
TODO - implement touch operator
</pre></div>

Ex 2) List all the states that Interstate Route 90 passes through:
TODO - implementation of cross operator

<P>
Ex 3) List all the cities, which are within 150 km of the Interstate Route 90 road.
<div class="code"><pre>
d.vect map=roads where="NAME='Interstate Route 90' or NAME='Interstate Route 90, US Route 395'" col=green
#incomplete: we need a LIKE operator or =~
v.extract input=roads output=interstate90 field=1 new=0 where="NAME='Interstate Route 90' or NAME='Interstate Route 90, US Route 395'"
#check if buffer means geodetic dist in Lat/Long:
v.buffer input=interstate90 output=interstate90_150km buffer=150000 tolerance=1
TODO - implementation of cross operator
</pre></div>
<hr>
<P>
Further <a href=links.html>Links</a> (related software, SQL reference etc).

<!-- FOOTER -->
<p>
<hr>
<DIV ALIGN=right>&copy; 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: 2003/08/19 16:17:25 $
</i></DIV>

</body>
</html>

Index: index.html
===================================================================
RCS file: /grassrepository/web/grass51/tutorial/index.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- index.html	14 Aug 2003 15:25:05 -0000	1.19
+++ index.html	19 Aug 2003 16:17:25 -0000	1.20
@@ -106,8 +106,9 @@
   <li><a href="network.html#vnetsalesman">v.net.salesman</a>
  </ol>
  <li><a href="vectoroverlay.html">Vector overlay/clipping examples</a>
-
+ <li><a href="usa_demo.html">Examples from US National Atlas</a>
 </ul>
+
 <li><a href="troubleshooting.html">Troubleshooting</a>
  <ol>
   <li><a href="troubleshooting.html#sqlnames">The SQL query is rejected (parse error)!</a>





More information about the grass-web mailing list