Title: Noriel Christopher C' Tiglao, Dr' Eng
1Introduction to GRASS
Module 5
- Noriel Christopher C. Tiglao, Dr. Eng
- 24 January 4 February 2005
- Statistical Research and Training Center (SRTC)
- Quezon City, Metro Manila
2Presentation Outline
- Open Source Concept
- Getting Started with GRASS
- Command Structure
- GRASS File Management
3Open Source Concept
- For freedoms of Free Software (Richard M.
Stallman) - The freedom to run the program, for any purpose
- The freedom to study how the program works, and
adapt it to your needs - The freedom to redistribute copies
- The freedom to improve the program, and release
your improvements to the public, so that the
whole community benefits
Founder of the Free Software Foundation in 1985
4Open Source Concept (contd.)
- The GNU General Public License (GPL) not only
grants the four freedoms but also protects them - http//www.gnu.org
- The license protects contributors against misuse
of their code contribution within proprietary
projects which do not allow free access to their
source code - GPL is the most widely used license for Free
Software
5Open Source Concept (contd.)
- Based on the assumption that by allowing the
programmers to read, redistribute, and modify the
source code, the software evolves - Software gets improved, software errors (often
called bugs) are fixed and capabilities
expanded - Full access to the source code is particularly
important for GIS because the underlying
algorithms can be complex and can greatly
influence the results of spatial analysis and
modeling
6Open Source Concept (contd.)
- While an average user may not be able to trace
bugs within a complex source code, there is a
number of specialists willing to test, analyze
and fix the code - The different backgrounds and expertise of these
developers contribute to the synergistic effects
leading to faster and more cost effective
software development of a stable and robust
product - Open source development is very dynamic
7GRASS as an Open Source GIS
- Geographical Resources Analysis Support System
- A raster/vector GIS combined with integrated
image processing and data visualization
subsystems - Includes more than 350 modules for management,
processing, analysis and visualization of
georeferenced data
8GRASS as an Open Source GIS
- Geographical Resources Analysis Support System
- A raster/vector GIS combined with integrated
image processing and data visualization
subsystems - Includes more than 350 modules for management,
processing, analysis and visualization of
georeferenced data
9GRASS as an Open Source GIS
- GPL offers GRASS users various advantages
- Full access to the source code
- Low costs
- Access to new features and capabilities developed
between the releases - Possibility to provide release more often that it
is common for proprietary products
10GRASS Development Model
WWW/FTP GRASS-releases Documents Sample data
Mailing lists
CVS Source code
RT bugtracker
INTERNET
Users
Developers
11GRASS Development
- GRASS Development Team is coordinate at ITC-irst
Centro per la Ricerca Scientifica e
Tecnologica, Trento (Italy) - GRASS Website http//grass.itc.it
12GRASS GIS Functionality
13GRASS GIS Functionality (contd.)
14GRASS GIS Functionality (contd.)
15Available platforms
- Linux
- SUN
- SGI
- MacOS X
- MS-Windows NT/2000/XP (requires the Cygwin tools)
16Organization of the GRASS Database
/usr/local/share/grassdata
DATABASE
ncarolina-ll/
ncarolina-utm/
trentino-gb/
LOCATIONS
PERMANENT/ helena/ user2/
PERMANENT/ user2/
PERMANENT/ helena/ markus/
MAPSETS
Map layers
17GRASS Database
- DATABASE (also called GISDBASE)
- UNIX directory which contains GRASS data
- Locations
- Defined by its coordinate system, map projection
and geographical boundaries - Can have several MAPSETS
- MAPSETS
- PERMANENT MAPSET can be added, modified or
removed by the owner can be accessed, analyzed
and copied by other users
18GRASS Database (contd.)
- PERMANENT MAPSET is useful in providing general
spatial data write-protected to other users who
are working in the same LOCATION - This PERMANENT MAPSET contains the DEFAULT_WIND
file which holds the default region boundary
coordinate values - In all mapsets, a WIND file is kept for storgin
current boundary coordinate values and the
currently selected raster resolution
19GRASS Modules
- Are organized by name, based on their function
class - Display
- General
- Imagey
- Raster
- Vector
- Site
- The first level refers to the function class,
followed by a dot and one or two works, again
separated by dots
20General Syntax
- module -flag1 flag2\ parameter1map1
,map2,\ parameter2number - module is the name of the command
- optional flags enable specific features
- parameters are names of input or output files or
may be a constant or name of a method, symbol
etc. - Note there must be no space when listing
comma-separated names
21GRASS Module Function Classes
22To run GRASS under Cygwin
- Double-click the Cygwin icon from the desktop
- Type startxwin.bat to start the X-Windows program
23To run GRASS under Cygwin (contd.)
- From the X-Windows shell, type grass57 then
Enter to start GRASS program
24Database Selection and Creation
25GRASS Command Line Interface
26GRASS Display Manager
27GRASS Monitor
28GRASS Menu System
- To run TclTkGRASS, type
- tcltkgrass
29GRASS running on Windows XP
30Listing available data
- To list available vector, raster and site data
layers, type - g.list rast
- g.list vect
- g.list sites
- Alternatively, in TclTkGRASS, select under MAP
LIST RASTER Run
31Displaying information about each layer
- r.info soils
- v.info streams
- s.info archsite
32Opening a GRASS monitor
- d.mon x0
- In TclTkGRASS, select DISPLAY MONITOR START
X0
33To view layers
- d.rast soils
- d.vect streams colblue
- d.sites archsites colwhite typebox
34To exit GRASS
- Type
- exit
- Close all monitors and other relevant windows
35To display map layers with titles
- g.list f vect
- g.list f vect mapsetPERMANENT
- G.mlist typevect patternr
36To copy a map layer
- g.copy
- Specify the map type and add an old a new map
name - g.copy vectrailroads_at_PERMANENT,myrailroads
37To rename a map layer
- g.rename
- Specify the map type and add an old a new map
name - g.rename vectmyrailroads,railnetwork
38To remove a map layer
- g.remove
- g.rename vectrailnetwork
39To remove multiple map layers
- g.mremove
- g.copy vectrailroads_at_PERMANENT,myrailroads1
- g.copy vectrailroads_at_PERMANENT,myrailroads2
- g.copy vectrailroads_at_PERMANENT,myrailroads3
- g.list vect
- g.mremove vectmyrail
40To add other MAPSETS to the MAPSET SEARCH PATH
- g.mapsets
- Toggle all available MAPSETS
- Type
- g.mapsets
41To copy a LOCATION
- To copy a LOCATION or even a complete GRASS
database directory, package the directories and
extract them in the destination directory - cd /usr/lcoal/share/grassdata
- tar cvfz myspearfish_location.tar.gz spearfish
- mv myspearfish_location.tar.gz target_directory/
- cd target_directory
- tar xvfz myspearfish_location.tar.gz
42To remove a LOCATION
- cd /usr/local/share/grassdata
- rm r spearfish
43Starting GRASS with a new project
44Starting GRASS with a new project(text-based
interface)
45Compiling data
- If we have data in different coordinate systems,
we have to import and store them in different
LOCATIONs. However, the data can be re-projected
between these LOCATIONs using the GRASS
projection modules
46End