<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FDnewcomb</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FDnewcomb"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FDnewcomb"/>
	<updated>2026-05-25T15:11:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26514</id>
		<title>NCGIS2021</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26514"/>
		<updated>2021-03-30T16:26:22Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: added link to slides from github site&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Grassgis logo colorlogo text whitebg.png|300px|right|none]]&lt;br /&gt;
&lt;br /&gt;
This page is about work related to GRASS GIS presented at NCGIS2021 (NC GIS 2021 Virtual Conference, North Carolina, USA), February 16-19, 2021 (https://ncgisconference.com/).&lt;br /&gt;
&lt;br /&gt;
== Presentations ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Methods for Recreating a DEM when Reprojecting a LiDAR Point Cloud ===&lt;br /&gt;
&lt;br /&gt;
* Description: Working with multiple LiDAR collection point clouds across a landscape can require reprojecting the point cloud and rebuilding a DEM for further analysis.  It's fairly straightforward to create a DEM from ground points, but there will be holes for buildings and waterbodies where breaklines may not be present to assist in filling in the holes.  Using the LiDAR ground point data, it's possible to quickly fill voids using GRASS GIS raster methods, and to identify areas where the technique does not work well and further work is needed.&lt;br /&gt;
* Speakers:  Doug Newcomb, Stephen Mather (Cleveland Metroparks)&lt;br /&gt;
* Materials: [https://youtu.be/p9KCfufNYgE Recording]&lt;br /&gt;
* Slides: [https://github.com/dnewcomb/grasspresent/blob/main/NCGIS_2021_recreating_the_DEM_dn_svm2.odp]&lt;br /&gt;
&lt;br /&gt;
=== New Major Release of GRASS GIS ===&lt;br /&gt;
&lt;br /&gt;
[[File:Grass gis r valley bottom 3d.png|thumb|right|Graphical user interface of the upcoming GRASS GIS 8.0.0 release with result of r.valley.bottom tool in 3D]]&lt;br /&gt;
&lt;br /&gt;
* Description: GRASS GIS is an all-in-one tool for geospatial analysis and remote sensing made by users for users. GRASS GIS is open source which removes the licensing hassle and cost and puts users to the center of the story. This talk will highlight the new major release of GRASS GIS. Version 8 provides a completely new first-time user experience and streamlines how users interact with their data. New features include dark-themed interface support, Voronoi-based area skeletons, gap filling, near feature attribute statistics, image collection support, customizable solar radiance model, and unlimited fine-scale hydrologic simulation. The new version contains all features from the previous versions including Python 3 scripting, spatio-temporal data analysis, PostgreSQL connections, HPC cluster support, low-end hardware support, and more. Experimental features available for download now include buffer statistics, road centerlines, vector attribute update with Python syntax, coastal, stream, and dam flooding, mass-preserving interpolation, transect generation, longest flow path, iterative subwatershed delineation, edge detection, user and producer accuracies, attribute plots, valley flatness, cost-distance area connectivity, and Sentinel, MODIS, USGS, and GBIF data download. Additionally, issues, fixes, and ongoing improvements are now publicly accessible at GitHub. This talk presents contributions by the whole GRASS GIS user and developer community and highlights additions by the Center for Geospatial Analytics at North Carolina State University.&lt;br /&gt;
* Speakers:  Vaclav Petras (NC State University), Anna Petrasova (NC State University)&lt;br /&gt;
* Materials: [https://youtu.be/-elznGO_r_c Recording], [https://wenzeslaus.github.io/grass-gis-talks/ncgis2021.html Slides]&lt;br /&gt;
&lt;br /&gt;
=== Creating Bathymetric Data for a Freshwater Reservoir using Satellite Imagery ===&lt;br /&gt;
&lt;br /&gt;
* Description: As part of a habitat assessment for aquatic species in the Roanoke Rapids reservoir, recent bathymetric data was data was needed. The only publicly available bathymetric data was 5 ft contour lines from the historic USGS 7.5’ quadrangle. Using publicly available Sentinel 2 data, depth data from biological sampling locations, lake water level data, and publicly available LiDAR data, a bathymetry layer was created using a combination of GRASS GIS software and the R project statistical software.&lt;br /&gt;
* Speaker: Doug Newcomb (USFWS)&lt;br /&gt;
* Materials: [https://youtu.be/3hOwUdaV4yM Recording]&lt;br /&gt;
* Slides: [https://ecos.fws.gov/ServCat/DownloadFile/196770]&lt;br /&gt;
&lt;br /&gt;
== Posters ==&lt;br /&gt;
&lt;br /&gt;
=== FUTURES v2: Urban Growth Modeling at Scale ===&lt;br /&gt;
&lt;br /&gt;
[[File:FUTURES v2 petrasova 2021 poster.png|thumb|right|FUTURES v2 new development result for USA at 30 m (poster thumbnail)]]&lt;br /&gt;
&lt;br /&gt;
* Authors: Anna Petrasova, Georgina Sanchez, Vaclav Petras, Ross K. Meentemeyer&lt;br /&gt;
* [https://www.researchgate.net/publication/349505889_FUTURES_v2_Urban_Growth_Modeling_at_Scale#fullTextFileContent Poster at ResearchGate]&lt;br /&gt;
* Citation: Petrasova, A., Sanchez, G., Petras, V., Meentemeyer, R.K. (2021) FUTURES v2: Urban Growth Modeling at Scale. NC GIS Conference. February 2021. [https://doi.org/10.13140/RG.2.2.11830.22081 DOI: 10.13140/RG.2.2.11830.22081]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- including last conference (in the series) and the most recent conference added before this --&amp;gt;&lt;br /&gt;
&amp;lt;!-- it would make sense to include also the next conference in the series and (any) next conference recorded --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[GRASS GIS at NCGIS2017]]&lt;br /&gt;
* [[NCGIS2019]]&lt;br /&gt;
* [[GRASS GIS Raleigh meetups 2017]]&lt;br /&gt;
* [[FOSS4G NA 2016: GRASS related workshops and presentations]] (Raleigh, NC)&lt;br /&gt;
* [[Using GRASS GIS through Python and tangible interfaces (workshop at FOSS4G NA 2016)]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Conferences]]&lt;br /&gt;
[[Category: 2021]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26513</id>
		<title>NCGIS2021</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26513"/>
		<updated>2021-03-30T16:17:56Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Added link to powerpoint presentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Grassgis logo colorlogo text whitebg.png|300px|right|none]]&lt;br /&gt;
&lt;br /&gt;
This page is about work related to GRASS GIS presented at NCGIS2021 (NC GIS 2021 Virtual Conference, North Carolina, USA), February 16-19, 2021 (https://ncgisconference.com/).&lt;br /&gt;
&lt;br /&gt;
== Presentations ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Methods for Recreating a DEM when Reprojecting a LiDAR Point Cloud ===&lt;br /&gt;
&lt;br /&gt;
* Description: Working with multiple LiDAR collection point clouds across a landscape can require reprojecting the point cloud and rebuilding a DEM for further analysis.  It's fairly straightforward to create a DEM from ground points, but there will be holes for buildings and waterbodies where breaklines may not be present to assist in filling in the holes.  Using the LiDAR ground point data, it's possible to quickly fill voids using GRASS GIS raster methods, and to identify areas where the technique does not work well and further work is needed.&lt;br /&gt;
* Speakers:  Doug Newcomb, Stephen Mather (Cleveland Metroparks)&lt;br /&gt;
* Materials: [https://youtu.be/p9KCfufNYgE Recording]&lt;br /&gt;
&lt;br /&gt;
=== New Major Release of GRASS GIS ===&lt;br /&gt;
&lt;br /&gt;
[[File:Grass gis r valley bottom 3d.png|thumb|right|Graphical user interface of the upcoming GRASS GIS 8.0.0 release with result of r.valley.bottom tool in 3D]]&lt;br /&gt;
&lt;br /&gt;
* Description: GRASS GIS is an all-in-one tool for geospatial analysis and remote sensing made by users for users. GRASS GIS is open source which removes the licensing hassle and cost and puts users to the center of the story. This talk will highlight the new major release of GRASS GIS. Version 8 provides a completely new first-time user experience and streamlines how users interact with their data. New features include dark-themed interface support, Voronoi-based area skeletons, gap filling, near feature attribute statistics, image collection support, customizable solar radiance model, and unlimited fine-scale hydrologic simulation. The new version contains all features from the previous versions including Python 3 scripting, spatio-temporal data analysis, PostgreSQL connections, HPC cluster support, low-end hardware support, and more. Experimental features available for download now include buffer statistics, road centerlines, vector attribute update with Python syntax, coastal, stream, and dam flooding, mass-preserving interpolation, transect generation, longest flow path, iterative subwatershed delineation, edge detection, user and producer accuracies, attribute plots, valley flatness, cost-distance area connectivity, and Sentinel, MODIS, USGS, and GBIF data download. Additionally, issues, fixes, and ongoing improvements are now publicly accessible at GitHub. This talk presents contributions by the whole GRASS GIS user and developer community and highlights additions by the Center for Geospatial Analytics at North Carolina State University.&lt;br /&gt;
* Speakers:  Vaclav Petras (NC State University), Anna Petrasova (NC State University)&lt;br /&gt;
* Materials: [https://youtu.be/-elznGO_r_c Recording], [https://wenzeslaus.github.io/grass-gis-talks/ncgis2021.html Slides]&lt;br /&gt;
&lt;br /&gt;
=== Creating Bathymetric Data for a Freshwater Reservoir using Satellite Imagery ===&lt;br /&gt;
&lt;br /&gt;
* Description: As part of a habitat assessment for aquatic species in the Roanoke Rapids reservoir, recent bathymetric data was data was needed. The only publicly available bathymetric data was 5 ft contour lines from the historic USGS 7.5’ quadrangle. Using publicly available Sentinel 2 data, depth data from biological sampling locations, lake water level data, and publicly available LiDAR data, a bathymetry layer was created using a combination of GRASS GIS software and the R project statistical software.&lt;br /&gt;
* Speaker: Doug Newcomb (USFWS)&lt;br /&gt;
* Materials: [https://youtu.be/3hOwUdaV4yM Recording]&lt;br /&gt;
* Slides: [https://ecos.fws.gov/ServCat/DownloadFile/196770]&lt;br /&gt;
&lt;br /&gt;
== Posters ==&lt;br /&gt;
&lt;br /&gt;
=== FUTURES v2: Urban Growth Modeling at Scale ===&lt;br /&gt;
&lt;br /&gt;
[[File:FUTURES v2 petrasova 2021 poster.png|thumb|right|FUTURES v2 new development result for USA at 30 m (poster thumbnail)]]&lt;br /&gt;
&lt;br /&gt;
* Authors: Anna Petrasova, Georgina Sanchez, Vaclav Petras, Ross K. Meentemeyer&lt;br /&gt;
* [https://www.researchgate.net/publication/349505889_FUTURES_v2_Urban_Growth_Modeling_at_Scale#fullTextFileContent Poster at ResearchGate]&lt;br /&gt;
* Citation: Petrasova, A., Sanchez, G., Petras, V., Meentemeyer, R.K. (2021) FUTURES v2: Urban Growth Modeling at Scale. NC GIS Conference. February 2021. [https://doi.org/10.13140/RG.2.2.11830.22081 DOI: 10.13140/RG.2.2.11830.22081]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- including last conference (in the series) and the most recent conference added before this --&amp;gt;&lt;br /&gt;
&amp;lt;!-- it would make sense to include also the next conference in the series and (any) next conference recorded --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[GRASS GIS at NCGIS2017]]&lt;br /&gt;
* [[NCGIS2019]]&lt;br /&gt;
* [[GRASS GIS Raleigh meetups 2017]]&lt;br /&gt;
* [[FOSS4G NA 2016: GRASS related workshops and presentations]] (Raleigh, NC)&lt;br /&gt;
* [[Using GRASS GIS through Python and tangible interfaces (workshop at FOSS4G NA 2016)]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Conferences]]&lt;br /&gt;
[[Category: 2021]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26492</id>
		<title>NCGIS2021</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=NCGIS2021&amp;diff=26492"/>
		<updated>2021-02-12T13:18:21Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: First presentation not made as USFWS employee&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Grassgis logo colorlogo text whitebg.png|300px|right|none]]&lt;br /&gt;
&lt;br /&gt;
This page is about work related to GRASS GIS presented at NCGIS2021 (NC GIS 2021 Virtual Conference, North Carolina, USA), February 16-19, 2021 (https://ncgisconference.com/).&lt;br /&gt;
&lt;br /&gt;
== Presentations ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Methods for Recreating a DEM when Reprojecting a LiDAR Point Cloud ===&lt;br /&gt;
&lt;br /&gt;
* Description: Working with multiple LiDAR collection point clouds across a landscape can require reprojecting the point cloud and rebuilding a DEM for further analysis.  It's fairly straightforward to create a DEM from ground points, but there will be holes for buildings and waterbodies where breaklines may not be present to assist in filling in the holes.  Using the LiDAR ground point data, it's possible to quickly fill voids using GRASS GIS raster methods, and to identify areas where the technique does not work well and further work is needed.&lt;br /&gt;
* Speakers:  Doug Newcomb , Stephen Mather (Cleveland Metroparks)&lt;br /&gt;
&lt;br /&gt;
=== New Major Release of GRASS GIS ===&lt;br /&gt;
&lt;br /&gt;
[[File:Grass gis r valley bottom 3d.png|thumb|right|Graphical user interface of the upcoming GRASS GIS 8.0.0 release with result of r.valley.bottom tool in 3D]]&lt;br /&gt;
&lt;br /&gt;
* Description: GRASS GIS is an all-in-one tool for geospatial analysis and remote sensing made by users for users. GRASS GIS is open source which removes the licensing hassle and cost and puts users to the center of the story. This talk will highlight the new major release of GRASS GIS. Version 8 provides a completely new first-time user experience and streamlines how users interact with their data. New features include dark-themed interface support, Voronoi-based area skeletons, gap filling, near feature attribute statistics, image collection support, customizable solar radiance model, and unlimited fine-scale hydrologic simulation. The new version contains all features from the previous versions including Python 3 scripting, spatio-temporal data analysis, PostgreSQL connections, HPC cluster support, low-end hardware support, and more. Experimental features available for download now include buffer statistics, road centerlines, vector attribute update with Python syntax, coastal, stream, and dam flooding, mass-preserving interpolation, transect generation, longest flow path, iterative subwatershed delineation, edge detection, user and producer accuracies, attribute plots, valley flatness, cost-distance area connectivity, and Sentinel, MODIS, USGS, and GBIF data download. Additionally, issues, fixes, and ongoing improvements are now publicly accessible at GitHub. This talk presents contributions by the whole GRASS GIS user and developer community and highlights additions by the Center for Geospatial Analytics at North Carolina State University.&lt;br /&gt;
* Speakers:  Vaclav Petras (NC State University), Anna Petrasova (NC State University)&lt;br /&gt;
* Materials: [https://wenzeslaus.github.io/grass-gis-talks/ncgis2021.html Slides]&lt;br /&gt;
&lt;br /&gt;
=== Creating Bathymetric Data for a Freshwater Reservoir using Satellite Imagery ===&lt;br /&gt;
&lt;br /&gt;
* Description: As part of a habitat assessment for aquatic species in the Roanoke Rapids reservoir, recent bathymetric data was data was needed. The only publicly available bathymetric data was 5 ft contour lines from the historic USGS 7.5’ quadrangle. Using publicly available Sentinel 2 data, depth data from biological sampling locations, lake water level data, and publicly available LiDAR data, a bathymetry layer was created using a combination of GRASS GIS software and the R project statistical software.&lt;br /&gt;
* Speaker: Doug Newcomb (USFWS)&lt;br /&gt;
&lt;br /&gt;
== Posters ==&lt;br /&gt;
&lt;br /&gt;
=== FUTURES v2: Urban Growth Modeling at Scale ===&lt;br /&gt;
&lt;br /&gt;
[[File:FUTURES v2 petrasova 2021 poster.png|thumb|right|FUTURES v2 new development result for USA at 30 m (poster thumbnail)]]&lt;br /&gt;
&lt;br /&gt;
* Authors: Anna Petrasova, Georgina Sanchez, Vaclav Petras, Ross K. Meentemeyer&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- including last conference (in the series) and the most recent conference added before this --&amp;gt;&lt;br /&gt;
&amp;lt;!-- it would make sense to include also the next conference in the series and (any) next conference recorded --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[GRASS GIS at NCGIS2017]]&lt;br /&gt;
* [[NCGIS2019]]&lt;br /&gt;
* [[GRASS GIS Raleigh meetups 2017]]&lt;br /&gt;
* [[FOSS4G NA 2016: GRASS related workshops and presentations]] (Raleigh, NC)&lt;br /&gt;
* [[Using GRASS GIS through Python and tangible interfaces (workshop at FOSS4G NA 2016)]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Conferences]]&lt;br /&gt;
[[Category: 2021]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Compile_and_Install_Ubuntu&amp;diff=26199</id>
		<title>Compile and Install Ubuntu</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Compile_and_Install_Ubuntu&amp;diff=26199"/>
		<updated>2020-05-24T02:13:13Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: updated library install  and configure string for for ubuntu 20.04&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;boilerplate metadata&amp;quot; id=&amp;quot;attention&amp;quot; style=&amp;quot;-moz-border-radius:30px; border: 1px double #35824B; margin-bottom: 1.5em; padding: 1em; background-color: #f9f9f9;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p style=&amp;quot;font-size: 150%; text-align: left;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#35824B&amp;quot;&amp;gt;'''Attention'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;&amp;lt;span style=&amp;quot;color:#333333&amp;quot;&amp;gt;'''The following instructions describe the compilation and installation of 7.x and its required dependencies completely from the source on Ubuntu based systems. Please, prefer pre-compiled packages over the manual way described below unless you know ''what'' and ''how'', you want to learn and help testing.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Very Important notes ==&lt;br /&gt;
&lt;br /&gt;
* '''Pre-compiled packages and backports''' are available from [https://wiki.ubuntu.com/UbuntuGIS UbuntuGIS] via their [https://launchpad.net/~ubuntugis/+archive/ppa/ ppa.launchpad] repositories. '''This is by far the simplest and fastest solution. Please prefer it over the manual way of compiling source code yourself as described below.'''&lt;br /&gt;
** Daily ready to installl GRASS GIS builds of the 7.x release branch and trunk are available from ''ppa:grass/grass-devel''&lt;br /&gt;
**: &amp;lt;source lang=bash&amp;gt;sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable&amp;lt;/source&amp;gt;&lt;br /&gt;
**: &amp;lt;source lang=bash&amp;gt;sudo add-apt-repository ppa:grass/grass-devel&amp;lt;/source&amp;gt;&lt;br /&gt;
** Latest version of GRASS 7.x is available from ''ppa:grass/grass-stable''&lt;br /&gt;
**: &amp;lt;source lang=bash&amp;gt;sudo add-apt-repository ppa:ubuntugis/ppa&amp;lt;/source&amp;gt; &lt;br /&gt;
**: &amp;lt;source lang=bash&amp;gt;sudo add-apt-repository ppa:grass/grass-stable&amp;lt;/source&amp;gt;&lt;br /&gt;
*: &amp;lt;source lang=bash&amp;gt;sudo apt-get update&amp;lt;/source&amp;gt;&lt;br /&gt;
*: &amp;lt;source lang=bash&amp;gt;sudo apt-get install grass76&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick instructions ==&lt;br /&gt;
&lt;br /&gt;
These instructions should work fine on Ubuntu distributions prior to release 20.04:&lt;br /&gt;
&lt;br /&gt;
1. Install some dependencies (PROJ, GEOS, GDAL libraries) and the compiler tools &amp;lt;br /&amp;gt;&lt;br /&gt;
(note: for GRASS GIS 7.8+ you need Python 3!)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# be sure to have an updated system&lt;br /&gt;
sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade -y&lt;br /&gt;
&lt;br /&gt;
# install PROJ&lt;br /&gt;
sudo apt-get install libproj-dev proj-data proj-bin -y&lt;br /&gt;
&lt;br /&gt;
# install GEOS&lt;br /&gt;
sudo apt-get install libgeos-dev -y&lt;br /&gt;
&lt;br /&gt;
# install GDAL&lt;br /&gt;
sudo apt-get install libgdal-dev python3-gdal gdal-bin -y&lt;br /&gt;
&lt;br /&gt;
# install PDAL (optional)&lt;br /&gt;
sudo apt-get install libpdal-dev pdal libpdal-plugin-python -y&lt;br /&gt;
&lt;br /&gt;
# recommended to give Python3 precedence over Python2 (which is end-of-life since 2019)&lt;br /&gt;
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1&lt;br /&gt;
&lt;br /&gt;
# install compiler stuff and further dependencies&lt;br /&gt;
# this is a single command, please copy-paste it entirely into the terminal:&lt;br /&gt;
sudo apt-get install \&lt;br /&gt;
  build-essential \&lt;br /&gt;
  flex make bison gcc libgcc1 g++ cmake ccache \&lt;br /&gt;
  python3 python3-dev \&lt;br /&gt;
  python3-opengl \&lt;br /&gt;
  python-wxversion python-wxtools python-wxgtk3.0 python3-wxgtk4.0 \&lt;br /&gt;
  python3-dateutil libgsl-dev python3-numpy \&lt;br /&gt;
  wx3.0-headers wx-common libwxgtk3.0-dev \&lt;br /&gt;
  libwxbase3.0-dev   \&lt;br /&gt;
  libncurses5-dev \&lt;br /&gt;
  libbz2-dev \&lt;br /&gt;
  zlib1g-dev gettext \&lt;br /&gt;
  libtiff5-dev libpnglite-dev \&lt;br /&gt;
  libcairo2 libcairo2-dev \&lt;br /&gt;
  sqlite3 libsqlite3-dev \&lt;br /&gt;
  libpq-dev \&lt;br /&gt;
  libreadline6-dev libfreetype6-dev \&lt;br /&gt;
  libfftw3-3 libfftw3-dev \&lt;br /&gt;
  libboost-thread-dev libboost-program-options-dev liblas-c-dev \&lt;br /&gt;
  subversion libzstd-dev \&lt;br /&gt;
  checkinstall \&lt;br /&gt;
  libglu1-mesa-dev libxmu-dev \&lt;br /&gt;
  ghostscript wget -y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This are optional video codec libraries for NVIZ video output:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install \&lt;br /&gt;
  libav-tools libavutil-dev ffmpeg2theora \&lt;br /&gt;
  libffmpegthumbnailer-dev \&lt;br /&gt;
  libavcodec-dev \&lt;br /&gt;
  libxmu-dev \&lt;br /&gt;
  libavformat-dev libswscale-dev &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
For Ubuntu 20.04:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install \&lt;br /&gt;
  build-essential \&lt;br /&gt;
  flex make bison gcc libgcc1 g++ cmake ccache \&lt;br /&gt;
  python3 python3-dev \&lt;br /&gt;
  python3-opengl \&lt;br /&gt;
  python-wxversion python-wxtools python3-wxgtk4.0 \&lt;br /&gt;
  python3-dateutil libgsl-dev python3-numpy \&lt;br /&gt;
  wx3.0-headers wx-common  libwxgtk3.0-gtk3-dev \&lt;br /&gt;
  libwxbase3.0-dev   \&lt;br /&gt;
  libncurses5-dev \&lt;br /&gt;
  libbz2-dev \&lt;br /&gt;
  zlib1g-dev gettext \&lt;br /&gt;
  libtiff5-dev libpnglite-dev \&lt;br /&gt;
  libcairo2 libcairo2-dev \&lt;br /&gt;
  sqlite3 libsqlite3-dev \&lt;br /&gt;
  libpq-dev \&lt;br /&gt;
  libreadline6-dev libfreetype6-dev \&lt;br /&gt;
  libfftw3-3 libfftw3-dev \&lt;br /&gt;
  libboost-thread-dev libboost-program-options-dev  libpdal-dev\&lt;br /&gt;
  subversion libzstd-dev \&lt;br /&gt;
  checkinstall \&lt;br /&gt;
  libglu1-mesa-dev libxmu-dev \&lt;br /&gt;
  ghostscript wget -y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
For NVIZ on Ubuntu 20.04:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install \&lt;br /&gt;
  ffmpeg libavutil-dev ffmpeg2theora \&lt;br /&gt;
  libffmpegthumbnailer-dev \&lt;br /&gt;
  libavcodec-dev \&lt;br /&gt;
  libxmu-dev \&lt;br /&gt;
  libavformat-dev libswscale-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now we have all &amp;quot;ingredients&amp;quot; readily installed on our system.&lt;br /&gt;
&lt;br /&gt;
'''Source code download''':&lt;br /&gt;
&lt;br /&gt;
There a two ways of getting the source code: either use a) the weekly snapshot (cannot be updated, or b) the source code from the GitHub repository (you can update your local copy easily in future):&lt;br /&gt;
&lt;br /&gt;
'''a) Download of the weekly source code snapshot (not recommended):'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# download latest GRASS GIS 7.x stable release source code:&lt;br /&gt;
mkdir $HOME/src/&lt;br /&gt;
cd  $HOME/src/&lt;br /&gt;
wget https://grass.osgeo.org/grass78/source/snapshot/grass-7.8.git_src_snapshot_latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
# Unpack source code package and remove tarball archive:&lt;br /&gt;
tar xvfz grass-7.8.git_src_snapshot_latest.tar.gz&lt;br /&gt;
rm -f grass-7.8.git_src_snapshot_latest.tar.gz &lt;br /&gt;
&lt;br /&gt;
# rename source code directory (yes, with the questionmarks!)&lt;br /&gt;
mv grass-7.8.git_src_snapshot_20??_??_?? grass-7.8.latest&lt;br /&gt;
cd grass-7.8.latest/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''b) Download of the current development version from GitHub (adopt the path below accordingly)'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/OSGeo/grass.git grass-7.8.latest.git&lt;br /&gt;
cd grass-7.8.latest.git/&lt;br /&gt;
git checkout releasebranch_7_8&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can '''compile''' the source code in order to generate the GRASS GIS binaries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# &amp;quot;configure&amp;quot; source code for local machine (checks for CPU type etc):&lt;br /&gt;
MYCFLAGS='-O2 -fPIC -fno-common -fexceptions -std=gnu99 -fstack-protector -m64'&lt;br /&gt;
#MYCXXFLAGS=''&lt;br /&gt;
MYLDFLAGS='-Wl,--no-undefined -Wl,-z,now'&lt;br /&gt;
&lt;br /&gt;
LDFLAGS=&amp;quot;$MYLDFLAGS&amp;quot; CFLAGS=&amp;quot;$MYCFLAGS&amp;quot; CXXFLAGS=&amp;quot;$MYCXXFLAGS&amp;quot; ./configure \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-proj --with-proj-share=/usr/share/proj \&lt;br /&gt;
  --with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
  --with-python \&lt;br /&gt;
  --with-geos \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-nls \&lt;br /&gt;
  --with-zstd \&lt;br /&gt;
  --with-liblas \&lt;br /&gt;
  --with-pdal \&lt;br /&gt;
  --with-cairo --with-cairo-ldflags=-lfontconfig \&lt;br /&gt;
  --with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
  --with-wxwidgets \&lt;br /&gt;
  --with-fftw \&lt;br /&gt;
  --with-motif \&lt;br /&gt;
  --with-opengl-libs=/usr/include/GL \&lt;br /&gt;
  --with-postgres=yes --with-postgres-includes=&amp;quot;/usr/include/postgresql&amp;quot; \&lt;br /&gt;
  --without-netcdf \&lt;br /&gt;
  --without-mysql \&lt;br /&gt;
  --without-odbc \&lt;br /&gt;
  --without-openmp \&lt;br /&gt;
  --without-ffmpeg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
For Ubuntu 20.04 remove --with-liblas :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# &amp;quot;configure&amp;quot; source code for local machine (checks for CPU type etc):&lt;br /&gt;
MYCFLAGS='-O2 -fPIC -fno-common -fexceptions -std=gnu99 -fstack-protector -m64'&lt;br /&gt;
#MYCXXFLAGS=''&lt;br /&gt;
MYLDFLAGS='-Wl,--no-undefined -Wl,-z,now'&lt;br /&gt;
&lt;br /&gt;
LDFLAGS=&amp;quot;$MYLDFLAGS&amp;quot; CFLAGS=&amp;quot;$MYCFLAGS&amp;quot; CXXFLAGS=&amp;quot;$MYCXXFLAGS&amp;quot; ./configure \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-proj --with-proj-share=/usr/share/proj \&lt;br /&gt;
  --with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
  --with-python \&lt;br /&gt;
  --with-geos \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-nls \&lt;br /&gt;
  --with-zstd \&lt;br /&gt;
  --with-pdal \&lt;br /&gt;
  --with-cairo --with-cairo-ldflags=-lfontconfig \&lt;br /&gt;
  --with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
  --with-wxwidgets \&lt;br /&gt;
  --with-fftw \&lt;br /&gt;
  --with-motif \&lt;br /&gt;
  --with-opengl-libs=/usr/include/GL \&lt;br /&gt;
  --with-postgres=yes --with-postgres-includes=&amp;quot;/usr/include/postgresql&amp;quot; \&lt;br /&gt;
  --without-netcdf \&lt;br /&gt;
  --without-mysql \&lt;br /&gt;
  --without-odbc \&lt;br /&gt;
  --without-openmp \&lt;br /&gt;
  --without-ffmpeg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now compile source code (takes some time as it generates binary code from the source code):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# note: the more CPUs you have, the higher the -j number may be set to&lt;br /&gt;
# here: build using 4 CPU cores&lt;br /&gt;
make -j4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install resulting GRASS GIS 7 binaries into /usr/local/:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start GRASS GIS in the terminal:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grass78&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Done &amp;amp; enjoy!'''&lt;br /&gt;
&lt;br /&gt;
== Hints ==&lt;br /&gt;
&lt;br /&gt;
* Usually, the installation of compiled code is done by using the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;make&amp;lt;/source&amp;gt; tool. Alternatively, this can be done by using the ''checkinstall'' tool (i.e., &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;sudo checkinstall&amp;lt;/source&amp;gt;  instead of  &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;sudo make install&amp;lt;/source&amp;gt;) which eases off removal of packages. If ''checkinstall'' fails to deliver, please note some related bugs: [https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/78455 78455] and [https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/599163 599163]. Useful information on using ''checkinstall'': [https://help.ubuntu.com/community/CompilingEasyHowTo Compiling things on Ubuntu the Easy Way].&lt;br /&gt;
&lt;br /&gt;
* In multi-core processors, the compilation performance can be boosted by using  ''-j''  switches (e.g. &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;make -j2&amp;lt;/source&amp;gt;  or  &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;make -j3&amp;lt;/source&amp;gt;  or even &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;make -j4&amp;lt;/source&amp;gt;) which specify the number of jobs (commands) to run simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Current stable Ubuntu version ===&lt;br /&gt;
First, update the system from the repositories&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, install ''SQLite'', ''SVN'' and ''dependencies'' for compiling PROJ, GEOS, GDAL/OGR, GRASS, GDAL-GRASS-PLUGIN (some additional packages may be required in this case); the following action will also install various dependencies (listed in the command line as &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;The following extra packages will be installed:&amp;lt;/source&amp;gt;...):&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following dependencies concern [http://releases.ubuntu.com/xenial/ Ubuntu Xenial Xerus (16.04 LTS)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a single command, please copy-paste it entirely into the terminal:&lt;br /&gt;
sudo apt-get install \&lt;br /&gt;
  build-essential \&lt;br /&gt;
  flex make bison gcc libgcc1 g++ cmake ccache \&lt;br /&gt;
  python python-dev \&lt;br /&gt;
  python-opengl \&lt;br /&gt;
  python-wxversion python-wxtools python-wxgtk3.0 \&lt;br /&gt;
  python-dateutil libgsl-dev python-numpy \&lt;br /&gt;
  wx3.0-headers wx-common libwxgtk3.0-dev \&lt;br /&gt;
  libwxbase3.0-dev   \&lt;br /&gt;
  libncurses5-dev \&lt;br /&gt;
  zlib1g-dev gettext \&lt;br /&gt;
  libtiff5-dev libpnglite-dev \&lt;br /&gt;
  libcairo2 libcairo2-dev \&lt;br /&gt;
  sqlite3 libsqlite3-dev \&lt;br /&gt;
  libpq-dev \&lt;br /&gt;
  libreadline6 libreadline6-dev libfreetype6-dev \&lt;br /&gt;
  libfftw3-3 libfftw3-dev \&lt;br /&gt;
  libboost-thread-dev libboost-program-options-dev liblas-c-dev \&lt;br /&gt;
  resolvconf \&lt;br /&gt;
  libjasper-dev \&lt;br /&gt;
  subversion \&lt;br /&gt;
  libav-tools libavutil-dev ffmpeg2theora \&lt;br /&gt;
  libffmpegthumbnailer-dev \&lt;br /&gt;
  libavcodec-dev \&lt;br /&gt;
  libxmu-dev \&lt;br /&gt;
  libavformat-dev libswscale-dev \&lt;br /&gt;
  checkinstall \&lt;br /&gt;
  libglu1-mesa-dev libxmu-dev \&lt;br /&gt;
  ghostscript&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following dependencies concern [http://releases.ubuntu.com/trusty/ Ubuntu Trusty Tahr (14.04 LTS)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a single command, please copy-paste it entirely into the terminal:&lt;br /&gt;
sudo apt-get install \&lt;br /&gt;
  build-essential \&lt;br /&gt;
  flex make bison gcc libgcc1 g++ \&lt;br /&gt;
  python python-dev \&lt;br /&gt;
  python-dateutil libgsl0-dev python-numpy \&lt;br /&gt;
  zlib1g-dev gettext \&lt;br /&gt;
  libtiff-dev libpnglite-dev \&lt;br /&gt;
  sqlite3 libsqlite3-dev \&lt;br /&gt;
  libboost-thread-dev libboost-program-options-dev liblas-c-dev \&lt;br /&gt;
  resolvconf \&lt;br /&gt;
  subversion \&lt;br /&gt;
  checkinstall \&lt;br /&gt;
  cmake ccache \&lt;br /&gt;
  python-opengl \&lt;br /&gt;
  python-wxversion python-wxtools python-wxgtk2.8 \&lt;br /&gt;
  wx2.8-headers wx-common libwxgtk2.8-dev libwxgtk2.8-dbg \&lt;br /&gt;
  libwxbase2.8-dev  libwxbase2.8-dbg \&lt;br /&gt;
  libncurses5-dev \&lt;br /&gt;
  libcairo2 libcairo2-dev \&lt;br /&gt;
  libpq-dev \&lt;br /&gt;
  libreadline6 libreadline6-dev libfreetype6-dev \&lt;br /&gt;
  libfftw3-3 libfftw3-dev \&lt;br /&gt;
  libjasper-dev \&lt;br /&gt;
  libav-tools libavutil-dev ffmpeg2theora \&lt;br /&gt;
  libffmpegthumbnailer-dev \&lt;br /&gt;
  libavcodec-dev \&lt;br /&gt;
  libxmu-dev \&lt;br /&gt;
  libavformat-dev libswscale-dev \&lt;br /&gt;
  libglu1-mesa-dev libxmu-dev \&lt;br /&gt;
  ghostscript&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* See the additional packages bellow and in other sections and install them. Note that some of them are [http://grass.osgeo.org/grass70/source/REQUIREMENTS.html required], namely PROJ.4, GEOS and GDAL. If you don't have special requirements, it is usually enough just to install PROJ.4, GEOS and GDAL from repository (rather then compile them manually).&lt;br /&gt;
&lt;br /&gt;
* for mysql support, &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libmysqlclient-dev&amp;lt;/source&amp;gt; is required&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install libmysqlclient-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for netcdf support, &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;netcdf-bin&amp;lt;/source&amp;gt; and &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libnetcdf-dev&amp;lt;/source&amp;gt;  is required&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install netcdf-bin libnetcdf-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for {{AddonCmd|i.spec.unmix}} Addon support, install LAPACK and BLAS:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install libatlas-dev libblas-dev liblapack-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* create a directory as a simple user where all source code is going to be stored -- in this example, a directory named &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;src&amp;lt;/source&amp;gt; under &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local&amp;lt;/source&amp;gt; is created &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkdir /usr/local/src&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* take over directories ownerships ('''replace''' below the terms ''userid'' and ''groupid'' with a real &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;userid&amp;lt;/source&amp;gt;): &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo chown userid:groupid /usr/local/src&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* similarly, grant &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;rwx&amp;lt;/source&amp;gt; (read-write-execute) permissions for our ''userid'' and ''groupid'' onto the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;src&amp;lt;/source&amp;gt; directory: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo chmod ug+rwx /usr/local/src&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Earlier Ubuntu versions ===&lt;br /&gt;
&lt;br /&gt;
For [http://old-releases.ubuntu.com/releases/ earlier Ubuntu versions], '''watch out for dependency differences!''' Modify the dependency list given above as instructed below.&lt;br /&gt;
&lt;br /&gt;
* for [http://releases.ubuntu.com/raring/ Ubuntu Raring Ringtail (13.04]), change the following dependencies:&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libav-tools libavutil-dev --&amp;gt; ffmpeg&amp;lt;/source&amp;gt; &lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt; --&amp;gt; lesstif2-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for [http://releases.ubuntu.com/precise/ Ubuntu Precise Pangolin (12.04)], change the following dependencies:&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libpnglite-dev --&amp;gt; libpngwriter-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libtiff5-dev --&amp;gt; libtiff4-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for [http://old-releases.ubuntu.com/releases/maverick/ Ubuntu Maverick Meerkat (10.10)] or later, change the following dependencies:&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libpngwriter-dev --&amp;gt; libpngwriter0-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;libcairo-dev --&amp;gt; libcairo2-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;fftw3 --&amp;gt; libfftw3-3&amp;lt;/source&amp;gt;&lt;br /&gt;
** &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;fftw3-dev --&amp;gt; libfftw3-dev&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* for [http://old-releases.ubuntu.com/releases/lucid/ Ubuntu Lucid Lynx (10.04)] or later, also install: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo apt-get install libhdf4-alt-dev libhdf4-0-alt&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for [http://old-releases.ubuntu.com/releases/ earlier Ubuntu versions], also install: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt; sudo apt-get install libhdf4g-dev libhdf4g-run&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using pre-compiled dev Packages for PROJ.4, GEOS and GDAL ==&lt;br /&gt;
&lt;br /&gt;
=== PROJ.4 ===&lt;br /&gt;
&lt;br /&gt;
Install the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;dev&amp;lt;/source&amp;gt; package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install libproj-dev proj-data proj-bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the call to &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;./configure&amp;lt;/source&amp;gt; for [[#GRASS|GRASS]], replace &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;--with-proj-share=/usr/local/share/proj/&amp;lt;/source&amp;gt; by &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;--with-proj-share=/usr/share/proj/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GEOS ===&lt;br /&gt;
&lt;br /&gt;
Install the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;dev&amp;lt;/source&amp;gt; package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# probably you also need to additionally install &amp;quot;libgeos-c1v5&amp;quot;&lt;br /&gt;
sudo apt-get install libgeos-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the call to &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;./configure&amp;lt;/source&amp;gt; for [[#GRASS|GRASS]], replace &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;--with-geos=/usr/local/bin/geos-config&amp;lt;/source&amp;gt; by &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;--with-geos=/usr/bin/geos-config&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GDAL ===&lt;br /&gt;
&lt;br /&gt;
Install the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;dev&amp;lt;/source&amp;gt; package (possibly without support for datumgrid):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install libgdal-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For support of WMS in wxGUI install Python GDAL bindings and GDAL executables:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python-gdal gdal-bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install also the required extra packages (note the message: &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;The following extra packages will be installed:&amp;lt;/source&amp;gt;)&lt;br /&gt;
* Look out for packages to be removed by this operation -- this is most likely caused by incompatible package versions. Fix these problems in advance using commands like the following: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install &amp;lt;package&amp;gt;=&amp;lt;required.version&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GRASS-GIS ===&lt;br /&gt;
&lt;br /&gt;
[[Compile_and_Install_Ubuntu#GRASS_GIS|Jump to sub-section GRASS-GIS below]]&lt;br /&gt;
&lt;br /&gt;
== Using pre-compiled dev Packages for PROJ.4, GEOS and GDAL from GIS.lab PPA==&lt;br /&gt;
&lt;br /&gt;
Ivan Mincik has made all required packages available in his [https://launchpad.net/~imincik/+archive/ubuntu/gis PPA]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo add-apt-repository ppa:imincik/gis&lt;br /&gt;
sudo apt-get install libproj-dev libgdal-dev python-gdal libgeos-dev&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can either also install GRASS GIS 7 from there or compile it yourself (see [[Compile_and_Install_Ubuntu#GRASS_GIS|Jump to sub-section GRASS-GIS below]])&lt;br /&gt;
&lt;br /&gt;
== Compile from source ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PROJ4 ===&lt;br /&gt;
&lt;br /&gt;
* within the directory &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local/src&amp;lt;/source&amp;gt; (create it if it does not exist) checkout &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;proj&amp;lt;/source&amp;gt; from its Subversion repository: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co http://svn.osgeo.org/metacrs/proj/branches/4.8/proj/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* get [http://download.osgeo.org/proj/proj-datumgrid-1.5.zip '''proj-datumgrid-1.5.zip'''] from [http://trac.osgeo.org/proj proj' trac] and move it under &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;proj/nad&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip&lt;br /&gt;
mv proj-datumgrid-1.5.zip /usr/local/src/proj/nad&lt;br /&gt;
cd /usr/local/src/proj/nad&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* decompress it &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip proj-datumgrid-1.5.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* go back to the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;proj&amp;lt;/source&amp;gt; directory &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /usr/local/src/proj&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* if required, clean previous configuration &amp;amp; compilation &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make distclean&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* simple configure, compile and install &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./configure  &amp;amp;&amp;amp;  make  &amp;amp;&amp;amp;  sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; or &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./configure &amp;amp;&amp;amp; make -j2  &amp;amp;&amp;amp;  sudo checkinstall&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ensure that &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local/lib&amp;lt;/source&amp;gt; is added to &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/etc/ld.so.conf&amp;lt;/source&amp;gt; and afterwards run &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* finally, go back to the parent directory simply by instructing&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GEOS ===&lt;br /&gt;
&lt;br /&gt;
* download '''geos-3.4.2.tar.bz2''' from [http://trac.osgeo.org/geos/ http://trac.osgeo.org/geos] using &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;wget&amp;lt;/source&amp;gt; &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* move to the &amp;quot;source-code&amp;quot; directory and decompress&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /usr/local/src/&lt;br /&gt;
bunzip2 geos-3.4.2.tar.bz2&lt;br /&gt;
tar xvf  geos-3.4.2.tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* if required, clean previous configuration &amp;amp; compilation  &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make distclean&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* move to geos directory  &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd geos-3.4.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* simple configure, compile and install &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./configure  &amp;amp;&amp;amp;  make  &amp;amp;&amp;amp;  sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; or &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./configure  &amp;amp;&amp;amp; make -j2  &amp;amp;&amp;amp;  sudo checkinstall&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* do not forget to execute &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GDAL ===&lt;br /&gt;
&lt;br /&gt;
'''Note''', GDAL must be compiled '''without''' GRASS support&lt;br /&gt;
&lt;br /&gt;
* download the current stable version &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://svn.osgeo.org/gdal/branches/1.11/gdal gdal_stable&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* enter in the &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;gdal_stable&amp;lt;/source&amp;gt; directory &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /usr/local/src/gdal_stable&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* optionally, update the source code &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn up&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* if required, clean previous configurations/compilations &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make distclean&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* a simple configuration without any parameters will detect and support various installed libraries &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./configure&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* skip to the ''compile and install'' step or check the following customised configuration example&lt;br /&gt;
 &amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-g -Wall&amp;quot; LDFLAGS=&amp;quot;-s&amp;quot; ./configure \&lt;br /&gt;
--with-png=internal \&lt;br /&gt;
--with-libtiff=internal \&lt;br /&gt;
--with-geotiff=internal \&lt;br /&gt;
--with-jpeg=internal \&lt;br /&gt;
--with-gif=internal \&lt;br /&gt;
--with-ecw=no \&lt;br /&gt;
--with-expat=yes \&lt;br /&gt;
--with-sqlite3=yes \&lt;br /&gt;
--with-geos=yes \&lt;br /&gt;
--with-python \&lt;br /&gt;
--with-libz=internal \&lt;br /&gt;
--with-netcdf \&lt;br /&gt;
--with-threads=yes \&lt;br /&gt;
--without-grass  \&lt;br /&gt;
--without-ogdi \&lt;br /&gt;
--with-pg=/usr/bin/pg_config \&lt;br /&gt;
--with-xerces=yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* compile, install &amp;amp; ldconfig &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make -j2  &amp;amp;&amp;amp;  sudo make install  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; or &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make -j2  &amp;amp;&amp;amp;  sudo checkinstall  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GRASS GIS ===&lt;br /&gt;
&lt;br /&gt;
Note the differences between different GRASS version (SVN branches) in download and cofiguration. Note also the changes required if you installed some of the dependencies from packages (rather then compiled them yourself).&lt;br /&gt;
&lt;br /&gt;
To fully understand the build process, read the  &amp;lt;code&amp;gt;INSTALL&amp;lt;/code&amp;gt; file, which is located in GRASS' source code root directory. For example, if you have problems related to 32bit versus 64bit, pay attention to section &amp;lt;code&amp;gt;(C)&amp;lt;/code&amp;gt;, entitled &amp;lt;code&amp;gt;COMPILATION NOTES for 64bit platforms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''' Getting GRASS' source code '''&lt;br /&gt;
&lt;br /&gt;
Select from one of the GRASS GIS versions and download (using SVN) the source code:&lt;br /&gt;
&lt;br /&gt;
* VERY OLD STABLE VERSION: current state of the 6.4.x release branch version (stable) &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4 grass64_release&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* STABLE VERSION: current state of the 7.2.x release branch version (current stable) &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass/branches/releasebranch_7_2 grass72_release&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* DEVELOPMENT VERSION: current state of the trunk (latest version of code where the development happens) &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass/trunk grass7_trunk&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* for other versions see [http://trac.osgeo.org/grass/wiki/DownloadSource GRASS Trac wiki].&lt;br /&gt;
&lt;br /&gt;
''' Configure, Compile and Install'''&lt;br /&gt;
&lt;br /&gt;
Enter the directory with the source code (downloaded by svn client), for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd grass72_release&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''GRASS GIS 6 example configuration''' (which can/should be adjusted according to specific needs):&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-O2 -Wall&amp;quot; LDFLAGS=&amp;quot;-s&amp;quot; ./configure \&lt;br /&gt;
--enable-largefile=yes \&lt;br /&gt;
--with-nls \&lt;br /&gt;
--with-cxx \&lt;br /&gt;
--with-proj-share=/usr/local/share/proj/ \&lt;br /&gt;
--with-geos=/usr/local/bin/geos-config \&lt;br /&gt;
--with-readline \&lt;br /&gt;
--with-python=yes \&lt;br /&gt;
--with-wxwidgets \&lt;br /&gt;
--with-cairo \&lt;br /&gt;
--with-opengl-libs=/usr/include/GL \&lt;br /&gt;
--with-motif \&lt;br /&gt;
--with-tcltk-includes=&amp;quot;/usr/include/tcl8.5&amp;quot; \&lt;br /&gt;
--with-ffmpeg=yes --with-ffmpeg-includes=&amp;quot;/usr/include/libavcodec /usr/include/libavformat /usr/include/libswscale /usr/include/libavutil&amp;quot; \&lt;br /&gt;
--with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
--with-postgres=yes --with-postgres-includes=&amp;quot;/usr/include/postgresql&amp;quot; \&lt;br /&gt;
--with-sqlite=yes \&lt;br /&gt;
--with-mysql=yes --with-mysql-includes=&amp;quot;/usr/include/mysql&amp;quot; \&lt;br /&gt;
--with-odbc=no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
'''Note''', the above configuration uses the &amp;lt;code&amp;gt;Proj4&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;GEOS&amp;lt;/code&amp;gt; packages compiled from the source. In the case that pre-compiled versions from the repository are required, remove the above corresponding lines to use the &amp;quot;defaults&amp;quot;, i.e. &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--with-proj-share=/usr/share/proj \&lt;br /&gt;
--with-geos=/usr/bin/geos-config \&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''GRASS GIS 7 example configuration''' (which can/should be adjusted according to specific needs):&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-O2 -Wall&amp;quot; LDFLAGS=&amp;quot;-s&amp;quot; ./configure \&lt;br /&gt;
--enable-largefile=yes \&lt;br /&gt;
--with-nls \&lt;br /&gt;
--with-cxx \&lt;br /&gt;
--with-readline \&lt;br /&gt;
--with-proj-share=/usr/local/share/proj/ \&lt;br /&gt;
--with-geos=/usr/local/bin/geos-config \&lt;br /&gt;
--with-wxwidgets \&lt;br /&gt;
--with-cairo \&lt;br /&gt;
--with-opengl-libs=/usr/include/GL \&lt;br /&gt;
--with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
--with-postgres=yes --with-postgres-includes=&amp;quot;/usr/include/postgresql&amp;quot; \&lt;br /&gt;
--with-sqlite=yes \&lt;br /&gt;
--with-mysql=yes --with-mysql-includes=&amp;quot;/usr/include/mysql&amp;quot; \&lt;br /&gt;
--with-odbc=no \&lt;br /&gt;
--with-liblas=yes --with-liblas-config=/usr/bin/liblas-config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
'''Note''', the above configuration uses the &amp;lt;code&amp;gt;Proj4&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;GEOS&amp;lt;/code&amp;gt; packages compiled from the source. In the case that pre-compiled versions from the repository are required, remove the above corresponding lines to use the &amp;quot;defaults&amp;quot;, i.e. (note the backslashe at the end of each line)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--with-proj-share=/usr/share/proj \&lt;br /&gt;
--with-geos=/usr/bin/geos-config \&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
'''Note 2''', if compiling with liblas, you will want liblas compiled with laszip support. liblas will look for laszip  includes in /usr/local/include/laszip by default. Creating the laszip directory in /usr/local/include and making a soft link.  ln -s /usr/local/include/lasz*.hpp /usr/local/include/laszip and ln -s /usr/local/include/lasunz*.hpp /usr/local/include/laszip should allow liblas to compile with laszip support &lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* compile &amp;amp; install &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make -j2  &amp;amp;&amp;amp;  sudo make install  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; or &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make -j2  &amp;amp;&amp;amp;  sudo checkinstall  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
   &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For subsequent updates execute (not need for the first time):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn up&lt;br /&gt;
make -j2 &amp;amp;&amp;amp; sudo make install  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes, it is required to clean previous configuration and compilation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make distclean&lt;br /&gt;
svn up&lt;br /&gt;
./configure ... # (use the configure command above)&lt;br /&gt;
make -j2 &amp;amp;&amp;amp; sudo make install  &amp;amp;&amp;amp;  sudo ldconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GDAL-GRASS-Plugin ===&lt;br /&gt;
&lt;br /&gt;
* get the plugin from [http://download.osgeo.org/gdal OSGeo's Download Server]: [http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz] using &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;wget&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz&lt;br /&gt;
tar xvzf gdal-grass-1.4.3.tar.gz&lt;br /&gt;
cd gdal-grass-1.4.3&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* create   &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/etc/ld.so.conf.d/grass.conf&amp;lt;/source&amp;gt;   or add in   &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/etc/ld.so.conf&amp;lt;/source&amp;gt; the GRASS library path: &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# GRASS 6.4 library path&lt;br /&gt;
/usr/local/src/grass64_release/lib&lt;br /&gt;
&lt;br /&gt;
# GRASS 6.5 library path&lt;br /&gt;
/usr/local/src/grass6_devel/lib&lt;br /&gt;
&lt;br /&gt;
# GRASS 7.0 library path&lt;br /&gt;
/usr/local/src/grass64_release/lib&lt;br /&gt;
&lt;br /&gt;
# GRASS 7 (development version) library path&lt;br /&gt;
/usr/local/src/grass7_trunk/lib&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* optionally, clean previous configurations/compilations&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 make distclean&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* configure -- point to GRASS installation/binaries&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt; ./configure \&lt;br /&gt;
 --prefix=/usr/local \&lt;br /&gt;
 --with-gdal=/usr/local/bin/gdal-config \&lt;br /&gt;
 --with-grass=/usr/local/grass-6.4.4svn/ \&lt;br /&gt;
 --with-autoload=&amp;quot;/usr/local/lib/gdalplugins/&amp;quot; \&lt;br /&gt;
 --with-ld-shared=&amp;quot;g++ -shared&amp;quot;&amp;lt;/source&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
* for GRASS 6.5, replace the respective line above, depending on where the source code in question is stored, with something like &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt; --with-grass=/usr/local/grass-6.5.svn/&amp;lt;/source&amp;gt;&lt;br /&gt;
* for GRASS 7.0, replace with &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt; --with-grass=/usr/local/grass-7.0.0svn/&amp;lt;/source&amp;gt;&lt;br /&gt;
* for GRASS 7, replace with &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt; --with-grass=/usr/local/grass_trunk/&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* compile &amp;amp; install using checkinstall&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 make -j2  &amp;amp;&amp;amp;  sudo checkinstall&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Post compilation/installation control =&lt;br /&gt;
&lt;br /&gt;
* For a recommended quick-check read the [http://grass.osgeo.org/wiki/Compile_and_install_GRASS_and_QGIS_with_GDAL/OGR_Plugin#Troubleshooting Troubleshooting] section at [http://grass.osgeo.org/wiki/Compile_and_install_GDAL-GRASS_plugin Compile_and_install_GDAL-GRASS_plugin]&lt;br /&gt;
&lt;br /&gt;
* in case of errors in future compilation attempts, remember to remove program binaries and files created with the &amp;quot;configuration&amp;quot; from previous compilations with&lt;br /&gt;
 make distclean&lt;br /&gt;
&lt;br /&gt;
* another common mistake is compiling a module against some GRASS version and then try to run it through another GRASS version. The solution is to recompile the affected module or, in case there are multiple GRASS installations, set up properly LD_LIBRARY_PATH paths.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Removal of GRASS =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get rid of a GRASS binaries installation, delete (update version numbers accordingly)&lt;br /&gt;
* &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local/grass-7.8.1.dev&amp;lt;/source&amp;gt; (directory, binaries location)&lt;br /&gt;
* &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local/bin/grass78&amp;lt;/source&amp;gt; (file)&lt;br /&gt;
* &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/home/username/.grassrc7&amp;lt;/source&amp;gt; (file)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If wanted, delete also the complete source code:&lt;br /&gt;
* &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;/usr/local/src/grass78_release&amp;lt;/source&amp;gt; (directory, source code location)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To remove &amp;lt;code&amp;gt;grass&amp;lt;/code&amp;gt; (or any other package) which was installed by &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;checkinstall&amp;lt;/source&amp;gt;, use &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;dpkg&amp;lt;/source&amp;gt;, e.g.&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo dpkg -r grass78 # package name defined at installation is important&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Packaging of GRASS =&lt;br /&gt;
&lt;br /&gt;
* See https://salsa.debian.org/debian-gis-team/grass/tree/master/debian for directions on rolling your own packages.&lt;br /&gt;
&lt;br /&gt;
For details about the auto-nightly-builds and after-market supplied packages from UbuntuGIS, please refer to the [[Ubuntu Packaging]] wiki page.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Docker: https://grass.osgeo.org/download/software/docker-images/&lt;br /&gt;
* [[Ubuntu Packaging]]&lt;br /&gt;
* [[GRASS in Debian]]&lt;br /&gt;
&lt;br /&gt;
= Archived Notes =&lt;br /&gt;
&lt;br /&gt;
Notes that concern the configuration and compilation of GRASS GIS and its dependencies for older versions of Ubuntu-Linux.&lt;br /&gt;
&lt;br /&gt;
== Ubuntu 7.10 64-bit ==&lt;br /&gt;
&lt;br /&gt;
* Compiling latest GRASS source code on a 64-bit machine (with an ATI graphic card) under Ubuntu 7.10 64-bit with support for: 64-bit, SQLite, OpenGL, PYTHON, FFMPEG&lt;br /&gt;
(Based on &amp;quot;Ubuntu 6.06 LTS - GRASS 6.1 Compilation Script&amp;quot; by David Finlayson)&lt;br /&gt;
''Assuming it is the first time attempting to compile GRASS' source code &amp;amp; installing SVN, PROJ, GDAL/OGR''&lt;br /&gt;
&lt;br /&gt;
'''Preparation'''&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
* install dependencies for compiling (in general) and dependencies for GRASS: PROJ, GDAL/OGR&lt;br /&gt;
 sudo apt-get install grass build-essential flex bison libncurses5-dev zlib1g-dev \&lt;br /&gt;
 libgdal1-dev libtiff4-dev libgcc1 libpng12-dev tcl8.4-dev tk8.4-dev fftw3-dev \&lt;br /&gt;
 libfreetype6-dev libavcodec-dev libxmu-dev gdal-bin libreadline5 libreadline5-dev \&lt;br /&gt;
 make python-dev python-wxversion&lt;br /&gt;
&lt;br /&gt;
* install SQLite&lt;br /&gt;
 sudo apt-get install sqlite3 libsqlite3-dev&lt;br /&gt;
&lt;br /&gt;
* install SVN&lt;br /&gt;
 sudo apt-get install subversion&lt;br /&gt;
&lt;br /&gt;
* create a directory as a simple user where source code(s) are going to be stored (in our example we use a directory called '''src''' under '''/usr/local''')&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir /usr/local/src&lt;br /&gt;
&lt;br /&gt;
* grant rwx (read-write-execute) permissions for our userid/ groupid on the directory (replace words userid and groupid with real userid):&lt;br /&gt;
 sudo chown ''userid'':''groupid'' /usr/local/src&lt;br /&gt;
&lt;br /&gt;
 sudo chmod ug+rwx /usr/local/src&lt;br /&gt;
&lt;br /&gt;
* download latest source code from GRASS SVN repository in a directory on the system (e.g. /usr/local/src)&lt;br /&gt;
 svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk&lt;br /&gt;
&lt;br /&gt;
* Above command places GRASS' source code in '''/usr/local/src/grass_trunk'''. In case of a subsequent update use the command: '''svn up''' from within the grass_trunk directory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''Before''' attempting to compile GRASS, READ section (C) in the '''INSTALL''' file located in the main directory of GRASS source code entitled:&lt;br /&gt;
'''(C) COMPILATION NOTES for 64bit platforms'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* installing FFTW3 if not already on system&lt;br /&gt;
 sudo apt-get install fftw3 fftw3-dev&lt;br /&gt;
&lt;br /&gt;
'''FFMPEG'''&lt;br /&gt;
&lt;br /&gt;
Note: Back in Ubuntu 7.10, installing ffmpeg through the repositories wouldn't work with grass. The following steps were successfully used.&lt;br /&gt;
&lt;br /&gt;
* install FFMPEG (information taken from: http://stream0.org/2008/01/install-ffmpeg-on-ubuntu-gutsy.html)&lt;br /&gt;
* download source code with svn&lt;br /&gt;
 svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg&lt;br /&gt;
&lt;br /&gt;
* install dependencies&lt;br /&gt;
 sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev \&lt;br /&gt;
      liba52-0.7.4 liba52-0.7.4-dev libx264-dev libdts-dev checkinstall \&lt;br /&gt;
      build-essential subversion&lt;br /&gt;
&lt;br /&gt;
* guide to ffmpeg directory&lt;br /&gt;
 cd ffmpeg&lt;br /&gt;
&lt;br /&gt;
if necessary: '''make distclean''' before configuration (look at notes below)&lt;br /&gt;
&lt;br /&gt;
* configuration ('''note:''' the configuration parameter &amp;quot;'''--enable-pp'''&amp;quot; does not work anymore)&lt;br /&gt;
 # configure FFMPEG&lt;br /&gt;
 ./configure --enable-gpl --enable-libvorbis --enable-libtheora \&lt;br /&gt;
             --enable-liba52 --enable-libdc1394 --enable-libgsm \&lt;br /&gt;
             --enable-libmp3lame --enable-libfaad --enable-libfaac \&lt;br /&gt;
             --enable-libxvid --enable-libx264 \&lt;br /&gt;
             --enable-shared&lt;br /&gt;
&lt;br /&gt;
* compilation&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
* installation on /usr/local/bin -- important to remember when configuring GRASS' source code for compilation&lt;br /&gt;
 sudo checkinstall&lt;br /&gt;
&lt;br /&gt;
'''Go for GRASS!'''&lt;br /&gt;
* in our example we used the /usr/local/src directory to store GRASS' source code, so:&lt;br /&gt;
 cd /usr/local/src/grass_trunk&lt;br /&gt;
&lt;br /&gt;
* configuration&lt;br /&gt;
  CFLAGS=&amp;quot;-g -Wall&amp;quot; ./configure --enable-64bit \&lt;br /&gt;
        --with-libs=/usr/lib64 --with-cxx --with-freetype=yes \&lt;br /&gt;
        --with-postgres=no --with-sqlite=yes --enable-largefile=yes \&lt;br /&gt;
        --with-tcltk-includes=/usr/include/tcl8.4 \&lt;br /&gt;
        --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
        --with-opengl-libs=/usr/include/GL --with-readline \&lt;br /&gt;
        --with-python=yes --with-ffmpeg=yes \&lt;br /&gt;
        --with-ffmpeg-includes=/usr/local/include/ffmpeg&lt;br /&gt;
&lt;br /&gt;
*if OpenGL fails then maybe it is necessary to link '''glxATI.h''' with '''glx.h''' and re-run the configuration&lt;br /&gt;
&lt;br /&gt;
 cd /usr/include/GL&lt;br /&gt;
&lt;br /&gt;
 sudo ln glxATI.h glx.h&lt;br /&gt;
&lt;br /&gt;
* compilation&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
* compilation is expected to end with a statement similar to the following:&lt;br /&gt;
&lt;br /&gt;
 Started compilation: Wed Feb 27 00:24:36 CET 2008&lt;br /&gt;
 --&lt;br /&gt;
 Errors in:&lt;br /&gt;
 No errors detected.&lt;br /&gt;
&lt;br /&gt;
* installation&lt;br /&gt;
 sudo checkinstall&lt;br /&gt;
&lt;br /&gt;
* launch 64-bit GRASS.6.4.svn&lt;br /&gt;
 grass64&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
* in case of errors in future compilation attempts, remember to remove program binaries with&lt;br /&gt;
 make clean&lt;br /&gt;
* and the files created with the &amp;quot;configuration&amp;quot; from previous compilations with&lt;br /&gt;
 make distclean&lt;br /&gt;
&lt;br /&gt;
== Ubuntu 6.06, 7.10 ==&lt;br /&gt;
&lt;br /&gt;
* [http://david.p.finlayson.googlepages.com/makegrass.sh makegrass.sh] is script designed to automate most of the download, configuration and compilation of GRASS 6.x-CVS&lt;br /&gt;
** it is advised use [https://help.ubuntu.com/community/CheckInstall checkinstall] (''sudo apt-get install checkinstall'') instead of ''make install'' to keep track of installed software &lt;br /&gt;
** Think twice before using this script. Some users experienced problems such as disabled XGL etc.&lt;br /&gt;
* [[User:Steko/Automated_CVS_compiling|Here]] is another of these scripts, it's homemade so probably you'll find the above more useful for production sites.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Compilation]]&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
[[Category: FAQ]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25928</id>
		<title>Introduction to GRASS GIS with terrain analysis examples</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25928"/>
		<updated>2019-11-06T21:55:02Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Added text to explain why the linked raster layer does not show up in the display window in GRASS 7.6 on Windows&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in the Advanced GIS training for the U. S. Fish and Wildlife Service (CSP7300) in June, 2015 by Doug Newcomb and updated September 2015 with input from Paul Lang for dune extraction.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Install {{AddonCmd|r.geomorphon}} addon&lt;br /&gt;
* Create geomorphon layer from dem layer&lt;br /&gt;
* Export raster data layer from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (June 2015)&lt;br /&gt;
&lt;br /&gt;
Revision: Doug Newcomb (March 2016)&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.0&lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Imagery: &amp;lt;tt&amp;gt;pen_1m_elevation.tif&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;island_mask.tif&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/folderview?id=0B_vgoO_ZmVS3OGg2bXRWM0c0dlE&amp;amp;usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis.  The geomorphon addon in GRASS GIS can analyse an elevation raster and classify the surface into common landforms. All data are located in &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt;, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Creating GRASS Location ==&lt;br /&gt;
&lt;br /&gt;
The first thing to do when starting to work in GRASS is to create a Location. GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
* In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.0--&amp;gt; GRASS GIS 7.0 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window (to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain2.png|Location Menu 1]]&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your GRASS Locations will reside.  Creating a new directory with a unique name for GRASS data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirectory name for this particular project. Like with ArcGIS, it is best to aviod spaces in Directory names to avoid problems down the road.  The data is from the Pensacola,FL and is in a UTM projection, so call it pensacola_utm &lt;br /&gt;
&lt;br /&gt;
*Enter the Data Directory and Project Location and click Next – this brings up the location creation method menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain3.png|Defining location projection]]&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog. &lt;br /&gt;
[[File:Terrain4.png|Georeferenced file selection dialog]]&lt;br /&gt;
* Browse  and select to the D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
GRASS reads  the projection and datum information from the elevation file and displays the projection data.&lt;br /&gt;
[[File:Terrain5.png|End of Locationcreation dialog]]&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain6.png|Import georeferenced file dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain7.png|Set Extents Dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain8.png|Create new mapset dialog]]&lt;br /&gt;
&lt;br /&gt;
*Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The nest time GRASS is started, you can either select an existing Location and Mapset,  Create a new mapset within the Location, or Create a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain9.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain10.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the {{Cmd|r.external}} command.&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain11.png|Add data dialog]]&lt;br /&gt;
&lt;br /&gt;
This brings up the {{Cmd|r.external}} dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain12.png|r.exteranl dialog]]&lt;br /&gt;
&lt;br /&gt;
*Browse to D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif&lt;br /&gt;
*Click on the box for Extend region extents based on new dataset. Note that Add layers into layer tree is checked.  For large data sets, leave this unchecked. &lt;br /&gt;
*Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain13.png|800px|Result of r.external]]&lt;br /&gt;
&lt;br /&gt;
The raster is also displayed in the Map Display window. The image is 945 million pixels.  It takes much less time to link to it than import it. &lt;br /&gt;
&lt;br /&gt;
Note: With GRASS 7.6 linked raster layers do not display until a color table is set.  Set the color table by Right-clicking on the layer, and selecting Set Color Table ( 2/3 of the way down). When the r.colors menu comes up, select the Define Tab. From the Name of color table drop down, select elevation. Click the Run button.  You will now see the sample elevation layer.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to:&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain14.png|Access the region settings]]&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select pen_1m_elev@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain15.png|Region settings dialog]]&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see output in the {{Cmd|g.region}} window and in the layer manager window.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain16.png|800px]]&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain17.png|Terrain17.png]]&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definition: resolution, bounds, rows and columns.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain18.png|Terrain18.png]]&lt;br /&gt;
&lt;br /&gt;
However, we are not really interested in the entire area, just a small section of the Western island. Let’s zoom into the area of interest with the Zoom tool on the Display window.&lt;br /&gt;
[[File:Terrain19.png|Zoom tool]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Zoom tool at the top of the Display window.&lt;br /&gt;
* Click and drag to form a box around the fat portion of the western island.&lt;br /&gt;
&lt;br /&gt;
Your Display window should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain20.png|Terrain20.png]]&lt;br /&gt;
&lt;br /&gt;
Since we are only working with this area, we can change the region values so that processing is only done in this area.  The easiest way to do this is to: &lt;br /&gt;
&lt;br /&gt;
* Click on the Various zoom options button on the Display window&lt;br /&gt;
* Select Set computational region extent from display&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain21.png|Set computational extent]]&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, Click on Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
The new extents of the region are now displayed.  Scroll up to compare to the old extents. You should see that the computational region is now about 23 million cells instead of 945 million.  This means that any computations will be much faster and will only work with the portion of the elevation layer that is within the new extents.&lt;br /&gt;
&lt;br /&gt;
== Step 4:  Changing Raster Colors ==&lt;br /&gt;
&lt;br /&gt;
There is very little topographical relief on this barrier island and it is difficult to see the differences in the features with the default color scheme.  To modify the colors,&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, Click Raster--&amp;gt;Manage colors--&amp;gt;Manage color rules interactively.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain22.png]]&lt;br /&gt;
&lt;br /&gt;
*In the color table window, set enter 4 in the box next to the Add button in the lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain23.png|Interactive color  management menu]]&lt;br /&gt;
&lt;br /&gt;
You can then manually set the colors and the intervals.  The colors will ramp between the intervals you set.  Make sure to keep nv and default in white and at the end for this exercise.  &lt;br /&gt;
&lt;br /&gt;
*Try different color settings and click the preview button.  &lt;br /&gt;
*When satisfied with your colors, click OK&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain24.png]]&lt;br /&gt;
&lt;br /&gt;
Your display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain25.png]]&lt;br /&gt;
&lt;br /&gt;
== Step 5: Adding the r.geomorphon Addon ==&lt;br /&gt;
( This step is no longer necessary , since r.geomorphon is now a core command in GRASS)&lt;br /&gt;
&lt;br /&gt;
== Step 6: Running r.geomorphon ==&lt;br /&gt;
( Update: Since the r.geomorphon command has been integrated int GRASS core in the current version of GRASS, you can start it by using the GUI to select Raster--&amp;gt;Terrain Analysis--&amp;gt;Landform.)&lt;br /&gt;
 &lt;br /&gt;
The {{AddonCmd|r.geomorphon}} command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes:&lt;br /&gt;
Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To start {{AddonCmd|r.geomorphon}}, &lt;br /&gt;
&lt;br /&gt;
*In the GRASS Command window, type {{AddonCmd|r.geomorphon}} and press Enter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain29.png|Starting {{AddonCmd|r.geomorphon}} from the command line]]&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the {{AddonCmd|r.geomorphon}} menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, select pen_1m_elev@PERMANENT&lt;br /&gt;
* In the Outer search radius, enter 60 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain30.png|r.geomorphon menu]]&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
*Click on the patterns tab.&lt;br /&gt;
*Type pensacola_form_60cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain31.png|r.geomorphon pattern menu]]&lt;br /&gt;
&lt;br /&gt;
*Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed, and a progress bar will show the progress of the command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain32.png]]&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the {{AddonCmd|r.geomorphon}} command is only using 60 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina (6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.0 on Windows is currently a 32-bit applcation and cannot address more than 2GB RAM on Windows 7 64 bit.&lt;br /&gt;
&lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain33.png|Add raster layer button]]&lt;br /&gt;
&lt;br /&gt;
* In the {{Cmd|d.rast}} menu that pops up, select pensacola_forms_60cell&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain34.png]]&lt;br /&gt;
&lt;br /&gt;
*Click OK&lt;br /&gt;
&lt;br /&gt;
Your overview map should look like this:&lt;br /&gt;
[[File:Terrain35.png|r.geomorphon result]]&lt;br /&gt;
&lt;br /&gt;
Use the zoom tool in the Display window to zoom into the section on the extreme lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain36.png]]&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  &lt;br /&gt;
&lt;br /&gt;
*Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain37.png|Value selection tool]]&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain38.png|Terrain38.png]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
*Click on the Add map elements Button &lt;br /&gt;
*Select Show/Hide legend&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values and classes.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain39.png|Legend for geomorphons]]&lt;br /&gt;
&lt;br /&gt;
== Step 7: Extracting Dune Footprints ==&lt;br /&gt;
In order to simplify the output to areas just representing dunes, we can perform a simple reclassification of the categories by running {{Cmd|r.reclass}} ( Raster--&amp;gt;Change category values and labels--&amp;gt;Reclassify)&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain40.png|Terrain40.png]]&lt;br /&gt;
&lt;br /&gt;
This will open the r{{Cmd|.reclass}} menu.  &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell as your input layer. &lt;br /&gt;
* Enter dune 1 as the output layer&lt;br /&gt;
* We will be keeping Classes 2,3, and 5 (summit, ridge , and spur) as part of dunes and removing the rest of the classes. The easy way to do this is to copy and paste the following text into the box where it says enter the text directly (as shown in the graphic below). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 = NULL&lt;br /&gt;
2 = 1 dune&lt;br /&gt;
3 = 1 dune&lt;br /&gt;
4 = NULL&lt;br /&gt;
5 = 1 dune&lt;br /&gt;
6 = NULL&lt;br /&gt;
7= NULL&lt;br /&gt;
8 = NULL&lt;br /&gt;
9 = NULL&lt;br /&gt;
10 = NULL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain41.png|Terrain41.png]]&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
Uncheck every layer in the layer manager window except the dunes layer.  Your Map Display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain42.png|dune reclassifiaction]]&lt;br /&gt;
&lt;br /&gt;
You now have a separate layer representing the dunes for this section of beach.&lt;br /&gt;
&lt;br /&gt;
While it seems like you have created a new layer, r.reclass actually just displays the old layer with different symbology.  This is very fast and takes up much less hard drive space.  GRASS GIS  will treat the result of r.class like a distinct layer for raster calculation and masking functions&lt;br /&gt;
&lt;br /&gt;
== Step 8: Exporting to GeoTiff ==&lt;br /&gt;
&lt;br /&gt;
While GRASS is a rich environment for analysis, the GRASS 7.0 datasets are not easily accessible by other applications.  Exporting to a common file format such as geotiff would make the data more generally available.&lt;br /&gt;
&lt;br /&gt;
To export the final geomorphon layer:&lt;br /&gt;
*From the Layer Manager window select File--&amp;gt;Export Raster map--&amp;gt;Common export formats&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain43.png|r.out.gdal selection]]&lt;br /&gt;
&lt;br /&gt;
This will open the r.out.gdal menu, which uses the gdal library give you the option to write to many different raster formats. &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell from the Name of raster map drop down&lt;br /&gt;
* In the Name for output raster file option, Browse to the directory ( GRASS_Terrain) and enter the name of the output file as pensacola_forms_60cell.tif&lt;br /&gt;
* Keep the Raster data format as GTiff&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain44.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Creation tab&lt;br /&gt;
* Set the data type to byte ( 0-255 integer range)&lt;br /&gt;
* In the Creation options window, type COMPRESS=DEFLATE,PREDICTOR=2&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain45.png]]&lt;br /&gt;
&lt;br /&gt;
The compression options in the creation options will cause the output geotiff to be losslessly compressed using the deflate method. Predictor= 2 makes the compression more efficient (Predictor=2 is for Integer rasters, Predictor=3 is for floating point rasters).&lt;br /&gt;
The export process finishes in about 2 seconds.&lt;br /&gt;
&lt;br /&gt;
If you have any time left, &lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click to highlight pen_1m_elev&lt;br /&gt;
* Uncheck the box next to pensacola_forms_60cell&lt;br /&gt;
* In the Display window, Select 3D View from the drop down in the upper right.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain46.png|Convert to 3D viewing]]&lt;br /&gt;
&lt;br /&gt;
This activates the 3D visualization mode for GRASS GIS. There are several options for 3D display of the different raster and vector layers.  Consult with your instructor for demonstration.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain47.png|800px|3D view with control]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Tutorial]]&lt;br /&gt;
[[Category: Terrain]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25921</id>
		<title>Introduction to GRASS GIS with terrain analysis examples</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25921"/>
		<updated>2019-10-28T14:08:36Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: update to mention GUI option to access command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in the Advanced GIS training for the U. S. Fish and Wildlife Service (CSP7300) in June, 2015 by Doug Newcomb and updated September 2015 with input from Paul Lang for dune extraction.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Install {{AddonCmd|r.geomorphon}} addon&lt;br /&gt;
* Create geomorphon layer from dem layer&lt;br /&gt;
* Export raster data layer from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (June 2015)&lt;br /&gt;
&lt;br /&gt;
Revision: Doug Newcomb (March 2016)&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.0&lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Imagery: &amp;lt;tt&amp;gt;pen_1m_elevation.tif&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;island_mask.tif&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/folderview?id=0B_vgoO_ZmVS3OGg2bXRWM0c0dlE&amp;amp;usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis.  The geomorphon addon in GRASS GIS can analyse an elevation raster and classify the surface into common landforms. All data are located in &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt;, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Creating GRASS Location ==&lt;br /&gt;
&lt;br /&gt;
The first thing to do when starting to work in GRASS is to create a Location. GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
* In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.0--&amp;gt; GRASS GIS 7.0 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window (to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain2.png|Location Menu 1]]&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your GRASS Locations will reside.  Creating a new directory with a unique name for GRASS data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirectory name for this particular project. Like with ArcGIS, it is best to aviod spaces in Directory names to avoid problems down the road.  The data is from the Pensacola,FL and is in a UTM projection, so call it pensacola_utm &lt;br /&gt;
&lt;br /&gt;
*Enter the Data Directory and Project Location and click Next – this brings up the location creation method menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain3.png|Defining location projection]]&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog. &lt;br /&gt;
[[File:Terrain4.png|Georeferenced file selection dialog]]&lt;br /&gt;
* Browse  and select to the D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
GRASS reads  the projection and datum information from the elevation file and displays the projection data.&lt;br /&gt;
[[File:Terrain5.png|End of Locationcreation dialog]]&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain6.png|Import georeferenced file dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain7.png|Set Extents Dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain8.png|Create new mapset dialog]]&lt;br /&gt;
&lt;br /&gt;
*Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The nest time GRASS is started, you can either select an existing Location and Mapset,  Create a new mapset within the Location, or Create a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain9.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain10.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the {{Cmd|r.external}} command.&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain11.png|Add data dialog]]&lt;br /&gt;
&lt;br /&gt;
This brings up the {{Cmd|r.external}} dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain12.png|r.exteranl dialog]]&lt;br /&gt;
&lt;br /&gt;
*Browse to D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif&lt;br /&gt;
*Click on the box for Extend region extents based on new dataset. Note that Add layers into layer tree is checked.  For large data sets, leave this unchecked. &lt;br /&gt;
*Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain13.png|800px|Result of r.external]]&lt;br /&gt;
&lt;br /&gt;
The raster is also displayed in the Map Display window. The image is 945 million pixels.  It takes much less time to link to it than import it.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to:&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain14.png|Access the region settings]]&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select pen_1m_elev@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain15.png|Region settings dialog]]&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see output in the {{Cmd|g.region}} window and in the layer manager window.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain16.png|800px]]&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain17.png|Terrain17.png]]&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definition: resolution, bounds, rows and columns.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain18.png|Terrain18.png]]&lt;br /&gt;
&lt;br /&gt;
However, we are not really interested in the entire area, just a small section of the Western island. Let’s zoom into the area of interest with the Zoom tool on the Display window.&lt;br /&gt;
[[File:Terrain19.png|Zoom tool]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Zoom tool at the top of the Display window.&lt;br /&gt;
* Click and drag to form a box around the fat portion of the western island.&lt;br /&gt;
&lt;br /&gt;
Your Display window should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain20.png|Terrain20.png]]&lt;br /&gt;
&lt;br /&gt;
Since we are only working with this area, we can change the region values so that processing is only done in this area.  The easiest way to do this is to: &lt;br /&gt;
&lt;br /&gt;
* Click on the Various zoom options button on the Display window&lt;br /&gt;
* Select Set computational region extent from display&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain21.png|Set computational extent]]&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, Click on Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
The new extents of the region are now displayed.  Scroll up to compare to the old extents. You should see that the computational region is now about 23 million cells instead of 945 million.  This means that any computations will be much faster and will only work with the portion of the elevation layer that is within the new extents.&lt;br /&gt;
&lt;br /&gt;
== Step 4:  Changing Raster Colors ==&lt;br /&gt;
&lt;br /&gt;
There is very little topographical relief on this barrier island and it is difficult to see the differences in the features with the default color scheme.  To modify the colors,&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, Click Raster--&amp;gt;Manage colors--&amp;gt;Manage color rules interactively.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain22.png]]&lt;br /&gt;
&lt;br /&gt;
*In the color table window, set enter 4 in the box next to the Add button in the lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain23.png|Interactive color  management menu]]&lt;br /&gt;
&lt;br /&gt;
You can then manually set the colors and the intervals.  The colors will ramp between the intervals you set.  Make sure to keep nv and default in white and at the end for this exercise.  &lt;br /&gt;
&lt;br /&gt;
*Try different color settings and click the preview button.  &lt;br /&gt;
*When satisfied with your colors, click OK&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain24.png]]&lt;br /&gt;
&lt;br /&gt;
Your display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain25.png]]&lt;br /&gt;
&lt;br /&gt;
== Step 5: Adding the r.geomorphon Addon ==&lt;br /&gt;
( This step is no longer necessary , since r.geomorphon is now a core command in GRASS)&lt;br /&gt;
&lt;br /&gt;
== Step 6: Running r.geomorphon ==&lt;br /&gt;
( Update: Since the r.geomorphon command has been integrated int GRASS core in the current version of GRASS, you can start it by using the GUI to select Raster--&amp;gt;Terrain Analysis--&amp;gt;Landform.)&lt;br /&gt;
 &lt;br /&gt;
The {{AddonCmd|r.geomorphon}} command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes:&lt;br /&gt;
Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To start {{AddonCmd|r.geomorphon}}, &lt;br /&gt;
&lt;br /&gt;
*In the GRASS Command window, type {{AddonCmd|r.geomorphon}} and press Enter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain29.png|Starting {{AddonCmd|r.geomorphon}} from the command line]]&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the {{AddonCmd|r.geomorphon}} menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, select pen_1m_elev@PERMANENT&lt;br /&gt;
* In the Outer search radius, enter 60 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain30.png|r.geomorphon menu]]&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
*Click on the patterns tab.&lt;br /&gt;
*Type pensacola_form_60cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain31.png|r.geomorphon pattern menu]]&lt;br /&gt;
&lt;br /&gt;
*Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed, and a progress bar will show the progress of the command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain32.png]]&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the {{AddonCmd|r.geomorphon}} command is only using 60 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina (6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.0 on Windows is currently a 32-bit applcation and cannot address more than 2GB RAM on Windows 7 64 bit.&lt;br /&gt;
&lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain33.png|Add raster layer button]]&lt;br /&gt;
&lt;br /&gt;
* In the {{Cmd|d.rast}} menu that pops up, select pensacola_forms_60cell&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain34.png]]&lt;br /&gt;
&lt;br /&gt;
*Click OK&lt;br /&gt;
&lt;br /&gt;
Your overview map should look like this:&lt;br /&gt;
[[File:Terrain35.png|r.geomorphon result]]&lt;br /&gt;
&lt;br /&gt;
Use the zoom tool in the Display window to zoom into the section on the extreme lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain36.png]]&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  &lt;br /&gt;
&lt;br /&gt;
*Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain37.png|Value selection tool]]&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain38.png|Terrain38.png]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
*Click on the Add map elements Button &lt;br /&gt;
*Select Show/Hide legend&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values and classes.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain39.png|Legend for geomorphons]]&lt;br /&gt;
&lt;br /&gt;
== Step 7: Extracting Dune Footprints ==&lt;br /&gt;
In order to simplify the output to areas just representing dunes, we can perform a simple reclassification of the categories by running {{Cmd|r.reclass}} ( Raster--&amp;gt;Change category values and labels--&amp;gt;Reclassify)&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain40.png|Terrain40.png]]&lt;br /&gt;
&lt;br /&gt;
This will open the r{{Cmd|.reclass}} menu.  &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell as your input layer. &lt;br /&gt;
* Enter dune 1 as the output layer&lt;br /&gt;
* We will be keeping Classes 2,3, and 5 (summit, ridge , and spur) as part of dunes and removing the rest of the classes. The easy way to do this is to copy and paste the following text into the box where it says enter the text directly (as shown in the graphic below). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 = NULL&lt;br /&gt;
2 = 1 dune&lt;br /&gt;
3 = 1 dune&lt;br /&gt;
4 = NULL&lt;br /&gt;
5 = 1 dune&lt;br /&gt;
6 = NULL&lt;br /&gt;
7= NULL&lt;br /&gt;
8 = NULL&lt;br /&gt;
9 = NULL&lt;br /&gt;
10 = NULL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain41.png|Terrain41.png]]&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
Uncheck every layer in the layer manager window except the dunes layer.  Your Map Display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain42.png|dune reclassifiaction]]&lt;br /&gt;
&lt;br /&gt;
You now have a separate layer representing the dunes for this section of beach.&lt;br /&gt;
&lt;br /&gt;
While it seems like you have created a new layer, r.reclass actually just displays the old layer with different symbology.  This is very fast and takes up much less hard drive space.  GRASS GIS  will treat the result of r.class like a distinct layer for raster calculation and masking functions&lt;br /&gt;
&lt;br /&gt;
== Step 8: Exporting to GeoTiff ==&lt;br /&gt;
&lt;br /&gt;
While GRASS is a rich environment for analysis, the GRASS 7.0 datasets are not easily accessible by other applications.  Exporting to a common file format such as geotiff would make the data more generally available.&lt;br /&gt;
&lt;br /&gt;
To export the final geomorphon layer:&lt;br /&gt;
*From the Layer Manager window select File--&amp;gt;Export Raster map--&amp;gt;Common export formats&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain43.png|r.out.gdal selection]]&lt;br /&gt;
&lt;br /&gt;
This will open the r.out.gdal menu, which uses the gdal library give you the option to write to many different raster formats. &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell from the Name of raster map drop down&lt;br /&gt;
* In the Name for output raster file option, Browse to the directory ( GRASS_Terrain) and enter the name of the output file as pensacola_forms_60cell.tif&lt;br /&gt;
* Keep the Raster data format as GTiff&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain44.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Creation tab&lt;br /&gt;
* Set the data type to byte ( 0-255 integer range)&lt;br /&gt;
* In the Creation options window, type COMPRESS=DEFLATE,PREDICTOR=2&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain45.png]]&lt;br /&gt;
&lt;br /&gt;
The compression options in the creation options will cause the output geotiff to be losslessly compressed using the deflate method. Predictor= 2 makes the compression more efficient (Predictor=2 is for Integer rasters, Predictor=3 is for floating point rasters).&lt;br /&gt;
The export process finishes in about 2 seconds.&lt;br /&gt;
&lt;br /&gt;
If you have any time left, &lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click to highlight pen_1m_elev&lt;br /&gt;
* Uncheck the box next to pensacola_forms_60cell&lt;br /&gt;
* In the Display window, Select 3D View from the drop down in the upper right.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain46.png|Convert to 3D viewing]]&lt;br /&gt;
&lt;br /&gt;
This activates the 3D visualization mode for GRASS GIS. There are several options for 3D display of the different raster and vector layers.  Consult with your instructor for demonstration.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain47.png|800px|3D view with control]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Tutorial]]&lt;br /&gt;
[[Category: Terrain]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25920</id>
		<title>Introduction to GRASS GIS with terrain analysis examples</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Introduction_to_GRASS_GIS_with_terrain_analysis_examples&amp;diff=25920"/>
		<updated>2019-10-28T14:03:15Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Removed directions for installing r.geomrophon addon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in the Advanced GIS training for the U. S. Fish and Wildlife Service (CSP7300) in June, 2015 by Doug Newcomb and updated September 2015 with input from Paul Lang for dune extraction.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Install {{AddonCmd|r.geomorphon}} addon&lt;br /&gt;
* Create geomorphon layer from dem layer&lt;br /&gt;
* Export raster data layer from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (June 2015)&lt;br /&gt;
&lt;br /&gt;
Revision: Doug Newcomb (March 2016)&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.0&lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Imagery: &amp;lt;tt&amp;gt;pen_1m_elevation.tif&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;island_mask.tif&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/folderview?id=0B_vgoO_ZmVS3OGg2bXRWM0c0dlE&amp;amp;usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis.  The geomorphon addon in GRASS GIS can analyse an elevation raster and classify the surface into common landforms. All data are located in &amp;lt;tt&amp;gt;D:\CSP7300_Terrain&amp;lt;/tt&amp;gt;, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Creating GRASS Location ==&lt;br /&gt;
&lt;br /&gt;
The first thing to do when starting to work in GRASS is to create a Location. GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
* In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.0--&amp;gt; GRASS GIS 7.0 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window (to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain2.png|Location Menu 1]]&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your GRASS Locations will reside.  Creating a new directory with a unique name for GRASS data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirectory name for this particular project. Like with ArcGIS, it is best to aviod spaces in Directory names to avoid problems down the road.  The data is from the Pensacola,FL and is in a UTM projection, so call it pensacola_utm &lt;br /&gt;
&lt;br /&gt;
*Enter the Data Directory and Project Location and click Next – this brings up the location creation method menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain3.png|Defining location projection]]&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog. &lt;br /&gt;
[[File:Terrain4.png|Georeferenced file selection dialog]]&lt;br /&gt;
* Browse  and select to the D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
GRASS reads  the projection and datum information from the elevation file and displays the projection data.&lt;br /&gt;
[[File:Terrain5.png|End of Locationcreation dialog]]&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain6.png|Import georeferenced file dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain7.png|Set Extents Dialog]]&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain8.png|Create new mapset dialog]]&lt;br /&gt;
&lt;br /&gt;
*Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The nest time GRASS is started, you can either select an existing Location and Mapset,  Create a new mapset within the Location, or Create a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain9.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain10.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the {{Cmd|r.external}} command.&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain11.png|Add data dialog]]&lt;br /&gt;
&lt;br /&gt;
This brings up the {{Cmd|r.external}} dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain12.png|r.exteranl dialog]]&lt;br /&gt;
&lt;br /&gt;
*Browse to D:\CSP7300\GRASS_Terrain \imagery\pen_1m_elev.tif&lt;br /&gt;
*Click on the box for Extend region extents based on new dataset. Note that Add layers into layer tree is checked.  For large data sets, leave this unchecked. &lt;br /&gt;
*Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain13.png|800px|Result of r.external]]&lt;br /&gt;
&lt;br /&gt;
The raster is also displayed in the Map Display window. The image is 945 million pixels.  It takes much less time to link to it than import it.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to:&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain14.png|Access the region settings]]&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select pen_1m_elev@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain15.png|Region settings dialog]]&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see output in the {{Cmd|g.region}} window and in the layer manager window.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain16.png|800px]]&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain17.png|Terrain17.png]]&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definition: resolution, bounds, rows and columns.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain18.png|Terrain18.png]]&lt;br /&gt;
&lt;br /&gt;
However, we are not really interested in the entire area, just a small section of the Western island. Let’s zoom into the area of interest with the Zoom tool on the Display window.&lt;br /&gt;
[[File:Terrain19.png|Zoom tool]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Zoom tool at the top of the Display window.&lt;br /&gt;
* Click and drag to form a box around the fat portion of the western island.&lt;br /&gt;
&lt;br /&gt;
Your Display window should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain20.png|Terrain20.png]]&lt;br /&gt;
&lt;br /&gt;
Since we are only working with this area, we can change the region values so that processing is only done in this area.  The easiest way to do this is to: &lt;br /&gt;
&lt;br /&gt;
* Click on the Various zoom options button on the Display window&lt;br /&gt;
* Select Set computational region extent from display&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain21.png|Set computational extent]]&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, Click on Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
The new extents of the region are now displayed.  Scroll up to compare to the old extents. You should see that the computational region is now about 23 million cells instead of 945 million.  This means that any computations will be much faster and will only work with the portion of the elevation layer that is within the new extents.&lt;br /&gt;
&lt;br /&gt;
== Step 4:  Changing Raster Colors ==&lt;br /&gt;
&lt;br /&gt;
There is very little topographical relief on this barrier island and it is difficult to see the differences in the features with the default color scheme.  To modify the colors,&lt;br /&gt;
&lt;br /&gt;
*In the Layer Manager window, Click Raster--&amp;gt;Manage colors--&amp;gt;Manage color rules interactively.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain22.png]]&lt;br /&gt;
&lt;br /&gt;
*In the color table window, set enter 4 in the box next to the Add button in the lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain23.png|Interactive color  management menu]]&lt;br /&gt;
&lt;br /&gt;
You can then manually set the colors and the intervals.  The colors will ramp between the intervals you set.  Make sure to keep nv and default in white and at the end for this exercise.  &lt;br /&gt;
&lt;br /&gt;
*Try different color settings and click the preview button.  &lt;br /&gt;
*When satisfied with your colors, click OK&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain24.png]]&lt;br /&gt;
&lt;br /&gt;
Your display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain25.png]]&lt;br /&gt;
&lt;br /&gt;
== Step 5: Adding the r.geomorphon Addon ==&lt;br /&gt;
( This step is no longer necessary , since r.geomorphon is now a core command in GRASS)&lt;br /&gt;
&lt;br /&gt;
== Step 6: Running r.geomorphon ==&lt;br /&gt;
&lt;br /&gt;
The {{AddonCmd|r.geomorphon}} command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes:&lt;br /&gt;
Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To start {{AddonCmd|r.geomorphon}}, &lt;br /&gt;
&lt;br /&gt;
*In the GRASS Command window, type {{AddonCmd|r.geomorphon}} and press Enter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain29.png|Starting {{AddonCmd|r.geomorphon}} from the command line]]&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the {{AddonCmd|r.geomorphon}} menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, select pen_1m_elev@PERMANENT&lt;br /&gt;
* In the Outer search radius, enter 60 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain30.png|r.geomorphon menu]]&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
*Click on the patterns tab.&lt;br /&gt;
*Type pensacola_form_60cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain31.png|r.geomorphon pattern menu]]&lt;br /&gt;
&lt;br /&gt;
*Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed, and a progress bar will show the progress of the command.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain32.png]]&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the {{AddonCmd|r.geomorphon}} command is only using 60 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina (6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.0 on Windows is currently a 32-bit applcation and cannot address more than 2GB RAM on Windows 7 64 bit.&lt;br /&gt;
&lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain33.png|Add raster layer button]]&lt;br /&gt;
&lt;br /&gt;
* In the {{Cmd|d.rast}} menu that pops up, select pensacola_forms_60cell&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain34.png]]&lt;br /&gt;
&lt;br /&gt;
*Click OK&lt;br /&gt;
&lt;br /&gt;
Your overview map should look like this:&lt;br /&gt;
[[File:Terrain35.png|r.geomorphon result]]&lt;br /&gt;
&lt;br /&gt;
Use the zoom tool in the Display window to zoom into the section on the extreme lower left.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain36.png]]&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  &lt;br /&gt;
&lt;br /&gt;
*Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain37.png|Value selection tool]]&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain38.png|Terrain38.png]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
*Click on the Add map elements Button &lt;br /&gt;
*Select Show/Hide legend&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values and classes.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain39.png|Legend for geomorphons]]&lt;br /&gt;
&lt;br /&gt;
== Step 7: Extracting Dune Footprints ==&lt;br /&gt;
In order to simplify the output to areas just representing dunes, we can perform a simple reclassification of the categories by running {{Cmd|r.reclass}} ( Raster--&amp;gt;Change category values and labels--&amp;gt;Reclassify)&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain40.png|Terrain40.png]]&lt;br /&gt;
&lt;br /&gt;
This will open the r{{Cmd|.reclass}} menu.  &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell as your input layer. &lt;br /&gt;
* Enter dune 1 as the output layer&lt;br /&gt;
* We will be keeping Classes 2,3, and 5 (summit, ridge , and spur) as part of dunes and removing the rest of the classes. The easy way to do this is to copy and paste the following text into the box where it says enter the text directly (as shown in the graphic below). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 = NULL&lt;br /&gt;
2 = 1 dune&lt;br /&gt;
3 = 1 dune&lt;br /&gt;
4 = NULL&lt;br /&gt;
5 = 1 dune&lt;br /&gt;
6 = NULL&lt;br /&gt;
7= NULL&lt;br /&gt;
8 = NULL&lt;br /&gt;
9 = NULL&lt;br /&gt;
10 = NULL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain41.png|Terrain41.png]]&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
Uncheck every layer in the layer manager window except the dunes layer.  Your Map Display window should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain42.png|dune reclassifiaction]]&lt;br /&gt;
&lt;br /&gt;
You now have a separate layer representing the dunes for this section of beach.&lt;br /&gt;
&lt;br /&gt;
While it seems like you have created a new layer, r.reclass actually just displays the old layer with different symbology.  This is very fast and takes up much less hard drive space.  GRASS GIS  will treat the result of r.class like a distinct layer for raster calculation and masking functions&lt;br /&gt;
&lt;br /&gt;
== Step 8: Exporting to GeoTiff ==&lt;br /&gt;
&lt;br /&gt;
While GRASS is a rich environment for analysis, the GRASS 7.0 datasets are not easily accessible by other applications.  Exporting to a common file format such as geotiff would make the data more generally available.&lt;br /&gt;
&lt;br /&gt;
To export the final geomorphon layer:&lt;br /&gt;
*From the Layer Manager window select File--&amp;gt;Export Raster map--&amp;gt;Common export formats&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain43.png|r.out.gdal selection]]&lt;br /&gt;
&lt;br /&gt;
This will open the r.out.gdal menu, which uses the gdal library give you the option to write to many different raster formats. &lt;br /&gt;
&lt;br /&gt;
* Select pensacola_forms_60cell from the Name of raster map drop down&lt;br /&gt;
* In the Name for output raster file option, Browse to the directory ( GRASS_Terrain) and enter the name of the output file as pensacola_forms_60cell.tif&lt;br /&gt;
* Keep the Raster data format as GTiff&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain44.png]]&lt;br /&gt;
&lt;br /&gt;
* Click on the Creation tab&lt;br /&gt;
* Set the data type to byte ( 0-255 integer range)&lt;br /&gt;
* In the Creation options window, type COMPRESS=DEFLATE,PREDICTOR=2&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain45.png]]&lt;br /&gt;
&lt;br /&gt;
The compression options in the creation options will cause the output geotiff to be losslessly compressed using the deflate method. Predictor= 2 makes the compression more efficient (Predictor=2 is for Integer rasters, Predictor=3 is for floating point rasters).&lt;br /&gt;
The export process finishes in about 2 seconds.&lt;br /&gt;
&lt;br /&gt;
If you have any time left, &lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click to highlight pen_1m_elev&lt;br /&gt;
* Uncheck the box next to pensacola_forms_60cell&lt;br /&gt;
* In the Display window, Select 3D View from the drop down in the upper right.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain46.png|Convert to 3D viewing]]&lt;br /&gt;
&lt;br /&gt;
This activates the 3D visualization mode for GRASS GIS. There are several options for 3D display of the different raster and vector layers.  Consult with your instructor for demonstration.&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain47.png|800px|3D view with control]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Tutorial]]&lt;br /&gt;
[[Category: Terrain]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_Documents&amp;diff=23800</id>
		<title>GRASS Documents</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_Documents&amp;diff=23800"/>
		<updated>2016-11-09T02:41:00Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Added Lidar Analysis of Vegetation Structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Usage ==&lt;br /&gt;
&lt;br /&gt;
=====[[Faq|Frequently asked questions and answers (FAQ)]]=====&lt;br /&gt;
&lt;br /&gt;
==== [http://grass.osgeo.org/documentation/manuals/ GRASS Manual pages] ====&lt;br /&gt;
&lt;br /&gt;
==== GRASS tutorials ====&lt;br /&gt;
&lt;br /&gt;
===== General =====&lt;br /&gt;
* [http://grass.osgeo.org/documentation/tutorials/ GRASS Tutorials]&lt;br /&gt;
* [[Wiki Tutorials]]: a nice collection&lt;br /&gt;
* [http://grass.osgeo.org/gdp/index.php GRASS Documentation project] huge amount of information for many versions of GRASS spanning the last 15 years; relevant content needs to be moved into this Wiki [''please help!'']&lt;br /&gt;
* [[GRASS_Education_%28Free_GIS_education%29#Teaching_Materials | Teaching materials]] (courses, training videos, presentations, etc.) contributed by the community.&lt;br /&gt;
* [[GRASS 6 Tutorial]]&lt;br /&gt;
* [http://www.ing.unitn.it/~grass/docs/tutorial_642/ GRASS 6.4.2 tutorial] by Ciolli, Tattoni, Vitti, Zottele, and Zatelli.&lt;br /&gt;
* [http://www.grassbook.org/ GRASS GIS Book] with educational data set download&lt;br /&gt;
* A list of [[Tips and Tricks|tips and tricks]] for the use of GRASS&lt;br /&gt;
&lt;br /&gt;
===== Basics =====&lt;br /&gt;
* Help with [[data formats]]&lt;br /&gt;
* Help with [[Vector Database Management|vector database management]] Help&lt;br /&gt;
* An overview of working with GRASS [[Vectordata | vector data]] (topological)&lt;br /&gt;
* [[SQL]] support in GRASS GIS&lt;br /&gt;
* [[Spatial SQL]] support in GRASS GIS&lt;br /&gt;
* [[Help with 3D]]&lt;br /&gt;
&lt;br /&gt;
===== Specific subjects =====&lt;br /&gt;
* [[Terrain Analysis with Geomorphons]]&lt;br /&gt;
* Geostatistics: [[How to interpolate point value using kriging method with R and GRASS 6|how to interpolate point value using kriging method with R and GRASS]].&lt;br /&gt;
* Help with [[Image_processing|Imagery and satellite]] data&lt;br /&gt;
* Help with [[LIDAR|LIDAR and swath bathymetry]] data&lt;br /&gt;
* Help with [[Time series]]&lt;br /&gt;
* Help with [[Color tables]]&lt;br /&gt;
* Help with creating [[Movies|Movies and animations]]&lt;br /&gt;
* Help with [[vector network analysis]]&lt;br /&gt;
* Help with [[GPS]] applications&lt;br /&gt;
* [[Trace vector contours from a scanned map]]&lt;br /&gt;
* [[Digitizing Area Features]]&lt;br /&gt;
* [[Interpolation|Resampling methods and interpolation in GRASS]]&lt;br /&gt;
* Help with [[GRASS raster semantics]]&lt;br /&gt;
* [[Cartography|Hints and links]] for the use of the cartographic tools in GRASS&lt;br /&gt;
* Help with the [[module command line parser]]&lt;br /&gt;
* Help with [[RST Spline Surfaces]]&lt;br /&gt;
* [[Lidar_Analysis_of_Vegetation_Structure]]&lt;br /&gt;
&lt;br /&gt;
===== Scripting &amp;amp; interfacing other systems =====&lt;br /&gt;
* [[GRASS and ABM]]&lt;br /&gt;
* [[GRASS and C++]]&lt;br /&gt;
* [[GRASS and GMT]]&lt;br /&gt;
* [[GRASS and Java]]&lt;br /&gt;
* [[GRASS and Octave]]&lt;br /&gt;
* [[GRASS and Paraview]]&lt;br /&gt;
* [[GRASS and PHP]]&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[GRASS and SAGA]]&lt;br /&gt;
* [[GRASS and Sextante]]&lt;br /&gt;
* [[GRASS and Shell]]&lt;br /&gt;
* [[GRASS and VTK]]&lt;br /&gt;
* [[QGIS GRASS Cookbook]]&lt;br /&gt;
&lt;br /&gt;
===== Help with modules =====&lt;br /&gt;
* [[r.sun]] - Solar irradiation model&lt;br /&gt;
* [[ps.map]] - Cartographic plot builder&lt;br /&gt;
* [[r.stream.*]] - r.stream tutorial&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
=== GRASS Citation Repository ===&lt;br /&gt;
You are encouraged to cite GRASS when using the software in your work. [[GRASS Citation Repository|On this page]] you find suggestions how to cite GRASS.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
* [[Installation Guide]] for binary packages&lt;br /&gt;
* [[Compile and Install]] from SVN source code repository (the latest and greatest...)&lt;br /&gt;
* [[Compile and install GRASS and QGIS with GDAL/OGR Plugin]] (e.g., to enable QGIS to read GRASS data directly)&lt;br /&gt;
* [[GRASS AddOns]] (User contributions)&lt;br /&gt;
* [[Raspberry Pi|GRASS on the Raspberry Pi]] $25 low powered/embedded mini-PC&lt;br /&gt;
&lt;br /&gt;
=== Development ===&lt;br /&gt;
* Programming: see document list at [[Development]].&lt;br /&gt;
* [[GRASS Translation Glossary]]&lt;br /&gt;
* [[GRASS Module Porting List]] (check here if you don't find a certain command in GRASS 6)&lt;br /&gt;
* [[Development#Linking GRASS to external languages|Linking GRASS to external languages]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category: Tutorial]]&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23799</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23799"/>
		<updated>2016-11-09T02:11:02Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
This gives a -10, 250 range around the high and low ground in the area (93-10 =83 and 128+250 = 378).  This should exclude most of the extraneous points and leave a 5 ft resolution Digital Surface Model(DSM).  Change the legend to display the new raster layer.  What differences do you see?&lt;br /&gt;
&lt;br /&gt;
For now we are going to leave this dataset, but we will come back to it later.&lt;br /&gt;
 &lt;br /&gt;
* Go back to Settings--&amp;gt;Region--&amp;gt; Set region to open the g.region dialog.&lt;br /&gt;
* Select the Resolution tab.&lt;br /&gt;
* Enter 20 in the 2D grid resolution box&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_43.png| g.gregion menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you go to Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
You will see :&lt;br /&gt;
nsres:      20&lt;br /&gt;
ewres:     20&lt;br /&gt;
&lt;br /&gt;
The Region resolution setting is now for 20ft cells.&lt;br /&gt;
&lt;br /&gt;
* Go back to the r.in.lidar menu and:&lt;br /&gt;
* Set the output raster to bladen_test_20ft_ch and&lt;br /&gt;
* Set the statistic to max. &lt;br /&gt;
* Set the transform layer back to dem05ft &lt;br /&gt;
* Check the box for use base raster resolution&lt;br /&gt;
* Click Run&lt;br /&gt;
* Set the legend to bladen_test_20ft_ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Z values were converted to height above ground using the 5ft DEM and then statistics were calculated for 20ft cells.  Notice how you see the outlines of the ditches.  &lt;br /&gt;
* Make sure that the bladen_test_20ft_ch is highlighted&lt;br /&gt;
* Click on the Query selected raster/vector button ( 4th from the left in the display window) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_44.png| Query button ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Place the crosshairs on one of the ditches&lt;br /&gt;
* Left Click&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_45.png| Query result ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A window will pop up giving the location coordinates, the layer being queried, the color of the feature, and the value of the feature.  In this case, the canopy height of the feature.  The Z conversion to height above ground is not perfect and may depend on the accuracy of the DEM and the steepness of the slope represented by the raster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that a slope is a smooth surface that is being interpolated to a grid format.  &lt;br /&gt;
&lt;br /&gt;
Choosing a cell size can be important.  At a 20ft resolution, you will be getting parts of larger trees  and  60ft may be more appropriate to capture a more completepicture of the landscape vegetaion.  Converting to height above ground allows for the use of cells of arbitrary size. Your analysis can  match up with the cell size and footprint to exactly match the cell alignment of existing data. &lt;br /&gt;
&lt;br /&gt;
There are several other statistical measures that are available in r.in lidar: n, mean, range, sum, standard deviation, variance, coefficeint of variance, median,percentile, skewness, trimmean.  Mean height, variance and skewness are metrics used  in vegetation analysis. &lt;br /&gt;
&lt;br /&gt;
At the 20ft resolution, repeat  r.in.lidar for variance and mean methods.  What differences do you see in the resulting rasters?&lt;br /&gt;
&lt;br /&gt;
Repeat r.in.lidar at 20ft resolution using n as the statistic to create a point count layer.&lt;br /&gt;
* Go to the Selection tab and &lt;br /&gt;
* Set the z range to  3,10 &lt;br /&gt;
* Set the output raster to  bladen_20ft_shrub_count&lt;br /&gt;
* Click Run&lt;br /&gt;
* Go to the Selection tab&lt;br /&gt;
* Set the zrange to 10,20&lt;br /&gt;
* Set the output raster to bladen_20ft_midstory_count&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
As stated above, using the raw point count is not suitable for vegetation analysis in areas where there are overlaps in collection.  However, if horizontal sections of the point counts per cell are divided by the total point count per cell you can compare the percentage of the points that occur in horizontal sections.  In this case, we will be using raster algebra to divide the shrub and midstory point counts by the total point counts using r.mapcalc, https://grass.osgeo.org/grass71/manuals/r.mapcalc.html .&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Raster map calculator (r.mapcalc) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_46.png| Raster Calculator Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.mapcalc menu:&lt;br /&gt;
&lt;br /&gt;
* Enter bladen_per_shrub in the Name for new raster map to create&lt;br /&gt;
* Use the dropdown in the Insert existing raster map section to select bladen_20ft_shrub_count&lt;br /&gt;
* Click on the / button for division&lt;br /&gt;
* Use the  dropdown to select bladen_20ft_count&lt;br /&gt;
Now things get interesting.  The point count rasters are integers.  Mathmatical operations between integers results in an integer.  Dividing an integer by a larger integer number results in a number less than one.  In an integer grid, this truncates to 0.    &lt;br /&gt;
&lt;br /&gt;
To get around this, you convert each integer grid before the operation to a floating point grid, so bladen_20ft_shrub becomes float(bladen_20ft_shrub) and bladen_20ft_count becomes float(bladen_20ft_count)  and you divide one floating point grid by another floating point grid and you get a floating point grid.  &lt;br /&gt;
&lt;br /&gt;
Multiply this floating point grid by 100 to put the values back in the range of 100 to 0.   Finally, convert results of the entire operation back to an integer grid by enclosing it with int() . &lt;br /&gt;
The final command in the Expression box is: &lt;br /&gt;
&lt;br /&gt;
 int((float(bladen_20ft_shrub_count@PERMANENT)/float(bladen_20ft_count@PERMANENT))*100)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_47.png| Raster Calculator Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting raster should look like this:&lt;br /&gt;
[[File:Grasslidar_48.png| Raster Calculator Result]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Repeat the exercise with the midstory layer and compare the two layers.  Do you see differences between the shrub and midstory percentage of points layers? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will continue the vegetation analysis, but first we need to take a short side trip into terrain analysis that will relate back to our vegetation analysis..  Terrain analysis will be done using geomrphons. &lt;br /&gt;
&lt;br /&gt;
== Step 5:  Terrain analysis with geomorphons ==&lt;br /&gt;
&lt;br /&gt;
What are geomorphons?  Geomorphon is a new technique for classifying terrain based on a line of sight analysis, see http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf&lt;br /&gt;
 and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_49.png| Geomorphon Classes]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes: Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To do our terrain classification, we will need to load the r.geomorphon addon to GRASS.  &lt;br /&gt;
&lt;br /&gt;
GRASS has an online repository of Addons much like QGIS has for plugins. Most addons do not require administrative access to install.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click on Settings--&amp;gt;Addons extentions--&amp;gt;Install extention from addons &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_50.png| Addon Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the Fetch and install extension window.  GRASS commands are named by their function:  r.* commands are raster commands, v.* commands are vector commands, i.* commands are image analysis commands.  &lt;br /&gt;
&lt;br /&gt;
* Click on the + next to raster to expand the view on all raster commands&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_51.png| Addon Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select r.geomorphon&lt;br /&gt;
* Click install&lt;br /&gt;
&lt;br /&gt;
In the Layer Manager window you can follow the progress of the installation. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_52.png| Addon Installation]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, downloading and installing the addon took 4 seconds on a 2010 vintage Windows 7 laptop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 6:  Running  r.geomorphon ==&lt;br /&gt;
&lt;br /&gt;
The r.geomorphon command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at the end of the command description.&lt;br /&gt;
&lt;br /&gt;
To start r.geomorphon, &lt;br /&gt;
&lt;br /&gt;
In the GRASS Command window, type r.geomorphon and press Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_53.png| Start r.geomorphon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the r.geomorphon menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, dem05ft@PERMANENT ( remember, the current resolution for the region is 20ft. GRASS will take the center value of the 5ft DEM in each 20ft cell and use that for the 20ft cell value, your output raster will be 20ft resolution)&lt;br /&gt;
* In the Outer search radius, enter 30 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_54.png| R.geomorphon setup]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
* Click on the patterns tab.&lt;br /&gt;
* Type common_20ft_30cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_55.png| R.geomorphon setup 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed , and a progress bar will show the progress of the command. &lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_56.png| Select Raster Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the d.rast menu that pops up, select common_20ft_30cell&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_57.png| Select Raster Layer d.rast]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Your results should look like this ( once you select the legend to show the current raster):&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_58.png| Geomorphon Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the r.geomorphon command is using less than 100 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina ( 6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.2 on Windows is 64 bit and will address more than 4 GB of RAM on that platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_59.png| Information Icon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_60.png| Query Results]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
* Click on the Add map elements Button &lt;br /&gt;
* Select Show/Hide legend &lt;br /&gt;
* Click on the Gradient  tab&lt;br /&gt;
* Check the boxes for draw smooth Gradient and ad histogram&lt;br /&gt;
* Put 10 in Number of text labels&lt;br /&gt;
* Click Apply&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values, classes and histogram by class.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_61.png| Geomorphon Legend]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty handy way of describing the landscape.  What does this have to do with vegetation? &lt;br /&gt;
&lt;br /&gt;
== Step 7:  Extracting canopy features using geomorphons ==&lt;br /&gt;
&lt;br /&gt;
* Add the bladen_test_5ft_ch  ( add raster) .  &lt;br /&gt;
* Set the region to match bladen_test_5ft_ch(SettingsRegionSet regionSet region to match raster map)&lt;br /&gt;
* Run a 3 cell common geomorphon analysis on the 5ft canopy height&lt;br /&gt;
&lt;br /&gt;
We want to look at the top of the canopy to pick out treetops and canopy openings.  The treetops should be summits and the canopy openings should be depressions.  We don’t care about any other class, so let’s create a new layer with just those two classes.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Change category values and classes--&amp;gt;Reclassify (r.reclass)&lt;br /&gt;
* Select common_5ft_ch_3cell for the Name of raster to be reclassified.&lt;br /&gt;
* Set the output raster to treetops_openings_5ft&lt;br /&gt;
&lt;br /&gt;
* Go down to the enter values directly box and type in:&lt;br /&gt;
1 = Null&lt;br /&gt;
2 = 1 Treetops&lt;br /&gt;
3 thru 9 = NULL&lt;br /&gt;
10 = 2 Openings&lt;br /&gt;
&lt;br /&gt;
* Turn off all other layers&lt;br /&gt;
* Set your legend to treetops_openings_5ft&lt;br /&gt;
&lt;br /&gt;
Your display should look like this ( zoomed into the carolina bay) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_62.png| Treetops and Openings]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, a note about r.reclass.  It does not create a new layer, it just creates a virtual layer with a filter pointing to the orginal raster.  This makes it very fast and saves on hard drive space.  GRASS will treat it like a real layer.&lt;br /&gt;
&lt;br /&gt;
Second, notice the line of “canopy openings” where the transmission right of way going across the pocosin vegetation and the line in the upper left and the tree tops in the field beyond the ditch.  We need to filter out by canopy height.&lt;br /&gt;
&lt;br /&gt;
The best way to do that is to create a canopy height-based mask.  In GRASS, the r.mask command, https://grass.osgeo.org/grass71/manuals/r.mask.html, is used.  One issue is that our canopy height is a floating point raster and r.mask needs an integer raster. To fix this, we go back to r.mapcalc:&lt;br /&gt;
&lt;br /&gt;
* Start r.mapcalc&lt;br /&gt;
* Select bladen_test_5ft_ch from the insert existing raster map layer dropdown&lt;br /&gt;
* Click on the / button and type 20 &lt;br /&gt;
* Type int( at the front of the equation and  ) at the end&lt;br /&gt;
Your mapcalc window will look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_63.png| Mapcalc treemask]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &lt;br /&gt;
int(bladen_test_5ft_ch@PERMANENT /20)&lt;br /&gt;
as the equation in the Expression box&lt;br /&gt;
Your mask raster should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_64.png| Height mask raster]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All we care about for tree tops are the areas in class 1 or higher, so start  r.mask.&lt;br /&gt;
&lt;br /&gt;
* Select Raster--&amp;gt;Mask{r.mask]&lt;br /&gt;
* In the Raster tab , Select bladen_5ft_treemask_20ft&lt;br /&gt;
* In the box for Raster values to use for mask type: 1 thru 8&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_65.png| Mask Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same area now looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_66.png| Mask Applied]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Turn off the mask layer&lt;br /&gt;
&lt;br /&gt;
You should now see the treetops and canopy openings.  Of the two classes here,  the treetops are probably valid, but the canopy openings that show up with this mask are 20ft or more above the ground and are probably just low spots in the canopy rather than true canopy openings.   &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_67.png| Mask Applied]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The raster mask will remain in place and affect all raster layers and raster operations until it is removed. To remove a raster mask:&lt;br /&gt;
&lt;br /&gt;
* Click on the Remove tab&lt;br /&gt;
* Check the box for Remove existing mask&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_68.png| Remove Mask ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8:  Exporting to GeoTiff ==&lt;br /&gt;
&lt;br /&gt;
While GRASS is a rich environment for analysis, the GRASS native datasets are not easily accessible by other applications.  Exporting to a common file format such as geotiff would make the data more generally available.&lt;br /&gt;
&lt;br /&gt;
To export the a raster layer from GRASS :&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window select File--&amp;gt;Export Raster map--&amp;gt;Common export formats&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_69.png| Select Raster Export ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.out.gdal menu, which uses the gdal library give you the option to write to many different raster formats. &lt;br /&gt;
&lt;br /&gt;
* Select bladen_per_shrub from the Name of raster map drop down&lt;br /&gt;
* In the Name for output raster file option, Browse to the directory ( c:\grasslidar) and enter the name of the output file as bladen_per_shrub_20ft..tif&lt;br /&gt;
* Keep the Raster data format as GTiff&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_70.png| R.out.gdal 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Creation tab&lt;br /&gt;
* Set the data type to byte ( 0-255 integer range)&lt;br /&gt;
* In the Creation options window, type COMPRESS=DEFLATE,PREDICTOR=2&lt;br /&gt;
&lt;br /&gt;
The compression options in the creation options will cause the output geotiff to be losslessly compressed using the deflate method. Predictor= 2 makes the compression more efficient.&lt;br /&gt;
The export process finishes in about 2 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_71.png| R.out.gdal 2 ]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_71.png&amp;diff=23798</id>
		<title>File:Grasslidar 71.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_71.png&amp;diff=23798"/>
		<updated>2016-11-09T02:06:38Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_70.png&amp;diff=23797</id>
		<title>File:Grasslidar 70.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_70.png&amp;diff=23797"/>
		<updated>2016-11-09T02:03:50Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_69.png&amp;diff=23796</id>
		<title>File:Grasslidar 69.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_69.png&amp;diff=23796"/>
		<updated>2016-11-09T02:00:29Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_68.png&amp;diff=23795</id>
		<title>File:Grasslidar 68.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_68.png&amp;diff=23795"/>
		<updated>2016-11-09T01:56:49Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_67.png&amp;diff=23794</id>
		<title>File:Grasslidar 67.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_67.png&amp;diff=23794"/>
		<updated>2016-11-09T01:53:46Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_66.png&amp;diff=23793</id>
		<title>File:Grasslidar 66.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_66.png&amp;diff=23793"/>
		<updated>2016-11-09T01:50:59Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_65.png&amp;diff=23792</id>
		<title>File:Grasslidar 65.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_65.png&amp;diff=23792"/>
		<updated>2016-11-09T01:48:31Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_64.png&amp;diff=23791</id>
		<title>File:Grasslidar 64.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_64.png&amp;diff=23791"/>
		<updated>2016-11-09T01:42:25Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23790</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23790"/>
		<updated>2016-11-09T01:38:46Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Added geomorphon section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
This gives a -10, 250 range around the high and low ground in the area (93-10 =83 and 128+250 = 378).  This should exclude most of the extraneous points and leave a 5 ft resolution Digital Surface Model(DSM).  Change the legend to display the new raster layer.  What differences do you see?&lt;br /&gt;
&lt;br /&gt;
For now we are going to leave this dataset, but we will come back to it later.&lt;br /&gt;
 &lt;br /&gt;
* Go back to Settings--&amp;gt;Region--&amp;gt; Set region to open the g.region dialog.&lt;br /&gt;
* Select the Resolution tab.&lt;br /&gt;
* Enter 20 in the 2D grid resolution box&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_43.png| g.gregion menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you go to Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
You will see :&lt;br /&gt;
nsres:      20&lt;br /&gt;
ewres:     20&lt;br /&gt;
&lt;br /&gt;
The Region resolution setting is now for 20ft cells.&lt;br /&gt;
&lt;br /&gt;
* Go back to the r.in.lidar menu and:&lt;br /&gt;
* Set the output raster to bladen_test_20ft_ch and&lt;br /&gt;
* Set the statistic to max. &lt;br /&gt;
* Set the transform layer back to dem05ft &lt;br /&gt;
* Check the box for use base raster resolution&lt;br /&gt;
* Click Run&lt;br /&gt;
* Set the legend to bladen_test_20ft_ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Z values were converted to height above ground using the 5ft DEM and then statistics were calculated for 20ft cells.  Notice how you see the outlines of the ditches.  &lt;br /&gt;
* Make sure that the bladen_test_20ft_ch is highlighted&lt;br /&gt;
* Click on the Query selected raster/vector button ( 4th from the left in the display window) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_44.png| Query button ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Place the crosshairs on one of the ditches&lt;br /&gt;
* Left Click&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_45.png| Query result ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A window will pop up giving the location coordinates, the layer being queried, the color of the feature, and the value of the feature.  In this case, the canopy height of the feature.  The Z conversion to height above ground is not perfect and may depend on the accuracy of the DEM and the steepness of the slope represented by the raster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that a slope is a smooth surface that is being interpolated to a grid format.  &lt;br /&gt;
&lt;br /&gt;
Choosing a cell size can be important.  At a 20ft resolution, you will be getting parts of larger trees  and  60ft may be more appropriate to capture a more completepicture of the landscape vegetaion.  Converting to height above ground allows for the use of cells of arbitrary size. Your analysis can  match up with the cell size and footprint to exactly match the cell alignment of existing data. &lt;br /&gt;
&lt;br /&gt;
There are several other statistical measures that are available in r.in lidar: n, mean, range, sum, standard deviation, variance, coefficeint of variance, median,percentile, skewness, trimmean.  Mean height, variance and skewness are metrics used  in vegetation analysis. &lt;br /&gt;
&lt;br /&gt;
At the 20ft resolution, repeat  r.in.lidar for variance and mean methods.  What differences do you see in the resulting rasters?&lt;br /&gt;
&lt;br /&gt;
Repeat r.in.lidar at 20ft resolution using n as the statistic to create a point count layer.&lt;br /&gt;
* Go to the Selection tab and &lt;br /&gt;
* Set the z range to  3,10 &lt;br /&gt;
* Set the output raster to  bladen_20ft_shrub_count&lt;br /&gt;
* Click Run&lt;br /&gt;
* Go to the Selection tab&lt;br /&gt;
* Set the zrange to 10,20&lt;br /&gt;
* Set the output raster to bladen_20ft_midstory_count&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
As stated above, using the raw point count is not suitable for vegetation analysis in areas where there are overlaps in collection.  However, if horizontal sections of the point counts per cell are divided by the total point count per cell you can compare the percentage of the points that occur in horizontal sections.  In this case, we will be using raster algebra to divide the shrub and midstory point counts by the total point counts using r.mapcalc, https://grass.osgeo.org/grass71/manuals/r.mapcalc.html .&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Raster map calculator (r.mapcalc) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_46.png| Raster Calculator Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.mapcalc menu:&lt;br /&gt;
&lt;br /&gt;
* Enter bladen_per_shrub in the Name for new raster map to create&lt;br /&gt;
* Use the dropdown in the Insert existing raster map section to select bladen_20ft_shrub_count&lt;br /&gt;
* Click on the / button for division&lt;br /&gt;
* Use the  dropdown to select bladen_20ft_count&lt;br /&gt;
Now things get interesting.  The point count rasters are integers.  Mathmatical operations between integers results in an integer.  Dividing an integer by a larger integer number results in a number less than one.  In an integer grid, this truncates to 0.    &lt;br /&gt;
&lt;br /&gt;
To get around this, you convert each integer grid before the operation to a floating point grid, so bladen_20ft_shrub becomes float(bladen_20ft_shrub) and bladen_20ft_count becomes float(bladen_20ft_count)  and you divide one floating point grid by another floating point grid and you get a floating point grid.  &lt;br /&gt;
&lt;br /&gt;
Multiply this floating point grid by 100 to put the values back in the range of 100 to 0.   Finally, convert results of the entire operation back to an integer grid by enclosing it with int() . &lt;br /&gt;
The final command in the Expression box is: &lt;br /&gt;
&lt;br /&gt;
 int((float(bladen_20ft_shrub_count@PERMANENT)/float(bladen_20ft_count@PERMANENT))*100)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_47.png| Raster Calculator Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting raster should look like this:&lt;br /&gt;
[[File:Grasslidar_48.png| Raster Calculator Result]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Repeat the exercise with the midstory layer and compare the two layers.  Do you see differences between the shrub and midstory percentage of points layers? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will continue the vegetation analysis, but first we need to take a short side trip into terrain analysis that will relate back to our vegetation analysis..  Terrain analysis will be done using geomrphons. &lt;br /&gt;
&lt;br /&gt;
== Step 5:  Terrain analysis with geomorphons ==&lt;br /&gt;
&lt;br /&gt;
What are geomorphons?  Geomorphon is a new technique for classifying terrain based on a line of sight analysis, see http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf&lt;br /&gt;
 and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_49.png| Geomorphon Classes]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes: Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To do our terrain classification, we will need to load the r.geomorphon addon to GRASS.  &lt;br /&gt;
&lt;br /&gt;
GRASS has an online repository of Addons much like QGIS has for plugins. Most addons do not require administrative access to install.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click on Settings--&amp;gt;Addons extentions--&amp;gt;Install extention from addons &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_50.png| Addon Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the Fetch and install extension window.  GRASS commands are named by their function:  r.* commands are raster commands, v.* commands are vector commands, i.* commands are image analysis commands.  &lt;br /&gt;
&lt;br /&gt;
* Click on the + next to raster to expand the view on all raster commands&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_51.png| Addon Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select r.geomorphon&lt;br /&gt;
* Click install&lt;br /&gt;
&lt;br /&gt;
In the Layer Manager window you can follow the progress of the installation. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_52.png| Addon Installation]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, downloading and installing the addon took 4 seconds on a 2010 vintage Windows 7 laptop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 6:  Running  r.geomorphon ==&lt;br /&gt;
&lt;br /&gt;
The r.geomorphon command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at the end of the command description.&lt;br /&gt;
&lt;br /&gt;
To start r.geomorphon, &lt;br /&gt;
&lt;br /&gt;
In the GRASS Command window, type r.geomorphon and press Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_53.png| Start r.geomorphon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the r.geomorphon menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, dem05ft@PERMANENT ( remember, the current resolution for the region is 20ft. GRASS will take the center value of the 5ft DEM in each 20ft cell and use that for the 20ft cell value, your output raster will be 20ft resolution)&lt;br /&gt;
* In the Outer search radius, enter 30 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_54.png| R.geomorphon setup]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
* Click on the patterns tab.&lt;br /&gt;
* Type common_20ft_30cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_55.png| R.geomorphon setup 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed , and a progress bar will show the progress of the command. &lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_56.png| Select Raster Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the d.rast menu that pops up, select common_20ft_30cell&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_57.png| Select Raster Layer d.rast]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Your results should look like this ( once you select the legend to show the current raster):&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_58.png| Geomorphon Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the r.geomorphon command is using less than 100 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina ( 6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.2 on Windows is 64 bit and will address more than 4 GB of RAM on that platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_59.png| Information Icon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_60.png| Query Results]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
* Click on the Add map elements Button &lt;br /&gt;
* Select Show/Hide legend &lt;br /&gt;
* Click on the Gradient  tab&lt;br /&gt;
* Check the boxes for draw smooth Gradient and ad histogram&lt;br /&gt;
* Put 10 in Number of text labels&lt;br /&gt;
* Click Apply&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values, classes and histogram by class.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_61.png| Geomorphon Legend]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty handy way of describing the landscape.  What does this have to do with vegetation? &lt;br /&gt;
&lt;br /&gt;
== Step 7:  Extracting canopy features using geomorphons ==&lt;br /&gt;
&lt;br /&gt;
* Add the bladen_test_5ft_ch  ( add raster) .  &lt;br /&gt;
* Set the region to match bladen_test_5ft_ch(SettingsRegionSet regionSet region to match raster map)&lt;br /&gt;
* Run a 3 cell common geomorphon analysis on the 5ft canopy height&lt;br /&gt;
&lt;br /&gt;
We want to look at the top of the canopy to pick out treetops and canopy openings.  The treetops should be summits and the canopy openings should be depressions.  We don’t care about any other class, so let’s create a new layer with just those two classes.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Change category values and classes--&amp;gt;Reclassify (r.reclass)&lt;br /&gt;
* Select common_5ft_ch_3cell for the Name of raster to be reclassified.&lt;br /&gt;
* Set the output raster to treetops_openings_5ft&lt;br /&gt;
&lt;br /&gt;
* Go down to the enter values directly box and type in:&lt;br /&gt;
1 = Null&lt;br /&gt;
2 = 1 Treetops&lt;br /&gt;
3 thru 9 = NULL&lt;br /&gt;
10 = 2 Openings&lt;br /&gt;
&lt;br /&gt;
* Turn off all other layers&lt;br /&gt;
* Set your legend to treetops_openings_5ft&lt;br /&gt;
&lt;br /&gt;
Your display should look like this ( zoomed into the carolina bay) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_62.png| Treetops and Openings]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, a note about r.reclass.  It does not create a new layer, it just creates a virtual layer with a filter pointing to the orginal raster.  This makes it very fast and saves on hard drive space.  GRASS will treat it like a real layer.&lt;br /&gt;
&lt;br /&gt;
Second, notice the line of “canopy openings” where the transmission right of way going across the pocosin vegetation and the line in the upper left and the tree tops in the field beyond the ditch.  We need to filter out by canopy height.&lt;br /&gt;
&lt;br /&gt;
The best way to do that is to create a canopy height-based mask.  In GRASS, the r.mask command, https://grass.osgeo.org/grass71/manuals/r.mask.html, is used.  One issue is that our canopy height is a floating point raster and r.mask needs an integer raster. To fix this, we go back to r.mapcalc:&lt;br /&gt;
&lt;br /&gt;
* Start r.mapcalc&lt;br /&gt;
* Select bladen_test_5ft_ch from the insert existing raster map layer dropdown&lt;br /&gt;
* Click on the / button and type 20 &lt;br /&gt;
* Type int( at the front of the equation and  ) at the end&lt;br /&gt;
Your mapcalc window will look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_63.png| Mapcalc treemask]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_63.png&amp;diff=23789</id>
		<title>File:Grasslidar 63.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_63.png&amp;diff=23789"/>
		<updated>2016-11-09T01:37:21Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_62.png&amp;diff=23788</id>
		<title>File:Grasslidar 62.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_62.png&amp;diff=23788"/>
		<updated>2016-11-09T01:33:36Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_61.png&amp;diff=23787</id>
		<title>File:Grasslidar 61.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_61.png&amp;diff=23787"/>
		<updated>2016-11-09T01:27:41Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23786</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23786"/>
		<updated>2016-11-09T01:23:39Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
This gives a -10, 250 range around the high and low ground in the area (93-10 =83 and 128+250 = 378).  This should exclude most of the extraneous points and leave a 5 ft resolution Digital Surface Model(DSM).  Change the legend to display the new raster layer.  What differences do you see?&lt;br /&gt;
&lt;br /&gt;
For now we are going to leave this dataset, but we will come back to it later.&lt;br /&gt;
 &lt;br /&gt;
* Go back to Settings--&amp;gt;Region--&amp;gt; Set region to open the g.region dialog.&lt;br /&gt;
* Select the Resolution tab.&lt;br /&gt;
* Enter 20 in the 2D grid resolution box&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_43.png| g.gregion menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you go to Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
You will see :&lt;br /&gt;
nsres:      20&lt;br /&gt;
ewres:     20&lt;br /&gt;
&lt;br /&gt;
The Region resolution setting is now for 20ft cells.&lt;br /&gt;
&lt;br /&gt;
* Go back to the r.in.lidar menu and:&lt;br /&gt;
* Set the output raster to bladen_test_20ft_ch and&lt;br /&gt;
* Set the statistic to max. &lt;br /&gt;
* Set the transform layer back to dem05ft &lt;br /&gt;
* Check the box for use base raster resolution&lt;br /&gt;
* Click Run&lt;br /&gt;
* Set the legend to bladen_test_20ft_ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Z values were converted to height above ground using the 5ft DEM and then statistics were calculated for 20ft cells.  Notice how you see the outlines of the ditches.  &lt;br /&gt;
* Make sure that the bladen_test_20ft_ch is highlighted&lt;br /&gt;
* Click on the Query selected raster/vector button ( 4th from the left in the display window) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_44.png| Query button ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Place the crosshairs on one of the ditches&lt;br /&gt;
* Left Click&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_45.png| Query result ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A window will pop up giving the location coordinates, the layer being queried, the color of the feature, and the value of the feature.  In this case, the canopy height of the feature.  The Z conversion to height above ground is not perfect and may depend on the accuracy of the DEM and the steepness of the slope represented by the raster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that a slope is a smooth surface that is being interpolated to a grid format.  &lt;br /&gt;
&lt;br /&gt;
Choosing a cell size can be important.  At a 20ft resolution, you will be getting parts of larger trees  and  60ft may be more appropriate to capture a more completepicture of the landscape vegetaion.  Converting to height above ground allows for the use of cells of arbitrary size. Your analysis can  match up with the cell size and footprint to exactly match the cell alignment of existing data. &lt;br /&gt;
&lt;br /&gt;
There are several other statistical measures that are available in r.in lidar: n, mean, range, sum, standard deviation, variance, coefficeint of variance, median,percentile, skewness, trimmean.  Mean height, variance and skewness are metrics used  in vegetation analysis. &lt;br /&gt;
&lt;br /&gt;
At the 20ft resolution, repeat  r.in.lidar for variance and mean methods.  What differences do you see in the resulting rasters?&lt;br /&gt;
&lt;br /&gt;
Repeat r.in.lidar at 20ft resolution using n as the statistic to create a point count layer.&lt;br /&gt;
* Go to the Selection tab and &lt;br /&gt;
* Set the z range to  3,10 &lt;br /&gt;
* Set the output raster to  bladen_20ft_shrub_count&lt;br /&gt;
* Click Run&lt;br /&gt;
* Go to the Selection tab&lt;br /&gt;
* Set the zrange to 10,20&lt;br /&gt;
* Set the output raster to bladen_20ft_midstory_count&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
As stated above, using the raw point count is not suitable for vegetation analysis in areas where there are overlaps in collection.  However, if horizontal sections of the point counts per cell are divided by the total point count per cell you can compare the percentage of the points that occur in horizontal sections.  In this case, we will be using raster algebra to divide the shrub and midstory point counts by the total point counts using r.mapcalc, https://grass.osgeo.org/grass71/manuals/r.mapcalc.html .&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Raster map calculator (r.mapcalc) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_46.png| Raster Calculator Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.mapcalc menu:&lt;br /&gt;
&lt;br /&gt;
* Enter bladen_per_shrub in the Name for new raster map to create&lt;br /&gt;
* Use the dropdown in the Insert existing raster map section to select bladen_20ft_shrub_count&lt;br /&gt;
* Click on the / button for division&lt;br /&gt;
* Use the  dropdown to select bladen_20ft_count&lt;br /&gt;
Now things get interesting.  The point count rasters are integers.  Mathmatical operations between integers results in an integer.  Dividing an integer by a larger integer number results in a number less than one.  In an integer grid, this truncates to 0.    &lt;br /&gt;
&lt;br /&gt;
To get around this, you convert each integer grid before the operation to a floating point grid, so bladen_20ft_shrub becomes float(bladen_20ft_shrub) and bladen_20ft_count becomes float(bladen_20ft_count)  and you divide one floating point grid by another floating point grid and you get a floating point grid.  &lt;br /&gt;
&lt;br /&gt;
Multiply this floating point grid by 100 to put the values back in the range of 100 to 0.   Finally, convert results of the entire operation back to an integer grid by enclosing it with int() . &lt;br /&gt;
The final command in the Expression box is: &lt;br /&gt;
&lt;br /&gt;
 int((float(bladen_20ft_shrub_count@PERMANENT)/float(bladen_20ft_count@PERMANENT))*100)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_47.png| Raster Calculator Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting raster should look like this:&lt;br /&gt;
[[File:Grasslidar_48.png| Raster Calculator Result]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Repeat the exercise with the midstory layer and compare the two layers.  Do you see differences between the shrub and midstory percentage of points layers? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will continue the vegetation analysis, but first we need to take a short side trip into terrain analysis that will relate back to our vegetation analysis..  Terrain analysis will be done using geomrphons. &lt;br /&gt;
&lt;br /&gt;
== Step 5:  Terrain analysis with geomorphons ==&lt;br /&gt;
&lt;br /&gt;
What are geomorphons?  Geomorphon is a new technique for classifying terrain based on a line of sight analysis, see http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf&lt;br /&gt;
 and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_49.png| Geomorphon Classes]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes: Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To do our terrain classification, we will need to load the r.geomorphon addon to GRASS.  &lt;br /&gt;
&lt;br /&gt;
GRASS has an online repository of Addons much like QGIS has for plugins. Most addons do not require administrative access to install.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click on Settings--&amp;gt;Addons extentions--&amp;gt;Install extention from addons &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_50.png| Addon Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the Fetch and install extension window.  GRASS commands are named by their function:  r.* commands are raster commands, v.* commands are vector commands, i.* commands are image analysis commands.  &lt;br /&gt;
&lt;br /&gt;
* Click on the + next to raster to expand the view on all raster commands&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_51.png| Addon Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select r.geomorphon&lt;br /&gt;
* Click install&lt;br /&gt;
&lt;br /&gt;
In the Layer Manager window you can follow the progress of the installation. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_52.png| Addon Installation]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, downloading and installing the addon took 4 seconds on a 2010 vintage Windows 7 laptop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 6:  Running  r.geomorphon ==&lt;br /&gt;
&lt;br /&gt;
The r.geomorphon command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at the end of the command description.&lt;br /&gt;
&lt;br /&gt;
To start r.geomorphon, &lt;br /&gt;
&lt;br /&gt;
In the GRASS Command window, type r.geomorphon and press Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_53.png| Start r.geomorphon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the r.geomorphon menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, dem05ft@PERMANENT ( remember, the current resolution for the region is 20ft. GRASS will take the center value of the 5ft DEM in each 20ft cell and use that for the 20ft cell value, your output raster will be 20ft resolution)&lt;br /&gt;
* In the Outer search radius, enter 30 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_54.png| R.geomorphon setup]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
* Click on the patterns tab.&lt;br /&gt;
* Type common_20ft_30cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_55.png| R.geomorphon setup 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed , and a progress bar will show the progress of the command. &lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_56.png| Select Raster Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the d.rast menu that pops up, select common_20ft_30cell&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_57.png| Select Raster Layer d.rast]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Your results should look like this ( once you select the legend to show the current raster):&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_58.png| Geomorphon Layer]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A check of the Windows Task Manager shows that the r.geomorphon command is using less than 100 MB of RAM to process the area.  This process will take 7.5 minutes on a 2010 vintage i7 laptop.&lt;br /&gt;
&lt;br /&gt;
Larger areas and larger cell radius extents will require more memory.  This process scales fairly well.  It has been used on the Statewide 20ft elevation grid for North Carolina ( 6.6 billion cells) with a radius of 30 cells, but it required more than 4GB of RAM and took overnight to run on a Linux workstation.  GRASS 7.2 on Windows is 64 bit and will address more than 4 GB of RAM on that platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see a lot of different patterns, but what do they mean?  Click on the Query raster / vector maps tool  and you can click individual cells to extract the value.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_59.png| Information Icon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a blue pixel represents integer value 9 or valley.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_60.png| Query Results]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &lt;br /&gt;
* Click on the Add map elements Button &lt;br /&gt;
* Select Show/Hide legend &lt;br /&gt;
* Click on the Gradient  tab&lt;br /&gt;
* Check the boxes for draw smooth Gradient and ad histogram&lt;br /&gt;
* Put 10 in Number of text labels&lt;br /&gt;
* Click Apply&lt;br /&gt;
&lt;br /&gt;
You should then see the following legend with the integer values, classes and histogram by class.&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_60.png&amp;diff=23785</id>
		<title>File:Grasslidar 60.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_60.png&amp;diff=23785"/>
		<updated>2016-11-09T01:21:57Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_59.png&amp;diff=23784</id>
		<title>File:Grasslidar 59.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_59.png&amp;diff=23784"/>
		<updated>2016-11-09T01:18:17Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_58.png&amp;diff=23783</id>
		<title>File:Grasslidar 58.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_58.png&amp;diff=23783"/>
		<updated>2016-11-09T01:14:11Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_57.png&amp;diff=23782</id>
		<title>File:Grasslidar 57.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_57.png&amp;diff=23782"/>
		<updated>2016-11-09T01:11:14Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_56.png&amp;diff=23781</id>
		<title>File:Grasslidar 56.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_56.png&amp;diff=23781"/>
		<updated>2016-11-09T01:09:21Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23780</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23780"/>
		<updated>2016-11-08T03:15:05Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: Add geomorphon section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
This gives a -10, 250 range around the high and low ground in the area (93-10 =83 and 128+250 = 378).  This should exclude most of the extraneous points and leave a 5 ft resolution Digital Surface Model(DSM).  Change the legend to display the new raster layer.  What differences do you see?&lt;br /&gt;
&lt;br /&gt;
For now we are going to leave this dataset, but we will come back to it later.&lt;br /&gt;
 &lt;br /&gt;
* Go back to Settings--&amp;gt;Region--&amp;gt; Set region to open the g.region dialog.&lt;br /&gt;
* Select the Resolution tab.&lt;br /&gt;
* Enter 20 in the 2D grid resolution box&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_43.png| g.gregion menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you go to Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
You will see :&lt;br /&gt;
nsres:      20&lt;br /&gt;
ewres:     20&lt;br /&gt;
&lt;br /&gt;
The Region resolution setting is now for 20ft cells.&lt;br /&gt;
&lt;br /&gt;
* Go back to the r.in.lidar menu and:&lt;br /&gt;
* Set the output raster to bladen_test_20ft_ch and&lt;br /&gt;
* Set the statistic to max. &lt;br /&gt;
* Set the transform layer back to dem05ft &lt;br /&gt;
* Check the box for use base raster resolution&lt;br /&gt;
* Click Run&lt;br /&gt;
* Set the legend to bladen_test_20ft_ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Z values were converted to height above ground using the 5ft DEM and then statistics were calculated for 20ft cells.  Notice how you see the outlines of the ditches.  &lt;br /&gt;
* Make sure that the bladen_test_20ft_ch is highlighted&lt;br /&gt;
* Click on the Query selected raster/vector button ( 4th from the left in the display window) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_44.png| Query button ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Place the crosshairs on one of the ditches&lt;br /&gt;
* Left Click&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_45.png| Query result ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A window will pop up giving the location coordinates, the layer being queried, the color of the feature, and the value of the feature.  In this case, the canopy height of the feature.  The Z conversion to height above ground is not perfect and may depend on the accuracy of the DEM and the steepness of the slope represented by the raster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that a slope is a smooth surface that is being interpolated to a grid format.  &lt;br /&gt;
&lt;br /&gt;
Choosing a cell size can be important.  At a 20ft resolution, you will be getting parts of larger trees  and  60ft may be more appropriate to capture a more completepicture of the landscape vegetaion.  Converting to height above ground allows for the use of cells of arbitrary size. Your analysis can  match up with the cell size and footprint to exactly match the cell alignment of existing data. &lt;br /&gt;
&lt;br /&gt;
There are several other statistical measures that are available in r.in lidar: n, mean, range, sum, standard deviation, variance, coefficeint of variance, median,percentile, skewness, trimmean.  Mean height, variance and skewness are metrics used  in vegetation analysis. &lt;br /&gt;
&lt;br /&gt;
At the 20ft resolution, repeat  r.in.lidar for variance and mean methods.  What differences do you see in the resulting rasters?&lt;br /&gt;
&lt;br /&gt;
Repeat r.in.lidar at 20ft resolution using n as the statistic to create a point count layer.&lt;br /&gt;
* Go to the Selection tab and &lt;br /&gt;
* Set the z range to  3,10 &lt;br /&gt;
* Set the output raster to  bladen_20ft_shrub_count&lt;br /&gt;
* Click Run&lt;br /&gt;
* Go to the Selection tab&lt;br /&gt;
* Set the zrange to 10,20&lt;br /&gt;
* Set the output raster to bladen_20ft_midstory_count&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
As stated above, using the raw point count is not suitable for vegetation analysis in areas where there are overlaps in collection.  However, if horizontal sections of the point counts per cell are divided by the total point count per cell you can compare the percentage of the points that occur in horizontal sections.  In this case, we will be using raster algebra to divide the shrub and midstory point counts by the total point counts using r.mapcalc, https://grass.osgeo.org/grass71/manuals/r.mapcalc.html .&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Raster map calculator (r.mapcalc) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_46.png| Raster Calculator Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.mapcalc menu:&lt;br /&gt;
&lt;br /&gt;
* Enter bladen_per_shrub in the Name for new raster map to create&lt;br /&gt;
* Use the dropdown in the Insert existing raster map section to select bladen_20ft_shrub_count&lt;br /&gt;
* Click on the / button for division&lt;br /&gt;
* Use the  dropdown to select bladen_20ft_count&lt;br /&gt;
Now things get interesting.  The point count rasters are integers.  Mathmatical operations between integers results in an integer.  Dividing an integer by a larger integer number results in a number less than one.  In an integer grid, this truncates to 0.    &lt;br /&gt;
&lt;br /&gt;
To get around this, you convert each integer grid before the operation to a floating point grid, so bladen_20ft_shrub becomes float(bladen_20ft_shrub) and bladen_20ft_count becomes float(bladen_20ft_count)  and you divide one floating point grid by another floating point grid and you get a floating point grid.  &lt;br /&gt;
&lt;br /&gt;
Multiply this floating point grid by 100 to put the values back in the range of 100 to 0.   Finally, convert results of the entire operation back to an integer grid by enclosing it with int() . &lt;br /&gt;
The final command in the Expression box is: &lt;br /&gt;
&lt;br /&gt;
 int((float(bladen_20ft_shrub_count@PERMANENT)/float(bladen_20ft_count@PERMANENT))*100)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_47.png| Raster Calculator Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting raster should look like this:&lt;br /&gt;
[[File:Grasslidar_48.png| Raster Calculator Result]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Repeat the exercise with the midstory layer and compare the two layers.  Do you see differences between the shrub and midstory percentage of points layers? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will continue the vegetation analysis, but first we need to take a short side trip into terrain analysis that will relate back to our vegetation analysis..  Terrain analysis will be done using geomrphons. &lt;br /&gt;
&lt;br /&gt;
== Step 5:  Terrain analysis with geomorphons ==&lt;br /&gt;
&lt;br /&gt;
What are geomorphons?  Geomorphon is a new technique for classifying terrain based on a line of sight analysis, see http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf&lt;br /&gt;
 and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_49.png| Geomorphon Classes]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this activity, we will use the simple 10 class calculation.  Outputs will be cells with the following classes: Flat, peak, ridge, shoulder, spur, slope hollow, footslope, valley, and pit.&lt;br /&gt;
&lt;br /&gt;
To do our terrain classification, we will need to load the r.geomorphon addon to GRASS.  &lt;br /&gt;
&lt;br /&gt;
GRASS has an online repository of Addons much like QGIS has for plugins. Most addons do not require administrative access to install.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click on Settings--&amp;gt;Addons extentions--&amp;gt;Install extention from addons &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_50.png| Addon Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the Fetch and install extension window.  GRASS commands are named by their function:  r.* commands are raster commands, v.* commands are vector commands, i.* commands are image analysis commands.  &lt;br /&gt;
&lt;br /&gt;
* Click on the + next to raster to expand the view on all raster commands&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_51.png| Addon Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select r.geomorphon&lt;br /&gt;
* Click install&lt;br /&gt;
&lt;br /&gt;
In the Layer Manager window you can follow the progress of the installation. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_52.png| Addon Installation]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, downloading and installing the addon took 4 seconds on a 2010 vintage Windows 7 laptop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 6:  Running  r.geomorphon ==&lt;br /&gt;
&lt;br /&gt;
The r.geomorphon command documentation is at http://grass.osgeo.org/grass70/manuals/addons/r.geomorphon.html and the publications for the technique can be found at the end of the command description.&lt;br /&gt;
&lt;br /&gt;
To start r.geomorphon, &lt;br /&gt;
&lt;br /&gt;
In the GRASS Command window, type r.geomorphon and press Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_53.png| Start r.geomorphon]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Entering the command without arguments brings up the r.geomorphon menu.  You will notice that there are tabs across the top.  The first tab is the Required Tab, with required data inputs to run the command.  &lt;br /&gt;
&lt;br /&gt;
* From the dropdown for Input DEM, dem05ft@PERMANENT ( remember, the current resolution for the region is 20ft. GRASS will take the center value of the 5ft DEM in each 20ft cell and use that for the 20ft cell value, your output raster will be 20ft resolution)&lt;br /&gt;
* In the Outer search radius, enter 30 ( number of cells around each cell to analyze) This is a very flat area, so the number may need to be higher to extract some features. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_54.png| R.geomorphon setup]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that as the command arguments are entered, they are echoed across the bottom.&lt;br /&gt;
&lt;br /&gt;
* Click on the patterns tab.&lt;br /&gt;
* Type common_20ft_30cell in the box under Most common geomorphic forms.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_55.png| R.geomorphon setup 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
The tab will immediately switch to the Command Output tab, the command options will be echoed , and a progress bar will show the progress of the command. &lt;br /&gt;
You will need to manually add the result to the Display.  &lt;br /&gt;
&lt;br /&gt;
* At the top of the Layer Manager window, Click Add raster map layer button&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_55.png&amp;diff=23779</id>
		<title>File:Grasslidar 55.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_55.png&amp;diff=23779"/>
		<updated>2016-11-08T03:13:27Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_54.png&amp;diff=23778</id>
		<title>File:Grasslidar 54.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_54.png&amp;diff=23778"/>
		<updated>2016-11-08T03:11:32Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_53.png&amp;diff=23777</id>
		<title>File:Grasslidar 53.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_53.png&amp;diff=23777"/>
		<updated>2016-11-08T03:08:20Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_52.png&amp;diff=23776</id>
		<title>File:Grasslidar 52.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_52.png&amp;diff=23776"/>
		<updated>2016-11-08T03:04:32Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_51.png&amp;diff=23775</id>
		<title>File:Grasslidar 51.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_51.png&amp;diff=23775"/>
		<updated>2016-11-08T03:02:43Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_50.png&amp;diff=23774</id>
		<title>File:Grasslidar 50.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_50.png&amp;diff=23774"/>
		<updated>2016-11-08T03:00:03Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23773</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23773"/>
		<updated>2016-11-08T02:57:19Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: More of the exercise&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
This gives a -10, 250 range around the high and low ground in the area (93-10 =83 and 128+250 = 378).  This should exclude most of the extraneous points and leave a 5 ft resolution Digital Surface Model(DSM).  Change the legend to display the new raster layer.  What differences do you see?&lt;br /&gt;
&lt;br /&gt;
For now we are going to leave this dataset, but we will come back to it later.&lt;br /&gt;
 &lt;br /&gt;
* Go back to Settings--&amp;gt;Region--&amp;gt; Set region to open the g.region dialog.&lt;br /&gt;
* Select the Resolution tab.&lt;br /&gt;
* Enter 20 in the 2D grid resolution box&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_43.png| g.gregion menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you go to Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
You will see :&lt;br /&gt;
nsres:      20&lt;br /&gt;
ewres:     20&lt;br /&gt;
&lt;br /&gt;
The Region resolution setting is now for 20ft cells.&lt;br /&gt;
&lt;br /&gt;
* Go back to the r.in.lidar menu and:&lt;br /&gt;
* Set the output raster to bladen_test_20ft_ch and&lt;br /&gt;
* Set the statistic to max. &lt;br /&gt;
* Set the transform layer back to dem05ft &lt;br /&gt;
* Check the box for use base raster resolution&lt;br /&gt;
* Click Run&lt;br /&gt;
* Set the legend to bladen_test_20ft_ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Z values were converted to height above ground using the 5ft DEM and then statistics were calculated for 20ft cells.  Notice how you see the outlines of the ditches.  &lt;br /&gt;
* Make sure that the bladen_test_20ft_ch is highlighted&lt;br /&gt;
* Click on the Query selected raster/vector button ( 4th from the left in the display window) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_44.png| Query button ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Place the crosshairs on one of the ditches&lt;br /&gt;
* Left Click&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_45.png| Query result ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A window will pop up giving the location coordinates, the layer being queried, the color of the feature, and the value of the feature.  In this case, the canopy height of the feature.  The Z conversion to height above ground is not perfect and may depend on the accuracy of the DEM and the steepness of the slope represented by the raster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that a slope is a smooth surface that is being interpolated to a grid format.  &lt;br /&gt;
&lt;br /&gt;
Choosing a cell size can be important.  At a 20ft resolution, you will be getting parts of larger trees  and  60ft may be more appropriate to capture a more completepicture of the landscape vegetaion.  Converting to height above ground allows for the use of cells of arbitrary size. Your analysis can  match up with the cell size and footprint to exactly match the cell alignment of existing data. &lt;br /&gt;
&lt;br /&gt;
There are several other statistical measures that are available in r.in lidar: n, mean, range, sum, standard deviation, variance, coefficeint of variance, median,percentile, skewness, trimmean.  Mean height, variance and skewness are metrics used  in vegetation analysis. &lt;br /&gt;
&lt;br /&gt;
At the 20ft resolution, repeat  r.in.lidar for variance and mean methods.  What differences do you see in the resulting rasters?&lt;br /&gt;
&lt;br /&gt;
Repeat r.in.lidar at 20ft resolution using n as the statistic to create a point count layer.&lt;br /&gt;
* Go to the Selection tab and &lt;br /&gt;
* Set the z range to  3,10 &lt;br /&gt;
* Set the output raster to  bladen_20ft_shrub_count&lt;br /&gt;
* Click Run&lt;br /&gt;
* Go to the Selection tab&lt;br /&gt;
* Set the zrange to 10,20&lt;br /&gt;
* Set the output raster to bladen_20ft_midstory_count&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
As stated above, using the raw point count is not suitable for vegetation analysis in areas where there are overlaps in collection.  However, if horizontal sections of the point counts per cell are divided by the total point count per cell you can compare the percentage of the points that occur in horizontal sections.  In this case, we will be using raster algebra to divide the shrub and midstory point counts by the total point counts using r.mapcalc, https://grass.osgeo.org/grass71/manuals/r.mapcalc.html .&lt;br /&gt;
&lt;br /&gt;
* Go to Raster--&amp;gt;Raster map calculator (r.mapcalc) &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_46.png| Raster Calculator Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will open the r.mapcalc menu:&lt;br /&gt;
&lt;br /&gt;
* Enter bladen_per_shrub in the Name for new raster map to create&lt;br /&gt;
* Use the dropdown in the Insert existing raster map section to select bladen_20ft_shrub_count&lt;br /&gt;
* Click on the / button for division&lt;br /&gt;
* Use the  dropdown to select bladen_20ft_count&lt;br /&gt;
Now things get interesting.  The point count rasters are integers.  Mathmatical operations between integers results in an integer.  Dividing an integer by a larger integer number results in a number less than one.  In an integer grid, this truncates to 0.    &lt;br /&gt;
&lt;br /&gt;
To get around this, you convert each integer grid before the operation to a floating point grid, so bladen_20ft_shrub becomes float(bladen_20ft_shrub) and bladen_20ft_count becomes float(bladen_20ft_count)  and you divide one floating point grid by another floating point grid and you get a floating point grid.  &lt;br /&gt;
&lt;br /&gt;
Multiply this floating point grid by 100 to put the values back in the range of 100 to 0.   Finally, convert results of the entire operation back to an integer grid by enclosing it with int() . &lt;br /&gt;
The final command in the Expression box is: &lt;br /&gt;
&lt;br /&gt;
 int((float(bladen_20ft_shrub_count@PERMANENT)/float(bladen_20ft_count@PERMANENT))*100)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_47.png| Raster Calculator Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting raster should look like this:&lt;br /&gt;
[[File:Grasslidar_48.png| Raster Calculator Result]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Repeat the exercise with the midstory layer and compare the two layers.  Do you see differences between the shrub and midstory percentage of points layers? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will continue the vegetation analysis, but first we need to take a short side trip into terrain analysis that will relate back to our vegetation analysis..  Terrain analysis will be done using geomrphons. &lt;br /&gt;
&lt;br /&gt;
== Step 5:  Terrain analysis with geomorphons ==&lt;br /&gt;
&lt;br /&gt;
What are geomorphons?  Geomorphon is a new technique for classifying terrain based on a line of sight analysis, see http://geomorphometry.org/system/files/StepinskiJasiewicz2011geomorphometry.pdf&lt;br /&gt;
 and , http://www.sciencedirect.com/science/article/pii/S0169555X12005028 &lt;br /&gt;
&lt;br /&gt;
The technique uses a line of sight metric for terrain form calculation.  There are options for a simple 10 class representation, a 498 class numeric coding, or positive and negative encoding per cell on line of sight.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_49.png| Geomorphon Classes]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_49.png&amp;diff=23772</id>
		<title>File:Grasslidar 49.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_49.png&amp;diff=23772"/>
		<updated>2016-11-08T02:55:05Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_48.png&amp;diff=23771</id>
		<title>File:Grasslidar 48.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_48.png&amp;diff=23771"/>
		<updated>2016-11-08T02:52:33Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_47.png&amp;diff=23770</id>
		<title>File:Grasslidar 47.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_47.png&amp;diff=23770"/>
		<updated>2016-11-08T02:50:23Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_46.png&amp;diff=23769</id>
		<title>File:Grasslidar 46.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_46.png&amp;diff=23769"/>
		<updated>2016-11-08T02:45:42Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_45.png&amp;diff=23768</id>
		<title>File:Grasslidar 45.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_45.png&amp;diff=23768"/>
		<updated>2016-11-08T02:39:11Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_44.png&amp;diff=23767</id>
		<title>File:Grasslidar 44.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_44.png&amp;diff=23767"/>
		<updated>2016-11-08T02:34:41Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_43.png&amp;diff=23766</id>
		<title>File:Grasslidar 43.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_43.png&amp;diff=23766"/>
		<updated>2016-11-08T02:30:59Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23765</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23765"/>
		<updated>2016-11-08T02:26:56Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_39.png|Updated Colors ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that in the light green and yellowish areas are significantly above the  DEM surface.  This is an indication that the laser did not penetrate the vegetation to hit the ground.   While the DEM is not perfect, it gives us a better ground surface than just using the min value.  There are ways to work around those differences, but that is not the topic for today.  &lt;br /&gt;
&lt;br /&gt;
Look at the other end&lt;br /&gt;
&lt;br /&gt;
* Set the region to match the 5ft dem&lt;br /&gt;
* Remove the base raster in the Transform tab and in the Optional tab&lt;br /&gt;
* Remove the zrange on the Selection tab&lt;br /&gt;
* Set the output raster to top_of_canopy_5ft&lt;br /&gt;
* Run r.in.lidar with the max method&lt;br /&gt;
&lt;br /&gt;
Change your legend to match the top of canopy layer.  What is the max height that you see? &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_40.png|Updated Colors Max Height ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Raster--&amp;gt;Reports and statistics--&amp;gt;Basic raster metadata (r.info)&lt;br /&gt;
* Select dem05ft&lt;br /&gt;
* Click Run&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_42.png| r.info output ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
R.info gives basic information about the raster layer.  You see the rows, columns, number of cells, projection, the command that created the raster is listed as well.  This is all useful information for metadata construction. The min and max values of the raster is what you need to look at now.  The maximum value in the DEM is 2264.559.  Since we have no trees in NC over 200ft, it seems we have some invalid high points.  To remedy this:*&lt;br /&gt;
* Go back to the Selection tab and and &lt;br /&gt;
* for the zrange enter -10,250.  &lt;br /&gt;
* Click Run&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_42.png&amp;diff=23764</id>
		<title>File:Grasslidar 42.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_42.png&amp;diff=23764"/>
		<updated>2016-11-08T02:24:02Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_41.png&amp;diff=23763</id>
		<title>File:Grasslidar 41.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_41.png&amp;diff=23763"/>
		<updated>2016-11-08T02:13:40Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_40.png&amp;diff=23762</id>
		<title>File:Grasslidar 40.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_40.png&amp;diff=23762"/>
		<updated>2016-11-08T02:10:49Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_39.png&amp;diff=23761</id>
		<title>File:Grasslidar 39.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_39.png&amp;diff=23761"/>
		<updated>2016-11-08T02:07:42Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23760</id>
		<title>Lidar Analysis of Vegetation Structure</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Lidar_Analysis_of_Vegetation_Structure&amp;diff=23760"/>
		<updated>2016-11-08T02:05:33Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This exercise was initially created as a session in a GIS training for the U. S. Fish and Wildlife Service  in May, 2016 by Doug Newcomb.&lt;br /&gt;
&lt;br /&gt;
== Session Objectives ==&lt;br /&gt;
&lt;br /&gt;
At the conclusion of this session, you will be able to:&lt;br /&gt;
&lt;br /&gt;
* Open GRASS GIS and Create a Location from an existing file&lt;br /&gt;
* Link external raster elevation data to the Location&lt;br /&gt;
* Import LAS point cloud data to assess DEM accuracy&lt;br /&gt;
* Import LAS point cloud data to create various vegetation structure products&lt;br /&gt;
* Export raster vegetation structure data layers from GRASS to GeoTiff&lt;br /&gt;
&lt;br /&gt;
Material Created By: Doug Newcomb (May 2016)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Software: GRASS 7.2 &lt;br /&gt;
&lt;br /&gt;
Directory Path: &amp;lt;tt&amp;gt;D:\grasslidar&amp;lt;/tt&amp;gt; (assumed at some places, use any directory you want)&lt;br /&gt;
&lt;br /&gt;
Image Files: D05_37_20026801_20141209.tif  D05_37_20026803_20141209.tif&lt;br /&gt;
D05_37_20026802_20141209.tif  D05_37_20026804_20141209.tif&lt;br /&gt;
&lt;br /&gt;
LAZ format LiDAR files:  LA_37_20026801_20141209.laz  LA_37_20026803_20141209.laz&lt;br /&gt;
LA_37_20026802_20141209.laz  LA_37_20026804_20141209.laz&lt;br /&gt;
&lt;br /&gt;
Data can be accessed online [https://drive.google.com/drive/folders/0B_vgoO_ZmVS3T2xnVDNoWk82ZTg?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Elevation data is commonly used in landscape analysis, but it is also quite useful in vegetation analysis.  This exercise will walk you through basic analysis of a LiDAR point cloud to better understand vegetation structure.  &lt;br /&gt;
&lt;br /&gt;
All data are located in c:\grasslidar\data, unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Creating GRASS Workspace ==&lt;br /&gt;
	The first thing to do when starting to work in GRASS is to create a Location.  GRASS Locations are single projection areas with a defined resolution and extent. The initial location can be easily created from an existing data set.&lt;br /&gt;
&lt;br /&gt;
In Windows, Click on Start--&amp;gt;All Programs--&amp;gt;GRASS GIS 7.2--&amp;gt; GRASS GIS 7.2 GUI&lt;br /&gt;
&lt;br /&gt;
Two windows will open, the GRASS startup window ( to select or create a workspace) and the GRASS command prompt.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_1.png|Initial GRASS startup screen on Windows ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the New button between the Location and Mapset windows. This will bring up the menu to define a new Location.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_2.png|Location Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GIS Data Directory is where all of your grass workspaces will reside.  Creating a new directory with a unique name for grass data is recommended.  This directory can be created anywhere that the user has write access.  Project location is a subdirctory name for this particular project. Like with ArcGIS, it is best to avoid spaces in Directory names to avoid problems down the road.  Click on the Browse button and select c:\grasslidar\grassdata. The data is from Bladen County, NC and is in the North Carolina State Plane NAD83(2011) projection with units feet, so call it bladen_stpft  &lt;br /&gt;
&lt;br /&gt;
* Enter the Data Directory  and Project Location – this brings up the location creation method menu&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_3.png|Location projection Menu 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the radio button for Read projection and datum terms from a georeferenced file.&lt;br /&gt;
* Click Next&lt;br /&gt;
&lt;br /&gt;
This brings up the georeferenced file dialog.  &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data and look at the data available:&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_4.png|File data 1 ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this directory, you will see 4 file types: asc, laz, tif, and vrt. LiDAR data is usually distributed as tiles of  point clouds and Digital Elevation Models (DEMs) ASC and TIFF are common file formats to distribute DEM data.  Asc is an ArcInfo ASCII Grid file, which is simply a text file representing a grid and does not have any projection data associated with it.  Generally .tif files distributed as DEMs have projection information embedded in the file.  LAZ is an open method of compression for LAS files.  VRT is a virtual raster index of the 4 .tif files in this directory.&lt;br /&gt;
&lt;br /&gt;
 In this directory, and select D05_37_20026801_20141209.tif as the georeferenced file. &lt;br /&gt;
* Click Next.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_5.png|File selected menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GRASS reads  the georeference data from the elevation file and displays the projection data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_6.png|Location projection information menu ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
The next message relates to setting a default path for GRASS startup.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_7.png|Location projection information window ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the following message, you have the option if importing the data set you used for georeferencing the workspace.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_8.png|Import file dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
&lt;br /&gt;
The location has been created. You are prompted to set the default region extents and resolution. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_9.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click No&lt;br /&gt;
You are then prompted to create a new mapset.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_10.png|Extents dialog ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Cancel&lt;br /&gt;
&lt;br /&gt;
You have finished creating a Location with the default PERMANENT mapset. The next time GRASS is started, you can either select an existing Location and Mapset,  create a new Mapset within the Location, or create a new Location.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_11.png|GRASS Startup Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
* Click on the PERMANENT Mapset&lt;br /&gt;
* Click Start GRASS session&lt;br /&gt;
&lt;br /&gt;
You will then see the Layer Manager Window, the Map Display Window for Display 1.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_12.png|GRASS Windows]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Step 2:  Adding a data layer ==&lt;br /&gt;
&lt;br /&gt;
We are now ready to add data to the Mapset.  We can either import Raster and Vector data using the GDAL translation library, or we can link to existing external data sets read only to reduce data duplication.  In this case, we will link to the 1m elevation data we used to create the Location using the r.external command.&lt;br /&gt;
&lt;br /&gt;
* In the Layer Manager window, click File--&amp;gt;Link external data--&amp;gt;Link external raster data.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_13.png|Link External Data Menu]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up the r.external dialog.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_14.png|Link External Data Menu 2]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We would like to treat the 4 tiles of LiDAR and elevation data as a single seamless unit, to accomplish this, we are going to first select the demo05ft.vrt image index as our input raster. &lt;br /&gt;
&lt;br /&gt;
* Browse to C:\grasslidar\data\dem05ft.vrt and select it. Note that the Add layers into layer tree is checked.  For large data sets, leave this unchecked.&lt;br /&gt;
* Click on the  import settings tab at the bottom&lt;br /&gt;
* Click on the box for Extend region extents based on new dataset. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_15.png|Link External Data Menu 3]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click back to the Source settings tab and Click Link.&lt;br /&gt;
&lt;br /&gt;
The Layer Manager window will switch to the Command console tab and display the results of the  r.external command . Click the close button on the r.external dialog.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_16.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 4 DEM rasters are displayed in the Map Display window as a single seamless data set . Any GIS software built with Geodata Abstraction Library(GDAL) ( including ArcGIS 10.0 and above) will see a vrt mosaic as a single raster layer. Creating the vrt is as simple as going to the black GRASS command window ,navigating to the directory in the with the rasters and typing:  gdalbuildvrt dem05ft.vrt *.tif &lt;br /&gt;
&lt;br /&gt;
For larger data sets, it takes much less time to link to a raster data set than import it and linking also saves on storage space.&lt;br /&gt;
&lt;br /&gt;
== Step 3:  Setting up the region ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The region in a GRASS mapset defines the extent and resolution of the results of any raster actions.  To make sure that all of a raster layer is affected by a command, it is customary to set the region’s extent and resolution to match the raster layer. To set the region to match the elevation raster that we just linked to ,&lt;br /&gt;
&lt;br /&gt;
* From the Layer Manager window drop down options, click the Settings--&amp;gt;Region--&amp;gt;Set region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_17.png|DEM View]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the g.region menu, in the Set region to match raster map section, use the drop down to select dem05ft@Permanent. &lt;br /&gt;
* Click Run&lt;br /&gt;
[[File:Grasslidar_18.png|Region Settings Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command finishes, your will see “Command finished” and the time taken  in the g.region window .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click Close in the g.region window&lt;br /&gt;
* Click Settings--&amp;gt;Region--&amp;gt;Display region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_19.png|Region Display Selection]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the command console tab of the Layer Manager window, you see the current region definintion: resolution, bounds, rows and columns.  The output resolution of raster layers created will usually match the region resolution.  To change the output resolution, you will need to change the resolution of the region.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_20.png|Extent and Resolution of Mapset]]&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick note about the results.  The datum is not recognised and assumed to be WGS84 by GRASS. The datum is NAD83 (2011).  The data coordinates  have not changed,  the datum information has not been recognized on import.  We can work with the data and assign the correct datum information after export from GRASS.  This should be corrected by the final release of this version of GRASS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Step 4:  Processing the Lidar data ==&lt;br /&gt;
&lt;br /&gt;
There are 4 lidar tiles that correspond to the 4 tiles of elevation data.  The  data is in the Compressed LAS files (laz) format. LASZip, http://www.laszip.org/, is an open compression method that losslessly compresses LAS format LiDAR  data files to about 25 -30 percent of the original size.&lt;br /&gt;
[[File:Grasslidar_21.png|LAZ LiDAR files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be using  the GRASS 7.1 r.in lidar. R.in.lidar uses a binning process, performing an analysis on the points that fall in each raster cell.  It’s best to process las tiles as a single unit to avoid border effects. There are two ways to do this:&lt;br /&gt;
1) Merge the las files together into a single file using tools such as lastools lasmerge, https://rapidlasso.com/lastools/lasmerge/ . Many software packages are still limited to LAS format 1.2 which can only handle up to 4.2 billion points per file ( a current limitation in GRASS7.1) .  This option can also take up hard drive space. &lt;br /&gt;
2) The second option available in r.in.lidar is to give a filename with  a list of adjacent LAS/LAZ files and it will treat it as a virtual seamless LiDAR data set.  If you look in the data directory, you will see laslist.txt.  The contents of the file are:&lt;br /&gt;
C:\grasslidar\data\LA_37_20026801_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026802_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026803_20141209.laz&lt;br /&gt;
C:\grasslidar\data\LA_37_20026804_20141209.laz&lt;br /&gt;
	&lt;br /&gt;
	This is a list of the compressed las files in the directory that you will be processing.  Give r.in.lidar c:\grasslidar\data\laslist.txt as the input file list, and it will treat all 4 files as a single point cloud.  This method has been tested on file lists up to 966 las files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise will use the second method.  To start r.in.lidar, go to File--&amp;gt;Import raster data--&amp;gt;LAS Lidar points import.&lt;br /&gt;
[[File:Grasslidar_22.png|Selecting r.in.lidar files]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bring up the r.in.lidar menu.  &lt;br /&gt;
&lt;br /&gt;
You will notice that there are several tabs across the top of the command window.  The first tab is the Input tab .  You can either enter the name of the individual las or laz file,  or you can enter the name of a txt file with a list of las or laz files.  In the second option, browse to the location of the laslist.txt file and select it as shown.  &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_23.png|r.in.lidar Input Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will set the output raster layer.&lt;br /&gt;
* Click on the Output tab&lt;br /&gt;
* In the Name for output raster layer box, type “ bladen_test_5ft_pt_count” as the output layer&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_24.png|r.in.lidar Output Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be binning the data using a 5ft resolution cell.  In this case, you will be counting how many LiDAR returns are in each 5ft cell.&lt;br /&gt;
* Click on the Statistic tab&lt;br /&gt;
* Select n from the Statistic to use for raster values drop down menu&lt;br /&gt;
[[File:Grasslidar_25.png|r.in.lidar Statistic Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the selection tab&lt;br /&gt;
* You want all points except the low noise ( class 7) so put 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20 into the box for “Only import points of selected classes.”  (feel free to copy and paste)&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_26.png|r.in.lidar Selection Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on the Optional tab &lt;br /&gt;
* Select the check box for Override projection check &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_27.png|r.in.lidar Options Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run.&lt;br /&gt;
&lt;br /&gt;
Your display should look like this, with the result of the point count automatically added to the display. &lt;br /&gt;
[[File:Grasslidar_28.png|r.in.lidar Count example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a legend to the display:&lt;br /&gt;
&lt;br /&gt;
* Click on the Add map elements button on the top of the Display window&lt;br /&gt;
* Select show/hide legend&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_29.png|Legend example Tab]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default legend is not clear for this data set, so simplify the legend by:&lt;br /&gt;
* Double clicking on the legend to bring up the d.legend menu.&lt;br /&gt;
* Click on the Gradient tab and check the Draw smooth gradient and Add histogram to smoothed legend.&lt;br /&gt;
* Change the number of text labels from the default of 5 to 8.&lt;br /&gt;
* Click OK&lt;br /&gt;
[[File:Grasslidar_30.png|Legend Gradient]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Grasslidar_31.png|Count display]]&amp;lt;br /&amp;gt;&lt;br /&gt;
As you can see in the illustration above, the histogram on the legend tells you that most of the cells have fewer than 10 points per cell.  For any valid statistical analysis of the point values in the cell you would need to pick a cell size larger than 5ft if you are performing statistics on the point values within each cell.  &lt;br /&gt;
&lt;br /&gt;
You can also see the overlap of the LiDAR data collection flight lines.  This makes the use of direct point count density useless as a measure of vegetation density unless all overlap points are removed.  &lt;br /&gt;
== Step 6:  Canopy Heights and Other Forest Structure Metrics ==&lt;br /&gt;
&lt;br /&gt;
Calculation of canopy heights involves determining the distance between the ground and the top of the vegetation.   It can be done two steps , creating a digital surface model (DSM) and subtracting the Digital Elevation Model (DEM) With GRASS, this can be done in one step.  &lt;br /&gt;
&lt;br /&gt;
Go back to the r.in.lidar menu:&lt;br /&gt;
* Set the output raster to bladen_test_5ft_ch. &lt;br /&gt;
* Go to the statistic tab and select max from the drop down menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_32.png|Max Height]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Select the Transform tab&lt;br /&gt;
* From the Subtract raster values from the z coordinates, select dem05ft from the dropdown menu. &lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_33.png|r.inlidar Transform]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Go to the Optional tab&lt;br /&gt;
* Check the boxes next to Override projection check and Use base raster actual resolution instead of computational region&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_34.png|r.inlidar Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click Run&lt;br /&gt;
* Select the Display window and double-click on the legend. &lt;br /&gt;
* Select as the input raster layer bladen_test_05ft_ch&lt;br /&gt;
&lt;br /&gt;
You have just used the 5 ft resolution DEM to convert the z values of the point cloud to height above ground.  Selecting the maximum value in each cell now gives the canopy height in each cell.  Using this proceedure allows you to convert the LiDAR point Z values to height above ground at the 5ft resolution, but the calculations after the conversion will be done for the cell size of the current resolution of the location.    &lt;br /&gt;
&lt;br /&gt;
Look back at the legend.  You will notice that the bottom value is negative 4.  Why is that?  Run r.in.lidar again with the statistic st to min and the output raster set to bladen_test_05ft_min.  &lt;br /&gt;
&lt;br /&gt;
* Go back to d.legend and set the raster to bladen_test_05ft_min.&lt;br /&gt;
* Click on the Gradient tab and set the number of text labels to 20&lt;br /&gt;
* Click apply&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_35.png|Legend  Options]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the bulk of the minimum values are less than the DEM surface.  Turn off all layers except the DEM layer.  Zoom into the large oval area in the Southeast corner of the DEM.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_36.png|DEM ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature is called a Carolina bay.  The northern half has been ditched and drained, and the southern half remains in the native thick vegetation.  Turn the min values back on.  &lt;br /&gt;
&lt;br /&gt;
* Go to raster--&amp;gt;Manage colors --&amp;gt; Color tables.  This will open the r.colors menu.&lt;br /&gt;
* Select the Define tab and in the Name of color table dropdown select elevation.&lt;br /&gt;
&lt;br /&gt;
[[File:Grasslidar_38.png|Color editing ]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_38.png&amp;diff=23759</id>
		<title>File:Grasslidar 38.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_38.png&amp;diff=23759"/>
		<updated>2016-11-08T02:04:39Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_37.png&amp;diff=23758</id>
		<title>File:Grasslidar 37.png</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=File:Grasslidar_37.png&amp;diff=23758"/>
		<updated>2016-11-08T02:04:22Z</updated>

		<summary type="html">&lt;p&gt;⚠️Dnewcomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>⚠️Dnewcomb</name></author>
	</entry>
</feed>