grass short course intro - grassbook.org filemarkus neteler, itcirst, 2004. grass course m a r k u s...

18
Markus Neteler – ITC-irst 2004 Advanced Databases Part 1: Introduction to GRASS Markus Neteler, ITC-irst, 2004

Upload: others

Post on 23-Sep-2019

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Advanced DatabasesPart 1: Introduction to GRASS

Markus Neteler, ITC­irst, 2004

Page 2: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Outline

 Software Licenses, GRASS History

 GRASS Database structure Linux file system structure

 Launching GRASS Sample session with 'Spearfish' dataset

Page 3: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Software Licenses: Free Software vs. non­free

Free Download

Free Software

Public domain

Xfree86 Style

Copylefted

GPL'ed

Open Source

Shareware

Closed Source

Proprietary

From GNU web site

GRASS: General Public License GPL

Page 4: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

GRASS History

1993

1998

1999

GRASS 4.1

GRASS 4.2.1/4.3

GRASS 5.0

GRASS 5.7

2001

GPL'ed

1997

GRASS 4.2

Manual code management

Automated code management (CVS)

PD

U.S. Army (1984­1995)

GRASS Development Team (1997­ present)

http://grass.itc.it

Page 5: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

GRASS Web site

 GRASS main web site

http://grass.itc.it

 Download: Current versions 5.0.x, 5.3.x, 5.7.x

 Documentation: “GRASS Documentation Project” (GDP)

 Sample data: “Spearfish location” ­ South Dakota, USA

Page 6: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Setup in DIT computer lab

 The installation of the software is done in /usr/local/grass57     which is a network directory (single installation for all users)

 The 'Spearfish' data set is installed in another network directory     (/utenti/grassdata/spearfish)

 The GRASS users have to store their data on a local disk (/scratch/     directory). This requires to create a link from the network data     directory containing the common maps to the local directory:

cd /scratch/grassdata/spearfishln ­s /utenti/grassdata/spearfish/PERMANENT PERMANENT

 Then GRASS can be launched. You will work in/scratch/grassdata/spearfish in your own mapset but also see thecommon data from the PERMANENT mapset.

Page 7: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Starting with GRASS

 Start GRASS 5.7:

   grass57 -gui

     Database: /scratch/grassdata/ <return>Location: spearfish (click)Mapset: if not present, generate it (right field)

Then click  “Use selection”

Page 8: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

GRASS Database structure: Locations and Mapsets

Page 9: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

UN*X/Linux file structure

/ root directory

eva

dev home media opt usr sbin varbin

markus

local

mailgrassdata pub test

grass57

log

 ...

dvd

bin

lib

lib

Page 10: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

UN*X/Linux file structure

chmod -r ugo+wrx <dateiname/ordner>chown -R root <Dateiname/Ordner>chgrp -R mail <Dateiname/Ordner>

Permissions  |  user  |  group | size   |   date     |   file / directory 

        other r :   readgroup w :  write user x :   execute ­ : file d : directory (subdirectory) l  : link (redirection)

Page 11: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Starting with GRASS

 Run the following commands:

g.list rast

g.list vect

 Convert vector map from old format to current format:

v.convert in=roads out=roadsg.list vect

d.m- add raster map 'elevation.dem'- add vector map 'roads'- display (world map symbol)

Page 12: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Starting with GRASS

Query map (select first)

Zoom

(Re)display entire location

(Re)display current region

Attributes

Page 13: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Warming up with GRASS

 Continue with the following commands (conversion of old points     format to current vector format):

v.in.sites in=archsites out=archsites

d.m­ add vector map 'archsites'

­ select icon symbol 'basic/diamond'­ display (world map symbol)

­ display attributes of 'archsites' map (str1 column)to find column names, query the map

­ select only 'interstates' by SQL statement

­ save d.m settings to file

Page 14: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Warming up with GRASS

 Continue with the following command:nviz el=elevation.dem vect=roads

Page 15: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Raster data model

 2D raster model (matrix)commands: r.*

3D raster model (voxels)commands: r3.*

2D rasterwith shading

3D voxels

Scanned topographic sheet

Page 16: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Vector data model

 2D/3D vector modelcommands: v.*

TIN

CAD

City vector map

Page 17: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Using GRASS

What else for the first day?

 Restart GRASS, read the manual: g.manual

r.info elevation.dem

v.info roads

v.format/v.database: define data storage settings

d.m: print function

Page 18: GRASS Short Course Intro - grassbook.org fileMarkus Neteler, ITCirst, 2004. GRASS Course M a r k u s N e t e l e r – I T C-i r s t 2 0 0 4 Outline Software Licenses, GRASS History

GRASS CourseM

ark

us N

ete

ler

– IT

C-i

rst

20

04

Leaving GRASS

To finish a GRASS session:

 Close all monitors by mouse click

 Save 'd.m' settings (name with extension: “.dmrc”), close 'd.m'

 To leave GRASS, enter into terminal window:

exit