SlideShare a Scribd company logo
1 of 64
Download to read offline
Geomorphology in
A 'how-to' manual
by
Skyler Sorsby
1
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Geomorphic tools in GRASS GIS: an open-source equivalent to ARC GIS functionality
By Skyler Sorsby
Contents
Item Page
I. Introduction………………………………………………………………………………………………………………………………………..2
II. To begin (3-10)
a. Downloading data from the National Map………………………………………………………………………………….3
b. Start GRASS GIS…………………………………………………………………………………………………………………………..4
c. Create a new layer/mapset………………………………………………………………………………………………………5-7
d. Import data……………………………………………………………………………………………………………………………8-10
III. Rasters (11-25)
a. Mosaic Rasters……………………………………………………………………………………………………………………. 11-12
b. Clip Rasters……………………………………………………………………………………………….............................12-13
c. Project a Raster……………………………………………………………………………………………………………………14-19
d. Downsampling…………………………………………………………………………………………………………………………. 20
e. Hillshades………………………………………………………………………………………………………………………………….21
f. Hypsometric overlay………………………………………………………………………………………………………………… 22
IV. Hydrologic analysis (focusing on stream profiles) (26-39)
a. Watershed delineation……………………………………………………………………………………………………………..23
b. Raster to vector……………………………………………………………………………………………………………………….. 24
c. Cleaning vectors………………………………………………………………………………………………………………………. 25
d. Isolating a main channel (polyline)……………………………………………………………………………………….26-27
e. Generate points along a line……………………………………………………………………………………………………..28
f. Create attribute table for a feature………………………………………………………………………………………29-30
g. Calculating upstream drainage area (Map Algebra)……………………………………………………………..31-32
h. Extract (raster) values to points……………………………………………………………………………………………….. 33
i. Export data to Excel (or R or Matlab)……………………………………………………………………………………34-35
V. Other topographic analyses (40-60)
a. Create a slope map……………………………………………………………………………………………………………………36
b. Digitize features…………………………………………………………………………………………………………………..37-39
c. Extract points from a polygon (for binning geomorphic surfaces)………………………………………(40-46)
i. Vector to raster……………………………………………………………………………………………………….40-41
ii. Downsample raster and assign new values to it...……………………………………………………….. 42
iii. Raster to points……………………………………………………………………………………………………… 43-44
iv. Color coding points by a field…………………………………………………………………………………. 45-46
d. Sinuosity of a line…………………………………………………………………………………………………………………47-49
e. Determine azimuths of lineaments (multiple)………………………………………………………………………….. 50
f. Topographic profiling (without the GUI tool)……………………………………………………………………….51-52
g. Isobase (base level) maps…………………………………………………………………………............................ 53-60
VI. Final note, terminology, and further references…………………………………………………………………….....61-63
2
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
I. Introduction
Incorporation of Geographic Information Systems (GIS) into geomorphic study enables the user to
perform larger-scale, quantitative geospatial analysis than is possible or feasible with paper topographic
maps. Additionally, the ability to digitally map (“digitize”) geologic, geomorphic, and geographic features
powerfully augments traditional field-based techniques. While a public license for the industry standard
software, ArcGIS, runs for hundreds to several thousands of dollars, open-source equivalents like GRASS
GIS and QGIS perform most of the same functions for free. Although the user interface of GRASS GIS
presents a less intuitive alternative to ArcGIS, robust algorithms and modular tools equip
geomorphologists with a strong platform for raster and vector-based geospatial calculations including
watershed delineation, stream profile construction, terrain curvature, aspect, and slope calculation,
topographic profiling, digital mapping, and isobase surface creation. Using these tools to accompany
field-based investigation, or perform a preliminary assessment of a study area provides a quantitative
edge to solving a myriad of geological problems. In this guide, I walk through particular application of
GRASS GIS to the digital study of geomorphic landforms.
On a more personal note…
I’m assuming that many of you, like myself, have had exposure to the quantitative power of GIS systems
but feel a bit lost when attempting to perform more extensive tasks within them. “What exactly can I do
with GIS?” “How do I go about doing it?” “What do the different tools do, and which of them do I
actually need?” Or perhaps, you’re disillusioned by the exorbitant cost of mainstream GIS platforms, like
Arc. “How can I use GIS if I can’t afford ArcGIS?” The answer to this last question is simple; the first few
will take a bit of explaining. The Army Corps of Engineer created GRASS as a powerful, freely-available
GIS under the GNU public license (http://www.gnu.org/licenses/gpl.html). GRASS GIS contains the
computational power and analytical structure to perform virtually any spatial analysis task needed in
common practice, with new tools and upgrades implemented in successive versions (the current stable
version is GRASS 6.4.3). This means that notable shortcomings of a current version are likely to be
addressed and remedied in the near future.
The structure of GRASS combines a large database of modular tools with a newer, more intuitive GUI
(Graphical User Interface). Subsequently, access to the diverse functionality of GRASS is becoming
increasingly more accessible to the general scientific community. The GRASS project website
(http://grass.osgeo.org/) contains many useful tutorials and tips for beginners, as well as a
comprehensive library detailing individual functions. Fortunately, every tool within the GRASS interface
is accompanied by varying levels of detailed help in a special tab entitled ‘Manual’. These helpful
resources, coupled with a large user-support community, make learning GRASS realistic and rewarding.
As to the types and uses of the various tools within GRASS, I hope to illustrate a wide range of
applications in this document. This guide is organized as a series of workflows to accomplish certain end-
goals, yet each task clearly (I hope) illustrates how to use a variety of GRASS’ features. Many tasks are
accompanied by screenshots, showing exactly how I obtained my results. Several high-utility tools are
used repeatedly, giving a multi-angled view of their usage. My primary interest in GIS pertains to
quantitative geomorphic analysis. However, most of the workflows, tools, and ideas may be applied
abstractly to produce useful data in entirely different fields. Geology, after all, does not contain the
entire sum of topics requiring spatial analysis. The reason I’ve compiled these specific routines and
workflows is twofold: First, because I’ve either failed to find another GRASS workflow accomplishing my
specific goal, or they’ve been buried deep within troubleshooting and Q&A blog websites. It is my hope
that some of the following instructions satisfy some of your unanswered questions.
3
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
II._To Begin
a. Downloading data from the National Map:
This is the starting point for performing topographic analysis in GIS, unless you have a different online
source for elevation data (like OpenTopography or Natural Earth), or someone handed you some lidar
on a USB drive.The first thing to do is find the website. This isn’t as easy as you would think, as it’s run
through the USGS website, and has been recently updated. Here is the URL to get to the download
platform:
http://viewer.nationalmap.gov/viewer/
In order to get elevation data from the National Map Viewer, click the ‘Download’ button on the toolbar,
which is symbolized by a down arrow. From there, you have a myriad of choices for how to select your
data—I just choose to drag a bounding box. Once this is accomplished, It will ask you for the type of data
you want (elevation), and subsequently what type of elevation data and what format. Don’t ask me the
difference betweem ArcGRID and GridFloat-I don’t particularly know or care. But I do usually go with
ArcGRID format. Hit ‘Next’. The available data should highlight in red, and the pane on the left side of
the screen should display your data product. Click it, and note that, below, there are some hyperlinks to
download your data chunks. Do so. If your selection spans several datasets, you will have several chunks
to merge together in GRASS later. Your data should download as an .adf file (Arc Binary GRID, for when
you import into GRASS). If you are confused about which file is your DEM, there are helpful guides
online, none the least from the USGS. Place your files in an easily-accessible location (and make sure
they’re unzipped!).
The National Map
download platform
Choose ‘download data’
‘draw bounding box’
You want
elevation
data
1 arc sec=30m resolution,
1/3 arc sec=10m resolution
Make sure you look
up the file type so
you can find your
downloaded DEM
later!
I like ‘ArcGrid’
format
4
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
b. Open the GRASS GIS browser.
This is the launch screen.
From this window, you can create several things called ‘locations’ and ‘mapsets’. You can also set your
database folder. When I first tried to figure out how to use GRASS, this greatly confused me. Your
database folder (I’ve named mine ‘demo database’) will contain all of your mapping projects, even those
for different study areas. Accordingly, you will probably ever need only one of these. Within this
database folder, you will create different ‘locations’, in effect different projects focusing on different
study areas. Within each ‘location’, you may have several ‘mapsets’. These partition your huge volume
of geospatial data into smaller divisions. We’ll be creating different mapsets for different pieces of
data—watershed analyses, lineament mapping, isobase calculation, etc.
c. Create a new location and mapset
Now that the basics of GRASS archiving are covered, we need to get started. To do this, click “location
wizard” (in some versions of GRASS: “new location”).
Your first step to becoming
a GRASS user.
5
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Next, choose your directory (again, mine is ‘demo database’), name your mapset (default is
‘newLocation’), and name your title. I will name my location “PineRidge_rangefront”, according to my
study area. Click next.
Now, you arrive at a screen asking for the projection of your coordinate system. I have screwed up here
multiple times. If you already have data, which you do, you can just tell GRASS to choose same
coordinate system (“Read projection and datum terms from a georeferenced data file”). Alternatively, if
you know what projection your data is in, you may choose its code or name from a list. However, my
data is already georeferenced (it’s a 10-meter DEM from the National Map), so I’ll choose its .adf file
(the DEM itself) to match. If you aren’t sure which file is your main datafile, look to see which one is the
largest size. Also, helpful guides are available online (google ‘DEM file formats’. Arc Binary GRID=.adf,
GeoTIFF=.tiff, ArcFloat=.flt, etc.). Clicking ‘next’, and ‘finish’ will trigger a query in GRASS: “Do you want
to import the data source used to create the location?” Your answer: Yes, don’t mind if I do.
The folder where you’ll
store all of your projects
What’s the name of
this project?
If you already have data (i.e.,
NED data from the National
Map), this is the easiest option.
6
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
This has several advantages. First, your data will be automatically imported to your mapset as a GRASS
raster. Second, your region will be set to fit your data. If you select ‘no’ at this step, you will wind up
having to do both these things by hand (we will do this anyway, just to show how it’s done).
If you chose ‘yes’, GRASS will spend a moment deep in thought while it converts your data. Once it’s
loaded, you may choose to add a new mapset. We will be adding several later, so there isn’t a pressing
need to create just one now. I choose ‘no’.
Now, after this long and tedious process, you may select the ‘PERMANENT’ mapset within your location.
A note about the ‘PERMANENT’ mapset: This is a special mapset, from which data may be seen and used
by other, created mapsets. However, other, created mapsets will be unable to share data amongst
themselves. For this reason, it’s good to have all your basemap data (i.e., elevation rasters, etc) in the
‘PERMANENT’ mapset. Click ‘Start GRASS’.
Heck yes, I want to import!
This is my downloaded DEM file. Look
up some common file types and become
familiar with the naming schemes
7
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
When the GRASS GIS GUI (Graphical User Interface: what lets scientists who don’t know programming
use GIS) launches, you will see two screens: The layer manager and the map display. These names are
intuitive; you work on your layers and process your data generally in the layer manager, and see the
visuals in the map display.
Your new
location
The core mapset
(create others if you wish)
8
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
d. Importing data
Earlier, we imported an elevation model raster (DEM) when we made our mapset. We even set the
mapset’s region to fit that raster. Now, let’s display it. Choose “Add raster”. There it is, the only piece of
data in our set.
There’s our raster, right front-and-center in all its Technicolor glory! However, our study area is larger
than this, and extends to the East another quadrangle. To get the other chunk of data imported, choose
Fileimport raster datacommon format. Up pops the import screen, asking you for the location and
format of your new data.
It may require a bit of legwork outside GRASS to determine the format of your data. The National Map
generally downloads DEM’s to Arc/Info Binary Grid (.adf) format, so that’s what I’ll choose. The National
Map’s data handling scheme labels all DEM’s (at least that I’ve downloaded) as w001001.adf. You may
have to dig through your download folder to get it. This will cause a problem, because your other,
original DEM is named w001001. So, to fix this, I change the name GRASS assigns to it to w001002. You
can do this easily within the ‘Import raster data’ window, where you already are:
The Layer Manager.
You can edit
properties and view
attributes here. Right
click on your data to
see some options
The Map Display.
Visual effects here
9
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
You shouldn’t have to tell grass to force your Lat/Lon map to do anything, or tell it to override the new
DEM’s projection. If you have to do this, you’re probably doing something wrong, and need to change
your mapset projection type to match that of your data.
Now that your new data is imported, where is it?? To view it as well as your old data, select both in the
layer manager. Next, in the map viewer, choose the “zoom in to selected map layers” button.
Name your
imported data
Know your
file type! My
dem is in
.adf format
I downloaded
ArcGrid format
10
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Now, we can see both of the DEM’s. However, they are still separate entities, as illustrated by the
separate color scales. Select both rasters in the layer manager, right click on them, and choose “Set
computational region to selected map(s)”. This is important, and will haunt you whenever you try to do
a conversion, display, or calculation on a raster not currently in your computation region. This is,
however, the correct fix. Now that the computational region is extended, go to the ‘Raster’ menu, and
select Overlay rasters r.patch.
First piece of data
(auto-imported)
Second piece of data
(imported by hand)
Note the different
color scales. We
need to make these
into one piece!
11
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
II._Working with rasters
a. Mosaicking rasters with R.patch:
In r.patch, choose both of your input rasters, and a name for your output rasters. The data is 10-meter
resolution, so I’m calling it PineRidge_10m. There are various options here, notably, the “allow output
files to overwrite existing files”. This may be handy if you screw up the first time, and need to re-do
whatever GRASS command you’re re-doing (This option is present in pretty much every GRASS tool).
Click ‘Run’, and note that, when it’s finished, GRASS will place the output into the layer tree. So, just
watch and wait.
My two elevation rasters
Find more
help here!
12
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Here’s the output:
Now, this is much nicer looking, and it’s all one piece. However, I want to zoom in on a small portion of
the study area to focus on.
b. Clip raster to smaller extent:
The area to the Northeast edge of Pine Ridge looks desirable, so I’d like to clip the map to that extent. To
do this, you’ll need to use g.region to constrain your calculation area—there are several ways to do this.
The first (and most tedious) is to manually enter coordinates for the eastmost, southernmost,
northmost, and westmost extents of your new area. A better way is to utilize heads-up digitizing to
create a polygon of our desired area, then restrain our area to just that polygon.
To start heads-up digitizing, choose ‘digitize’ in the map display instead of ‘2D view’. This will reveal an
additional toolbar, and require you to choose a vector to digitize/edit. Since there isn’t one yet, choose
‘new Vector map’. It will prompt you to name it; I named mine study_area. Now, use the ‘digitize new
area’ button, and click some vertices on the map. When done, right click to finalize the polygon. A new
dialogue box, asking you to okay the new creation will appear. Click ‘ok’. The new shapefile’s attribute
table will pop up too. Click out of it.
Now, both of my elevation rasters are joined.
In other terms, ‘my DEMs are mosaicked’
13
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Now, your display should look something like this:
Click the power button on the digitizer display. Affirm that yes, you do want to save the changes to the
new vector map. If you wish, right click on the new shapefile in the layer manager, and choose
‘Properties’. In the ‘colors’ tab, choose the area fill to be transparent.
Now, right click on the shapefile in the layer manager, and choose “set computational region from
selected map(s)”. This will restrain all further work to an area the shape and size of your polygon. Also
use SettingsRegiong.region to restrict the display to a box the size of your polygon.
Next, we use the “Map Algebra” function to create a new elevation raster of the same area as our
polygon. The Map Algebra dialogue box is quite confusing to the newcomer, and it is rather unclear how
to tell it exactly what to do. Enter the name of the new raster map in the correct box. Select the existing
raster map where requested, which will put the full raster name (in quotes) into the calculation box.
Since all we wish to do (for now) is restrict to the polygon’s shape, and since the calculation region is
already set to the polygon’s shape, just click “run”. [NOTE: for a pictorial example, skip ahead to the
‘Map Algebra’ section, you may need to.]
The new raster will be in the shape and dimensions of a box whose boundaries include the outermost
vertices of your digitized polygon. I haven’t found a method for creating a non-box shaped region yet…
Now that we have trimmed the raster to our area of focus, we should project our data to a new
coordinate system: UTM. Currently, our National Map data is in lat/long coordinates. The difference
here is that lat/long counts distance in degrees/minutes/seconds and elevation in meters, while UTM
(Universal Transverse Mercator) sees all spatial variation in terms of meters. The reasons for changing to
UTM coordinates are many; however, the simple answer is that most geospatial processing simply isn’t
built to work in a coordinate system without a uniform unit for x, y, and z dimensions. Fortunately, we
are in luck: the only other programs that intuitively do a projection change well cost hundreds to
thousands of dollars!
My new raster will be the
size of the smallest
rectangle that can contain
my digitized polygon
14
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
c. Project to UTM coordinates:
To do this, you’ll need to exit GRASS and restart. The first step is to create a new location with a
different projection system.
Now, I can do what I want. My data is imported, and
I can choose the new projection. Doing this from a
list is the easiest way.
15
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Since we’re taking our existing data and projecting into new coordinate system, I find it easiest to
choose one from a list:
Universal Transverse Mercator (UTM) does things in meters, so it’s the desirable projection to work in.
Find it here…
…Or type it in here!
The earth is curved, so projections vary across
its surface. Look up the correct zone for your
data. (a table covering the U.S. UTM zones in on
the next page)
16
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
The UTM zone you choose depends on where you are. Different longitudes project differently, and
require the correct zone. Here is a map of UTM projection zones in the USA (google: UTM zones):
Since I’m working with data from the panhandle of Nebraska, I choose zone 13.
Next, it asks you to specify your geodetic datum. I prefer NAD 1983.
I use nad83. If you’re
curious about the
different types, see
the ‘Help’ page.
17
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Next, you may get a screen asking which transformation you’d like. I’ll stick with the default (0).
Now that you have things set up, you can launch the ‘PERMENANT’ mapset of your new UTM-projected
location. Once your layer manager and map display pop up, you can re-project your old lat/long data
from our previous location into UTM coordinates. To do this, use:
18
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Rasterdevelop raster mapr.proj
Due to GRASS’ inability to project things on-the-fly, the only (and right) way to change your projection is
to do so in a totally different workspace. Because of this, the r.proj command is built to take data from a
different location, stretch and resample it, and create a projected version of the file in the new location.
r.proj will ask you for the ‘location’ containing your raster, its name, the name to call the new map,
resampling methods, and resolution. BUT FIRST, to make all of this happen, we need to do some
preliminary leg-work. In the ‘Target’ tab of r.proj, check the “Print input map’s bounds in the current
projection and exit” box. This will tell us the extents of the old map in the new location, so we can use
g.region to resize our calculation area:
Resolution:
1 arc-second = 30 meters.
1/3 arc-second = 10 meters.
1/9 arc-second = 3 meters.
My data is a res. of 10 meters.
Check this box to find out
your data’s bounds in UTM
coordinates.
19
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Checking the box tells r.region that no, we don’t want to actually import the raster yet, because our
region isn’t set, but we wish to know the bounds of the map so we can set the region by hand. Here’s
the output of r.proj adjacent to the g.region window, with the updated region settings:
Now you can enter the values spit out by r.proj into g.region, set the region, uncheck the box in r.proj,
and actually import the data to the UTM projection! Here’s my result:
Now that your DEM is 1) projected to a UTM coordinate system, and 2) GRASS-ized for processing, you
are now able to perform innumerable geoprocessing tasks, including:
 Neighborhood statistical analysis
 Terrain analysisshaded relief (“hillshade”)
 Terrain analysisslope and aspect (generate slope, aspect, and their derivatives)
 Hydrologic modelling watershed analysis (stream network and basin delineation, etc).
 File NVIZ (for 3d visualization of raster surfaces!)
The sky is the limit. You just need to figure out what exactly you want to do. First of all, I like to create a
hillshade, to better see what’s going on in the landscape.
My mosaicked, clipped,
projected raster.
20
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
d. Downsampling a raster:
Before you do any fancy raster processing, you’ll need to sit back and figure out if your resolution is to
your satisfaction. If it’s high-res and you (like me) don’t have a high-power processor, raster operations
could take quite some time. If you don’t need the high-res, and can’t afford to make your study area
smaller, you can always downsample.
To downsample, or coarsen the resolution of your raster, is a two-step process in GRASS GIS. First, you’ll
need to change your region’s resolution (Settingsregiong.region). I’m working with 10-meter
resolution (each pixel is 10x10 meters). I wish to downsample to 30 meters. So, in the g.region tool, I’ll
set my 2D resolution to 30. After running this, open r.resamp.stats (RasterDevelop Raster
Mapresample using aggregate statistics). Tell the tool which map you’re resampling (my fancy new
UTM-projection elevation map, in my case), and what you’d like to call the output. Next, make sure the
aggregation method is ‘average’. Hit ‘Run’, and watch the magic.
Here’s a blown-up comparison of my input (10-meter) and output (30-meter) DEM’s:
As you can see, the spatial resolution is now coarser, and quicker to manipulate. If you don’t need the
resolution, don’t use it. Now, we can create a low stress (and less time-consuming) hillshade.
g.region tampers with
the mapset resolution
(I want 30-meter
pixels instead of 10-
meter, so I enter “30”
r.resamp.stats looks at the
coarsened region and re-
does your raster resolution
to match it
21
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
e. Creating a hillshade: r.shaded.relief
Open r.shaded.relief (available from
typing it into the command line, or
choosing it from the RasterTerrain
analysisShaded relief menu.
Here, you have a plethora of options
to choose from to create your new
hillshade. You tell r.shaded.relief
which raster file you’d like to shade
in the “Required” tab. In the
“Optional” tab, you define the
output name, altitude of the light
source to shade by, horizontal angle
(Azimuth), and exaggeration. I like
to leave these parameters on
default, as I’ve been very satisfied
with the ouputs so far. Click “Run”.
Depending on the size and
resolution of your raster, this may
take a while. Let GRASS think; it will
produce sooner or later.
My new shaded relief
map (hillshade)
22
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
f. Overlay a hypsometric tint:
A traditionally useful way to augment the visual display of a hillshade is to take the original DEM raster,
give it a nice color scale, and set it to be a semi-transparent layer over the hillshade (a process called
‘draping a hypsometric tint’). Having worked with digital topography for a while, I’ve experimented with
different color tables; I find that a grayscale is visually-appealing and simple to do in GRASS (creating
your own color table is non-intuitive, and best left for QGIS). To set the color of your DEM raster, right
click on it in the layer manager and choose ‘set color table’. The tool will pop up, and in the ‘Colors’ tab,
set the color table type to ‘grey’. Run, and close the dialogue box. The DEM should now grade from
black to white. To set the transparency, right click on the DEM in the layer manager again, and choose
‘Change opacity level’. In the box that pops up, choose the percent opacity you’d like; I set mine to 30%.
Here’s what the result looks like:
Now, you can more easily distinguish areas of low and high elevation. Let’s move on to more complex
functions.
The lower elevation is
darker
The higher elevation is
lighter
23
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
IV._Hydrologic analysis (focusing on stream profiles)
a. Delineating a watershed, it’s sub-basins, and stream channels:
Open RasterHydrologic modelingr.watersheds. The input to this tool is, simply, your DEM (not the
hillshade!). In the ‘Output_options’ tab, type names in boxes of output maps that you’d like. They are:
1) “number of cells that drain through each cell”, less cumbersomely-known as “Flow
Accumulation”. This tool operates under the ‘raindrop’ model, assuming that peaks and ridges in
the terrain serve as hydrologic divisions, and that water will accumulate downslope of these
features. The output raster is a map of predicted areas that water will collect, with each pixel
assigned a value equal to the number of upslope cells draining into it. This means that pixels in
stream channels will have higher flow accumulation numbers than will adjacent hillslopes.
Although not exceedingly useful, this would be a good raster to keep—it can be processed with
the map algebra function later to produce a raster of upstream drainage areas, an important
hydrologic variable.
2) Drainage direction. This raster tells the tool which way water is most likely to flow. It isn’t
necessary to keep for any function I’m aware of, but you should do so anyways for the sake of
covering your bases.
3) “unique label for each watershed basin”. Also known as your watershed basins map. This is
important for display paramaters.
4) “stream segments”. A raster of the proposed stream network. This will need cleaning
eventually.
5) “each half-basin is given a unique value”. Also known as your half-basin map. Another useful
parameter.
6) “useful for visual display of results”. If you want a combo raster for just looking at, this is it.
7) Slope length and slope steepness. Slope steepness rasters, useful for engineering purposes.
An important input that you’ll have to tinker with resides in the Input_options tab: the “minimum size of
exterior watershed basins”. This controls how many segments are in your streams. Larger input values
will require streams to have more drainage area, and will consequently coarsen your stream map. You’ll
have to experiment. In the “Optional” tab, you can choose Multidirectional flow accumulation, which is
useful if your standard D8 flow accumulation produces a bunch of straight lines. Also, checking “Use
positive flow accumulation even for likely underestimates” can ensure that your use of the Flow
Accumulation raster will give credible values. When you’re satisfied, click ‘Run’. You may have to re-run
this tool several times, adjusting the size of your basins as you go. To let this happen, check the “allow
output files to overwrite existing files” box in the “Optional” tab.
If all goes well, each of these raster maps should pop up in your layer manager.
24
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
b. Raster to Vector:
You can easily convert a raster map into a vector feature in GRASS GIS. This is quite useful, and I will
vectorize my streams and drainage basins with Rastermap type conversionsr.to.vect. My
watershed features will be polygons; the streams will be lines. After my rasters are converted to vectors,
and a bit of color-changing and opacity altering, my result looks like this:
I set a lower basin threshold for my streams, to get higher detail, then generalized my basins by
increasing the threshold, and running r.watershed again. A more precise, basin-specific map may be
created with r.water.outlet.
25
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
c. Cleaning vectors:
Although the stream extraction process is run by a high-level algorithm, NAD DEM’s are notorious for
containing artefacts and noise that produce some stream channels that don’t exist. Other tiny vectors,
called ‘dangles’ may be produced, producing streams that more resemble pipe-cleaners than anything
else. To get rid of these ‘dangles’, etc., there extists v.clean:
Most of what needs to be trimmed may become so through using the “remove dangles” function of
v.clean. Increasing the threshold removes larger “dangles”, and above a certain point, will start
removing tributaries in your stream network. Some closed-line boxes, etc. will still have to be cleaned by
hand using the digitizer as an editing tool.
v.clean nabbed these
‘dangles’…
…but these will have to
come out by hand.
Line length threshold
26
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
d. Restricting your network to focus on one stream (build polylines, etc):
The stream network is clean of ‘dangles’, and now I’d like to trim off all of the tributaries and extra main-
stem channels to restrict my focus to the northwestern-most main stem. Using the digitizer to delete
features, one can accomplish just that. Here is my result:
Note that, while the digitizer is still on, many vertices can be noted along my restricted channel. In order
to produce vector points, as I hope to do, I need all of these segments joined into a single line, called a
“polyline”. This may be accomplished through using the Vectortopologyv.build.polylines command.
First, I need to quit digitizing and save my edits. Next, in v.build.polylines, I can select my newly-trimmed
stream vector, and in the ‘Optional’ panel instruct v.build.polylines to populate the new, merged line
vector with the information from the first segment of the old line vector.
Each of these dark green
crosshairs is a vertex. In
order to make our point
extraction work, we need
to get rid of them but
keep the lines which
connect them.
How: v.build.polylines!
The pale green and orange stream
segments represent what I’ve
trimmed off, whether by v.clean or
by hand.
27
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Here’s the result:
Notice that, although most of the vertices are gone, about ten easily visible vertices remain. There is a
significant reason for this: at those locations, junction with tributary streams has created an artefact in
our data—a box or other oddity that must be removed by hand via the digitizer. Once each new dangle
or box has been removed, run v.build.polylines again. If it isn’t fully merged this time, problem spots are
easily recognized with the digitizer turned on (reveals
vertices) or topology displayed (see the ‘Properties’ option
by right clicking the stream shpfile in the layer manager). I
deleted all the small boxes and dangles in my stream by
hand, and here’s the result.
While most vertices
are gone, several
remain. This means
that there’s more
than one junction
feeding into the
main stem at each
of these locations.
Trim them out with
the digitizer.
A classic example of a polyline
interruption that both v.clean and
I missed. Delete the small closed
loop in the digitizer.
Much better! Now all that’s left are
the two end-nodes. Everything in
between is consolidated into one
continuous line.
28
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
e. To generate points along a line:
I now have a single-thread line (just one segment, no intermediate vertices). This is a requirement to
generate points along my stream’s path, using v.segment. (Vectortopology maintenance-v.segment)
V.segment generates points at a specified interval along a given line (if you’d like to do more than one
line in a given shapefile, you’ll need to do extra work, but this may in part be automated). The key to
successfully using this tool is a ‘rules file’ containing instructions for each point. This sounds tedious, and
the only other option is to enter these rules by hand into the v.segment tool window, but there is a fairly
simple way to make this process quick and smooth: Excel. The rules you need are as follows:
P 1 1 0
P 2 1 100
P 3 1 200
P 4 1 300
Where the first column denotes the type of ‘segment’ you’d like (P=points, L=lines), the second column
contains the row number for number of the new point (should be an ascending sequence of integers),
the third column is the number of the vector you’re creating the points along (I labeled the stream ‘1’),
and the fourth column is the distance along the line at which to create the point. Now, this does look
tedious, but if you type these values into an Excel spreadsheet and auto-continue the trend until well
past the projected length of your line, it takes only seconds. The Excel spreadsheet must be saved as a
delimited text file in a location (perhaps the GRASS location) you can map to easily. Here’s a screenshot
of my Excel document, which I’ve saved as a text file:
Now that the ‘rules’ text file is saved, and the feature(s) we wish to add points along has an attribute
table and a unique category number, we’re ready for the v.segment tool. Simply select select your text
file, name your output file, and voila! You’re good to go.
29
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
f. A new attribute table:
Although we have our points now, they’re in dire straits and need
some help. They are what they are—points, without an attribute table
or even a record of the distances they represent. Ah well, these things
can be added.
First things first, use the DatabaseVector Database
connectionsnew table again to give these points an attribute table.
Instead of leaving things as-is with this tool, let’s add some columns
while we’re at it (else, this will have to be manually done later with
v.db.addcol). Click on the “Optional” tab. In the lower portion of the
screen, note the text box inviting you to name new columns and list
their type.
This part of the process, again, can be frustrating if you do it wrong.
The information must be entered in a specific way: dataname
datatype, nextdataname nextdatatype
Short names are good;
‘elevation’ is a bad choice, as
it will likely get chopped off
after a few letters—‘elev’ will
be much more successful.
The data types seen above
(the ones you’ll likely need)
are:
 int – this data type will only receive integer values. If you try to stuff decimals or fractions into it,
it will loudly complain and rudely fail to comply.
 double precision—this type accepts all numbers, up to many decimal places. Most data you’ll
collect are of this type, so pretty much any column you’ll add should be of double precision
type.
 varchar(#)—varchar allows you to store any symbols ever, but does not recognize them as
numeric (I think). It does, however, allow you to put in a mix of symbols that are useful for
display purposes, primarily coloring schemes. Creating a column of varchar(11) type allows each
cell to contain up to eleven unique characters. You’ll need this if you want to color your points
by an attribute (input colors look like 181:332:013, nine numbers split into three pieces by two
colons). Name it GRASSrgb for the sake of easily finding it later.
Each small
black ‘X’ is
a new
point that
we’ve
just
generated.
Notice the arrangement of the syntax—this is
important, as GRASS is quite particular. The
format is columname data type. You’ll want a
data type of double precision for most things.
30
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
If for some reason you’ve found that you need to add another column later, after the table is made (or
you’ve gone ahead and created the table without reading my suggestions, silly, silly you!), you can
always use v.db.addcol to input new names and datatypes (as seen above). GRASS 6.4.3 has a mostly-
operational GUI menu to do this by hand, too: right click on the points vector in the layer manager and
choose “show attribute data”. From there, you should be able to figure out how to do this by point-and-
click methodology.
So, we now have points that a) have an attribute table, b) have distinct integer ‘cat’ values to tell them
apart, and c) empty columns named after the attributes we’re going to extract. We’re on the right track.
But first, an aside. We have a raster of elevation values at 30-meter resolution already—this will be
instrumental in creating the long profile of the stream we just extracted points for. However, we
(almost) have another piece of useful data that we can take with us, too: upstream drainage area. The
flow accumulation raster we created earlier as a part of r.watershed tells exactly how many cells drain
into each downslope cell, but we want area values instead of pixel-counts. This can easily be
accomplished by using Map Algebra yet again.
31
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
g. Using Map Algebra to create an upstream drainage area raster from a flow accumulation raster:
Open up the Map Algebra calculator. This tool takes your commands and applies it over entire rasters to
create new data. It is quite powerful, and most (if not all) of the raster tools have their roots here.
Anyway, here’s a picture of the operation we did earlier [creating a clipped raster from a larger one after
using g.region]:
As you can see, the trick to clipping your raster earlier was changing the regional extent to a much
smaller area with g.region, then opening the Raster Map Calculator (aka Map Algebra) to create a new
raster equal to the old one (but now in a differently-sized region, which chops off the raster’s
boundaries). The syntax for the Raster Calculator can be a bit obtuse at first; let’s do another example
while we calculate upstream drainage area.
Here, select your raster maps
to include in the calculation.
32
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
As stated several times before, flow accumulation for a given cell is the cumulative sum of all upslope
cells that directly or indirectly drain into it. In other words, this gives us the number of cells in the
drainage area, but not the area of those cells. Fortunately, if we’ve kept track of the resolution of the
DEM we’ve been using (it started as 1/3 arc-second, was projected to 10-meter, then downsampled to
30-meter), we can simply multiply this total sum of all upslope cells by the area of each cell quickly and
efficiently. Here’s what this would look like for my 30-meter DEM:
The output map, ‘upstream_area’, now contains drainage area, rather than drainage pixel count. Now,
we’ve got all the data that I’d like to use in describing the stream profile. And the extraction process,
comparative to what we’ve done so far, is cake!
Multiplying your flow
accumulation raster by the area of
each cell will generate an
upstream drainage area raster. My
cells are 30x30 meters.
33
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
h. Extracting raster values to points (points that have an attribute table already, that is):
Now that we have our point shapefile up and running, the extraction is easy. The powerful tool that
accomplishes this goes by the name of v.what.rast (VectorUpdate attributesupdate attributes from
raster). You don’t need to type in the datatype this time. You only need the name of the column you’re
updating and the name of the raster you’re updating from. If you have more than one attribute you’d
like to extract, you’ll have to do them all separately, but the process itself is quick.
If you check the point vector’s attribute table after the extractions (assuming no malfunctions or user
errors), you should see values in your previously-empty columns.
So, we’ve come a long way to get to the point (no pun intended): from importing a DEM, mosaicking,
trimming, projecting, extracting streams, cleaning them, trimming them, making polylines from them,
adding attribute tables, making points along those lines, adding an attribute table to them, adding
columns to that attribute table, and finally extracting raster values to those points. Whew. “But what”,
you may ask, “about the cumulative distances for each of our points? You can’t make a profile without
distance!” You would be very correct in asking this. The simple answer I have is that, when creating your
points, GRASS did not write your input distances to each point. Bummer dude. But what you can do now
is export your data as an Excel-compatible file and auto-fill your data table with distance values (since
you still have your “rules file” for making the points in the first place). Here’s how you export your data
for some well-earned processing (in Excel, Matlab, or my preference, R):
Point vector to update
raster to extract values from
Column to populate with data (necessary to
create in advance, which we’ve done)
34
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
i. Exporting vector data to be read into Excel (or Matlab or R):
Now that you have all the data you want (minus distance, which you can auto-fill in Excel), you need to
export it for manipulation and plotting. This is the fun part. Up until now, you’ve been jumping through
hoops to collect data—now you’re just about to visualize it for yourself.
In the Layer Manager, right click on your point vector and click ‘Export’. Up pops v.out.ogr (also available
from Fileexport vector data). It asks for a name in a rather unintuitive way: “OGR output datasouce
name”. This is the name of the folder and file your data will be written to.
Note that I’ve made a name for the “OGR output
datasource”, told v.out.ogr that my vectors are
points, thank you very much, and that I’d like my
OGR format to be CSV (a comma-delimited text
file that easily opens as an Excel document). If
you don’t want to spend forever searching for the
auto-directory output location, specify the
directory path in the “OGR output datasource
name” box. My path, which I store all of my
random riffraff like the “rules file”, etc. in is:
C:UsersSkylerDocumentsGRASS_docsdemo
database
Now that the data is successfully exported, we can find it and open it in Excel (or read it into Matlab or
R, if you wish) for visualization.
Should instead be:
C:UsersSkylerDocumentsGRASS_docs
demo database
If I leave the file pathway out, GRASS will auto dump
my data into my local user folder on the C: drive.
We’re exporting points
File type is CSV, a
comma-delimited
file easily readable
by MS Excel
35
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Finalizing the stream profile, from using the above steps:
In Excel, open the .csv file you just created. Notice that there is a ‘cat’ column, an ‘elevation’ column, a
‘da’ (drainage area) column, a (as to now) useless GRASSrgb column, and absolutely no distance column.
Darn. Let’s auto-fill one really quick. As you are probably familiar with already, if you type in values
succeeding rows in Excel, highlight those rows, then double-click the corner of the black highlighting box
(a crosshair appears), it auto-fills your column with extrapolated values until its length matches those of
the other columns in the spreadsheet (you could drag the crosshair manually, if you prefer). Do this for a
new ‘distance’ column to get your x-axis for the long profile.
Now that you have your spatial parameters, you can calculate some derivatives of the data. Take a
moving average (using Excel’s statistical package or R’s lowess function) to smooth the profile and
remove the notorious NED 10-meter contour stair-steps from your profile. Calculate profile slope; take it
a step further and calculate normalized steepness, Ksn (Ksn=slope/(DrainageArea^-ABS(theta ref)) ;
theta ref=0.5 for general stream profiles). Take the log of slope and drainage area, and plot a fancy
slope-area diagram to compartmentalize the geomorphic transitions of your stream—the works. My
point is that you can derive all of these data from a good stream profile construction, itself totally
doable in GRASS GIS.
In case you’re wondering, I did calculate and plot each of these variables in Excel (although I much
prefer R):
If you’d like to learn how to manipulate and plot your GRASS export in R, I’m writing a document about
that as well.
900
950
1000
1050
1100
1150
1200
0 10000 20000 30000 40000 50000
Elevation(m)
Downstream distance (m)
Raw elevation (m)
Smoothed
elevation (m)
0
0.005
0.01
0.015
0 10000 20000 30000 40000 50000
Slope
Downstream distance (m)
Slope
0
20
40
60
80
100
0 10000 20000 30000 40000 50000
Ksn
Downstream distance (m)
y = -0.6941x + 3.1794
-5
-4
-3
-2
-1
7 7.5 8 8.5 9
Log(slope)
log(drainage area)
geomorphic
compartment
boundary
(hillslope to
flat plains)
36
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
V._Other topographic analyses
a. Create slope maps and other spatial derivatives:
Rasterterrain analysisslope and aspect (r.slope.aspect)
r.slope.aspect will generate slope, aspect, and curvature from a standard DEM. While these are
important morphometric parameters useful in delineating abstract landforms, I haven’t found a need
(yet) for anything other than the standard slope map. A map of a landscape’s differential slope is
important: it plays a role in slope stability and mass wasting processes, but more important to me, it aids
in mapping geomorphic surfaces. With a good slope map, you can find the flat spots and digitize river
terraces. You can interpret regional-scale breaks-in-slope and map them as lineaments. And generation
of this kind of map is remarkably easy. While producing a slope map in past decades has required
rigorous expertise with map algebra, GRASS does it for you quickly and intuitively with r.slope.aspect.
Input your DEM, name your slope map in the “Outputs” tab, check “Allow output files to overwrite
existing files” in the “Optional” tab in case you screw up the first time, and hit ‘Run’. Here’s an example
output:
Notice bright yellow areas where the slope is exceptionally steep, and blue areas where the land is
relatively flat. When zoomed in closer, one can distinguish several straight lines cross-cutting
topography. These could be lineaments, which we will use the digitizer to preliminarily map.
37
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
b. Digitizing features in GRASS:
While slightly cumbersome in ARC, digitizing new features in GRASS GIS is relatively straightforward and
intuitive. In the Map Display window, you have many buttons to choose from, each of which does
strange and wondrous things. A prominent button on the rightmost edge of the window should read
“2D view”, and have an arrow for a drop-down menu. Click it, and select Digitize. A new editor toolbar
will appear, with an additional drop-down menu. Since we’d like to digitize some lineaments from
scratch, click the new drop-down menu and select “New Vector Map”. Once you’ve named it and clicked
“OK”, you’re in business.
The new attribute table will pop up—great. Unless you’d like to add some columns to better distinguish
your data (other than the default ‘cat’ number), click ‘Quit’ to get back to digitizing. Now, you should
have the Map Display window with the new editor toolbar, your new vector selected for editing. Things
get very intuitive from this point—you can choose to create new points, lines, or areas (polygons), and
update or view their attributes. To digitize preliminary lineaments, click the “Digitize new line” button
and point-and-click to create new segments (right click to finish a line).
Good
.
Change
from 2D to
Digitize.
Select “New vector map”.
38
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Each time you finalize a feature, a small window pops up asking if you’re really sure you’d like to make
the shape final. Yes, yes you would. If you screw up somehow, you can always go back, use the “Delete
Feature” tool, and get rid of your problems. Anyways, after you’ve hit ‘Submit’, you have a new feature!
Digitize your lineaments in like fashion (I’m only going to do several, quick-n-dirty estimates of
lineaments). When you’re done, click the power button in the right corner of the editor toolbar (you
may have to stretch the Map Display window to see it, like I just did). Tell GRASS “Yes, thanks for asking,
but I really would like to save my edits to the new shapefile!” and voila, you have a new shapefile of
lineaments.
This is necessary. GRASS is
asking for your permission to
catalog this new vector object
as the first entry in the new
‘cat’ column.
39
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
I altered the color and line thickness of the few, roughly-mapped lineaments in our vector shapefile by
right-clicking the vector in the Layer Manager, choosing properties, and adjusting the ‘Colors’ and ‘Lines’
tabs.
NOTE: When digitizing lineaments, try to use multiples sources of imagery. I like to do this in QGIS
because the Google Earth plugin allows me to interpret high-resolution aerial photographs in addition to
hillshades and slope maps. Also, the color scale of your raster slope map may be easily-adjusted in QGIS,
allowing you to hone in on, say, the features between 5% and 25% slope or whichever range you’d like. I
will write more about this in my guide to visualizing data in QGIS. But for now, all I wish to accomplish is
a simple digitization of a geomorphic feature.
ADDITIONAL NOTE: digitizing can usefully constrain a myriad of geomorphic surfaces, not just proposed
fault scarps. Fluvial and marine terraces, etc. may be digitized in the same manner, using areas
(polygons) instead.
My proposed lineaments. I’ve
probably missed quite a few, and
some of these are probably not
real structures, but hey, it’s
preliminary mapping, man!
40
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
c. Digitizing a polygon, and extracting points from its interior (aka, “binning”):
The idea behind this is simple, and the workflow isn’t overtly complicated: I want to digitize a polygon
that covers the extent of a geomorphic surface, and I want to extract points at equally-spaced intervals
throughout that polygon, each of which contains some sort of spatial parameter (slope, elevation,
aspect, etc.). Unfortunately, there’s no automated tool to do this, unless you use the Model Builder to
make it yourself. ArcGIS has the “XTools Pro” kit, which accomplishes this task automatically yet costs a
good chunk of change, but we can do better.
ci. Digitizing a polygon:
First, change your map view mode from ‘2D’ to ‘Digitize’ (like we did for digitizing lineaments), and
select a “New Vector Map” to digitize. Click the “Digitize new area” button, and you’re set. I’ve noticed a
bright spot on my slope map, in the northern-northeastern corner, where a prominent escarpment is
located. I’d like to know the general slope of this feature. Let’s digitize its perimeter, so that we can
extract points from within it. Click points to establish the perimeter, then right-click to close the
polygon. Exit the digitizer and save your edits.
Great. This is the first step in extracting points over an area (Duh!).
I changed the
fill color to
‘transparent’
and the outline
to white. to
better highlight
the polygon.
41
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Converting our vector polygon to a raster:
The polygon we’ve created bounds the area for our point extraction. Now, we’re going to need to
convert that polygon to a raster, such that each cell within the polygon will have a value of ‘1’, and all
other cells will have a value of ‘0’. The reason for this is, you can’t simply tell GRASS to “look inside X
polygon and extract points from Y raster”. We’re going to need some map algebra from the Raster
Calculator to get the job done. We’re going to take the rasterized polygon and multiply it by the raster
containing the values we wish to extract. 1*Value= Value, 0*Value= 0. To get this rasterized polygon,
here’s the deal:
Vectormap type conversionsv.to.rast
Set source of values to ‘val’, and val=1. (afterwards, right click on the vector in the Layer Manager and
click ‘Univariate raster statistics’ to confirm that the max value is 1, and the minimum value is 0) Here’s
some screenshots of v.to.rast:
Using ‘val’ will allow us
to set the part of our
new raster representing
the polygon to ‘1’.
Don’t forget
this step!
Make sure that
‘Raster value’=1.
Leave the rest alone.
Our hip,
new raster.
It’s too
high-res,
though.
42
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
cii. Coarsening our region to extract fewer, representative points:
We’ve already downsampled our DEM from 10-meter grid resolution to 30-meter grid resolution to
decrease our processing time, but I (in the time that I’ve written this) have changed my region to 10m-
resolution. It really shows in the raster I’ve just created—the grid squares are very small. We should
coarsen this raster before we continue. [NOTE, if you’re still in a coarser resolution (like 30-meter), you
don’t have to do this part, unless you feel the need to coarsen things further]. The reason being, as we
extract points over a broad area at higher resolution, GRASS assigns one point per raster grid square.
And we’re going to wind up with a lot of points, probably more data than we care or need to analyze. To
fix this problem, we need use g.region to coarsen our sampling density (We will also produce a further-
coarsened ‘polygon’ raster in the process).
SettingsRegiong.region, or type g.region into the command line.bSet the 2D resolution to 30
meters, and click ‘Run’. Close the dialog box. In the Layer Manager window, right click on the raster
we’re coarsening, and choose “Set computation region from selected map(s)”. Now that the region
resolution is coarsened, open up rasterDevelop Raster Mapr.resamp.stats. This function, as before,
will resample (in our case, coarsen) our raster to 30-meter grid resolution (9x as coarse as a 10-meter).
Make sure that the type is ‘average’, and give your output map a distinguishable name. Hit ‘run’.
Now that the raster we’ll sample from is coarse enough to a point extraction.
g.region tampers with
the mapset resolution
(I want 30-meter
pixels instead of 10-
meter, so I enter “30”
r.resamp.stats looks at the
coarsened region and re-
does your raster resolution
to match it
From
10x10
meter
squares
To 30x30
meter
squares.
Black line
for
emphasis.
43
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Get values from one raster to another: more Map Algebra!
Now that we have a downsampled raster of our original polygon, here’s where using the ‘val’ setting in
the v.to.rast tool comes into play. If it worked correctly, as stated before, each grid cell within our
original polygon’s bounds should have a value of 1; all others should equal zero. Again, you can check by
right-clicking the coarsened ‘polygon’ raster, and choosing ‘Univariate Raster Statistics’, which will spit
out max and min values in the Command console.
Now, if we multiply our ‘polygon’ raster by another raster, say our slope map, the polygonal area will
contain the values of the other raster (1*value=value), while all other parts will retain values of zero
(0*value=value). This is of utmost importance for the next step (you’ll see why in a minute).
By now, a bit of map algebra is easy. Open r.mapcalc from the ‘Raster’ menu, enter a name for your
‘revalued polygon’ raster, and multiply your coarsened ‘polygon’ raster by one with the values you want.
These two maps are selected here.
New
name.
Now,
we’ve
got slope
values
for every
pixel in
our
rasterize
d
polygon.
44
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
ciii. Raster to points:
To recap—we converted a polygon to a size equivalent raster version. We downsampled that raster such
that it will sample evenly while giving us a manageable amount of data. The Raster Calculator was used
next to give the required values to our downsampled ‘polygon’ raster. Now, we’re going to finish the
process and extract a point from each grid square in the updated ‘polygon’ raster. To do this we use the
reverse of v.to.rast:
RasterMap type conversionsr.to.vect
This command will take whatever raster you have and change it to your preference of vector format. We
used it on our watersheds raster to make polygons; we also used it on our stream raster to get a
drainage network of lines. Now, we’ll use it to make some points.
This specification tells GRASS that every
pixel must produce a point. That’s why
we downsampled earlier!
One point
per raster
pixel.
(black line
for
emphasis)
45
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
civ. Coloring a vector:
Now that we have our points (I re-symbolized mine to small circles instead of x’s), we can choose to
color-code them to visually show us its range of values. First, we’re going to need to add a new column,
‘GRASSrgb’ of type ‘varchar(11)’ to hold the auto-generated color values. Use DatabaseVector
Database Connectionsadd column (or type v.db.addcol in the command line). Type the following into
the ‘Name and type’ box: GRASSrgb varchar(11), hit ‘Run’.
Close the tool, then right-click the vector in the Layer
Manager, and choose ‘set color table’. The name of the
column containing the slope data is likely to be ‘value’.
The name of the color column to populate is
‘GRASSrgb’. The type of color table is up to you, I like
byr (blue-yellow-red). Click ‘Run’. Grass will think for a
minute—it has to assign a color value to each point on
a gradational scale. That’s okay. Once it finishes
thinking and writing the colors to the GRASSrgb
column, close the tool. Right click on the vector in the
Layer Manager again, and choose ‘Properties’. In the
‘Colors’ tab, check the box reading ‘Get colors from
map table column (of form RRR:GGG:BBB)’. Leave the
other variables the same (you may check the ‘transparent’ option in the ‘Feature color’ section to
remove the border of each point). In the ‘Symbols’ tab, select the one you’d like (I prefer circles), and set
the size (~10 works for me).
F.Y.I., the v.db.addcol tool can
add any column you want.
Type varchar(11) will be able
to hold the various characters
necessary for color-coding.
The ‘value’ column contains
our extracted data from the
slope raster.
Color
column:
GRASSrgb
byr=”blue
to yellow
to red”
color scale
Outline =
transparent
(personal
preference)
Symbol
type and
size.
46
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Now that we FINALLY have a set of points extracted from within the
boundaries of our polygon, containing the values we wished to extract,
we can export the values with v.out.ogr, just like before. Right click on
the vector of points you’ve worked so hard to extract, and choose
‘Export’ (or do it from Fileexport vector mapcommon formats, OR
type v.out.ogr into the command line). Give your ‘OGR datasource’ a
name that has a full-scale file pathway tacked on the front, so you don’t
have to go hunting around for your exported data. Remember that the
file pathway can be copied from the address bar of your Windows
Explorer, just add the extra backslash and type your file name.
Remember to export as a .csv for easy import to Excel (etc). Also
remember to check the feature type box, ‘points’, and uncheck the rest.
While you’re in Excel, you can use the histogram function of the ‘Data
Analysis’ package to graphically display your results (read up on Excel’s help site to enable this package
and use it):
0
50
100
150
200
250
300
350
400
0 10 20 30 40 50
Frequency
Slope
Histogram distribution of slopes
on prominent Pine Ridge escarpment
The resulting
point vector.
Congrats!
Clear skewness towards
lower slopes
47
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
d. Sinuosity of a line:
Compared to extracting points from a polygon, this is a relatively easy task. GRASS GIS keeps a nice little
bag of tricks hidden up its sleeve in the v.to.db tool. With this handy function, you can find out the
sinuosity of your curved line, the azimuth of your straight-ish line, length, perimeter, area, you name it.
Here’s what it looks like for the main stem stream we derived earlier. Add a column to the stream
polyline with v.db.addcol, with sinuos double precision entered in for the name and data type. Make
sure that it also has a ‘cat’ column, and that the first entry in the ‘cat’ column is set to something (it may
be missing any entries, you may have to add it by hand in the attribute table). In the v.to.db tool, select
‘sinuous’ from the list of attributes to calculate, and in the ‘Optional’ tab, select your ‘sinuos’ column.
Calculated whole-reach sinuosity: 1.64
However, what if you want to look at sinuosity of specific reaches of the stream? Sinuosity the curviness
of a stream segment, and it would be helpful to see how this curviness changes over its course. To do
this, we’ll have to revisit the v.segment tool. Vectortopology maintenancesplit polylines (or type
v.segment into the command window).
Tells GRASS to calculate
sinuosity for your vector line.
I made a column named
‘sinuos’, with v.db.addcol,
specifically for this purpose.
My main-stem
stream channel.
This value is spat out into
the ‘sinuos’ column.
48
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Instead of generating points like we did earlier, we can use the same
methodology to generate a bunch of segments in sequence along the
stream, with defined lengths that can each be surveyed for sinuosity.
Half-wavelengths seem to be about 1.2 km long (you can measure full
wavelength if you’d prefer), so I’ll make segments 1.5 km in length (1500
m). I measured this distance with the ‘Measure distance’ tool on the
menu of the Map Display (make sure you’re in UTM coordinates!). As
with generating points, this could be either your hardest or easiest step in
the process. If you don’t have a ‘rules file’, you’ll have to type in each
value by hand. Bummer. You’d better make up a ‘rules file’ in Excel.
Here’s the format:
Type Segment ID
ID of line to
segment along Start of segment End of segment
L 1 1 0 1500
L 2 1 1500 3000
L 3 1 3000 4500
Create a table like this in Excel (minus the headers), highlight the whole mess, hover your cursor over
the lower right-hand corner of the selection (where it turns into a black crosshair), and drag down to
autofill in the bulk of the entries. If you don’t know the total length of your line, that’s okay. You can use
trial and error while you’re running v.segment (make sure the ‘overwrite files’ option is checked). Save
your Excel document as a delimited text file (I use tab delimited), and use it as the input for your ‘rules
file’. Here’s the first few lines of my Excel sheet, and the colorized (random colors) segment output:
Using the
distance tool to
measure half-
wavelength.
(the increment
by which I’ll
split the stream
into segments).
49
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Since the v.segment tool creates the segments but fails to take responsibility for them, we’ll have to use
v.db.addtable to create a new attribute table for our segmented line vector and toss some columns into
it (syntax for column names and type is: cat int, sinuosity double precision). Now that our main stem is
segmented and has an attribute table, we can easily use v.to.db update the new “sinuosity” column,
with the same procedure as for a single line vector.
Now, let’s change the colors the same way we did earlier (v.db.addcol will make your GRASSrgb column,
right click on your vector and set the color table to fill this column with colors according to the sinuosity,
then right click and edit the vector’s “Properties” tool to tell GRASS to color by that column). Also export
your data using v.out.ogr to create a csv file, as demonstrated several times earlier (remember, distance
values must be added by hand, using auto-fill in Excel, or more robust methodology in R).
1
1.5
2
2.5
0 50000
Sinuosity
Distance downstream (m)
Hot colors
indicate
higher
sinuosity,
cold
colors are
straighter
reaches.
Possible
zones of
channel
steepening?
50
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
e. Determining azimuth of a line:
Using v.to.db to auto-calculate line azimuths is even easier. If you already have straight line vectors (i.e.,
our lineaments from earlier, simply use v.db.addcol to create a new column for the lines’ attribute table
(AZ or azimuth are good names). Type, again, should be double precision, as the input values will likely
have decimals. In v.to.db, choose ‘azimuth’ as the value to upload and the name of your new column to
receive it. Here’s a lineament map I created earlier, and my results displayed as a rose diagram (a
‘circular histogram’) created in R and beautified in Inkscape:
Like with the sinuosity function of v.to.db, azimuth values are calculated and assigned to each line in the
vector set. Export using v.out.ogr as a csv, with a defined file pathway, and you’re all set to analyze the
data (Excel can do histograms, but the ‘circular’ package of R can do nifty rose diagrams, as seen above!)
Rose diagram
constructed in the
R computational
environment
51
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
f. Topographic profiling without the GUI tool:
If you notice, the Map Display has an ‘Analyze map’ button that, when clicked, gives the option to a)
calculate a distance, b) generate a histogram of raster values, or c) draw a topographic profile. While the
option to point-and-click a topo profile into being is a good thing, this tool only works if you’re using
UTM coordinates (for me, at least) and also fails to leave a trace of your profile once you’re finished.
Additionally, the high-resolution of the profiler may be a bit much for visual display over large distances.
To remedy these problems, you may also create one by hand.
The methodology of digitizing a line, and extracting points along that line with v.segment and a user-
created “rules file” is identical to that of the stream profile extraction we did earlier. Except this line is
already single-thread and doesn’t need cleaning! Score one for the Republic.
If you haven’t already, change the Map Display view mode from ‘2D’ to ‘Digitize’. Use the drop-down
menu on the editor toolbar that just popped up to tell GRASS you’d like to edit a “New vector map”.
Name the map something without spaces, and exit the new attribute table when it springs up. Use the
“New line” tool to draw a line across topography you’d like to profile. Add an attribute table and ‘cat’
column by clicking on your line with the “Display/Update categories” tool. Or just add it by hand in the
attribute table after exiting the editor. Exit the editor and save your edits.
New vector
line, created in
the digitizer.
Designate
new vector
The Power
button‘New line’
tool
52
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Now, open the v.segment tool (VectorTopology maintenancesplit polylines, or just type v.segment
in the command line). Use your rules file from before, of format:
P 1 1 0
P 2 1 100
P 3 1 200
P 4 1 300
Where column one is segment type (P=points), column two is the ‘cat’ ID for each new point, column
three is the ‘cat’ ID for the line you’re generating points along, and column four is the distance along the
line for each point. Create the first few points in Excel, auto-fill the rest (at least the distance length of
your line, which you can measure in the Map Display with the ‘Measure Distance’ tool), and save the
results as a delimited text file in your GRASS directory (or other convenient location) to use as your
‘rules file’ for v.segment.
Once the points are created, add a new attribute table, for the poor ‘lil points along your profile line
have none, and make sure to add the column ‘elevation’ as a double precision (syntax for the name and
type box: elevation double precision).
Next, use v.what.rast to extract values to your points from the elevation raster. (VectorUpdate
attributesupdate attributes from raster).
Finally, export your data as a .csv file using v.out.ogr and a defined file pathway. Use the autofill function
of Excel (or a more powerful program) to generate distances for each of your points.
950
1050
1150
1250
0 10000 20000 30000 40000
Elevation(m)
Distance along profile (m)
53
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
g. Creating an Isobase (local base-level) map:
Isobase maps represent an approximation of local base level, the “erosional-tectonic” surface of a
landscape (Grohmann et. al 2006). They are created by sampling elevations of Strahler 2nd
and 3rd
order
streams at evenly-distributed intervals, and interpolating the results. Second and third order streams
are incised sufficiently to differentiate local base level from surrounding hillslopes, yet lack the erosion
power of larger 4th
(and higher) order streams to erase topographic signatures. As stream channels
represent the most tectonically-sensitive component of a hillslope, a map derived from their elevations
effectively “sheds” less-sensitive terrain components and allows a clearer and simpler view of
environmental and tectonic modifications to topography. General methodology, which we can produce,
multiplies a cleaned, rasterized stream network with first-order branches removed and stream values
set to 1 (all else equal to zero) with a raster of elevation contours (10m+ resolution) to gain a new raster
of evenly-distributed pixels containing stream elevations. An isobase map is the resultant surface
interpolated from these spot elevations, whose differential features may have tectonic implications.
Figure from Grohmann et. al (2006), illustrating derivation of an isobase surface.
Let’s get started on an isobase map (next page).
54
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
To start, let’s pull up the stream network we created
with r.watershed. Notice that there are 7-8 main
channels, with many dendritic branches coming off of
each. If we sample elevations from our stream map as
it is, it’s likely that the small tributaries won’t
adequately represent the average incisional depth of
the region. In other words, we need to trim off the
smaller-order streams to reduce the noise in the
isobase map we’re working towards (Note that our
threshold value from r.watershed has already clipped
off the smallest tributaries automatically). We can
move forwards in the process once we’ve got a more
generalized map of the larger streams. To start with,
we can open up the v.clean tool to remove smaller
stream segments. However, even the main channels
of our streams are highly-segmented, and the v.clean
tool can only remove so much before it starts erasing
sizeable chunks of the main stems.
To continue any further, we’ll need to do some
clipping by hand with the digitizer tool. In the Map
Viewer, as before, change the view from ‘2D’ to
‘Digitize’, select your stream network (I’ve made a
duplicate named ‘1st
_and_2nd
_order_streams’, to
handle my edits while leaving the original network
untouched), and choose the ‘Delete feature’ tool.
After some trimming, here’s what my network
looks like:
Once you’re satisfied, you can rasterize your
streams for the next step.
Original stream
network from
r.watershed
Using v.clean to remove small
tributaries (large ‘dangles’)
After v.clean:
Finish the job
manually in
the digitizer:
55
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Rasterizing a stream network:
In order to extract elevations to representative intervals along our refined stream network (Mostly 2nd
and 3rd
-order), a raster of the streams (stream pixels=1, all else=0) must be multiplied by a raster of
contour lines (contour lines=elevation, all else=0). To get our streams ready, the trick we used to
rasterize our polygonal shape needs to be implemented to rasterize our vector lines. To do this, use
VectorMap type conversionsv.to.rast (or type v.to.rast in the command line). When the tool pops
up, input your refined vector stream network, choose a name for your output raster, and make sure that
your source of raster values is ‘val’. In the ‘Selection’ tab, check only the ‘line’ box under ‘Feature type’.
In the ‘Optional’ tab, double-check to make sure that the ‘Raster value’ field is set to 1. This will output
exactly what we want: a raster of our stream network, with stream pixels containing a value of ‘1’, and
all other spaces with a value of ‘0’.
Use ‘val’ again
to set all stream
pixels to ‘1’
We’re
using lines
Raster
value=1
The output
raster:
56
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Deriving contours from a DEM, and rasterizing them:
Create contours by accessing RasterTerrain AnalysisGenerate contours (or type r.contour into the
command line). In the tool’s window, choose your input DEM (I chose my original 10-meter DEM), and
an output name for your vector contours. In the ‘Optional’ window, specify your contour interval (in
meters, or whatever elevation unit your raster is in), and a minimum value of points necessary for a
contour (Higher numbers eliminate small closed-loop contour noise). I chose a 30-meter interval:
30-meter contour interval;
set minimum of 500 pts to
make contour line
(remove visual ‘noise’)
30-meter
contours!
57
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Rasterizing contour lines, retaining vector values:
Now that you have your vector contour lines, (which automatically contain elevations for their value),
they need to be rasterized. The process is similar to rasterizing a stream line or landform shape, except
this time we’d like the raster to retain elevation values (else, we’ll have to multiply them with the Raster
Calculator, adding an unnecessary step!). To do this, open the same tool we’ve been using to rasterize
things, v.to.rast (look in the vector menu or type v.to.rast in the command line). In the same old tool
window, we have two very important changes to make: The source of raster values needs to be set to
‘attr’, and in the previously-unused ‘Attributes’ tab, the ‘Name of column for ‘attr’ parameter should be
set to our elevation column (my column is named ‘level’). Other than that, everything is the same. Hit
‘Run’.
The output is a raster of contour elevations. Now, we can move on to the next step.
This time, use
‘attr’. We want
to keep the
vector values!
Upon generation,
our elevations
were placed in the
‘level’ column.
This defines the
‘attr’ parameter.
Our new
contour
raster,
colorized
by height:
58
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Raster Map Calculator (even more Map Algebra!):
Now that we have a raster of contour elevations and a raster of our stream network, we can prepare for
our isobase surface interpolation by multiplying the two rasters together. This will result in a fairly
evenly-distributed raster of spot elevations—wherever streams cross contour lines. Although we could
have used some map algebra to give every stream pixel an elevation and interpolate from that, the
resulting isosurface would be unfairly weighted, biased towards stream channels. This way, we’ll get a
smoother, more representative isosurface. In the Raster Map Calculator, here’s what it will look like:
Although the output isn’t much to look at, we’re ready for a surface interpolation.
Multiply contour raster
by stream raster.
The map of
intersections,
each assigned
an elevation.
Not much to
look at yet.
59
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Interpolating a surface from raster points:
Now that we have a raster of spot elevations for 2nd
and 3rd
-order streams, we can use a surface
interpolation tool to generate our isobase map. There are several methods to choose from, but I prefer
the inverse distance-squared weighting of the r.surf.idw tool to do the job. RasterInterpolate
surfacesIDW from raster points. In the ‘Optional’ section, you may specify the number of existing
points you’d like to reference for each newly-created pixel. The default is 12. A higher number of points
will generalize your surface further. Make your choice (you can always overwrite later with a different
number), and hit ‘Run’. It may take a few minutes to generate your isobase surface; don’t worry, GRASS
is hard at work and will produce results at the end!
It turns out that I did need to adjust my number of interpolation points—12 produced a blocky map,
increasing to 40 made for a much smoother display. Note the quick-n-dirty revision of the quick-n-dirty
lineament map from earlier.
Isobase first
attempt. Pretty
blocky!
I upped the
number of points
to factor into each
interpolation to 40.
Isobase, second
attempt. Much nicer!
Add isobase contours
and inferred lineaments.
60
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Teaser: viewing surfaces in NVIZ:
In the GRASS environment, a nice 3D
visualization tool called NVIZ exists.
(FileNVIZ). You may display any
sort of elevation data, overlay any
vector files, and intuitively choose
camera angles and lighting
conditions. Here’s a peek of our new
isobase surface in NVIZ. Notice it’s a
bit rough around the edges
(literally!), but it has potential to
look good, and can serve you well—
all you have to do is tinker with it.
The reason I’m writing this portion is
that there’s a trick to using it in
lat/long projections. In UTM
coordinates, like I’m using, things are AOK. Everything stretches correctly because everything is in the
same units (meters). In lat/long coordinates, however, surfaces in NVIZ will appear distorted and darkly-
shadowed. The reason for this is, while elevation units are still in meters, horizontal units are in arc-
seconds! This means you’ll have elevation values of 1500m or 3667m, but distances between them of
0.003 or 0.05 (degrees). Needless to say, NVIZ thinks that you have an immensely high elevation, with an
immensely great change over 0.05 meters of horizontal change! No wonder the output is blotchy and
dark. To fix this, use the Raster Map Calculator to divide your lat/long projected DEM by 111120, the
correct conversion factor from meters to degrees. Then, use your manually skewed DEM as the
elevation raster for NVIZ—the results will look much better. (In case you weren’t paying attention, this is
only necessary for lat/long projections, NOT utm, which are fine as they are).
First glimpse of NVIZ’s 3D
capabilities. Beat that, ArcScene!
61
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
VI. Epilogue: Why you should use R to plot your data
Although the general trend in undergraduate geoprocessing is to plot your smaller datasets in Excel,
there are a multitude of reasons to use a more robust (albeit less intuitive) object-oriented interface like
R (or Matlab). Let me, in the space of a page, attempt to convince you.
1) Excel costs money. R is free, under the GNU license.
No description necessary for this one! Free is often better, especially when the free option is more
robust and powerful than the expensive one.
2) Although it’s reassuring to see your data and graphs on the same page, it’s hard to organize
when everything’s smashed together.
In R, you import data as a table, convert to a matrix or extract column vectors, and store each piece
of data separately, in neatly-arranged variables. This means if you’d like to multiply one column of
data by another, you know exactly where to find them and exactly what their dimensions are.
3) Although controls are fairly point-and-click and user-friendly in Excel, many tasks are by hand!
You can type A1*B1 in column C to get an answer, but you have to drag-down this calculation (or
double-click the crosshairs) to apply it to ALL of columns A and B. Any sort of manipulation
performed on column vectors (which is what each column of data is) must be manually performed in
some way. When you make a plot of your data, you have to manually alter the default parameters
to get the display you really want (which is often, if not all the time for me). In R, all of the processes
that are manual in Excel may be easily performed with a few keystrokes! This makes it faster in the
long run, as well as neater and less of a pain if you screw up and have to re-do something.
4) Excel’s graphics must be heavily-tweaked to reach professional standards.
Admittedly, so do R’s graphics. The difference, however, lies in the fact that you can type in all the
parameters you want to change as part of the plot function, and re-use the ones you like later with
virtually no effort. Thus, the click-that-button, open-that-window, change-that-font, alter-the-line-
weight, change-the-color-and-outline-of-markers, change-the-scale, change-that-axis-label, change-
that-other-axis-label pain-in-the-rear routine becomes much more streamline and efficient,
especially if you’re mass-producing graphs of similar type.
5) Excel just can’t do certain things.
Would you like to visualize 3D data (x,y,z coordinates, for example)? Would you like to create a rose
diagram (circular histogram, for directional data)? Well, sorry! Because Excel doesn’t know how to
do those things. Period. Why? Because Excel is a business and economics spreadsheet program. R is
a computational environment for data and graphics. The underlying function of R is much better
suited for scientific use. And if you can’t find what you need, you can likely find a plugin that does
what you want from the CRAN server (where all things good and R come from).
The only drawback to using R is the glaringly blank user interface, and overwhelmingly non-intuitive (at
first) controls. The solution: download RStudio or Rcommander (user-friendly interfaces specifically
made for the R environment). Read a few intro tutorials (I will create one shortly). Things become clear,
and you’ll sure be glad you took the time to learn it.
62
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Two plots I made in R (I did add a few final touches in Inkscape):
63
This and more at my website: https://sites.google.com/site/sorsbysj/
LinkedIn: https://www.linkedin.com/in/skylersorsby
Glossary of terms
GIS: Geographic Information System. A software package that processes and displays geospatial data.
ArcGIS: the industry standard professional GIS platform, developed by ESRI. It is intuitive to use.
GRASS GIS: Geographic Resources Analysis Support System. An open-source GIS equivalent in many
respects to ArcGIS, but less intuitive.
Raster: gridded data assembled as a sheet of pixels. Photographs are raster images. Elevation models
are raster images. This format is useful for describing continuous data with high textural variation.
Vector: a polygon, line, or point. These features are expressed as a function of equations and lines, and
retain crisp, sharp edges when scaled.
DEM: “Digital Elevation Model”. A raster containing spatial coordinates and a height value for each pixel.
These are digital versions of topographic base maps.
NED: National Elevation Dataset. Many elevation modules in The National Map derive from this source.
Lidar: Light Detection and Ranging. A laser-scanned topographic model, precise to within several
horizontal meters, and several vertical centimeters.
Isobase: aka base-level. The elevation level that hillslopes attempt to erode down to. “Topographic
equilibrium level”.
Sinuosity: The ‘curviness’ of a line. This is measured for channel segments by dividing the shorest,
straight-line distance between two points on a river by the length of river between them.
Map Algebra: whole-raster math, with a calculation applied to each pixel (slope maps are derived with
map algebra).
Helpful guides to learning GRASS GIS (available online as pdfs):
“Introduction to GRASS GIS software” by Markus Neteler
“GRASS 6 in a nutshell” by Markus Neteler, for the Open Source Geospatial ’05 Conference
“GRASS GIS for Geomorphologists: An introductory guide” by Andrew Wickert
Some nice innovations for studying morphotectonism:
Grohmann, CH, 2004. “Morphometric analysis in geographic information systems: applications of free
software GRASS and R”. Computers and Geosciences, Issue 30: Elsevier Ltd. p.1055-1067.
Grohmann, CH, Riccomini, C, and Alves, FM. 2007. “SRTM-based morphotectonic analysis of the Pocos
de Caldas Alkaline Massif, southeastern Brazil”. Computers and Geosciences, Issue 33: Elsevier
Ltd. p. 10-19.

More Related Content

What's hot

Height measurement of aerial photograph
Height measurement of aerial photographHeight measurement of aerial photograph
Height measurement of aerial photographvidyasagar university
 
Surveying ii module iii class 1,2
Surveying ii module iii class 1,2Surveying ii module iii class 1,2
Surveying ii module iii class 1,2SHAMJITH KM
 
Numbering system of topographical map
Numbering system of topographical mapNumbering system of topographical map
Numbering system of topographical mapMithun Ray
 
Lec_6_Intro to geo-referencing
Lec_6_Intro to geo-referencingLec_6_Intro to geo-referencing
Lec_6_Intro to geo-referencingAtiqa khan
 
Geographic coordinate system & map projection
Geographic coordinate system & map projectionGeographic coordinate system & map projection
Geographic coordinate system & map projectionvishalkedia119
 
Photogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and ParallaxPhotogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and ParallaxAhmed Nassar
 
Topic stereoscopy, Parallax, Relief displacement
Topic  stereoscopy, Parallax, Relief displacementTopic  stereoscopy, Parallax, Relief displacement
Topic stereoscopy, Parallax, Relief displacementsrinivas2036
 
Dgps seminar
Dgps seminarDgps seminar
Dgps seminaranand0030
 
Aerial photographs
Aerial photographsAerial photographs
Aerial photographsNaresh Kumar
 
Triangulation and trilateration pdf...
Triangulation and trilateration pdf...Triangulation and trilateration pdf...
Triangulation and trilateration pdf...Gokul Saud
 
Distortions and displacement on aerial photograph
Distortions and displacement on aerial photographDistortions and displacement on aerial photograph
Distortions and displacement on aerial photographchandan00781
 
Height measurement of aerial photography
Height measurement of aerial photographyHeight measurement of aerial photography
Height measurement of aerial photographyvidyasagar university
 
Chapter 5: Remote sensing
Chapter 5: Remote sensingChapter 5: Remote sensing
Chapter 5: Remote sensingShankar Gangaju
 
Lecture01: Introduction to Photogrammetry
Lecture01: Introduction to PhotogrammetryLecture01: Introduction to Photogrammetry
Lecture01: Introduction to PhotogrammetrySarhat Adam
 

What's hot (20)

Height measurement of aerial photograph
Height measurement of aerial photographHeight measurement of aerial photograph
Height measurement of aerial photograph
 
Surveying ii module iii class 1,2
Surveying ii module iii class 1,2Surveying ii module iii class 1,2
Surveying ii module iii class 1,2
 
Numbering system of topographical map
Numbering system of topographical mapNumbering system of topographical map
Numbering system of topographical map
 
Lec_6_Intro to geo-referencing
Lec_6_Intro to geo-referencingLec_6_Intro to geo-referencing
Lec_6_Intro to geo-referencing
 
Stereoscopic parallax
Stereoscopic parallaxStereoscopic parallax
Stereoscopic parallax
 
Geographic coordinate system & map projection
Geographic coordinate system & map projectionGeographic coordinate system & map projection
Geographic coordinate system & map projection
 
Photogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and ParallaxPhotogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and Parallax
 
Microwave remote sensing
Microwave remote sensingMicrowave remote sensing
Microwave remote sensing
 
datum
datumdatum
datum
 
Stereoscopic vision
Stereoscopic visionStereoscopic vision
Stereoscopic vision
 
Topic stereoscopy, Parallax, Relief displacement
Topic  stereoscopy, Parallax, Relief displacementTopic  stereoscopy, Parallax, Relief displacement
Topic stereoscopy, Parallax, Relief displacement
 
Stereoscopic Parallax
Stereoscopic ParallaxStereoscopic Parallax
Stereoscopic Parallax
 
Types of Map Scales
Types of Map ScalesTypes of Map Scales
Types of Map Scales
 
Dgps seminar
Dgps seminarDgps seminar
Dgps seminar
 
Aerial photographs
Aerial photographsAerial photographs
Aerial photographs
 
Triangulation and trilateration pdf...
Triangulation and trilateration pdf...Triangulation and trilateration pdf...
Triangulation and trilateration pdf...
 
Distortions and displacement on aerial photograph
Distortions and displacement on aerial photographDistortions and displacement on aerial photograph
Distortions and displacement on aerial photograph
 
Height measurement of aerial photography
Height measurement of aerial photographyHeight measurement of aerial photography
Height measurement of aerial photography
 
Chapter 5: Remote sensing
Chapter 5: Remote sensingChapter 5: Remote sensing
Chapter 5: Remote sensing
 
Lecture01: Introduction to Photogrammetry
Lecture01: Introduction to PhotogrammetryLecture01: Introduction to Photogrammetry
Lecture01: Introduction to Photogrammetry
 

Similar to Introduction to geomorphology in GRASS GIS - by Skyler Sorsby

Open Source GIS
Open Source GISOpen Source GIS
Open Source GISJoe Larson
 
JGrass and uDig, chronicles of a lovestory
JGrass and uDig, chronicles of a lovestoryJGrass and uDig, chronicles of a lovestory
JGrass and uDig, chronicles of a lovestoryAndrea Antonello
 
Argis manual gratuito
Argis manual gratuitoArgis manual gratuito
Argis manual gratuitoluismate
 
Getting your Data Out There: An Introduction to Distributed GIS
Getting your Data Out There:An Introduction to Distributed GISGetting your Data Out There:An Introduction to Distributed GIS
Getting your Data Out There: An Introduction to Distributed GISJohn Reiser
 
Foss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopFoss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopAndrea Antonello
 
Free open source gis
Free open source gisFree open source gis
Free open source gisAshok Peddi
 
Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Joanne Cook
 
Gtkwebgis third ch_one_reduced
Gtkwebgis third ch_one_reducedGtkwebgis third ch_one_reduced
Gtkwebgis third ch_one_reducedKhadijaKhan52
 
FOSS4G2018: presentation of the app Geopaparazzi
FOSS4G2018: presentation of the app GeopaparazziFOSS4G2018: presentation of the app Geopaparazzi
FOSS4G2018: presentation of the app Geopaparazzisilli
 
Sistemi Informativi Territoriali e Software Libero
Sistemi Informativi Territoriali e Software LiberoSistemi Informativi Territoriali e Software Libero
Sistemi Informativi Territoriali e Software LiberoMaurizio Napolitano
 
Introduction to Geographic Information System (GIS)
Introduction to Geographic Information System (GIS)Introduction to Geographic Information System (GIS)
Introduction to Geographic Information System (GIS)Shashank Singh
 
map3d_mapguide_postgis
map3d_mapguide_postgismap3d_mapguide_postgis
map3d_mapguide_postgisPrasad PANDIT
 
My GIS Timeline
My GIS TimelineMy GIS Timeline
My GIS Timelinejeffhobbs
 
Azlina5 road ahead
Azlina5 road aheadAzlina5 road ahead
Azlina5 road aheadAzlina Mahad
 
Path Finding In Hazad Terrain
Path Finding In Hazad TerrainPath Finding In Hazad Terrain
Path Finding In Hazad TerrainOren Koler
 
Geopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulGeopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulHirofumi Hayashi
 
Geographic information system and remote sensing
Geographic information system and remote sensingGeographic information system and remote sensing
Geographic information system and remote sensingchala hailu
 

Similar to Introduction to geomorphology in GRASS GIS - by Skyler Sorsby (20)

Geoinformatics handbook
Geoinformatics handbookGeoinformatics handbook
Geoinformatics handbook
 
Open Source GIS
Open Source GISOpen Source GIS
Open Source GIS
 
JGrass and uDig, chronicles of a lovestory
JGrass and uDig, chronicles of a lovestoryJGrass and uDig, chronicles of a lovestory
JGrass and uDig, chronicles of a lovestory
 
Argis manual gratuito
Argis manual gratuitoArgis manual gratuito
Argis manual gratuito
 
Argis manual gratuito
Argis manual gratuitoArgis manual gratuito
Argis manual gratuito
 
Getting your Data Out There: An Introduction to Distributed GIS
Getting your Data Out There:An Introduction to Distributed GISGetting your Data Out There:An Introduction to Distributed GIS
Getting your Data Out There: An Introduction to Distributed GIS
 
Bcs Talk Notes
Bcs Talk NotesBcs Talk Notes
Bcs Talk Notes
 
Foss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi WorkshopFoss4g2016 Geopaparazzi Workshop
Foss4g2016 Geopaparazzi Workshop
 
Free open source gis
Free open source gisFree open source gis
Free open source gis
 
Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Lancaster University GIS Course 2010
Lancaster University GIS Course 2010
 
Gtkwebgis third ch_one_reduced
Gtkwebgis third ch_one_reducedGtkwebgis third ch_one_reduced
Gtkwebgis third ch_one_reduced
 
FOSS4G2018: presentation of the app Geopaparazzi
FOSS4G2018: presentation of the app GeopaparazziFOSS4G2018: presentation of the app Geopaparazzi
FOSS4G2018: presentation of the app Geopaparazzi
 
Sistemi Informativi Territoriali e Software Libero
Sistemi Informativi Territoriali e Software LiberoSistemi Informativi Territoriali e Software Libero
Sistemi Informativi Territoriali e Software Libero
 
Introduction to Geographic Information System (GIS)
Introduction to Geographic Information System (GIS)Introduction to Geographic Information System (GIS)
Introduction to Geographic Information System (GIS)
 
map3d_mapguide_postgis
map3d_mapguide_postgismap3d_mapguide_postgis
map3d_mapguide_postgis
 
My GIS Timeline
My GIS TimelineMy GIS Timeline
My GIS Timeline
 
Azlina5 road ahead
Azlina5 road aheadAzlina5 road ahead
Azlina5 road ahead
 
Path Finding In Hazad Terrain
Path Finding In Hazad TerrainPath Finding In Hazad Terrain
Path Finding In Hazad Terrain
 
Geopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulGeopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 Seoul
 
Geographic information system and remote sensing
Geographic information system and remote sensingGeographic information system and remote sensing
Geographic information system and remote sensing
 

Recently uploaded

Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxJorenAcuavera1
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)itwameryclare
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxFarihaAbdulRasheed
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfWildaNurAmalia2
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptJoemSTuliba
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naJASISJULIANOELYNV
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 

Recently uploaded (20)

Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptx
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.ppt
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by na
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 

Introduction to geomorphology in GRASS GIS - by Skyler Sorsby

  • 1. Geomorphology in A 'how-to' manual by Skyler Sorsby
  • 2. 1 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Geomorphic tools in GRASS GIS: an open-source equivalent to ARC GIS functionality By Skyler Sorsby Contents Item Page I. Introduction………………………………………………………………………………………………………………………………………..2 II. To begin (3-10) a. Downloading data from the National Map………………………………………………………………………………….3 b. Start GRASS GIS…………………………………………………………………………………………………………………………..4 c. Create a new layer/mapset………………………………………………………………………………………………………5-7 d. Import data……………………………………………………………………………………………………………………………8-10 III. Rasters (11-25) a. Mosaic Rasters……………………………………………………………………………………………………………………. 11-12 b. Clip Rasters……………………………………………………………………………………………….............................12-13 c. Project a Raster……………………………………………………………………………………………………………………14-19 d. Downsampling…………………………………………………………………………………………………………………………. 20 e. Hillshades………………………………………………………………………………………………………………………………….21 f. Hypsometric overlay………………………………………………………………………………………………………………… 22 IV. Hydrologic analysis (focusing on stream profiles) (26-39) a. Watershed delineation……………………………………………………………………………………………………………..23 b. Raster to vector……………………………………………………………………………………………………………………….. 24 c. Cleaning vectors………………………………………………………………………………………………………………………. 25 d. Isolating a main channel (polyline)……………………………………………………………………………………….26-27 e. Generate points along a line……………………………………………………………………………………………………..28 f. Create attribute table for a feature………………………………………………………………………………………29-30 g. Calculating upstream drainage area (Map Algebra)……………………………………………………………..31-32 h. Extract (raster) values to points……………………………………………………………………………………………….. 33 i. Export data to Excel (or R or Matlab)……………………………………………………………………………………34-35 V. Other topographic analyses (40-60) a. Create a slope map……………………………………………………………………………………………………………………36 b. Digitize features…………………………………………………………………………………………………………………..37-39 c. Extract points from a polygon (for binning geomorphic surfaces)………………………………………(40-46) i. Vector to raster……………………………………………………………………………………………………….40-41 ii. Downsample raster and assign new values to it...……………………………………………………….. 42 iii. Raster to points……………………………………………………………………………………………………… 43-44 iv. Color coding points by a field…………………………………………………………………………………. 45-46 d. Sinuosity of a line…………………………………………………………………………………………………………………47-49 e. Determine azimuths of lineaments (multiple)………………………………………………………………………….. 50 f. Topographic profiling (without the GUI tool)……………………………………………………………………….51-52 g. Isobase (base level) maps…………………………………………………………………………............................ 53-60 VI. Final note, terminology, and further references…………………………………………………………………….....61-63
  • 3. 2 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby I. Introduction Incorporation of Geographic Information Systems (GIS) into geomorphic study enables the user to perform larger-scale, quantitative geospatial analysis than is possible or feasible with paper topographic maps. Additionally, the ability to digitally map (“digitize”) geologic, geomorphic, and geographic features powerfully augments traditional field-based techniques. While a public license for the industry standard software, ArcGIS, runs for hundreds to several thousands of dollars, open-source equivalents like GRASS GIS and QGIS perform most of the same functions for free. Although the user interface of GRASS GIS presents a less intuitive alternative to ArcGIS, robust algorithms and modular tools equip geomorphologists with a strong platform for raster and vector-based geospatial calculations including watershed delineation, stream profile construction, terrain curvature, aspect, and slope calculation, topographic profiling, digital mapping, and isobase surface creation. Using these tools to accompany field-based investigation, or perform a preliminary assessment of a study area provides a quantitative edge to solving a myriad of geological problems. In this guide, I walk through particular application of GRASS GIS to the digital study of geomorphic landforms. On a more personal note… I’m assuming that many of you, like myself, have had exposure to the quantitative power of GIS systems but feel a bit lost when attempting to perform more extensive tasks within them. “What exactly can I do with GIS?” “How do I go about doing it?” “What do the different tools do, and which of them do I actually need?” Or perhaps, you’re disillusioned by the exorbitant cost of mainstream GIS platforms, like Arc. “How can I use GIS if I can’t afford ArcGIS?” The answer to this last question is simple; the first few will take a bit of explaining. The Army Corps of Engineer created GRASS as a powerful, freely-available GIS under the GNU public license (http://www.gnu.org/licenses/gpl.html). GRASS GIS contains the computational power and analytical structure to perform virtually any spatial analysis task needed in common practice, with new tools and upgrades implemented in successive versions (the current stable version is GRASS 6.4.3). This means that notable shortcomings of a current version are likely to be addressed and remedied in the near future. The structure of GRASS combines a large database of modular tools with a newer, more intuitive GUI (Graphical User Interface). Subsequently, access to the diverse functionality of GRASS is becoming increasingly more accessible to the general scientific community. The GRASS project website (http://grass.osgeo.org/) contains many useful tutorials and tips for beginners, as well as a comprehensive library detailing individual functions. Fortunately, every tool within the GRASS interface is accompanied by varying levels of detailed help in a special tab entitled ‘Manual’. These helpful resources, coupled with a large user-support community, make learning GRASS realistic and rewarding. As to the types and uses of the various tools within GRASS, I hope to illustrate a wide range of applications in this document. This guide is organized as a series of workflows to accomplish certain end- goals, yet each task clearly (I hope) illustrates how to use a variety of GRASS’ features. Many tasks are accompanied by screenshots, showing exactly how I obtained my results. Several high-utility tools are used repeatedly, giving a multi-angled view of their usage. My primary interest in GIS pertains to quantitative geomorphic analysis. However, most of the workflows, tools, and ideas may be applied abstractly to produce useful data in entirely different fields. Geology, after all, does not contain the entire sum of topics requiring spatial analysis. The reason I’ve compiled these specific routines and workflows is twofold: First, because I’ve either failed to find another GRASS workflow accomplishing my specific goal, or they’ve been buried deep within troubleshooting and Q&A blog websites. It is my hope that some of the following instructions satisfy some of your unanswered questions.
  • 4. 3 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby II._To Begin a. Downloading data from the National Map: This is the starting point for performing topographic analysis in GIS, unless you have a different online source for elevation data (like OpenTopography or Natural Earth), or someone handed you some lidar on a USB drive.The first thing to do is find the website. This isn’t as easy as you would think, as it’s run through the USGS website, and has been recently updated. Here is the URL to get to the download platform: http://viewer.nationalmap.gov/viewer/ In order to get elevation data from the National Map Viewer, click the ‘Download’ button on the toolbar, which is symbolized by a down arrow. From there, you have a myriad of choices for how to select your data—I just choose to drag a bounding box. Once this is accomplished, It will ask you for the type of data you want (elevation), and subsequently what type of elevation data and what format. Don’t ask me the difference betweem ArcGRID and GridFloat-I don’t particularly know or care. But I do usually go with ArcGRID format. Hit ‘Next’. The available data should highlight in red, and the pane on the left side of the screen should display your data product. Click it, and note that, below, there are some hyperlinks to download your data chunks. Do so. If your selection spans several datasets, you will have several chunks to merge together in GRASS later. Your data should download as an .adf file (Arc Binary GRID, for when you import into GRASS). If you are confused about which file is your DEM, there are helpful guides online, none the least from the USGS. Place your files in an easily-accessible location (and make sure they’re unzipped!). The National Map download platform Choose ‘download data’ ‘draw bounding box’ You want elevation data 1 arc sec=30m resolution, 1/3 arc sec=10m resolution Make sure you look up the file type so you can find your downloaded DEM later! I like ‘ArcGrid’ format
  • 5. 4 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby b. Open the GRASS GIS browser. This is the launch screen. From this window, you can create several things called ‘locations’ and ‘mapsets’. You can also set your database folder. When I first tried to figure out how to use GRASS, this greatly confused me. Your database folder (I’ve named mine ‘demo database’) will contain all of your mapping projects, even those for different study areas. Accordingly, you will probably ever need only one of these. Within this database folder, you will create different ‘locations’, in effect different projects focusing on different study areas. Within each ‘location’, you may have several ‘mapsets’. These partition your huge volume of geospatial data into smaller divisions. We’ll be creating different mapsets for different pieces of data—watershed analyses, lineament mapping, isobase calculation, etc. c. Create a new location and mapset Now that the basics of GRASS archiving are covered, we need to get started. To do this, click “location wizard” (in some versions of GRASS: “new location”). Your first step to becoming a GRASS user.
  • 6. 5 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Next, choose your directory (again, mine is ‘demo database’), name your mapset (default is ‘newLocation’), and name your title. I will name my location “PineRidge_rangefront”, according to my study area. Click next. Now, you arrive at a screen asking for the projection of your coordinate system. I have screwed up here multiple times. If you already have data, which you do, you can just tell GRASS to choose same coordinate system (“Read projection and datum terms from a georeferenced data file”). Alternatively, if you know what projection your data is in, you may choose its code or name from a list. However, my data is already georeferenced (it’s a 10-meter DEM from the National Map), so I’ll choose its .adf file (the DEM itself) to match. If you aren’t sure which file is your main datafile, look to see which one is the largest size. Also, helpful guides are available online (google ‘DEM file formats’. Arc Binary GRID=.adf, GeoTIFF=.tiff, ArcFloat=.flt, etc.). Clicking ‘next’, and ‘finish’ will trigger a query in GRASS: “Do you want to import the data source used to create the location?” Your answer: Yes, don’t mind if I do. The folder where you’ll store all of your projects What’s the name of this project? If you already have data (i.e., NED data from the National Map), this is the easiest option.
  • 7. 6 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby This has several advantages. First, your data will be automatically imported to your mapset as a GRASS raster. Second, your region will be set to fit your data. If you select ‘no’ at this step, you will wind up having to do both these things by hand (we will do this anyway, just to show how it’s done). If you chose ‘yes’, GRASS will spend a moment deep in thought while it converts your data. Once it’s loaded, you may choose to add a new mapset. We will be adding several later, so there isn’t a pressing need to create just one now. I choose ‘no’. Now, after this long and tedious process, you may select the ‘PERMANENT’ mapset within your location. A note about the ‘PERMANENT’ mapset: This is a special mapset, from which data may be seen and used by other, created mapsets. However, other, created mapsets will be unable to share data amongst themselves. For this reason, it’s good to have all your basemap data (i.e., elevation rasters, etc) in the ‘PERMANENT’ mapset. Click ‘Start GRASS’. Heck yes, I want to import! This is my downloaded DEM file. Look up some common file types and become familiar with the naming schemes
  • 8. 7 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby When the GRASS GIS GUI (Graphical User Interface: what lets scientists who don’t know programming use GIS) launches, you will see two screens: The layer manager and the map display. These names are intuitive; you work on your layers and process your data generally in the layer manager, and see the visuals in the map display. Your new location The core mapset (create others if you wish)
  • 9. 8 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby d. Importing data Earlier, we imported an elevation model raster (DEM) when we made our mapset. We even set the mapset’s region to fit that raster. Now, let’s display it. Choose “Add raster”. There it is, the only piece of data in our set. There’s our raster, right front-and-center in all its Technicolor glory! However, our study area is larger than this, and extends to the East another quadrangle. To get the other chunk of data imported, choose Fileimport raster datacommon format. Up pops the import screen, asking you for the location and format of your new data. It may require a bit of legwork outside GRASS to determine the format of your data. The National Map generally downloads DEM’s to Arc/Info Binary Grid (.adf) format, so that’s what I’ll choose. The National Map’s data handling scheme labels all DEM’s (at least that I’ve downloaded) as w001001.adf. You may have to dig through your download folder to get it. This will cause a problem, because your other, original DEM is named w001001. So, to fix this, I change the name GRASS assigns to it to w001002. You can do this easily within the ‘Import raster data’ window, where you already are: The Layer Manager. You can edit properties and view attributes here. Right click on your data to see some options The Map Display. Visual effects here
  • 10. 9 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby You shouldn’t have to tell grass to force your Lat/Lon map to do anything, or tell it to override the new DEM’s projection. If you have to do this, you’re probably doing something wrong, and need to change your mapset projection type to match that of your data. Now that your new data is imported, where is it?? To view it as well as your old data, select both in the layer manager. Next, in the map viewer, choose the “zoom in to selected map layers” button. Name your imported data Know your file type! My dem is in .adf format I downloaded ArcGrid format
  • 11. 10 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Now, we can see both of the DEM’s. However, they are still separate entities, as illustrated by the separate color scales. Select both rasters in the layer manager, right click on them, and choose “Set computational region to selected map(s)”. This is important, and will haunt you whenever you try to do a conversion, display, or calculation on a raster not currently in your computation region. This is, however, the correct fix. Now that the computational region is extended, go to the ‘Raster’ menu, and select Overlay rasters r.patch. First piece of data (auto-imported) Second piece of data (imported by hand) Note the different color scales. We need to make these into one piece!
  • 12. 11 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby II._Working with rasters a. Mosaicking rasters with R.patch: In r.patch, choose both of your input rasters, and a name for your output rasters. The data is 10-meter resolution, so I’m calling it PineRidge_10m. There are various options here, notably, the “allow output files to overwrite existing files”. This may be handy if you screw up the first time, and need to re-do whatever GRASS command you’re re-doing (This option is present in pretty much every GRASS tool). Click ‘Run’, and note that, when it’s finished, GRASS will place the output into the layer tree. So, just watch and wait. My two elevation rasters Find more help here!
  • 13. 12 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Here’s the output: Now, this is much nicer looking, and it’s all one piece. However, I want to zoom in on a small portion of the study area to focus on. b. Clip raster to smaller extent: The area to the Northeast edge of Pine Ridge looks desirable, so I’d like to clip the map to that extent. To do this, you’ll need to use g.region to constrain your calculation area—there are several ways to do this. The first (and most tedious) is to manually enter coordinates for the eastmost, southernmost, northmost, and westmost extents of your new area. A better way is to utilize heads-up digitizing to create a polygon of our desired area, then restrain our area to just that polygon. To start heads-up digitizing, choose ‘digitize’ in the map display instead of ‘2D view’. This will reveal an additional toolbar, and require you to choose a vector to digitize/edit. Since there isn’t one yet, choose ‘new Vector map’. It will prompt you to name it; I named mine study_area. Now, use the ‘digitize new area’ button, and click some vertices on the map. When done, right click to finalize the polygon. A new dialogue box, asking you to okay the new creation will appear. Click ‘ok’. The new shapefile’s attribute table will pop up too. Click out of it. Now, both of my elevation rasters are joined. In other terms, ‘my DEMs are mosaicked’
  • 14. 13 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Now, your display should look something like this: Click the power button on the digitizer display. Affirm that yes, you do want to save the changes to the new vector map. If you wish, right click on the new shapefile in the layer manager, and choose ‘Properties’. In the ‘colors’ tab, choose the area fill to be transparent. Now, right click on the shapefile in the layer manager, and choose “set computational region from selected map(s)”. This will restrain all further work to an area the shape and size of your polygon. Also use SettingsRegiong.region to restrict the display to a box the size of your polygon. Next, we use the “Map Algebra” function to create a new elevation raster of the same area as our polygon. The Map Algebra dialogue box is quite confusing to the newcomer, and it is rather unclear how to tell it exactly what to do. Enter the name of the new raster map in the correct box. Select the existing raster map where requested, which will put the full raster name (in quotes) into the calculation box. Since all we wish to do (for now) is restrict to the polygon’s shape, and since the calculation region is already set to the polygon’s shape, just click “run”. [NOTE: for a pictorial example, skip ahead to the ‘Map Algebra’ section, you may need to.] The new raster will be in the shape and dimensions of a box whose boundaries include the outermost vertices of your digitized polygon. I haven’t found a method for creating a non-box shaped region yet… Now that we have trimmed the raster to our area of focus, we should project our data to a new coordinate system: UTM. Currently, our National Map data is in lat/long coordinates. The difference here is that lat/long counts distance in degrees/minutes/seconds and elevation in meters, while UTM (Universal Transverse Mercator) sees all spatial variation in terms of meters. The reasons for changing to UTM coordinates are many; however, the simple answer is that most geospatial processing simply isn’t built to work in a coordinate system without a uniform unit for x, y, and z dimensions. Fortunately, we are in luck: the only other programs that intuitively do a projection change well cost hundreds to thousands of dollars! My new raster will be the size of the smallest rectangle that can contain my digitized polygon
  • 15. 14 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby c. Project to UTM coordinates: To do this, you’ll need to exit GRASS and restart. The first step is to create a new location with a different projection system. Now, I can do what I want. My data is imported, and I can choose the new projection. Doing this from a list is the easiest way.
  • 16. 15 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Since we’re taking our existing data and projecting into new coordinate system, I find it easiest to choose one from a list: Universal Transverse Mercator (UTM) does things in meters, so it’s the desirable projection to work in. Find it here… …Or type it in here! The earth is curved, so projections vary across its surface. Look up the correct zone for your data. (a table covering the U.S. UTM zones in on the next page)
  • 17. 16 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby The UTM zone you choose depends on where you are. Different longitudes project differently, and require the correct zone. Here is a map of UTM projection zones in the USA (google: UTM zones): Since I’m working with data from the panhandle of Nebraska, I choose zone 13. Next, it asks you to specify your geodetic datum. I prefer NAD 1983. I use nad83. If you’re curious about the different types, see the ‘Help’ page.
  • 18. 17 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Next, you may get a screen asking which transformation you’d like. I’ll stick with the default (0). Now that you have things set up, you can launch the ‘PERMENANT’ mapset of your new UTM-projected location. Once your layer manager and map display pop up, you can re-project your old lat/long data from our previous location into UTM coordinates. To do this, use:
  • 19. 18 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Rasterdevelop raster mapr.proj Due to GRASS’ inability to project things on-the-fly, the only (and right) way to change your projection is to do so in a totally different workspace. Because of this, the r.proj command is built to take data from a different location, stretch and resample it, and create a projected version of the file in the new location. r.proj will ask you for the ‘location’ containing your raster, its name, the name to call the new map, resampling methods, and resolution. BUT FIRST, to make all of this happen, we need to do some preliminary leg-work. In the ‘Target’ tab of r.proj, check the “Print input map’s bounds in the current projection and exit” box. This will tell us the extents of the old map in the new location, so we can use g.region to resize our calculation area: Resolution: 1 arc-second = 30 meters. 1/3 arc-second = 10 meters. 1/9 arc-second = 3 meters. My data is a res. of 10 meters. Check this box to find out your data’s bounds in UTM coordinates.
  • 20. 19 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Checking the box tells r.region that no, we don’t want to actually import the raster yet, because our region isn’t set, but we wish to know the bounds of the map so we can set the region by hand. Here’s the output of r.proj adjacent to the g.region window, with the updated region settings: Now you can enter the values spit out by r.proj into g.region, set the region, uncheck the box in r.proj, and actually import the data to the UTM projection! Here’s my result: Now that your DEM is 1) projected to a UTM coordinate system, and 2) GRASS-ized for processing, you are now able to perform innumerable geoprocessing tasks, including:  Neighborhood statistical analysis  Terrain analysisshaded relief (“hillshade”)  Terrain analysisslope and aspect (generate slope, aspect, and their derivatives)  Hydrologic modelling watershed analysis (stream network and basin delineation, etc).  File NVIZ (for 3d visualization of raster surfaces!) The sky is the limit. You just need to figure out what exactly you want to do. First of all, I like to create a hillshade, to better see what’s going on in the landscape. My mosaicked, clipped, projected raster.
  • 21. 20 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby d. Downsampling a raster: Before you do any fancy raster processing, you’ll need to sit back and figure out if your resolution is to your satisfaction. If it’s high-res and you (like me) don’t have a high-power processor, raster operations could take quite some time. If you don’t need the high-res, and can’t afford to make your study area smaller, you can always downsample. To downsample, or coarsen the resolution of your raster, is a two-step process in GRASS GIS. First, you’ll need to change your region’s resolution (Settingsregiong.region). I’m working with 10-meter resolution (each pixel is 10x10 meters). I wish to downsample to 30 meters. So, in the g.region tool, I’ll set my 2D resolution to 30. After running this, open r.resamp.stats (RasterDevelop Raster Mapresample using aggregate statistics). Tell the tool which map you’re resampling (my fancy new UTM-projection elevation map, in my case), and what you’d like to call the output. Next, make sure the aggregation method is ‘average’. Hit ‘Run’, and watch the magic. Here’s a blown-up comparison of my input (10-meter) and output (30-meter) DEM’s: As you can see, the spatial resolution is now coarser, and quicker to manipulate. If you don’t need the resolution, don’t use it. Now, we can create a low stress (and less time-consuming) hillshade. g.region tampers with the mapset resolution (I want 30-meter pixels instead of 10- meter, so I enter “30” r.resamp.stats looks at the coarsened region and re- does your raster resolution to match it
  • 22. 21 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby e. Creating a hillshade: r.shaded.relief Open r.shaded.relief (available from typing it into the command line, or choosing it from the RasterTerrain analysisShaded relief menu. Here, you have a plethora of options to choose from to create your new hillshade. You tell r.shaded.relief which raster file you’d like to shade in the “Required” tab. In the “Optional” tab, you define the output name, altitude of the light source to shade by, horizontal angle (Azimuth), and exaggeration. I like to leave these parameters on default, as I’ve been very satisfied with the ouputs so far. Click “Run”. Depending on the size and resolution of your raster, this may take a while. Let GRASS think; it will produce sooner or later. My new shaded relief map (hillshade)
  • 23. 22 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby f. Overlay a hypsometric tint: A traditionally useful way to augment the visual display of a hillshade is to take the original DEM raster, give it a nice color scale, and set it to be a semi-transparent layer over the hillshade (a process called ‘draping a hypsometric tint’). Having worked with digital topography for a while, I’ve experimented with different color tables; I find that a grayscale is visually-appealing and simple to do in GRASS (creating your own color table is non-intuitive, and best left for QGIS). To set the color of your DEM raster, right click on it in the layer manager and choose ‘set color table’. The tool will pop up, and in the ‘Colors’ tab, set the color table type to ‘grey’. Run, and close the dialogue box. The DEM should now grade from black to white. To set the transparency, right click on the DEM in the layer manager again, and choose ‘Change opacity level’. In the box that pops up, choose the percent opacity you’d like; I set mine to 30%. Here’s what the result looks like: Now, you can more easily distinguish areas of low and high elevation. Let’s move on to more complex functions. The lower elevation is darker The higher elevation is lighter
  • 24. 23 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby IV._Hydrologic analysis (focusing on stream profiles) a. Delineating a watershed, it’s sub-basins, and stream channels: Open RasterHydrologic modelingr.watersheds. The input to this tool is, simply, your DEM (not the hillshade!). In the ‘Output_options’ tab, type names in boxes of output maps that you’d like. They are: 1) “number of cells that drain through each cell”, less cumbersomely-known as “Flow Accumulation”. This tool operates under the ‘raindrop’ model, assuming that peaks and ridges in the terrain serve as hydrologic divisions, and that water will accumulate downslope of these features. The output raster is a map of predicted areas that water will collect, with each pixel assigned a value equal to the number of upslope cells draining into it. This means that pixels in stream channels will have higher flow accumulation numbers than will adjacent hillslopes. Although not exceedingly useful, this would be a good raster to keep—it can be processed with the map algebra function later to produce a raster of upstream drainage areas, an important hydrologic variable. 2) Drainage direction. This raster tells the tool which way water is most likely to flow. It isn’t necessary to keep for any function I’m aware of, but you should do so anyways for the sake of covering your bases. 3) “unique label for each watershed basin”. Also known as your watershed basins map. This is important for display paramaters. 4) “stream segments”. A raster of the proposed stream network. This will need cleaning eventually. 5) “each half-basin is given a unique value”. Also known as your half-basin map. Another useful parameter. 6) “useful for visual display of results”. If you want a combo raster for just looking at, this is it. 7) Slope length and slope steepness. Slope steepness rasters, useful for engineering purposes. An important input that you’ll have to tinker with resides in the Input_options tab: the “minimum size of exterior watershed basins”. This controls how many segments are in your streams. Larger input values will require streams to have more drainage area, and will consequently coarsen your stream map. You’ll have to experiment. In the “Optional” tab, you can choose Multidirectional flow accumulation, which is useful if your standard D8 flow accumulation produces a bunch of straight lines. Also, checking “Use positive flow accumulation even for likely underestimates” can ensure that your use of the Flow Accumulation raster will give credible values. When you’re satisfied, click ‘Run’. You may have to re-run this tool several times, adjusting the size of your basins as you go. To let this happen, check the “allow output files to overwrite existing files” box in the “Optional” tab. If all goes well, each of these raster maps should pop up in your layer manager.
  • 25. 24 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby b. Raster to Vector: You can easily convert a raster map into a vector feature in GRASS GIS. This is quite useful, and I will vectorize my streams and drainage basins with Rastermap type conversionsr.to.vect. My watershed features will be polygons; the streams will be lines. After my rasters are converted to vectors, and a bit of color-changing and opacity altering, my result looks like this: I set a lower basin threshold for my streams, to get higher detail, then generalized my basins by increasing the threshold, and running r.watershed again. A more precise, basin-specific map may be created with r.water.outlet.
  • 26. 25 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby c. Cleaning vectors: Although the stream extraction process is run by a high-level algorithm, NAD DEM’s are notorious for containing artefacts and noise that produce some stream channels that don’t exist. Other tiny vectors, called ‘dangles’ may be produced, producing streams that more resemble pipe-cleaners than anything else. To get rid of these ‘dangles’, etc., there extists v.clean: Most of what needs to be trimmed may become so through using the “remove dangles” function of v.clean. Increasing the threshold removes larger “dangles”, and above a certain point, will start removing tributaries in your stream network. Some closed-line boxes, etc. will still have to be cleaned by hand using the digitizer as an editing tool. v.clean nabbed these ‘dangles’… …but these will have to come out by hand. Line length threshold
  • 27. 26 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby d. Restricting your network to focus on one stream (build polylines, etc): The stream network is clean of ‘dangles’, and now I’d like to trim off all of the tributaries and extra main- stem channels to restrict my focus to the northwestern-most main stem. Using the digitizer to delete features, one can accomplish just that. Here is my result: Note that, while the digitizer is still on, many vertices can be noted along my restricted channel. In order to produce vector points, as I hope to do, I need all of these segments joined into a single line, called a “polyline”. This may be accomplished through using the Vectortopologyv.build.polylines command. First, I need to quit digitizing and save my edits. Next, in v.build.polylines, I can select my newly-trimmed stream vector, and in the ‘Optional’ panel instruct v.build.polylines to populate the new, merged line vector with the information from the first segment of the old line vector. Each of these dark green crosshairs is a vertex. In order to make our point extraction work, we need to get rid of them but keep the lines which connect them. How: v.build.polylines! The pale green and orange stream segments represent what I’ve trimmed off, whether by v.clean or by hand.
  • 28. 27 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Here’s the result: Notice that, although most of the vertices are gone, about ten easily visible vertices remain. There is a significant reason for this: at those locations, junction with tributary streams has created an artefact in our data—a box or other oddity that must be removed by hand via the digitizer. Once each new dangle or box has been removed, run v.build.polylines again. If it isn’t fully merged this time, problem spots are easily recognized with the digitizer turned on (reveals vertices) or topology displayed (see the ‘Properties’ option by right clicking the stream shpfile in the layer manager). I deleted all the small boxes and dangles in my stream by hand, and here’s the result. While most vertices are gone, several remain. This means that there’s more than one junction feeding into the main stem at each of these locations. Trim them out with the digitizer. A classic example of a polyline interruption that both v.clean and I missed. Delete the small closed loop in the digitizer. Much better! Now all that’s left are the two end-nodes. Everything in between is consolidated into one continuous line.
  • 29. 28 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby e. To generate points along a line: I now have a single-thread line (just one segment, no intermediate vertices). This is a requirement to generate points along my stream’s path, using v.segment. (Vectortopology maintenance-v.segment) V.segment generates points at a specified interval along a given line (if you’d like to do more than one line in a given shapefile, you’ll need to do extra work, but this may in part be automated). The key to successfully using this tool is a ‘rules file’ containing instructions for each point. This sounds tedious, and the only other option is to enter these rules by hand into the v.segment tool window, but there is a fairly simple way to make this process quick and smooth: Excel. The rules you need are as follows: P 1 1 0 P 2 1 100 P 3 1 200 P 4 1 300 Where the first column denotes the type of ‘segment’ you’d like (P=points, L=lines), the second column contains the row number for number of the new point (should be an ascending sequence of integers), the third column is the number of the vector you’re creating the points along (I labeled the stream ‘1’), and the fourth column is the distance along the line at which to create the point. Now, this does look tedious, but if you type these values into an Excel spreadsheet and auto-continue the trend until well past the projected length of your line, it takes only seconds. The Excel spreadsheet must be saved as a delimited text file in a location (perhaps the GRASS location) you can map to easily. Here’s a screenshot of my Excel document, which I’ve saved as a text file: Now that the ‘rules’ text file is saved, and the feature(s) we wish to add points along has an attribute table and a unique category number, we’re ready for the v.segment tool. Simply select select your text file, name your output file, and voila! You’re good to go.
  • 30. 29 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby f. A new attribute table: Although we have our points now, they’re in dire straits and need some help. They are what they are—points, without an attribute table or even a record of the distances they represent. Ah well, these things can be added. First things first, use the DatabaseVector Database connectionsnew table again to give these points an attribute table. Instead of leaving things as-is with this tool, let’s add some columns while we’re at it (else, this will have to be manually done later with v.db.addcol). Click on the “Optional” tab. In the lower portion of the screen, note the text box inviting you to name new columns and list their type. This part of the process, again, can be frustrating if you do it wrong. The information must be entered in a specific way: dataname datatype, nextdataname nextdatatype Short names are good; ‘elevation’ is a bad choice, as it will likely get chopped off after a few letters—‘elev’ will be much more successful. The data types seen above (the ones you’ll likely need) are:  int – this data type will only receive integer values. If you try to stuff decimals or fractions into it, it will loudly complain and rudely fail to comply.  double precision—this type accepts all numbers, up to many decimal places. Most data you’ll collect are of this type, so pretty much any column you’ll add should be of double precision type.  varchar(#)—varchar allows you to store any symbols ever, but does not recognize them as numeric (I think). It does, however, allow you to put in a mix of symbols that are useful for display purposes, primarily coloring schemes. Creating a column of varchar(11) type allows each cell to contain up to eleven unique characters. You’ll need this if you want to color your points by an attribute (input colors look like 181:332:013, nine numbers split into three pieces by two colons). Name it GRASSrgb for the sake of easily finding it later. Each small black ‘X’ is a new point that we’ve just generated. Notice the arrangement of the syntax—this is important, as GRASS is quite particular. The format is columname data type. You’ll want a data type of double precision for most things.
  • 31. 30 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby If for some reason you’ve found that you need to add another column later, after the table is made (or you’ve gone ahead and created the table without reading my suggestions, silly, silly you!), you can always use v.db.addcol to input new names and datatypes (as seen above). GRASS 6.4.3 has a mostly- operational GUI menu to do this by hand, too: right click on the points vector in the layer manager and choose “show attribute data”. From there, you should be able to figure out how to do this by point-and- click methodology. So, we now have points that a) have an attribute table, b) have distinct integer ‘cat’ values to tell them apart, and c) empty columns named after the attributes we’re going to extract. We’re on the right track. But first, an aside. We have a raster of elevation values at 30-meter resolution already—this will be instrumental in creating the long profile of the stream we just extracted points for. However, we (almost) have another piece of useful data that we can take with us, too: upstream drainage area. The flow accumulation raster we created earlier as a part of r.watershed tells exactly how many cells drain into each downslope cell, but we want area values instead of pixel-counts. This can easily be accomplished by using Map Algebra yet again.
  • 32. 31 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby g. Using Map Algebra to create an upstream drainage area raster from a flow accumulation raster: Open up the Map Algebra calculator. This tool takes your commands and applies it over entire rasters to create new data. It is quite powerful, and most (if not all) of the raster tools have their roots here. Anyway, here’s a picture of the operation we did earlier [creating a clipped raster from a larger one after using g.region]: As you can see, the trick to clipping your raster earlier was changing the regional extent to a much smaller area with g.region, then opening the Raster Map Calculator (aka Map Algebra) to create a new raster equal to the old one (but now in a differently-sized region, which chops off the raster’s boundaries). The syntax for the Raster Calculator can be a bit obtuse at first; let’s do another example while we calculate upstream drainage area. Here, select your raster maps to include in the calculation.
  • 33. 32 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby As stated several times before, flow accumulation for a given cell is the cumulative sum of all upslope cells that directly or indirectly drain into it. In other words, this gives us the number of cells in the drainage area, but not the area of those cells. Fortunately, if we’ve kept track of the resolution of the DEM we’ve been using (it started as 1/3 arc-second, was projected to 10-meter, then downsampled to 30-meter), we can simply multiply this total sum of all upslope cells by the area of each cell quickly and efficiently. Here’s what this would look like for my 30-meter DEM: The output map, ‘upstream_area’, now contains drainage area, rather than drainage pixel count. Now, we’ve got all the data that I’d like to use in describing the stream profile. And the extraction process, comparative to what we’ve done so far, is cake! Multiplying your flow accumulation raster by the area of each cell will generate an upstream drainage area raster. My cells are 30x30 meters.
  • 34. 33 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby h. Extracting raster values to points (points that have an attribute table already, that is): Now that we have our point shapefile up and running, the extraction is easy. The powerful tool that accomplishes this goes by the name of v.what.rast (VectorUpdate attributesupdate attributes from raster). You don’t need to type in the datatype this time. You only need the name of the column you’re updating and the name of the raster you’re updating from. If you have more than one attribute you’d like to extract, you’ll have to do them all separately, but the process itself is quick. If you check the point vector’s attribute table after the extractions (assuming no malfunctions or user errors), you should see values in your previously-empty columns. So, we’ve come a long way to get to the point (no pun intended): from importing a DEM, mosaicking, trimming, projecting, extracting streams, cleaning them, trimming them, making polylines from them, adding attribute tables, making points along those lines, adding an attribute table to them, adding columns to that attribute table, and finally extracting raster values to those points. Whew. “But what”, you may ask, “about the cumulative distances for each of our points? You can’t make a profile without distance!” You would be very correct in asking this. The simple answer I have is that, when creating your points, GRASS did not write your input distances to each point. Bummer dude. But what you can do now is export your data as an Excel-compatible file and auto-fill your data table with distance values (since you still have your “rules file” for making the points in the first place). Here’s how you export your data for some well-earned processing (in Excel, Matlab, or my preference, R): Point vector to update raster to extract values from Column to populate with data (necessary to create in advance, which we’ve done)
  • 35. 34 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby i. Exporting vector data to be read into Excel (or Matlab or R): Now that you have all the data you want (minus distance, which you can auto-fill in Excel), you need to export it for manipulation and plotting. This is the fun part. Up until now, you’ve been jumping through hoops to collect data—now you’re just about to visualize it for yourself. In the Layer Manager, right click on your point vector and click ‘Export’. Up pops v.out.ogr (also available from Fileexport vector data). It asks for a name in a rather unintuitive way: “OGR output datasouce name”. This is the name of the folder and file your data will be written to. Note that I’ve made a name for the “OGR output datasource”, told v.out.ogr that my vectors are points, thank you very much, and that I’d like my OGR format to be CSV (a comma-delimited text file that easily opens as an Excel document). If you don’t want to spend forever searching for the auto-directory output location, specify the directory path in the “OGR output datasource name” box. My path, which I store all of my random riffraff like the “rules file”, etc. in is: C:UsersSkylerDocumentsGRASS_docsdemo database Now that the data is successfully exported, we can find it and open it in Excel (or read it into Matlab or R, if you wish) for visualization. Should instead be: C:UsersSkylerDocumentsGRASS_docs demo database If I leave the file pathway out, GRASS will auto dump my data into my local user folder on the C: drive. We’re exporting points File type is CSV, a comma-delimited file easily readable by MS Excel
  • 36. 35 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Finalizing the stream profile, from using the above steps: In Excel, open the .csv file you just created. Notice that there is a ‘cat’ column, an ‘elevation’ column, a ‘da’ (drainage area) column, a (as to now) useless GRASSrgb column, and absolutely no distance column. Darn. Let’s auto-fill one really quick. As you are probably familiar with already, if you type in values succeeding rows in Excel, highlight those rows, then double-click the corner of the black highlighting box (a crosshair appears), it auto-fills your column with extrapolated values until its length matches those of the other columns in the spreadsheet (you could drag the crosshair manually, if you prefer). Do this for a new ‘distance’ column to get your x-axis for the long profile. Now that you have your spatial parameters, you can calculate some derivatives of the data. Take a moving average (using Excel’s statistical package or R’s lowess function) to smooth the profile and remove the notorious NED 10-meter contour stair-steps from your profile. Calculate profile slope; take it a step further and calculate normalized steepness, Ksn (Ksn=slope/(DrainageArea^-ABS(theta ref)) ; theta ref=0.5 for general stream profiles). Take the log of slope and drainage area, and plot a fancy slope-area diagram to compartmentalize the geomorphic transitions of your stream—the works. My point is that you can derive all of these data from a good stream profile construction, itself totally doable in GRASS GIS. In case you’re wondering, I did calculate and plot each of these variables in Excel (although I much prefer R): If you’d like to learn how to manipulate and plot your GRASS export in R, I’m writing a document about that as well. 900 950 1000 1050 1100 1150 1200 0 10000 20000 30000 40000 50000 Elevation(m) Downstream distance (m) Raw elevation (m) Smoothed elevation (m) 0 0.005 0.01 0.015 0 10000 20000 30000 40000 50000 Slope Downstream distance (m) Slope 0 20 40 60 80 100 0 10000 20000 30000 40000 50000 Ksn Downstream distance (m) y = -0.6941x + 3.1794 -5 -4 -3 -2 -1 7 7.5 8 8.5 9 Log(slope) log(drainage area) geomorphic compartment boundary (hillslope to flat plains)
  • 37. 36 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby V._Other topographic analyses a. Create slope maps and other spatial derivatives: Rasterterrain analysisslope and aspect (r.slope.aspect) r.slope.aspect will generate slope, aspect, and curvature from a standard DEM. While these are important morphometric parameters useful in delineating abstract landforms, I haven’t found a need (yet) for anything other than the standard slope map. A map of a landscape’s differential slope is important: it plays a role in slope stability and mass wasting processes, but more important to me, it aids in mapping geomorphic surfaces. With a good slope map, you can find the flat spots and digitize river terraces. You can interpret regional-scale breaks-in-slope and map them as lineaments. And generation of this kind of map is remarkably easy. While producing a slope map in past decades has required rigorous expertise with map algebra, GRASS does it for you quickly and intuitively with r.slope.aspect. Input your DEM, name your slope map in the “Outputs” tab, check “Allow output files to overwrite existing files” in the “Optional” tab in case you screw up the first time, and hit ‘Run’. Here’s an example output: Notice bright yellow areas where the slope is exceptionally steep, and blue areas where the land is relatively flat. When zoomed in closer, one can distinguish several straight lines cross-cutting topography. These could be lineaments, which we will use the digitizer to preliminarily map.
  • 38. 37 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby b. Digitizing features in GRASS: While slightly cumbersome in ARC, digitizing new features in GRASS GIS is relatively straightforward and intuitive. In the Map Display window, you have many buttons to choose from, each of which does strange and wondrous things. A prominent button on the rightmost edge of the window should read “2D view”, and have an arrow for a drop-down menu. Click it, and select Digitize. A new editor toolbar will appear, with an additional drop-down menu. Since we’d like to digitize some lineaments from scratch, click the new drop-down menu and select “New Vector Map”. Once you’ve named it and clicked “OK”, you’re in business. The new attribute table will pop up—great. Unless you’d like to add some columns to better distinguish your data (other than the default ‘cat’ number), click ‘Quit’ to get back to digitizing. Now, you should have the Map Display window with the new editor toolbar, your new vector selected for editing. Things get very intuitive from this point—you can choose to create new points, lines, or areas (polygons), and update or view their attributes. To digitize preliminary lineaments, click the “Digitize new line” button and point-and-click to create new segments (right click to finish a line). Good . Change from 2D to Digitize. Select “New vector map”.
  • 39. 38 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Each time you finalize a feature, a small window pops up asking if you’re really sure you’d like to make the shape final. Yes, yes you would. If you screw up somehow, you can always go back, use the “Delete Feature” tool, and get rid of your problems. Anyways, after you’ve hit ‘Submit’, you have a new feature! Digitize your lineaments in like fashion (I’m only going to do several, quick-n-dirty estimates of lineaments). When you’re done, click the power button in the right corner of the editor toolbar (you may have to stretch the Map Display window to see it, like I just did). Tell GRASS “Yes, thanks for asking, but I really would like to save my edits to the new shapefile!” and voila, you have a new shapefile of lineaments. This is necessary. GRASS is asking for your permission to catalog this new vector object as the first entry in the new ‘cat’ column.
  • 40. 39 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby I altered the color and line thickness of the few, roughly-mapped lineaments in our vector shapefile by right-clicking the vector in the Layer Manager, choosing properties, and adjusting the ‘Colors’ and ‘Lines’ tabs. NOTE: When digitizing lineaments, try to use multiples sources of imagery. I like to do this in QGIS because the Google Earth plugin allows me to interpret high-resolution aerial photographs in addition to hillshades and slope maps. Also, the color scale of your raster slope map may be easily-adjusted in QGIS, allowing you to hone in on, say, the features between 5% and 25% slope or whichever range you’d like. I will write more about this in my guide to visualizing data in QGIS. But for now, all I wish to accomplish is a simple digitization of a geomorphic feature. ADDITIONAL NOTE: digitizing can usefully constrain a myriad of geomorphic surfaces, not just proposed fault scarps. Fluvial and marine terraces, etc. may be digitized in the same manner, using areas (polygons) instead. My proposed lineaments. I’ve probably missed quite a few, and some of these are probably not real structures, but hey, it’s preliminary mapping, man!
  • 41. 40 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby c. Digitizing a polygon, and extracting points from its interior (aka, “binning”): The idea behind this is simple, and the workflow isn’t overtly complicated: I want to digitize a polygon that covers the extent of a geomorphic surface, and I want to extract points at equally-spaced intervals throughout that polygon, each of which contains some sort of spatial parameter (slope, elevation, aspect, etc.). Unfortunately, there’s no automated tool to do this, unless you use the Model Builder to make it yourself. ArcGIS has the “XTools Pro” kit, which accomplishes this task automatically yet costs a good chunk of change, but we can do better. ci. Digitizing a polygon: First, change your map view mode from ‘2D’ to ‘Digitize’ (like we did for digitizing lineaments), and select a “New Vector Map” to digitize. Click the “Digitize new area” button, and you’re set. I’ve noticed a bright spot on my slope map, in the northern-northeastern corner, where a prominent escarpment is located. I’d like to know the general slope of this feature. Let’s digitize its perimeter, so that we can extract points from within it. Click points to establish the perimeter, then right-click to close the polygon. Exit the digitizer and save your edits. Great. This is the first step in extracting points over an area (Duh!). I changed the fill color to ‘transparent’ and the outline to white. to better highlight the polygon.
  • 42. 41 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Converting our vector polygon to a raster: The polygon we’ve created bounds the area for our point extraction. Now, we’re going to need to convert that polygon to a raster, such that each cell within the polygon will have a value of ‘1’, and all other cells will have a value of ‘0’. The reason for this is, you can’t simply tell GRASS to “look inside X polygon and extract points from Y raster”. We’re going to need some map algebra from the Raster Calculator to get the job done. We’re going to take the rasterized polygon and multiply it by the raster containing the values we wish to extract. 1*Value= Value, 0*Value= 0. To get this rasterized polygon, here’s the deal: Vectormap type conversionsv.to.rast Set source of values to ‘val’, and val=1. (afterwards, right click on the vector in the Layer Manager and click ‘Univariate raster statistics’ to confirm that the max value is 1, and the minimum value is 0) Here’s some screenshots of v.to.rast: Using ‘val’ will allow us to set the part of our new raster representing the polygon to ‘1’. Don’t forget this step! Make sure that ‘Raster value’=1. Leave the rest alone. Our hip, new raster. It’s too high-res, though.
  • 43. 42 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby cii. Coarsening our region to extract fewer, representative points: We’ve already downsampled our DEM from 10-meter grid resolution to 30-meter grid resolution to decrease our processing time, but I (in the time that I’ve written this) have changed my region to 10m- resolution. It really shows in the raster I’ve just created—the grid squares are very small. We should coarsen this raster before we continue. [NOTE, if you’re still in a coarser resolution (like 30-meter), you don’t have to do this part, unless you feel the need to coarsen things further]. The reason being, as we extract points over a broad area at higher resolution, GRASS assigns one point per raster grid square. And we’re going to wind up with a lot of points, probably more data than we care or need to analyze. To fix this problem, we need use g.region to coarsen our sampling density (We will also produce a further- coarsened ‘polygon’ raster in the process). SettingsRegiong.region, or type g.region into the command line.bSet the 2D resolution to 30 meters, and click ‘Run’. Close the dialog box. In the Layer Manager window, right click on the raster we’re coarsening, and choose “Set computation region from selected map(s)”. Now that the region resolution is coarsened, open up rasterDevelop Raster Mapr.resamp.stats. This function, as before, will resample (in our case, coarsen) our raster to 30-meter grid resolution (9x as coarse as a 10-meter). Make sure that the type is ‘average’, and give your output map a distinguishable name. Hit ‘run’. Now that the raster we’ll sample from is coarse enough to a point extraction. g.region tampers with the mapset resolution (I want 30-meter pixels instead of 10- meter, so I enter “30” r.resamp.stats looks at the coarsened region and re- does your raster resolution to match it From 10x10 meter squares To 30x30 meter squares. Black line for emphasis.
  • 44. 43 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Get values from one raster to another: more Map Algebra! Now that we have a downsampled raster of our original polygon, here’s where using the ‘val’ setting in the v.to.rast tool comes into play. If it worked correctly, as stated before, each grid cell within our original polygon’s bounds should have a value of 1; all others should equal zero. Again, you can check by right-clicking the coarsened ‘polygon’ raster, and choosing ‘Univariate Raster Statistics’, which will spit out max and min values in the Command console. Now, if we multiply our ‘polygon’ raster by another raster, say our slope map, the polygonal area will contain the values of the other raster (1*value=value), while all other parts will retain values of zero (0*value=value). This is of utmost importance for the next step (you’ll see why in a minute). By now, a bit of map algebra is easy. Open r.mapcalc from the ‘Raster’ menu, enter a name for your ‘revalued polygon’ raster, and multiply your coarsened ‘polygon’ raster by one with the values you want. These two maps are selected here. New name. Now, we’ve got slope values for every pixel in our rasterize d polygon.
  • 45. 44 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby ciii. Raster to points: To recap—we converted a polygon to a size equivalent raster version. We downsampled that raster such that it will sample evenly while giving us a manageable amount of data. The Raster Calculator was used next to give the required values to our downsampled ‘polygon’ raster. Now, we’re going to finish the process and extract a point from each grid square in the updated ‘polygon’ raster. To do this we use the reverse of v.to.rast: RasterMap type conversionsr.to.vect This command will take whatever raster you have and change it to your preference of vector format. We used it on our watersheds raster to make polygons; we also used it on our stream raster to get a drainage network of lines. Now, we’ll use it to make some points. This specification tells GRASS that every pixel must produce a point. That’s why we downsampled earlier! One point per raster pixel. (black line for emphasis)
  • 46. 45 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby civ. Coloring a vector: Now that we have our points (I re-symbolized mine to small circles instead of x’s), we can choose to color-code them to visually show us its range of values. First, we’re going to need to add a new column, ‘GRASSrgb’ of type ‘varchar(11)’ to hold the auto-generated color values. Use DatabaseVector Database Connectionsadd column (or type v.db.addcol in the command line). Type the following into the ‘Name and type’ box: GRASSrgb varchar(11), hit ‘Run’. Close the tool, then right-click the vector in the Layer Manager, and choose ‘set color table’. The name of the column containing the slope data is likely to be ‘value’. The name of the color column to populate is ‘GRASSrgb’. The type of color table is up to you, I like byr (blue-yellow-red). Click ‘Run’. Grass will think for a minute—it has to assign a color value to each point on a gradational scale. That’s okay. Once it finishes thinking and writing the colors to the GRASSrgb column, close the tool. Right click on the vector in the Layer Manager again, and choose ‘Properties’. In the ‘Colors’ tab, check the box reading ‘Get colors from map table column (of form RRR:GGG:BBB)’. Leave the other variables the same (you may check the ‘transparent’ option in the ‘Feature color’ section to remove the border of each point). In the ‘Symbols’ tab, select the one you’d like (I prefer circles), and set the size (~10 works for me). F.Y.I., the v.db.addcol tool can add any column you want. Type varchar(11) will be able to hold the various characters necessary for color-coding. The ‘value’ column contains our extracted data from the slope raster. Color column: GRASSrgb byr=”blue to yellow to red” color scale Outline = transparent (personal preference) Symbol type and size.
  • 47. 46 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Now that we FINALLY have a set of points extracted from within the boundaries of our polygon, containing the values we wished to extract, we can export the values with v.out.ogr, just like before. Right click on the vector of points you’ve worked so hard to extract, and choose ‘Export’ (or do it from Fileexport vector mapcommon formats, OR type v.out.ogr into the command line). Give your ‘OGR datasource’ a name that has a full-scale file pathway tacked on the front, so you don’t have to go hunting around for your exported data. Remember that the file pathway can be copied from the address bar of your Windows Explorer, just add the extra backslash and type your file name. Remember to export as a .csv for easy import to Excel (etc). Also remember to check the feature type box, ‘points’, and uncheck the rest. While you’re in Excel, you can use the histogram function of the ‘Data Analysis’ package to graphically display your results (read up on Excel’s help site to enable this package and use it): 0 50 100 150 200 250 300 350 400 0 10 20 30 40 50 Frequency Slope Histogram distribution of slopes on prominent Pine Ridge escarpment The resulting point vector. Congrats! Clear skewness towards lower slopes
  • 48. 47 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby d. Sinuosity of a line: Compared to extracting points from a polygon, this is a relatively easy task. GRASS GIS keeps a nice little bag of tricks hidden up its sleeve in the v.to.db tool. With this handy function, you can find out the sinuosity of your curved line, the azimuth of your straight-ish line, length, perimeter, area, you name it. Here’s what it looks like for the main stem stream we derived earlier. Add a column to the stream polyline with v.db.addcol, with sinuos double precision entered in for the name and data type. Make sure that it also has a ‘cat’ column, and that the first entry in the ‘cat’ column is set to something (it may be missing any entries, you may have to add it by hand in the attribute table). In the v.to.db tool, select ‘sinuous’ from the list of attributes to calculate, and in the ‘Optional’ tab, select your ‘sinuos’ column. Calculated whole-reach sinuosity: 1.64 However, what if you want to look at sinuosity of specific reaches of the stream? Sinuosity the curviness of a stream segment, and it would be helpful to see how this curviness changes over its course. To do this, we’ll have to revisit the v.segment tool. Vectortopology maintenancesplit polylines (or type v.segment into the command window). Tells GRASS to calculate sinuosity for your vector line. I made a column named ‘sinuos’, with v.db.addcol, specifically for this purpose. My main-stem stream channel. This value is spat out into the ‘sinuos’ column.
  • 49. 48 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Instead of generating points like we did earlier, we can use the same methodology to generate a bunch of segments in sequence along the stream, with defined lengths that can each be surveyed for sinuosity. Half-wavelengths seem to be about 1.2 km long (you can measure full wavelength if you’d prefer), so I’ll make segments 1.5 km in length (1500 m). I measured this distance with the ‘Measure distance’ tool on the menu of the Map Display (make sure you’re in UTM coordinates!). As with generating points, this could be either your hardest or easiest step in the process. If you don’t have a ‘rules file’, you’ll have to type in each value by hand. Bummer. You’d better make up a ‘rules file’ in Excel. Here’s the format: Type Segment ID ID of line to segment along Start of segment End of segment L 1 1 0 1500 L 2 1 1500 3000 L 3 1 3000 4500 Create a table like this in Excel (minus the headers), highlight the whole mess, hover your cursor over the lower right-hand corner of the selection (where it turns into a black crosshair), and drag down to autofill in the bulk of the entries. If you don’t know the total length of your line, that’s okay. You can use trial and error while you’re running v.segment (make sure the ‘overwrite files’ option is checked). Save your Excel document as a delimited text file (I use tab delimited), and use it as the input for your ‘rules file’. Here’s the first few lines of my Excel sheet, and the colorized (random colors) segment output: Using the distance tool to measure half- wavelength. (the increment by which I’ll split the stream into segments).
  • 50. 49 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Since the v.segment tool creates the segments but fails to take responsibility for them, we’ll have to use v.db.addtable to create a new attribute table for our segmented line vector and toss some columns into it (syntax for column names and type is: cat int, sinuosity double precision). Now that our main stem is segmented and has an attribute table, we can easily use v.to.db update the new “sinuosity” column, with the same procedure as for a single line vector. Now, let’s change the colors the same way we did earlier (v.db.addcol will make your GRASSrgb column, right click on your vector and set the color table to fill this column with colors according to the sinuosity, then right click and edit the vector’s “Properties” tool to tell GRASS to color by that column). Also export your data using v.out.ogr to create a csv file, as demonstrated several times earlier (remember, distance values must be added by hand, using auto-fill in Excel, or more robust methodology in R). 1 1.5 2 2.5 0 50000 Sinuosity Distance downstream (m) Hot colors indicate higher sinuosity, cold colors are straighter reaches. Possible zones of channel steepening?
  • 51. 50 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby e. Determining azimuth of a line: Using v.to.db to auto-calculate line azimuths is even easier. If you already have straight line vectors (i.e., our lineaments from earlier, simply use v.db.addcol to create a new column for the lines’ attribute table (AZ or azimuth are good names). Type, again, should be double precision, as the input values will likely have decimals. In v.to.db, choose ‘azimuth’ as the value to upload and the name of your new column to receive it. Here’s a lineament map I created earlier, and my results displayed as a rose diagram (a ‘circular histogram’) created in R and beautified in Inkscape: Like with the sinuosity function of v.to.db, azimuth values are calculated and assigned to each line in the vector set. Export using v.out.ogr as a csv, with a defined file pathway, and you’re all set to analyze the data (Excel can do histograms, but the ‘circular’ package of R can do nifty rose diagrams, as seen above!) Rose diagram constructed in the R computational environment
  • 52. 51 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby f. Topographic profiling without the GUI tool: If you notice, the Map Display has an ‘Analyze map’ button that, when clicked, gives the option to a) calculate a distance, b) generate a histogram of raster values, or c) draw a topographic profile. While the option to point-and-click a topo profile into being is a good thing, this tool only works if you’re using UTM coordinates (for me, at least) and also fails to leave a trace of your profile once you’re finished. Additionally, the high-resolution of the profiler may be a bit much for visual display over large distances. To remedy these problems, you may also create one by hand. The methodology of digitizing a line, and extracting points along that line with v.segment and a user- created “rules file” is identical to that of the stream profile extraction we did earlier. Except this line is already single-thread and doesn’t need cleaning! Score one for the Republic. If you haven’t already, change the Map Display view mode from ‘2D’ to ‘Digitize’. Use the drop-down menu on the editor toolbar that just popped up to tell GRASS you’d like to edit a “New vector map”. Name the map something without spaces, and exit the new attribute table when it springs up. Use the “New line” tool to draw a line across topography you’d like to profile. Add an attribute table and ‘cat’ column by clicking on your line with the “Display/Update categories” tool. Or just add it by hand in the attribute table after exiting the editor. Exit the editor and save your edits. New vector line, created in the digitizer. Designate new vector The Power button‘New line’ tool
  • 53. 52 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Now, open the v.segment tool (VectorTopology maintenancesplit polylines, or just type v.segment in the command line). Use your rules file from before, of format: P 1 1 0 P 2 1 100 P 3 1 200 P 4 1 300 Where column one is segment type (P=points), column two is the ‘cat’ ID for each new point, column three is the ‘cat’ ID for the line you’re generating points along, and column four is the distance along the line for each point. Create the first few points in Excel, auto-fill the rest (at least the distance length of your line, which you can measure in the Map Display with the ‘Measure Distance’ tool), and save the results as a delimited text file in your GRASS directory (or other convenient location) to use as your ‘rules file’ for v.segment. Once the points are created, add a new attribute table, for the poor ‘lil points along your profile line have none, and make sure to add the column ‘elevation’ as a double precision (syntax for the name and type box: elevation double precision). Next, use v.what.rast to extract values to your points from the elevation raster. (VectorUpdate attributesupdate attributes from raster). Finally, export your data as a .csv file using v.out.ogr and a defined file pathway. Use the autofill function of Excel (or a more powerful program) to generate distances for each of your points. 950 1050 1150 1250 0 10000 20000 30000 40000 Elevation(m) Distance along profile (m)
  • 54. 53 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby g. Creating an Isobase (local base-level) map: Isobase maps represent an approximation of local base level, the “erosional-tectonic” surface of a landscape (Grohmann et. al 2006). They are created by sampling elevations of Strahler 2nd and 3rd order streams at evenly-distributed intervals, and interpolating the results. Second and third order streams are incised sufficiently to differentiate local base level from surrounding hillslopes, yet lack the erosion power of larger 4th (and higher) order streams to erase topographic signatures. As stream channels represent the most tectonically-sensitive component of a hillslope, a map derived from their elevations effectively “sheds” less-sensitive terrain components and allows a clearer and simpler view of environmental and tectonic modifications to topography. General methodology, which we can produce, multiplies a cleaned, rasterized stream network with first-order branches removed and stream values set to 1 (all else equal to zero) with a raster of elevation contours (10m+ resolution) to gain a new raster of evenly-distributed pixels containing stream elevations. An isobase map is the resultant surface interpolated from these spot elevations, whose differential features may have tectonic implications. Figure from Grohmann et. al (2006), illustrating derivation of an isobase surface. Let’s get started on an isobase map (next page).
  • 55. 54 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby To start, let’s pull up the stream network we created with r.watershed. Notice that there are 7-8 main channels, with many dendritic branches coming off of each. If we sample elevations from our stream map as it is, it’s likely that the small tributaries won’t adequately represent the average incisional depth of the region. In other words, we need to trim off the smaller-order streams to reduce the noise in the isobase map we’re working towards (Note that our threshold value from r.watershed has already clipped off the smallest tributaries automatically). We can move forwards in the process once we’ve got a more generalized map of the larger streams. To start with, we can open up the v.clean tool to remove smaller stream segments. However, even the main channels of our streams are highly-segmented, and the v.clean tool can only remove so much before it starts erasing sizeable chunks of the main stems. To continue any further, we’ll need to do some clipping by hand with the digitizer tool. In the Map Viewer, as before, change the view from ‘2D’ to ‘Digitize’, select your stream network (I’ve made a duplicate named ‘1st _and_2nd _order_streams’, to handle my edits while leaving the original network untouched), and choose the ‘Delete feature’ tool. After some trimming, here’s what my network looks like: Once you’re satisfied, you can rasterize your streams for the next step. Original stream network from r.watershed Using v.clean to remove small tributaries (large ‘dangles’) After v.clean: Finish the job manually in the digitizer:
  • 56. 55 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Rasterizing a stream network: In order to extract elevations to representative intervals along our refined stream network (Mostly 2nd and 3rd -order), a raster of the streams (stream pixels=1, all else=0) must be multiplied by a raster of contour lines (contour lines=elevation, all else=0). To get our streams ready, the trick we used to rasterize our polygonal shape needs to be implemented to rasterize our vector lines. To do this, use VectorMap type conversionsv.to.rast (or type v.to.rast in the command line). When the tool pops up, input your refined vector stream network, choose a name for your output raster, and make sure that your source of raster values is ‘val’. In the ‘Selection’ tab, check only the ‘line’ box under ‘Feature type’. In the ‘Optional’ tab, double-check to make sure that the ‘Raster value’ field is set to 1. This will output exactly what we want: a raster of our stream network, with stream pixels containing a value of ‘1’, and all other spaces with a value of ‘0’. Use ‘val’ again to set all stream pixels to ‘1’ We’re using lines Raster value=1 The output raster:
  • 57. 56 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Deriving contours from a DEM, and rasterizing them: Create contours by accessing RasterTerrain AnalysisGenerate contours (or type r.contour into the command line). In the tool’s window, choose your input DEM (I chose my original 10-meter DEM), and an output name for your vector contours. In the ‘Optional’ window, specify your contour interval (in meters, or whatever elevation unit your raster is in), and a minimum value of points necessary for a contour (Higher numbers eliminate small closed-loop contour noise). I chose a 30-meter interval: 30-meter contour interval; set minimum of 500 pts to make contour line (remove visual ‘noise’) 30-meter contours!
  • 58. 57 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Rasterizing contour lines, retaining vector values: Now that you have your vector contour lines, (which automatically contain elevations for their value), they need to be rasterized. The process is similar to rasterizing a stream line or landform shape, except this time we’d like the raster to retain elevation values (else, we’ll have to multiply them with the Raster Calculator, adding an unnecessary step!). To do this, open the same tool we’ve been using to rasterize things, v.to.rast (look in the vector menu or type v.to.rast in the command line). In the same old tool window, we have two very important changes to make: The source of raster values needs to be set to ‘attr’, and in the previously-unused ‘Attributes’ tab, the ‘Name of column for ‘attr’ parameter should be set to our elevation column (my column is named ‘level’). Other than that, everything is the same. Hit ‘Run’. The output is a raster of contour elevations. Now, we can move on to the next step. This time, use ‘attr’. We want to keep the vector values! Upon generation, our elevations were placed in the ‘level’ column. This defines the ‘attr’ parameter. Our new contour raster, colorized by height:
  • 59. 58 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Raster Map Calculator (even more Map Algebra!): Now that we have a raster of contour elevations and a raster of our stream network, we can prepare for our isobase surface interpolation by multiplying the two rasters together. This will result in a fairly evenly-distributed raster of spot elevations—wherever streams cross contour lines. Although we could have used some map algebra to give every stream pixel an elevation and interpolate from that, the resulting isosurface would be unfairly weighted, biased towards stream channels. This way, we’ll get a smoother, more representative isosurface. In the Raster Map Calculator, here’s what it will look like: Although the output isn’t much to look at, we’re ready for a surface interpolation. Multiply contour raster by stream raster. The map of intersections, each assigned an elevation. Not much to look at yet.
  • 60. 59 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Interpolating a surface from raster points: Now that we have a raster of spot elevations for 2nd and 3rd -order streams, we can use a surface interpolation tool to generate our isobase map. There are several methods to choose from, but I prefer the inverse distance-squared weighting of the r.surf.idw tool to do the job. RasterInterpolate surfacesIDW from raster points. In the ‘Optional’ section, you may specify the number of existing points you’d like to reference for each newly-created pixel. The default is 12. A higher number of points will generalize your surface further. Make your choice (you can always overwrite later with a different number), and hit ‘Run’. It may take a few minutes to generate your isobase surface; don’t worry, GRASS is hard at work and will produce results at the end! It turns out that I did need to adjust my number of interpolation points—12 produced a blocky map, increasing to 40 made for a much smoother display. Note the quick-n-dirty revision of the quick-n-dirty lineament map from earlier. Isobase first attempt. Pretty blocky! I upped the number of points to factor into each interpolation to 40. Isobase, second attempt. Much nicer! Add isobase contours and inferred lineaments.
  • 61. 60 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Teaser: viewing surfaces in NVIZ: In the GRASS environment, a nice 3D visualization tool called NVIZ exists. (FileNVIZ). You may display any sort of elevation data, overlay any vector files, and intuitively choose camera angles and lighting conditions. Here’s a peek of our new isobase surface in NVIZ. Notice it’s a bit rough around the edges (literally!), but it has potential to look good, and can serve you well— all you have to do is tinker with it. The reason I’m writing this portion is that there’s a trick to using it in lat/long projections. In UTM coordinates, like I’m using, things are AOK. Everything stretches correctly because everything is in the same units (meters). In lat/long coordinates, however, surfaces in NVIZ will appear distorted and darkly- shadowed. The reason for this is, while elevation units are still in meters, horizontal units are in arc- seconds! This means you’ll have elevation values of 1500m or 3667m, but distances between them of 0.003 or 0.05 (degrees). Needless to say, NVIZ thinks that you have an immensely high elevation, with an immensely great change over 0.05 meters of horizontal change! No wonder the output is blotchy and dark. To fix this, use the Raster Map Calculator to divide your lat/long projected DEM by 111120, the correct conversion factor from meters to degrees. Then, use your manually skewed DEM as the elevation raster for NVIZ—the results will look much better. (In case you weren’t paying attention, this is only necessary for lat/long projections, NOT utm, which are fine as they are). First glimpse of NVIZ’s 3D capabilities. Beat that, ArcScene!
  • 62. 61 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby VI. Epilogue: Why you should use R to plot your data Although the general trend in undergraduate geoprocessing is to plot your smaller datasets in Excel, there are a multitude of reasons to use a more robust (albeit less intuitive) object-oriented interface like R (or Matlab). Let me, in the space of a page, attempt to convince you. 1) Excel costs money. R is free, under the GNU license. No description necessary for this one! Free is often better, especially when the free option is more robust and powerful than the expensive one. 2) Although it’s reassuring to see your data and graphs on the same page, it’s hard to organize when everything’s smashed together. In R, you import data as a table, convert to a matrix or extract column vectors, and store each piece of data separately, in neatly-arranged variables. This means if you’d like to multiply one column of data by another, you know exactly where to find them and exactly what their dimensions are. 3) Although controls are fairly point-and-click and user-friendly in Excel, many tasks are by hand! You can type A1*B1 in column C to get an answer, but you have to drag-down this calculation (or double-click the crosshairs) to apply it to ALL of columns A and B. Any sort of manipulation performed on column vectors (which is what each column of data is) must be manually performed in some way. When you make a plot of your data, you have to manually alter the default parameters to get the display you really want (which is often, if not all the time for me). In R, all of the processes that are manual in Excel may be easily performed with a few keystrokes! This makes it faster in the long run, as well as neater and less of a pain if you screw up and have to re-do something. 4) Excel’s graphics must be heavily-tweaked to reach professional standards. Admittedly, so do R’s graphics. The difference, however, lies in the fact that you can type in all the parameters you want to change as part of the plot function, and re-use the ones you like later with virtually no effort. Thus, the click-that-button, open-that-window, change-that-font, alter-the-line- weight, change-the-color-and-outline-of-markers, change-the-scale, change-that-axis-label, change- that-other-axis-label pain-in-the-rear routine becomes much more streamline and efficient, especially if you’re mass-producing graphs of similar type. 5) Excel just can’t do certain things. Would you like to visualize 3D data (x,y,z coordinates, for example)? Would you like to create a rose diagram (circular histogram, for directional data)? Well, sorry! Because Excel doesn’t know how to do those things. Period. Why? Because Excel is a business and economics spreadsheet program. R is a computational environment for data and graphics. The underlying function of R is much better suited for scientific use. And if you can’t find what you need, you can likely find a plugin that does what you want from the CRAN server (where all things good and R come from). The only drawback to using R is the glaringly blank user interface, and overwhelmingly non-intuitive (at first) controls. The solution: download RStudio or Rcommander (user-friendly interfaces specifically made for the R environment). Read a few intro tutorials (I will create one shortly). Things become clear, and you’ll sure be glad you took the time to learn it.
  • 63. 62 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Two plots I made in R (I did add a few final touches in Inkscape):
  • 64. 63 This and more at my website: https://sites.google.com/site/sorsbysj/ LinkedIn: https://www.linkedin.com/in/skylersorsby Glossary of terms GIS: Geographic Information System. A software package that processes and displays geospatial data. ArcGIS: the industry standard professional GIS platform, developed by ESRI. It is intuitive to use. GRASS GIS: Geographic Resources Analysis Support System. An open-source GIS equivalent in many respects to ArcGIS, but less intuitive. Raster: gridded data assembled as a sheet of pixels. Photographs are raster images. Elevation models are raster images. This format is useful for describing continuous data with high textural variation. Vector: a polygon, line, or point. These features are expressed as a function of equations and lines, and retain crisp, sharp edges when scaled. DEM: “Digital Elevation Model”. A raster containing spatial coordinates and a height value for each pixel. These are digital versions of topographic base maps. NED: National Elevation Dataset. Many elevation modules in The National Map derive from this source. Lidar: Light Detection and Ranging. A laser-scanned topographic model, precise to within several horizontal meters, and several vertical centimeters. Isobase: aka base-level. The elevation level that hillslopes attempt to erode down to. “Topographic equilibrium level”. Sinuosity: The ‘curviness’ of a line. This is measured for channel segments by dividing the shorest, straight-line distance between two points on a river by the length of river between them. Map Algebra: whole-raster math, with a calculation applied to each pixel (slope maps are derived with map algebra). Helpful guides to learning GRASS GIS (available online as pdfs): “Introduction to GRASS GIS software” by Markus Neteler “GRASS 6 in a nutshell” by Markus Neteler, for the Open Source Geospatial ’05 Conference “GRASS GIS for Geomorphologists: An introductory guide” by Andrew Wickert Some nice innovations for studying morphotectonism: Grohmann, CH, 2004. “Morphometric analysis in geographic information systems: applications of free software GRASS and R”. Computers and Geosciences, Issue 30: Elsevier Ltd. p.1055-1067. Grohmann, CH, Riccomini, C, and Alves, FM. 2007. “SRTM-based morphotectonic analysis of the Pocos de Caldas Alkaline Massif, southeastern Brazil”. Computers and Geosciences, Issue 33: Elsevier Ltd. p. 10-19.