<?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%8FMmetz</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%8FMmetz"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FMmetz"/>
	<updated>2026-05-25T19:58:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25788</id>
		<title>Talk:GRASS GIS Community Sprint Berlin 2019</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25788"/>
		<updated>2019-05-23T08:14:14Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Markus Metz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sponsors &amp;amp; Supporters =&lt;br /&gt;
&lt;br /&gt;
The GRASS Community sprint was kindly sponsored by FOSSGIS e.V. and coorganized by DIW Berlin, which provided the venue.&lt;br /&gt;
 &lt;br /&gt;
= Participants and Reports =&lt;br /&gt;
&lt;br /&gt;
Summarizing '''press release''': TODO&lt;br /&gt;
&lt;br /&gt;
[[File:grassgis 2019 berlin sprint group photo.jpg|400px|center|GRASS GIS community sprinters at DIW Berlin, 2019]]&lt;br /&gt;
&lt;br /&gt;
== Peter Loewe ==&lt;br /&gt;
&lt;br /&gt;
[[File:Community-Sprint 2019 Zenodo high level view.jpg|thumb|right|Community-Sprint 2019 Zenodo high level view]]&lt;br /&gt;
&lt;br /&gt;
* Discussion about Zenodo / GitHub integration&lt;br /&gt;
* Set up of Wikipage about the [https://grasswiki.osgeo.org/wiki/GitHub-Zenodo_linkage Zenodo-GitHuB integration] with all known facts and necessary steps tp dp this.&lt;br /&gt;
* Investigating [https://grass.osgeo.org/grass7/manuals/addons/v.surf.mass.html v.surf.mass] for social sciences and economic research.&lt;br /&gt;
* Preparation of OSGeo as a software commons for upcoming FOSS4G in Bucarest.&lt;br /&gt;
* Provision of Sprint infrastructure (coffee machine, vittle, display of holy GRASS relics, etc.)&lt;br /&gt;
&lt;br /&gt;
== Markus Neteler ==&lt;br /&gt;
&lt;br /&gt;
* creation of all new Github repos&lt;br /&gt;
** GRASS GIS core: https://github.com/OSGeo/grass (GRASS GIS &amp;gt;= 7.x)&lt;br /&gt;
** GRASS GIS legacy: https://github.com/OSGeo/grass-legacy (GRASS GIS 3.x, 4.x, 5.x, 6.x - 1987 - 2016)&lt;br /&gt;
** GRASS GIS addons: https://github.com/OSGeo/grass-addons&lt;br /&gt;
** GRASS GIS promotional material: https://github.com/OSGeo/grass-promo&lt;br /&gt;
** Upcoming new web site: https://github.com/OSGeo/grass-website&lt;br /&gt;
* Testing of new Github repo at: https://github.com/OSGeo/grass/&lt;br /&gt;
* Github teams created - different roles for read/write/admin access&lt;br /&gt;
** grass-committers: GRASS GIS developers team  (read/write)&lt;br /&gt;
** grass-admin: GRASS GIS GitHub admin team (all)&lt;br /&gt;
** grass-docker-homebrew-users: users for automated dockerhub and homebrew builds (read-only)&lt;br /&gt;
* New Github users added upon email communication&lt;br /&gt;
* Draft version of https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* (briefly) discussed image collections in GRASS GIS (needed for H2020 [http://openEO.org openEO.org])&lt;br /&gt;
* First PR :-) {{github_pr|8}}&lt;br /&gt;
* aftermath cleanup: tracked in https://trac.osgeo.org/grass/wiki/GitMigration#Aftermathcleanup&lt;br /&gt;
&lt;br /&gt;
== Nicolas Bozon ==&lt;br /&gt;
&lt;br /&gt;
* Presentation via video call of a first glance at the [[Website migration plan 2019|upcoming new GRASS GIS web site]] based on Hugo&lt;br /&gt;
&lt;br /&gt;
[[File:grass2019_berlin_sprint_new_website.jpg|thumb|right|Upcoming new GRASS GIS web site]]&lt;br /&gt;
&lt;br /&gt;
== Martin Landa ==&lt;br /&gt;
&lt;br /&gt;
* Working on GitHub migration&lt;br /&gt;
** finalize source code migration to GitHub ({{trac|3722}})&lt;br /&gt;
*** Targets: https://github.com/OSGeo/grass, https://github.com/OSGeo/grass-addons, https://github.com/OSGeo/grass-promo, https://github.com/OSGeo/grass-legacy&lt;br /&gt;
*** svn2git migration dump and logs: https://grass.osgeo.org/svn2git_archive/&lt;br /&gt;
* Update/Fix WinGRASS build procedure to work with Git&lt;br /&gt;
* {{github_pr|9}}&lt;br /&gt;
* Discussed GRASS support for image collection with Soeren&lt;br /&gt;
&lt;br /&gt;
== Ondřej Pešek ==&lt;br /&gt;
&lt;br /&gt;
* {{cmd|g.gui.gmodeler}}: Working on PyWPS export (see [https://github.com/ctu-yfsg/2017-d-grass-modeler-pywps/compare/master@%7B17/05/2019%7D...master@%7B21/05/2019%7D github commits] overview)&lt;br /&gt;
* Research and discussions about ANN-fueled semantic segmentation modules for GRASS GIS&lt;br /&gt;
* Watching Sören's screenings of Mandelbrot's fractals&lt;br /&gt;
&lt;br /&gt;
== Anna Petrasova and Vaclav Petras ==&lt;br /&gt;
&lt;br /&gt;
* video call from sprint to sprint: Minneapolis OSGeo sprint &amp;lt;--&amp;gt; Berlin GRASS GIS community sprint&lt;br /&gt;
** discussing GitHub migration and HowToGit document&lt;br /&gt;
&lt;br /&gt;
== Veronica Andreo ==&lt;br /&gt;
&lt;br /&gt;
* video call from Argentina&lt;br /&gt;
** learning and testing with HowToGit document&lt;br /&gt;
** discussion about progress of the new website&lt;br /&gt;
&lt;br /&gt;
== Anne Ghisla aka aghisla ==&lt;br /&gt;
&lt;br /&gt;
* Discuss with Peter about archiving of source code in Zenodo (one DOI per GRASS release, connection with git)&lt;br /&gt;
* Follow closely the svn2git migration and the design of the new commit/push workflow&lt;br /&gt;
* Start working on the HTML man pages, so that they refer to git for source code and last edit timestamp ({{github_pr|11}}, work in progress)&lt;br /&gt;
* Investigate a clean way of dropping Python 2.x support, to be done before 2020 (official EOL of Python 2.x)&lt;br /&gt;
* Check with MarkusM how to update g.extension to use git - maybe the Debian Python Team's way can be of inspiration https://salsa.debian.org/python-team/tools/python-modules&lt;br /&gt;
&lt;br /&gt;
== Markus Metz ==&lt;br /&gt;
&lt;br /&gt;
* Help with git migration and documentation https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* Fix basic GIS functionality: r.contour ([https://trac.osgeo.org/grass/ticket/3846 #3846]), [https://github.com/OSGeo/grass/pull/6 GH-PR #6]&lt;br /&gt;
* Help on polishing github profile&lt;br /&gt;
* discussions with the other participants on best practice and future plans (git, python3, proj6)&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25787</id>
		<title>Talk:GRASS GIS Community Sprint Berlin 2019</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25787"/>
		<updated>2019-05-23T08:09:12Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Markus Metz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sponsors &amp;amp; Supporters =&lt;br /&gt;
&lt;br /&gt;
The GRASS Community sprint was kindly sponsored by FOSSGIS e.V. and coorganized by DIW Berlin, which provided the venue.&lt;br /&gt;
 &lt;br /&gt;
= Participants and Reports =&lt;br /&gt;
&lt;br /&gt;
Summarizing '''press release''': TODO&lt;br /&gt;
&lt;br /&gt;
[[File:grassgis 2019 berlin sprint group photo.jpg|400px|center|GRASS GIS community sprinters at DIW Berlin, 2019]]&lt;br /&gt;
&lt;br /&gt;
== Peter Loewe ==&lt;br /&gt;
&lt;br /&gt;
[[File:Community-Sprint 2019 Zenodo high level view.jpg|thumb|right|Community-Sprint 2019 Zenodo high level view]]&lt;br /&gt;
&lt;br /&gt;
* Discussion about Zenodo / GitHub integration&lt;br /&gt;
* Set up of Wikipage about the [https://grasswiki.osgeo.org/wiki/GitHub-Zenodo_linkage Zenodo-GitHuB integration] with all known facts and necessary steps tp dp this.&lt;br /&gt;
* Investigating [https://grass.osgeo.org/grass7/manuals/addons/v.surf.mass.html v.surf.mass] for social sciences and economic research.&lt;br /&gt;
* Preparation of OSGeo as a software commons for upcoming FOSS4G in Bucarest.&lt;br /&gt;
* Provision of Sprint infrastructure (coffee machine, vittle, display of holy GRASS relics, etc.)&lt;br /&gt;
&lt;br /&gt;
== Markus Neteler ==&lt;br /&gt;
&lt;br /&gt;
* creation of all new Github repos&lt;br /&gt;
** GRASS GIS core: https://github.com/OSGeo/grass (GRASS GIS &amp;gt;= 7.x)&lt;br /&gt;
** GRASS GIS legacy: https://github.com/OSGeo/grass-legacy (GRASS GIS 3.x, 4.x, 5.x, 6.x - 1987 - 2016)&lt;br /&gt;
** GRASS GIS addons: https://github.com/OSGeo/grass-addons&lt;br /&gt;
** GRASS GIS promotional material: https://github.com/OSGeo/grass-promo&lt;br /&gt;
** Upcoming new web site: https://github.com/OSGeo/grass-website&lt;br /&gt;
* Testing of new Github repo at: https://github.com/OSGeo/grass/&lt;br /&gt;
* Github teams created - different roles for read/write/admin access&lt;br /&gt;
** grass-committers: GRASS GIS developers team  (read/write)&lt;br /&gt;
** grass-admin: GRASS GIS GitHub admin team (all)&lt;br /&gt;
** grass-docker-homebrew-users: users for automated dockerhub and homebrew builds (read-only)&lt;br /&gt;
* New Github users added upon email communication&lt;br /&gt;
* Draft version of https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* (briefly) discussed image collections in GRASS GIS (needed for H2020 [http://openEO.org openEO.org])&lt;br /&gt;
* First PR :-) {{github_pr|8}}&lt;br /&gt;
* aftermath cleanup: tracked in https://trac.osgeo.org/grass/wiki/GitMigration#Aftermathcleanup&lt;br /&gt;
&lt;br /&gt;
== Nicolas Bozon ==&lt;br /&gt;
&lt;br /&gt;
* Presentation via video call of a first glance at the [[Website migration plan 2019|upcoming new GRASS GIS web site]] based on Hugo&lt;br /&gt;
&lt;br /&gt;
[[File:grass2019_berlin_sprint_new_website.jpg|thumb|right|Upcoming new GRASS GIS web site]]&lt;br /&gt;
&lt;br /&gt;
== Martin Landa ==&lt;br /&gt;
&lt;br /&gt;
* Working on GitHub migration&lt;br /&gt;
** finalize source code migration to GitHub ({{trac|3722}})&lt;br /&gt;
*** Targets: https://github.com/OSGeo/grass, https://github.com/OSGeo/grass-addons, https://github.com/OSGeo/grass-promo, https://github.com/OSGeo/grass-legacy&lt;br /&gt;
*** svn2git migration dump and logs: https://grass.osgeo.org/svn2git_archive/&lt;br /&gt;
* Update/Fix WinGRASS build procedure to work with Git&lt;br /&gt;
* {{github_pr|9}}&lt;br /&gt;
* Discussed GRASS support for image collection with Soeren&lt;br /&gt;
&lt;br /&gt;
== Ondřej Pešek ==&lt;br /&gt;
&lt;br /&gt;
* {{cmd|g.gui.gmodeler}}: Working on PyWPS export (see [https://github.com/ctu-yfsg/2017-d-grass-modeler-pywps/compare/master@%7B17/05/2019%7D...master@%7B21/05/2019%7D github commits] overview)&lt;br /&gt;
* Research and discussions about ANN-fueled semantic segmentation modules for GRASS GIS&lt;br /&gt;
* Watching Sören's screenings of Mandelbrot's fractals&lt;br /&gt;
&lt;br /&gt;
== Anna Petrasova and Vaclav Petras ==&lt;br /&gt;
&lt;br /&gt;
* video call from sprint to sprint: Minneapolis OSGeo sprint &amp;lt;--&amp;gt; Berlin GRASS GIS community sprint&lt;br /&gt;
** discussing GitHub migration and HowToGit document&lt;br /&gt;
&lt;br /&gt;
== Veronica Andreo ==&lt;br /&gt;
&lt;br /&gt;
* video call from Argentina&lt;br /&gt;
** learning and testing with HowToGit document&lt;br /&gt;
** discussion about progress of the new website&lt;br /&gt;
&lt;br /&gt;
== Anne Ghisla aka aghisla ==&lt;br /&gt;
&lt;br /&gt;
* Discuss with Peter about archiving of source code in Zenodo (one DOI per GRASS release, connection with git)&lt;br /&gt;
* Follow closely the svn2git migration and the design of the new commit/push workflow&lt;br /&gt;
* Start working on the HTML man pages, so that they refer to git for source code and last edit timestamp ({{github_pr|11}}, work in progress)&lt;br /&gt;
* Investigate a clean way of dropping Python 2.x support, to be done before 2020 (official EOL of Python 2.x)&lt;br /&gt;
* Check with MarkusM how to update g.extension to use git - maybe the Debian Python Team's way can be of inspiration https://salsa.debian.org/python-team/tools/python-modules&lt;br /&gt;
&lt;br /&gt;
== Markus Metz ==&lt;br /&gt;
&lt;br /&gt;
* Help with git migration and documentation https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* Fix basic GIS functionality: r.contour ([https://trac.osgeo.org/grass/ticket/3846 #3846]), [https://github.com/OSGeo/grass/pull/6 GH-PR #6]&lt;br /&gt;
* Help on polishing github profile&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25786</id>
		<title>Talk:GRASS GIS Community Sprint Berlin 2019</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25786"/>
		<updated>2019-05-23T08:08:55Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Markus Metz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sponsors &amp;amp; Supporters =&lt;br /&gt;
&lt;br /&gt;
The GRASS Community sprint was kindly sponsored by FOSSGIS e.V. and coorganized by DIW Berlin, which provided the venue.&lt;br /&gt;
 &lt;br /&gt;
= Participants and Reports =&lt;br /&gt;
&lt;br /&gt;
Summarizing '''press release''': TODO&lt;br /&gt;
&lt;br /&gt;
[[File:grassgis 2019 berlin sprint group photo.jpg|400px|center|GRASS GIS community sprinters at DIW Berlin, 2019]]&lt;br /&gt;
&lt;br /&gt;
== Peter Loewe ==&lt;br /&gt;
&lt;br /&gt;
[[File:Community-Sprint 2019 Zenodo high level view.jpg|thumb|right|Community-Sprint 2019 Zenodo high level view]]&lt;br /&gt;
&lt;br /&gt;
* Discussion about Zenodo / GitHub integration&lt;br /&gt;
* Set up of Wikipage about the [https://grasswiki.osgeo.org/wiki/GitHub-Zenodo_linkage Zenodo-GitHuB integration] with all known facts and necessary steps tp dp this.&lt;br /&gt;
* Investigating [https://grass.osgeo.org/grass7/manuals/addons/v.surf.mass.html v.surf.mass] for social sciences and economic research.&lt;br /&gt;
* Preparation of OSGeo as a software commons for upcoming FOSS4G in Bucarest.&lt;br /&gt;
* Provision of Sprint infrastructure (coffee machine, vittle, display of holy GRASS relics, etc.)&lt;br /&gt;
&lt;br /&gt;
== Markus Neteler ==&lt;br /&gt;
&lt;br /&gt;
* creation of all new Github repos&lt;br /&gt;
** GRASS GIS core: https://github.com/OSGeo/grass (GRASS GIS &amp;gt;= 7.x)&lt;br /&gt;
** GRASS GIS legacy: https://github.com/OSGeo/grass-legacy (GRASS GIS 3.x, 4.x, 5.x, 6.x - 1987 - 2016)&lt;br /&gt;
** GRASS GIS addons: https://github.com/OSGeo/grass-addons&lt;br /&gt;
** GRASS GIS promotional material: https://github.com/OSGeo/grass-promo&lt;br /&gt;
** Upcoming new web site: https://github.com/OSGeo/grass-website&lt;br /&gt;
* Testing of new Github repo at: https://github.com/OSGeo/grass/&lt;br /&gt;
* Github teams created - different roles for read/write/admin access&lt;br /&gt;
** grass-committers: GRASS GIS developers team  (read/write)&lt;br /&gt;
** grass-admin: GRASS GIS GitHub admin team (all)&lt;br /&gt;
** grass-docker-homebrew-users: users for automated dockerhub and homebrew builds (read-only)&lt;br /&gt;
* New Github users added upon email communication&lt;br /&gt;
* Draft version of https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* (briefly) discussed image collections in GRASS GIS (needed for H2020 [http://openEO.org openEO.org])&lt;br /&gt;
* First PR :-) {{github_pr|8}}&lt;br /&gt;
* aftermath cleanup: tracked in https://trac.osgeo.org/grass/wiki/GitMigration#Aftermathcleanup&lt;br /&gt;
&lt;br /&gt;
== Nicolas Bozon ==&lt;br /&gt;
&lt;br /&gt;
* Presentation via video call of a first glance at the [[Website migration plan 2019|upcoming new GRASS GIS web site]] based on Hugo&lt;br /&gt;
&lt;br /&gt;
[[File:grass2019_berlin_sprint_new_website.jpg|thumb|right|Upcoming new GRASS GIS web site]]&lt;br /&gt;
&lt;br /&gt;
== Martin Landa ==&lt;br /&gt;
&lt;br /&gt;
* Working on GitHub migration&lt;br /&gt;
** finalize source code migration to GitHub ({{trac|3722}})&lt;br /&gt;
*** Targets: https://github.com/OSGeo/grass, https://github.com/OSGeo/grass-addons, https://github.com/OSGeo/grass-promo, https://github.com/OSGeo/grass-legacy&lt;br /&gt;
*** svn2git migration dump and logs: https://grass.osgeo.org/svn2git_archive/&lt;br /&gt;
* Update/Fix WinGRASS build procedure to work with Git&lt;br /&gt;
* {{github_pr|9}}&lt;br /&gt;
* Discussed GRASS support for image collection with Soeren&lt;br /&gt;
&lt;br /&gt;
== Ondřej Pešek ==&lt;br /&gt;
&lt;br /&gt;
* {{cmd|g.gui.gmodeler}}: Working on PyWPS export (see [https://github.com/ctu-yfsg/2017-d-grass-modeler-pywps/compare/master@%7B17/05/2019%7D...master@%7B21/05/2019%7D github commits] overview)&lt;br /&gt;
* Research and discussions about ANN-fueled semantic segmentation modules for GRASS GIS&lt;br /&gt;
* Watching Sören's screenings of Mandelbrot's fractals&lt;br /&gt;
&lt;br /&gt;
== Anna Petrasova and Vaclav Petras ==&lt;br /&gt;
&lt;br /&gt;
* video call from sprint to sprint: Minneapolis OSGeo sprint &amp;lt;--&amp;gt; Berlin GRASS GIS community sprint&lt;br /&gt;
** discussing GitHub migration and HowToGit document&lt;br /&gt;
&lt;br /&gt;
== Veronica Andreo ==&lt;br /&gt;
&lt;br /&gt;
* video call from Argentina&lt;br /&gt;
** learning and testing with HowToGit document&lt;br /&gt;
** discussion about progress of the new website&lt;br /&gt;
&lt;br /&gt;
== Anne Ghisla aka aghisla ==&lt;br /&gt;
&lt;br /&gt;
* Discuss with Peter about archiving of source code in Zenodo (one DOI per GRASS release, connection with git)&lt;br /&gt;
* Follow closely the svn2git migration and the design of the new commit/push workflow&lt;br /&gt;
* Start working on the HTML man pages, so that they refer to git for source code and last edit timestamp ({{github_pr|11}}, work in progress)&lt;br /&gt;
* Investigate a clean way of dropping Python 2.x support, to be done before 2020 (official EOL of Python 2.x)&lt;br /&gt;
* Check with MarkusM how to update g.extension to use git - maybe the Debian Python Team's way can be of inspiration https://salsa.debian.org/python-team/tools/python-modules&lt;br /&gt;
&lt;br /&gt;
== Markus Metz ==&lt;br /&gt;
&lt;br /&gt;
* Help with git migration and documentation https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* Fix basic GIS functionality: r.contour ([https://trac.osgeo.org/grass/ticket/3846 #3846]), [https://github.com/OSGeo/grass/pull/6 GH-PR 6]&lt;br /&gt;
* Help on polishing github profile&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25785</id>
		<title>Talk:GRASS GIS Community Sprint Berlin 2019</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25785"/>
		<updated>2019-05-23T08:07:19Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: + Markus M&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sponsors &amp;amp; Supporters =&lt;br /&gt;
&lt;br /&gt;
The GRASS Community sprint was kindly sponsored by FOSSGIS e.V. and coorganized by DIW Berlin, which provided the venue.&lt;br /&gt;
 &lt;br /&gt;
= Participants and Reports =&lt;br /&gt;
&lt;br /&gt;
Summarizing '''press release''': TODO&lt;br /&gt;
&lt;br /&gt;
[[File:grassgis 2019 berlin sprint group photo.jpg|400px|center|GRASS GIS community sprinters at DIW Berlin, 2019]]&lt;br /&gt;
&lt;br /&gt;
== Peter Loewe ==&lt;br /&gt;
&lt;br /&gt;
[[File:Community-Sprint 2019 Zenodo high level view.jpg|thumb|right|Community-Sprint 2019 Zenodo high level view]]&lt;br /&gt;
&lt;br /&gt;
* Discussion about Zenodo / GitHub integration&lt;br /&gt;
* Set up of Wikipage about the [https://grasswiki.osgeo.org/wiki/GitHub-Zenodo_linkage Zenodo-GitHuB integration] with all known facts and necessary steps tp dp this.&lt;br /&gt;
* Investigating [https://grass.osgeo.org/grass7/manuals/addons/v.surf.mass.html v.surf.mass] for social sciences and economic research.&lt;br /&gt;
* Preparation of OSGeo as a software commons for upcoming FOSS4G in Bucarest.&lt;br /&gt;
* Provision of Sprint infrastructure (coffee machine, vittle, display of holy GRASS relics, etc.)&lt;br /&gt;
&lt;br /&gt;
== Markus Neteler ==&lt;br /&gt;
&lt;br /&gt;
* creation of all new Github repos&lt;br /&gt;
** GRASS GIS core: https://github.com/OSGeo/grass (GRASS GIS &amp;gt;= 7.x)&lt;br /&gt;
** GRASS GIS legacy: https://github.com/OSGeo/grass-legacy (GRASS GIS 3.x, 4.x, 5.x, 6.x - 1987 - 2016)&lt;br /&gt;
** GRASS GIS addons: https://github.com/OSGeo/grass-addons&lt;br /&gt;
** GRASS GIS promotional material: https://github.com/OSGeo/grass-promo&lt;br /&gt;
** Upcoming new web site: https://github.com/OSGeo/grass-website&lt;br /&gt;
* Testing of new Github repo at: https://github.com/OSGeo/grass/&lt;br /&gt;
* Github teams created - different roles for read/write/admin access&lt;br /&gt;
** grass-committers: GRASS GIS developers team  (read/write)&lt;br /&gt;
** grass-admin: GRASS GIS GitHub admin team (all)&lt;br /&gt;
** grass-docker-homebrew-users: users for automated dockerhub and homebrew builds (read-only)&lt;br /&gt;
* New Github users added upon email communication&lt;br /&gt;
* Draft version of https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* (briefly) discussed image collections in GRASS GIS (needed for H2020 [http://openEO.org openEO.org])&lt;br /&gt;
* First PR :-) {{github_pr|8}}&lt;br /&gt;
* aftermath cleanup: tracked in https://trac.osgeo.org/grass/wiki/GitMigration#Aftermathcleanup&lt;br /&gt;
&lt;br /&gt;
== Nicolas Bozon ==&lt;br /&gt;
&lt;br /&gt;
* Presentation via video call of a first glance at the [[Website migration plan 2019|upcoming new GRASS GIS web site]] based on Hugo&lt;br /&gt;
&lt;br /&gt;
[[File:grass2019_berlin_sprint_new_website.jpg|thumb|right|Upcoming new GRASS GIS web site]]&lt;br /&gt;
&lt;br /&gt;
== Martin Landa ==&lt;br /&gt;
&lt;br /&gt;
* Working on GitHub migration&lt;br /&gt;
** finalize source code migration to GitHub ({{trac|3722}})&lt;br /&gt;
*** Targets: https://github.com/OSGeo/grass, https://github.com/OSGeo/grass-addons, https://github.com/OSGeo/grass-promo, https://github.com/OSGeo/grass-legacy&lt;br /&gt;
*** svn2git migration dump and logs: https://grass.osgeo.org/svn2git_archive/&lt;br /&gt;
* Update/Fix WinGRASS build procedure to work with Git&lt;br /&gt;
* {{github_pr|9}}&lt;br /&gt;
* Discussed GRASS support for image collection with Soeren&lt;br /&gt;
&lt;br /&gt;
== Ondřej Pešek ==&lt;br /&gt;
&lt;br /&gt;
* {{cmd|g.gui.gmodeler}}: Working on PyWPS export (see [https://github.com/ctu-yfsg/2017-d-grass-modeler-pywps/compare/master@%7B17/05/2019%7D...master@%7B21/05/2019%7D github commits] overview)&lt;br /&gt;
* Research and discussions about ANN-fueled semantic segmentation modules for GRASS GIS&lt;br /&gt;
* Watching Sören's screenings of Mandelbrot's fractals&lt;br /&gt;
&lt;br /&gt;
== Anna Petrasova and Vaclav Petras ==&lt;br /&gt;
&lt;br /&gt;
* video call from sprint to sprint: Minneapolis OSGeo sprint &amp;lt;--&amp;gt; Berlin GRASS GIS community sprint&lt;br /&gt;
** discussing GitHub migration and HowToGit document&lt;br /&gt;
&lt;br /&gt;
== Veronica Andreo ==&lt;br /&gt;
&lt;br /&gt;
* video call from Argentina&lt;br /&gt;
** learning and testing with HowToGit document&lt;br /&gt;
** discussion about progress of the new website&lt;br /&gt;
&lt;br /&gt;
== Anne Ghisla aka aghisla ==&lt;br /&gt;
&lt;br /&gt;
* Discuss with Peter about archiving of source code in Zenodo (one DOI per GRASS release, connection with git)&lt;br /&gt;
* Follow closely the svn2git migration and the design of the new commit/push workflow&lt;br /&gt;
* Start working on the HTML man pages, so that they refer to git for source code and last edit timestamp ({{github_pr|11}}, work in progress)&lt;br /&gt;
* Investigate a clean way of dropping Python 2.x support, to be done before 2020 (official EOL of Python 2.x)&lt;br /&gt;
* Check with MarkusM how to update g.extension to use git - maybe the Debian Python Team's way can be of inspiration https://salsa.debian.org/python-team/tools/python-modules&lt;br /&gt;
&lt;br /&gt;
== Markus Metz ==&lt;br /&gt;
&lt;br /&gt;
* Help with git migration and documentation https://trac.osgeo.org/grass/wiki/HowToGit&lt;br /&gt;
* Fix basic GIS functionality: r.contour ([https://trac.osgeo.org/grass/ticket/3846 #3846])&lt;br /&gt;
* Help on polishing github profile&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25645</id>
		<title>GRASS GIS Community Sprint Berlin 2019</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Berlin_2019&amp;diff=25645"/>
		<updated>2019-04-17T07:11:37Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* In person: + Markus M */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{toc|right}}&lt;br /&gt;
&lt;br /&gt;
== Timing, Venue  ==&lt;br /&gt;
&lt;br /&gt;
'''May 17 (Fri) - May 20 (Mon), 2019 at DIW Berlin, Berlin, Germany'''.&lt;br /&gt;
&lt;br /&gt;
Location: Mohrenstraße 58, 10117 Berlin ([https://www.openstreetmap.org/node/358106189 OSM Map])&lt;br /&gt;
&lt;br /&gt;
== Sponsors ==&lt;br /&gt;
&lt;br /&gt;
DIW Berlin: Free provision of meeting rooms and internet access.&lt;br /&gt;
&lt;br /&gt;
Donation from OSGeo. Please check more info [[GRASS GIS Budget 2019]].&lt;br /&gt;
&lt;br /&gt;
We also welcome direct '''financial contributions''' to help reducing travelling and accommodation expenses for GRASS developers with far arrival If you are interested to sponsor the GRASS Community Sprint, please read about&lt;br /&gt;
&lt;br /&gt;
:::'''sponsoring the GRASS project''' via our [https://www.paypal.com/pools/c/86YKZiIEPV Paypal money pool]&lt;br /&gt;
&lt;br /&gt;
[[Image:Btn_donate_SM.gif|center|link=http://grass.osgeo.org/donations/]]&lt;br /&gt;
&lt;br /&gt;
For any questions, please contact [[User:Landa|Martin Landa]]. Any surplus at the end of the event will be turned over to the GRASS GIS project.&lt;br /&gt;
&lt;br /&gt;
This GRASS GIS Community Sprint is a great occasion for you to support the development of GRASS. With your contribution you'll enable more developers to meet. The community sprint is an important opportunity for the GRASS developers to discuss and collaboratively resolve bugs, plan the direction for the project and work on new features. Please see below for the more detailed agenda. The developers and contributors are donating their valuable time, so it would be great if in-kind funding can be made available from within the community to cover out-of-pocket expenses. All of the work that takes place at the community sprint will be directly contributed back into the GRASS project to the benefit of everyone who uses it.&lt;br /&gt;
&lt;br /&gt;
== Agenda - What we plan to do ==&lt;br /&gt;
&lt;br /&gt;
* Discuss scientific citation of GRASS code and changes to the metadata of man-pages. (PL)&lt;br /&gt;
&lt;br /&gt;
=== New website ===&lt;br /&gt;
&lt;br /&gt;
== Planned participation ==&lt;br /&gt;
&lt;br /&gt;
For organizational reasons. &lt;br /&gt;
&lt;br /&gt;
=== In person ===&lt;br /&gt;
&lt;br /&gt;
Please add your name here:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|width=100px|'''Arrival'''&lt;br /&gt;
|width=100px|'''Departure'''&lt;br /&gt;
|'''Topic'''&lt;br /&gt;
|width=75px|'''T-Shirt'''&lt;br /&gt;
|'''Notes'''&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|[[User:Landa|Martin Landa]]&lt;br /&gt;
|Czech Republic&lt;br /&gt;
|17/18&lt;br /&gt;
|20&lt;br /&gt;
|&lt;br /&gt;
|L&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|[[User:Neteler|Markus Neteler]]&lt;br /&gt;
|Germany&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|&lt;br /&gt;
|M&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|[[User:peter.loewe|Peter Loewe]]&lt;br /&gt;
|Germany&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|&lt;br /&gt;
|XL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|[[User:mmetz|Markus Metz]]&lt;br /&gt;
|Germany&lt;br /&gt;
|17&lt;br /&gt;
|20&lt;br /&gt;
|&lt;br /&gt;
|L&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Accomodation ==&lt;br /&gt;
&lt;br /&gt;
There are several Hotels etc. in walking distance.&lt;br /&gt;
&lt;br /&gt;
=== Backpackers ===&lt;br /&gt;
[https://www.cityhostel-berlin.com/ City-Hostel Berlin]&lt;br /&gt;
=== Hotels ===&lt;br /&gt;
tbd&lt;br /&gt;
&lt;br /&gt;
== Venue ==&lt;br /&gt;
==== Address ====&lt;br /&gt;
DIW Berlin, Mohrenstrasse 58, 10117 Berlin&lt;br /&gt;
&lt;br /&gt;
==== Public transport  ====&lt;br /&gt;
===== Subway / U-Bahn =====&lt;br /&gt;
* stations &amp;quot;Mohrenstraße&amp;quot;, &amp;quot;Stadtmitte&amp;quot; or &amp;quot;Französische Straße&amp;quot;&lt;br /&gt;
===== Light rail / S-Bahn =====&lt;br /&gt;
* Friedrichstraße station (10mins walk from there)&lt;br /&gt;
&lt;br /&gt;
==== Rooms ====&lt;br /&gt;
&lt;br /&gt;
* Friday, May 17: 5.2.8 / 5.2.011&lt;br /&gt;
* Saturday, May 18 (tbd)&lt;br /&gt;
* Sunday, May 19 (tbd)&lt;br /&gt;
* Monday, May 20: 5.2.8 / 5.2.011&lt;br /&gt;
&lt;br /&gt;
=== Pre-event tasks ===&lt;br /&gt;
&lt;br /&gt;
==== Remaining tasks ====&lt;br /&gt;
&lt;br /&gt;
* Provide information about lodging options (hotels, backpackers, etc)&lt;br /&gt;
&lt;br /&gt;
* Provide information about what's up in Berlin&lt;br /&gt;
* Provide information about restaurants&lt;br /&gt;
* Plan/order catering&lt;br /&gt;
* Discuss swag (t-shirts ? mugs ?)&lt;br /&gt;
* Discuss BBQ event or similar for saturday night&lt;br /&gt;
* @DIW-IT: Prepare WLAN-access tix.&lt;br /&gt;
* consider whatsapp(or similar) channel for last minute communication&lt;br /&gt;
* consider side events: &lt;br /&gt;
** [https://sdtb.de/museum-of-technology/623/ Museum of Technology](they have an ancient Zuse computer on display)&lt;br /&gt;
** [http://www.computerspielemuseum.de/1210_Home.htm Video game museum]&lt;br /&gt;
** Group picture at the Brandenburg Gate ?&lt;br /&gt;
** Fancy dinner (or breakfast!) at the [https://tv-turm.de/en/bar-restaurant/ revolving restaurant] up on the tv tower ? (Sponsors???) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Completed tasks ====&lt;br /&gt;
* DONE: Reserve rooms at DIW for 21 - 22 May&lt;br /&gt;
* DONE: Rooms at DIW have been reserved for May 18-21 and May 23 (May 18 + 21: office room(s); May 19/20/23: meeting room)&lt;br /&gt;
* DONE: provide information about the venue and how to get there&lt;br /&gt;
* DONE: Provide information about public transport&lt;br /&gt;
=== Via IRC chat ===&lt;br /&gt;
&lt;br /&gt;
(IRC is a nice archaic chat system, see [[IRC]])&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|'''Note'''&lt;br /&gt;
|-&lt;br /&gt;
|@#&lt;br /&gt;
|...&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Individual Preparation ==&lt;br /&gt;
&lt;br /&gt;
* Bring your own computer&lt;br /&gt;
* Bring [http://en.wikipedia.org/wiki/Mains_electricity_by_country your power connector adapter] if needed (photo: [https://en.wikipedia.org/wiki/File:Schuko_plug_and_socket.png Germany]). See also http://www.power-plugs-sockets.com/&lt;br /&gt;
* Install subversion and the compiler tools, and come with a working GRASS development environment if possible.&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&lt;br /&gt;
== Reports ==&lt;br /&gt;
&lt;br /&gt;
See [[Talk:GRASS_Community_Sprint_Berlin_2019]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
* ''Is the GRASS Community Sprint just a coding event?''&lt;br /&gt;
** It is mainly a coding and documentation event. It is a working session for people who are already participants in the GRASS project and/or are committed to improving the GRASS project.&lt;br /&gt;
** On demand we can do some presentations of current working GRASS implementation and new upcoming features to spread the idea of Open Source GIS software&lt;br /&gt;
* ''Is the GRASS Community Sprint for developers only?''&lt;br /&gt;
** No: anybody can help, with testing, checking out bugs and fixes, documentation and more.&lt;br /&gt;
* ''Where can I get help and more information about the community sprint?''&lt;br /&gt;
** Contact Martin Landa &amp;lt;tt&amp;gt;landa.martin gmail.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Workshops]]&lt;br /&gt;
[[Category: Code Sprint]]&lt;br /&gt;
[[Category: 2019]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial&amp;diff=25361</id>
		<title>V.generalize tutorial</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial&amp;diff=25361"/>
		<updated>2018-11-13T15:53:39Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: + layer=1 for cats and where options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== MODULE ==&lt;br /&gt;
&lt;br /&gt;
* GRASS 6.4 {{cmd|v.generalize}}&lt;br /&gt;
* GRASS 7.x {{cmd|v.generalize|version=70}}&lt;br /&gt;
&lt;br /&gt;
== TUTORIAL ==&lt;br /&gt;
 &lt;br /&gt;
== Introduction ==&lt;br /&gt;
 &lt;br /&gt;
This tutorial presents and explains the functionality of GRASS vector module ''v.generalize''.&lt;br /&gt;
This module implements generalization operators for GRASS vector maps. The topics covered in this tutorial are: simplification, smoothing, network generalization and displacement. For the basic introduction to these operators check the {{cmd|v.generalize}} man page, or for the exhausting introduction check McMaster and Shea (TODO: add reference).&lt;br /&gt;
&lt;br /&gt;
It is recommended to read the official man page before reading this document, or read&lt;br /&gt;
these two documents at the same time since this tutorial does not contain the&lt;br /&gt;
(detail) descriptions of input parameters whereas the man page has very few examples&lt;br /&gt;
and no pictures at all. (Even the author of module and both of the documents must have consult the man page several times....)&lt;br /&gt;
This document is also meant to be a &amp;quot;report&amp;quot; showing the work done during the Google Summer of Code 2007.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the examples in this text work with Spearfish dataset, which can&lt;br /&gt;
be downloaded [[Sample_datasets|here]]. Also, this&lt;br /&gt;
tutorial assumes that the user is already running GRASS session with the Spearfish&lt;br /&gt;
location and a monitor opened. Also, if you click on any picture here, it will be shown in its full size.  &lt;br /&gt;
&lt;br /&gt;
All the algorithms presented in this document (try to) preserve the topology&lt;br /&gt;
of the input maps. This means, for example, that the smoothing and simplification methods&lt;br /&gt;
never remove the first and last points of lines and that displacement preserves the junctions.&lt;br /&gt;
&lt;br /&gt;
== Simplification ==&lt;br /&gt;
 &lt;br /&gt;
''v.generalize'' implements many simplification algorithms. The most widely used&lt;br /&gt;
is Douglas-Peucker algorithm (TODO: reference). We can apply this algorithm to&lt;br /&gt;
any vector map in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas method=douglas threshold=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The explanation of the line above is following: Run v.generalize, apply Douglas-Peucker&lt;br /&gt;
algorithm with threshold equals to 50 to the map roads and store the output in vector&lt;br /&gt;
map output_douglas. The last output line produced by this module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Number of vertices was reduced from 5468 to 2107[38%]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
means that the input file (roads) has 5468 vertices in total and the new map (roads_douglas)&lt;br /&gt;
has only 2107 vertices which is only 38% of original. On the other hand, if we run the &lt;br /&gt;
commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_douglas col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that there are no significant differences between the input and output maps. &amp;quot;Only the details were removed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic1.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
The amount of the details removed can be specified by parameter: threshold. It is the &lt;br /&gt;
case that the output map has fewer vertices and details for greater values of threshold.&lt;br /&gt;
For example, if we run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas method=douglas threshold=200 --overwrite&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we obtain a map with only 1726 vertices. A disadvantage of the command above is that&lt;br /&gt;
it never removes the lines. &amp;lt;strike&amp;gt;If we also want to remove the small lines, we need to run&lt;br /&gt;
the command above with the -r flag. If the -r flag is presented, lines shorter than&lt;br /&gt;
threshold and areas with areas less than threshold are removed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize -r input=roads output=roads_douglas method=douglas threshold=200 --overwrite&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
 Fixme: -r flag and method=remove_small have been removed. Try v.clean for removing small areas or&lt;br /&gt;
 v.edit map=mapname type=line tool=delete query=length thresh=0,0,-0.5&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
In this case, roads_douglas has only 850 vertices and it contains 387 lines whereas&lt;br /&gt;
the original map (roads) contains 825 lines. In this case, the output map has very few details,&lt;br /&gt;
but the basic shapes and topology are preserved:&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic2.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&amp;lt;strike&amp;gt;It is also possible remove small lines/areas only (without any simplification). This is achieved&lt;br /&gt;
by method=remove_small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_remove_small method=remove_small threshold=200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces following map with 399 lines. (Note removed lines in the upper left corner)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic3.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Douglas-Peucker Algorithm has very reasonable results, but it is very hard to find(guess) the&lt;br /&gt;
right value of threshold. Moreover, it is also impossible to simplify each line to (for example) 40%.&lt;br /&gt;
Exactly for such cases, ''v.generalize'' provides method=douglas_reduction. This algorithm&lt;br /&gt;
is a modification of Douglas-Peucker Algorithm which takes another paratemer ''reduction''&lt;br /&gt;
which denotes (approximate) simplification of lines. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas_reduction method=douglas_reduction \&lt;br /&gt;
  threshold=0 reduction=50 --overwrite&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads_douglas_reduction&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces following map with 3018 vertices (55%). (Note that there are almost no differencies between the original and the new map)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic4.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Also observe that the following commands are equivalent&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=in output=out method=douglas threshold=eps&lt;br /&gt;
v.generalize input=in output=out method=douglas_reduction threshold=eps reduction=100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another algorithm implemented in this modules is &amp;quot;Vertex Reduction&amp;quot;. This algorithm removes&lt;br /&gt;
the consecutive poins (on the same line) which are closer to each other than threshold. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=in output=out method=reduction threshold=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
removes duplicate points. More precisely, if two consecutive points have the same &lt;br /&gt;
coordinates then the second point is removed and the first is preserved. The last two algorithm&lt;br /&gt;
implemented by this module are &amp;quot;Lang&amp;quot; and &amp;quot;Reumann-Witkam&amp;quot; algorithm. For more information about these two algorithms, please see the {{cmd|v.generalize}} man page.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The following four pictures show the results obtained by Reumann, Douglas, Lang&lt;br /&gt;
and Vertex Reduction algorithm resp. The algorithms were run with threshold set to 50&lt;br /&gt;
and Lang algorithm with look_ahead=7.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery Caption=&amp;quot;Simplification algorithms&amp;quot; widths=&amp;quot;300px&amp;quot; heights=&amp;quot;225px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
Image:v.generalize.reumann.png|Reumann-Witkam algorithm result containing 2522 [46%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.douglas.png|Douglas algorithm result containing 2107 [38%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.lang.png|Lang algorithm result containing 2160 [39%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.reduction.png|Vertex Reduction algorithm result containing 4296 [78%] points&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The map produced by&lt;br /&gt;
* Reumann-Witkam algorithm contains 2522 [46%] points,&lt;br /&gt;
* Douglas: 2107 [38%] points,&lt;br /&gt;
* Lang: 2160 [39%] and&lt;br /&gt;
* Vertex Reduction: 4296 [78%].&lt;br /&gt;
&lt;br /&gt;
== Smoothing ==&lt;br /&gt;
 &lt;br /&gt;
''v.generalize'' also supports many smoothing algorithm. For basic descriptions, please consult the {{cmd|v.generalize}} man page.&lt;br /&gt;
&lt;br /&gt;
Probably, the best results are produced by &amp;quot;Chaiken&amp;quot;, &amp;quot;Hermite&amp;quot; and &amp;quot;Snakes&amp;quot; algorithms/methods. &lt;br /&gt;
However, the remaining algorithms may also produce very reasonable results. Although&lt;br /&gt;
the Chaiken and Hermite methods may produce the maps with a lot of new points, the methods&lt;br /&gt;
presented above (simplification) provide a good tool for tackling this problem.&lt;br /&gt;
&lt;br /&gt;
If we run the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_chaiken method=chaiken threshold=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we get a new map with 33364[640%] vertices.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic5.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
This map looks almost exactly the same as the original map at the current level of detail as the&lt;br /&gt;
picture below shows. This pictures was produced by the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_chaiken col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic6.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
However, if we zoom to a small region, we can see that the new map consists of smooth(er) lines &lt;br /&gt;
which (very reasonable) approximate the original ones. &lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic7.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If we apply &amp;quot;Hermite&amp;quot; method instead, we will obtain a map with 14640[267%] vertices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_hermite method=hermite threshold=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic8.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Note, that a difference between &amp;quot;Chaiken&amp;quot; and &amp;quot;Hermite&amp;quot; is that the lines produced&lt;br /&gt;
by &amp;quot;Chaiken&amp;quot; &amp;quot;inscribe&amp;quot; the original lines whereas the &amp;quot;Hermite&amp;quot; lines &amp;quot;circumscribe&amp;quot; the&lt;br /&gt;
original lines as can be seen in the picture below. (Black line is original line,&lt;br /&gt;
green line is &amp;quot;Chaiken&amp;quot; and blue is &amp;quot;Hermite&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic9.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
The algorithms mentioned above are suitable for smooth approximation of given lines.&lt;br /&gt;
On the other hand, if the aim of smoothing is to &amp;quot;straighten&amp;quot; the lines then the better&lt;br /&gt;
results are achieved by the other methods. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_sa method=sliding_averaging look_ahead=7 slide=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Image:v.generalize.pic10.png]] ??? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At first sight, we can see that roads_sa contains smooth and straight lines which&lt;br /&gt;
preserve the original shape of the lines. This difference is obvious if we zoom to a small&lt;br /&gt;
region of a map (see below. Again, original line is black, new line is blue)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic11.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If the lines are &amp;quot;too straight&amp;quot; then we can set &amp;quot;slide&amp;quot; to a smaller value to obtain the lines&lt;br /&gt;
which better preserve the original shape. In the picture below, original line is black,&lt;br /&gt;
line produced by &amp;quot;slide=1&amp;quot; is blue and &amp;quot;slide=0.3&amp;quot; is green.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic12.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Very similar results can be obtained by Distance Weighting Algorithm (method=distance_weighting).&lt;br /&gt;
This is not very surprising since these algorithms are almost the same. For example,&lt;br /&gt;
the image below shows the outputs of &amp;quot;Distance Weighting Algorithm&amp;quot;. The image was generated&lt;br /&gt;
by the following sequence of commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_dw1 method=distance_weighting look_ahead=7 slide=1&lt;br /&gt;
v.generalize input=roads output=roads_dw2 method=distance_weighting look_ahead=7 slide=0.3&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_dw1 col=red&lt;br /&gt;
d.vect roads_dw2 col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic13.png|center|thumb|400px|method=distance_weighting]]&lt;br /&gt;
&lt;br /&gt;
Also, very good resutls can be obtained by the &amp;quot;Snakes&amp;quot; algorithm. On the other hand,&lt;br /&gt;
it is the (asymptotically) slowest&lt;br /&gt;
smoothing algorithm implemented in this however. Behaviour of this algorithm is controlled by&lt;br /&gt;
&amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; parameter. Reasonable range of values for these two parameters is [0..5]&lt;br /&gt;
where higher values correspond to the straighter lines. Module outputs the input map if&lt;br /&gt;
alpha=beta=0. And this command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_snakes method=snakes alpha=1 beta=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a map containing following region (original line is black)&lt;br /&gt;
[[Image:v.generalize.pic14.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Last smoothing algorithm implemented in this module is &amp;quot;Boyle's Forward-Looking Algorithm&amp;quot; which&lt;br /&gt;
is another &amp;quot;straightening&amp;quot; algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_boyle method=boyle look_ahead=5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a map containing following region (original line is black)&lt;br /&gt;
[[Image:v.generalize.pic15.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
=== Area smoothing example ===&lt;br /&gt;
&lt;br /&gt;
 # spearfish&lt;br /&gt;
 g.region rast=geology&lt;br /&gt;
 r.reclass in=geology out=geology.claysand &amp;lt;&amp;lt; EOF&lt;br /&gt;
 8 = 8 claysand&lt;br /&gt;
 EOF&lt;br /&gt;
 r.to.vect in=geology.claysand out=geology_claysand feature=area&lt;br /&gt;
 v.generalize in=geology_claysand out=geology_claysand_smooth method=snakes&lt;br /&gt;
&lt;br /&gt;
== Displacement ==&lt;br /&gt;
&lt;br /&gt;
If we render entire Spearfish location, we can see in the upper half of the map two interstates which&lt;br /&gt;
overlap. This is not logically correct (I hope, they do not evarlap in real) and it is also&lt;br /&gt;
considered as an (presentation) error. For solving such problems, ''v.generalize'' provides&lt;br /&gt;
&amp;quot;dislplacement&amp;quot; method. As the name suggests, this method displaces linear features which are&lt;br /&gt;
close to each other so that they do not overlap/collide. Method implemented in this modules (based on Snakes)&lt;br /&gt;
has very good results but not very good perfomance. Therefore the calculations may take few(several) minutes.&lt;br /&gt;
For this reason, displacement is applied to the simplified lines in this document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_dr method=douglas_reduction threshold=0 reduction=50&lt;br /&gt;
v.generalize input=roads_dr output=roads_dr_disp method=displacement alpha=0.01 beta=0.01 threshold=100 iterations=35&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First command produces simplified lines and then the second command applied displacement operator&lt;br /&gt;
to the simplified line. Parameters alpha and beta specifies the rigidity of the lines. This means&lt;br /&gt;
that displacement is bigger for small values of alpha and beta. Also, the displacement is&lt;br /&gt;
not very significant for higher(&amp;amp;gt;=1.0) values of alpha, beta. Threshold parameter&lt;br /&gt;
denotes the critical distance. Only the points (and their neighbours) which are closer&lt;br /&gt;
than threshold apart are displaced by ''v.generalize''. Module tries to move these&lt;br /&gt;
points such that they are at least threshold apart. However, the displaced points are never&lt;br /&gt;
threshold (or more) apart for positive values of alpha and beta. Displacement as implemented&lt;br /&gt;
in ''v.generalize'' is an iterative process. Parameter &amp;quot;iterarions&amp;quot; specifies the number&lt;br /&gt;
of iterations the collisions between the points are resolved. In general, the quality of displacement&lt;br /&gt;
increases with the number of iterations. However, quality converges quite rapidly and&lt;br /&gt;
for all maps I tried, the sufficient value of iterations was between 20 and 50.&lt;br /&gt;
Two command above produce the picture below. Note that it is now possible to distinguish&lt;br /&gt;
between two &amp;quot;interastate lines&amp;quot; and also observe the free space between interstate and the lines&lt;br /&gt;
directly below it.     &lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic16.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
== Network Generalization ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Network generalization is suitable for selecting &amp;quot;the most important&amp;quot; subnetwork&lt;br /&gt;
of a network. For example, to select highways, interstates from a road network. Examples&lt;br /&gt;
in this section work with new GRASS default dataset, which can be downloaded [[Sample_datasets|here]].&lt;br /&gt;
&lt;br /&gt;
If we render map &amp;quot;streets_wake&amp;quot; we really cannot see the streets, but the only&lt;br /&gt;
thing we can see is a big black rhombus. We will try to improve this. Firstly, network&lt;br /&gt;
generalization requites quite a lot of time and memory. Therefore, we begin with&lt;br /&gt;
simplification of &amp;quot;streets_wake&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=streets_wake output=streets_rs method=remove_small threshold=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we can begin with network generalization. If we execute the folllowing command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=streets_rs output=streets_rs_network method=network betweeness_thresh=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we obtain the following map containing &amp;quot;only&amp;quot; 14128. Original map has 49746&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.net50.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If this is still not enough, we can increase the value of betweeness_thresh to, for example 200.&lt;br /&gt;
For this value, ''v.generalize'' produces following map with 11537 lines.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.net200.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
It is also possible to change the values of &amp;quot;closeness_thresh&amp;quot; and &amp;quot;degree_thresh&amp;quot;. Parameter&lt;br /&gt;
&amp;quot;closeness_thresh&amp;quot; is suitable for selecting the &amp;quot;centre(s)&amp;quot; of a network. This parameter&lt;br /&gt;
is always between 0 and 1. And &amp;quot;reasonable values&amp;quot; of this parameter are smaller for&lt;br /&gt;
bigger network.&lt;br /&gt;
&lt;br /&gt;
== Gereneral Parameters ==&lt;br /&gt;
&lt;br /&gt;
''v.generalize'' has some parameters and flags which affect the general behaviour of module.&lt;br /&gt;
&lt;br /&gt;
The simplest one is -c flag. &amp;quot;C&amp;quot; stands for copy and if this flag is on then the attributes&lt;br /&gt;
are copied from the old map to the new map. Note that the attributes of removed features are&lt;br /&gt;
dropped. &lt;br /&gt;
&lt;br /&gt;
Default behaviour of this module is that the selected algorithm/method is applied to the all&lt;br /&gt;
lines/areas. It is possible to apply the most of the algorithms only to the selected features.&lt;br /&gt;
This is achieved by &amp;quot;type&amp;quot;, &amp;quot;layer&amp;quot;, &amp;quot;cats&amp;quot; and &amp;quot;where&amp;quot; parameters. This works for all algorithms&lt;br /&gt;
except &amp;quot;Network Generalization&amp;quot; which is always applied to the all features. &lt;br /&gt;
For example, the following command applies &amp;quot;Douglas Reduction&amp;quot; algorithm to interstates and highways (cat&amp;amp;lt;3)&lt;br /&gt;
and leaves the other lines unaltered. It also copies the attributes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize -c input=roads output=roads_douglas_reduction2 method=douglas_reduction threshold=0 reduction=50 type=line layer=1 where=&amp;quot;cat&amp;amp;lt;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the following command removes the small areas&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=soils output=soils_remove_small method=remove_small threshold=200 type=area&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, the following command displaces only the interstates (cats=1) and the lines with a different&lt;br /&gt;
category number are not taken into the account.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_displacement2 method=displacement \&lt;br /&gt;
   threshold=75 alpha=0.01 beta=0.01 iterations=20 layer=1 cats=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic10.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
We end up with a complex example of a generalization of &amp;quot;roads&amp;quot; in Spearfish location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#straighten the lines&lt;br /&gt;
v.generalize input=roads output=step1 method=snakes alpha=1 beta=1&lt;br /&gt;
#simplification&lt;br /&gt;
v.generalize input=step1 output=step2 method=douglas_reduction threshold=0 reduction=55&lt;br /&gt;
#displacement&lt;br /&gt;
v.generalize input=step2 output=step3 method=displacement alpha=0.01 beta=0.01 threshold=100 iterations=50&lt;br /&gt;
#remove small areas&lt;br /&gt;
v.generalize input=step3 output=step4 method=remove_small threshold=75&lt;br /&gt;
#network generalization&lt;br /&gt;
v.generalize input=step4 output=step5 method=network betweeness_thresh=5 closeness_thresh=0.0425&lt;br /&gt;
#smoothing&lt;br /&gt;
v.generalize input=step5 output=step6 method=chaiken threshold=1&lt;br /&gt;
#simplification&lt;br /&gt;
v.generalize input=step6 output=step7 method=douglas threshold=1&lt;br /&gt;
#remove temporary maps&lt;br /&gt;
g.remove vect=step1,step2,step3,step4,step5,step6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result &amp;quot;step7&amp;quot; has 655 lines and 3545 vertices and the commands above have the following effect:&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.anim.gif|center|thumb|400px|caption text here (animation)]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Use cases:&lt;br /&gt;
* http://www.custom-scenery.org/Line-data-simpl.275.0.html&lt;br /&gt;
&lt;br /&gt;
== AUTHORS ==&lt;br /&gt;
&lt;br /&gt;
* Daniel Bundala, Google Summer of Code 2007, Student&lt;br /&gt;
* Wolf Bergenheim, Mentor&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category: Tutorial]]&lt;br /&gt;
[[Category: Vector]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25282</id>
		<title>GRASS and Shell</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25282"/>
		<updated>2018-07-29T15:00:19Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Automated batch jobs: Setting the GRASS environmental variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information about GRASS GIS' own shell setup and use. &lt;br /&gt;
&lt;br /&gt;
For information about scripting for GRASS, please refer to the page [http://grasswiki.osgeo.org/wiki/Shell_scripting Shell scripting].&lt;br /&gt;
&lt;br /&gt;
== Automated batch jobs: Setting the GRASS environmental variables ==&lt;br /&gt;
&lt;br /&gt;
'''''Main article: [[Working with GRASS without starting it explicitly]]'''''&lt;br /&gt;
&lt;br /&gt;
This section applies to jobs which shall set the entire GRASS environment.&lt;br /&gt;
You have to set a couple of variables to enable GRASS command to run from outside GRASS:&lt;br /&gt;
&lt;br /&gt;
   # Example in bash shell syntax:&lt;br /&gt;
 &lt;br /&gt;
   # path to GRASS binaries and libraries:&lt;br /&gt;
   export GISBASE=/usr/lib64/grass74&lt;br /&gt;
 &lt;br /&gt;
   export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts&lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib&lt;br /&gt;
   &lt;br /&gt;
   # set PYTHONPATH to include the GRASS Python lib&lt;br /&gt;
   if [ ! &amp;quot;$PYTHONPATH&amp;quot; ] ; then&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python&amp;quot;&lt;br /&gt;
   else&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python:$PYTHONPATH&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
   export PYTHONPATH&lt;br /&gt;
 &lt;br /&gt;
   # use process ID (PID) as lock file number:&lt;br /&gt;
   export GIS_LOCK=$$&lt;br /&gt;
 &lt;br /&gt;
   # settings for graphical output to PNG file (optional)&lt;br /&gt;
   export GRASS_PNGFILE=/tmp/grass6output.png&lt;br /&gt;
   export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
   export GRASS_WIDTH=900&lt;br /&gt;
   export GRASS_HEIGHT=1200&lt;br /&gt;
   export GRASS_PNG_COMPRESSION=1&lt;br /&gt;
   export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with the last used GISDBASE, LOCATION_NAME, and MAPSET&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=$HOME/.grassrc7&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with a different GISDBASE, LOCATION_NAME, and/or MAPSET&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=/tmp/grass7-${USER}-$GIS_LOCK/gisrc&lt;br /&gt;
   # remove any leftover files/folder&lt;br /&gt;
   rm -fr /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
   mkdir /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
   export TMPDIR=&amp;quot;/tmp/grass7-${USER}-$GIS_LOCK&amp;quot;&lt;br /&gt;
   # set GISDBASE, LOCATION_NAME, and/or MAPSET&lt;br /&gt;
   echo &amp;quot;GISDBASE: /path/to/some/grassdata&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   echo &amp;quot;LOCATION_NAME: some_location&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   echo &amp;quot;MAPSET: some_mapset&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   # start in text mode&lt;br /&gt;
   echo &amp;quot;GRASS_GUI: text&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
&lt;br /&gt;
The following three settings are only recommended if you will be calling the script from another program - e.g. a PHP web page using system() or exec()&lt;br /&gt;
&lt;br /&gt;
   export HOME=/var/www&lt;br /&gt;
   export USER=www-data&lt;br /&gt;
   export GROUP=www-data&lt;br /&gt;
&lt;br /&gt;
Now you can test:&lt;br /&gt;
&lt;br /&gt;
   # this should print the GRASS version used:&lt;br /&gt;
   g.version&lt;br /&gt;
   # check GISDBASE, LOCATION_NAME, and MAPSET&lt;br /&gt;
   g.gisenv&lt;br /&gt;
   # other calculations go here ...&lt;br /&gt;
&lt;br /&gt;
If this works, you can launch other GRASS commands. The approach works within Shell scripts and also in the command line terminal.&lt;br /&gt;
&lt;br /&gt;
When done, you should cleanup internal tmp files like this:&lt;br /&gt;
&lt;br /&gt;
   # run GRASS' cleanup routine&lt;br /&gt;
   $GISBASE/etc/clean_temp&lt;br /&gt;
 &lt;br /&gt;
   # remove session tmp directory:&lt;br /&gt;
   rm -rf /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changing the prompt:'''&lt;br /&gt;
&lt;br /&gt;
   PS1_BACKUP=&amp;quot;$PS1&amp;quot;&lt;br /&gt;
   export PS1=&amp;quot;GRASS 6&amp;gt; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once you are done, you can set it back (see also next hint about unsetting variables):&lt;br /&gt;
   export PS1=&amp;quot;$PS1_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Unsetting variables after usage:'''&lt;br /&gt;
&lt;br /&gt;
   Using the &amp;quot;unset VARNAME&amp;quot; command you get rid of it:&lt;br /&gt;
   unset GISBASE&lt;br /&gt;
   unset GISRC&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
* GRASS shell script job to generate a [http://grass.fbk.eu/spearfish/php_grass_earthquakes.php Recent Earthquakes Map] (get the [http://grass.fbk.eu/spearfish/grass_earthquakes.sh grass_earthquakes.sh shell script])&lt;br /&gt;
&lt;br /&gt;
=== Parallel GRASS jobs ===&lt;br /&gt;
&lt;br /&gt;
See [[Parallel GRASS jobs]] for Grid Engine, PBS etc.&lt;br /&gt;
&lt;br /&gt;
=== GRASS Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 6.4, there is an alternative method to easily run jobs in GRASS from a collection of commands in a shell script file. Just define the environmental variable GRASS_BATCH_JOB with the shell script file containing GRASS (or whatever) commands, preferably with full path. Then launch GRASS and it will be executed. It is best to launch GRASS in &amp;lt;tt&amp;gt;-text&amp;lt;/tt&amp;gt; mode and to provide gisdbase/location/mapset as parameters. The job script needs executable file permissions (&amp;lt;tt&amp;gt;chmod&amp;lt;/tt&amp;gt; on Unix). In order to get readable percentage output during the processing (0..2..4... 100%), we set the environment variable GRASS_MESSAGE_FORMAT to &amp;quot;plain&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#### 1) PREPARATION&lt;br /&gt;
# First we generate a script which contains the command(s) to be executed:&lt;br /&gt;
# for convenience, we save the file in our HOME directory&lt;br /&gt;
## You may use also a text editor for this, here we use the &amp;quot;echo&amp;quot; shell command&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
# set computational region, here: UTM32N coordinates&lt;br /&gt;
g.region n=4900000 s=4800000 w=700000 e=800000 res=100&lt;br /&gt;
v.random mymap3000 n=3000&lt;br /&gt;
v.out.ogr input=mymap3000 output=mymap3000.shp&amp;quot; &amp;gt; $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# verify the content of the file&lt;br /&gt;
cat $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# make it user executable (this is important, use 'chmod' or via file manager)&lt;br /&gt;
chmod u+x $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# create a directory (may be elsewhere) to hold the location used for processing&lt;br /&gt;
mkdir -p $HOME/grassdata&lt;br /&gt;
&lt;br /&gt;
# create new temporary location for the job, exit after creation of this location&lt;br /&gt;
grass70 -c epsg:32632 $HOME/grassdata/mytemploc_utm32n -e&lt;br /&gt;
&lt;br /&gt;
#### 2) USING THE BATCH JOB&lt;br /&gt;
# define job file as environmental variable&lt;br /&gt;
export GRASS_BATCH_JOB=&amp;quot;$HOME/my_grassjob.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# now we can use this new location and run the job defined via GRASS_BATCH_JOB&lt;br /&gt;
grass70 $HOME/grassdata/mytemploc_utm32n/PERMANENT&lt;br /&gt;
&lt;br /&gt;
#### 3) CLEANUP&lt;br /&gt;
# switch back to interactive mode, for the next GRASS GIS session&lt;br /&gt;
unset GRASS_BATCH_JOB&lt;br /&gt;
&lt;br /&gt;
# delete temporary location (consider to export results first in your batch job)&lt;br /&gt;
rm -rf $HOME/grassdata/mytemploc_utm32n&lt;br /&gt;
&lt;br /&gt;
# Now you can use the resulting SHAPE file &amp;quot;mymap3000.shp&amp;quot; elsewhere.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass70 command starts GRASS in the given mapset, executes the contents of the job file and leaves GRASS. Since the normal startup/closure is used, all internal tmp files are properly removed.&lt;br /&gt;
&lt;br /&gt;
Note: The $HOME variable (or the ~ shortcut) cannot be used in the batch job itself since the variables are not available here.&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
* Another set of GRASS shell scripts to run the job to generate another version of the [http://adhoc.osgeo.osuosl.org/grass/alternate_projections/earthquakes_wintri.png Recent Earthquakes Map] (find the setup files in the [https://trac.osgeo.org/grass/browser/grass-promo/tutorials/batch_processing &amp;quot;batch_processing&amp;quot; tutorials section] of the GRASS SVN)&lt;br /&gt;
&lt;br /&gt;
=== Unattended execution ===&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|GNU_Screen}} is another ''extremely'' valuable tool if you need to detatch and leave long-running processes unattended. It is well worth your time to learn how to use it if you run scripts on remote systems. There are many good tutorials on the web.&lt;br /&gt;
: Usage:&lt;br /&gt;
:: Run &amp;quot;screen&amp;quot; in the terminal. You will reach again the command line but now in screen mode. Now start GRASS. &lt;br /&gt;
::: - To disconnect from the session press Control-A, Control-D.&lt;br /&gt;
::: - To list your screens type &amp;quot;screen -ls&amp;quot; (to find it back)&lt;br /&gt;
::: - To reconnect with a disconnected screen run &amp;quot;screen -r [identifier]&amp;quot; (the &amp;quot;identifier&amp;quot; you need only if you have several screens running)&lt;br /&gt;
:: Enjoy.&lt;br /&gt;
&lt;br /&gt;
* Along with the &amp;quot;{{wikipedia|nohup}}&amp;quot; (no hang-up) command you can login to your machine, launch the job and leave the machine again. &lt;br /&gt;
The process will continue after you logged off when you start it with nohup:&lt;br /&gt;
        nohup grass64 ~/grassdata/spearfish60/neteler/ &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Receive a notification when finished ===&lt;br /&gt;
&lt;br /&gt;
Maybe put email notification at the end of 'my_grassjob.sh' using the &amp;quot;mail&amp;quot; or the &amp;quot;mutt&amp;quot; program, for example like this:&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;Finished at `date`&amp;quot; &amp;gt; /tmp/done.txt &amp;amp;&amp;amp; \&lt;br /&gt;
        EDITOR=touch mutt -s &amp;quot;Job done&amp;quot; \&lt;br /&gt;
        me@mydomain.org &amp;lt; /tmp/done.txt &amp;amp;&amp;amp; rm -f /tmp/done.txt&lt;br /&gt;
&lt;br /&gt;
or like this:&lt;br /&gt;
        mail -s &amp;quot;GRASS job $0 finished&amp;quot; me@mydomain.org &amp;lt;&amp;lt;EOF&lt;br /&gt;
          GRASS GIS has finished the batch job $0&lt;br /&gt;
        EOF&lt;br /&gt;
&lt;br /&gt;
or simply like this:&lt;br /&gt;
        echo &amp;quot;GRASS GIS has finished the batch job $0&amp;quot; | mail -s &amp;quot;GRASS job finished&amp;quot; me@mydomain.org&lt;br /&gt;
&lt;br /&gt;
== Stupid pet tricks (don't use them!) ==&lt;br /&gt;
&lt;br /&gt;
Note: This is highly discouraged. Keep fingers off from manually modifying the content of a GRASS GIS mapset (at least don't complain if you break things).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;;Quick cd to the MAPSET directory&lt;br /&gt;
To make a quick little function called 'g.cd' to change into the mapset dir, add this to &amp;lt;tt&amp;gt;~/.grass.bashrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.cd()&lt;br /&gt;
{&lt;br /&gt;
  MAPSET=`g.gisenv get=MAPSET`&lt;br /&gt;
  LOCATION_NAME=`g.gisenv get=LOCATION_NAME`&lt;br /&gt;
  GISDBASE=`g.gisenv get=GISDBASE`&lt;br /&gt;
  LOCATION=&amp;quot;$GISDBASE/$LOCATION_NAME/$MAPSET&amp;quot;&lt;br /&gt;
  cd &amp;quot;$LOCATION/$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that you can also do like: &amp;quot;&amp;lt;tt&amp;gt;g.cd colr/&amp;lt;/tt&amp;gt;&amp;quot; to get to the color tables directory, or &amp;quot;&amp;lt;tt&amp;gt;g.cd ..&amp;lt;/tt&amp;gt;&amp;quot; to get to the LOCATION directory.&lt;br /&gt;
&lt;br /&gt;
Another method would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  alias g.home='cd `dirname &amp;quot;$HISTFILE&amp;quot;`'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Simpler command completion from command history&lt;br /&gt;
&lt;br /&gt;
Add this to a file called &amp;lt;tt&amp;gt;~/.inputrc&amp;lt;/tt&amp;gt; in your home dir:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
set prefer-visible-bell&lt;br /&gt;
&lt;br /&gt;
# -------- Bind page up/down wih history search ---------&lt;br /&gt;
&amp;quot;\e[5~&amp;quot;: history-search-backward&lt;br /&gt;
&amp;quot;\e[6~&amp;quot;: history-search-forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can type a bit of a command and use PgUp and PgDn to cycle through the command history which matches in a way less clumsy that Ctrl-r. Also it tells to make the shell flash on alarm instead of sending a beep to the speaker (making tab-completion compatible with your office mates).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Generic Shell script tutorials:&lt;br /&gt;
* [http://tldp.org/LDP/abs/abs-guide.pdf Advance bash-scripting guide]&lt;br /&gt;
* [http://www.linuxconfig.org/Bash_scripting_Tutorial Bash scripting Tutorial]&lt;br /&gt;
&lt;br /&gt;
GRASS Shell script tutorials:&lt;br /&gt;
* [http://www.grassbook.org/examples_menu3rd.php GRASS Book script examples]&lt;br /&gt;
* [http://www.grassbook.org/unix_commands_table.php List of important UNIX system commands]&lt;br /&gt;
&lt;br /&gt;
Misc:&lt;br /&gt;
* [[Script portability]]&lt;br /&gt;
* Other GRASS environment {{cmd|variables}}&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[Working with GRASS without starting it explicitly]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Linking to other languages]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25068</id>
		<title>Parallel GRASS jobs</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25068"/>
		<updated>2018-03-10T21:39:38Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: GRASS on a cluster: cross-link wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Parallel GRASS jobs ==&lt;br /&gt;
&lt;br /&gt;
NOTE: GRASS 6 libraries are NOT thread safe (except for GPDE, see below).&lt;br /&gt;
&lt;br /&gt;
GRASS doesn't perform any locking on the files within a GRASS&lt;br /&gt;
database, so the user may end up with one process reading a file while&lt;br /&gt;
another process is in the middle of writing it. The most problematic&lt;br /&gt;
case is the WIND file, which contains the [[current region]], although&lt;br /&gt;
there are others.&lt;br /&gt;
&lt;br /&gt;
If a user wants to run multiple commands concurrently, steps need to &lt;br /&gt;
be taken to ensure that this type of conflict doesn't happen. For the&lt;br /&gt;
current region, the user can use the WIND_OVERRIDE environment variable to&lt;br /&gt;
specify a named region which should be used instead of the WIND file.&lt;br /&gt;
&lt;br /&gt;
Or the user can use the GRASS_REGION environment variable to specify the&lt;br /&gt;
region parameters (the syntax is the same as the WIND file, but with&lt;br /&gt;
newlines replaced with semicolons). With this approach, the region can&lt;br /&gt;
only be read, not modified.&lt;br /&gt;
&lt;br /&gt;
Problems can also arise if the user reads files from another mapset while&lt;br /&gt;
another session is modifying those files. The WIND file isn't an issue&lt;br /&gt;
here, nor are the files containing raster data (which are updated&lt;br /&gt;
atomically), but the various support files may be.&lt;br /&gt;
&lt;br /&gt;
See below for ways around these limitations.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
This you should know about GRASS' behaviour concerning multiple jobs:&lt;br /&gt;
* You can run '''multiple processes''' in '''multiple locations''' ([http://grass.osgeo.org/grass64/manuals/html64_user/helptext.html what's that?]). ''Peaceful coexistence.''&lt;br /&gt;
* You can run multiple processes in the same mapset, but only if the region is untouched. If you are unsure, it's recommended to  launch each job in its own mapset within the location.&lt;br /&gt;
* You can run '''multiple processes''' in the '''same location''', but in '''different mapsets'''. ''Peaceful coexistence.''&lt;br /&gt;
&lt;br /&gt;
=== Approach ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are at least two approaches of &amp;quot;poor man&amp;quot; parallelization without modifying GRASS source code:&lt;br /&gt;
* split map into spatial chunks (possibly with overlap to gain smooth results)&lt;br /&gt;
* time series: run each map elaboration on a different node.&lt;br /&gt;
&lt;br /&gt;
See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
== Working with tiles ==&lt;br /&gt;
&lt;br /&gt;
Huge map reprojection example:&lt;br /&gt;
&lt;br /&gt;
'''Q:''' I'd like to try splitting a large raster into small chunks and then projecting each one separately, sending the project command to the background. The problem is that, if the GRASS command changes the region settings, things might not work.&lt;br /&gt;
&lt;br /&gt;
'''A:''' {{cmd|r.proj}} doesn't change the region.&lt;br /&gt;
&lt;br /&gt;
Processing the map in chunks requires setting a different region for&lt;br /&gt;
each command. That can be done by creating named regions and using the&lt;br /&gt;
WIND_OVERRIDE environment variable, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
       g.region ... save=region1&lt;br /&gt;
       g.region ... save=region2&lt;br /&gt;
       ...&lt;br /&gt;
       WIND_OVERRIDE=region1 r.proj ... &amp;amp;&lt;br /&gt;
       WIND_OVERRIDE=region2 r.proj ... &amp;amp;&lt;br /&gt;
       ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(for python see the grass.use_temp_region() function)&lt;br /&gt;
&lt;br /&gt;
The main factor which is likely to affect parallelism is the fact that the processes won't share their caches, so there'll be some degree of inefficiency if there's substantial overlap between the source areas for the processes.&lt;br /&gt;
&lt;br /&gt;
If you have more than one such map to project, processing entire maps in parallel might be a better choice (so that you get N maps projected in 10 hours rather than 1 map in 10/N hours).&lt;br /&gt;
&lt;br /&gt;
== Parallelized code ==&lt;br /&gt;
&lt;br /&gt;
=== OpenMP ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-openmp&lt;br /&gt;
&lt;br /&gt;
==== GPDE using OpenMP ====&lt;br /&gt;
&lt;br /&gt;
The only parallelized library in GRASS &amp;gt;=6.3 is GRASS Partial Differential Equations Library (GPDE) and the gmath library in GRASS 7. Read more in [[OpenMP]].&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass73/manuals/libpython/pygrass.modules.interface.html?highlight=parallelmodulequeue#pygrass.modules.interface.module.ParallelModuleQueue PyGRASS ParallelModuleQueue]&lt;br /&gt;
&lt;br /&gt;
=== pthreads ===&lt;br /&gt;
&lt;br /&gt;
Note: only used in the r.mapcalc ''parser''!&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-pthread&lt;br /&gt;
&lt;br /&gt;
The ''parser'' of {{cmd|r.mapcalc}} in GRASS 7 has been parallelized using GNU {{wikipedia|pthreads}}. The computation itself is executed serially.&lt;br /&gt;
&lt;br /&gt;
=== Bourne and Python Scripts ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Often very easy &amp;amp; can be done without modification to the main source code.&lt;br /&gt;
&lt;br /&gt;
* See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
=== OpenMPI ===&lt;br /&gt;
&lt;br /&gt;
Good for a multi-system cluster connected by a fast network.&lt;br /&gt;
&lt;br /&gt;
The {{AddonCmd|GIPE}} ''i.vi.mpi'' addon module has been created as a MPI ({{wikipedia|Message Passing Interface}}) implementation of the {{AddonCmd|GIPE}} ''i.vi'' addon module.&lt;br /&gt;
* See also the [[Agriculture and HPC]] wiki page.&lt;br /&gt;
&lt;br /&gt;
=== MPI Programming ===&lt;br /&gt;
&lt;br /&gt;
There is a sample implementation at module level in [http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.vi.mpi i.vi.mpi]&lt;br /&gt;
&lt;br /&gt;
=== GPU Programming ===&lt;br /&gt;
&lt;br /&gt;
Good for certain kinds of calculations (e.g. ray-tracing) on a single system with a fast graphics card.&lt;br /&gt;
&lt;br /&gt;
There is a version of the {{cmd|r.sun}} module which has been modified to use {{wikipedia|OpenCL}}. (works; still experimental)&lt;br /&gt;
&lt;br /&gt;
* See [[GPU]]&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
  ./configure --with-opencl&lt;br /&gt;
&lt;br /&gt;
== Cluster and Grid computing ==&lt;br /&gt;
&lt;br /&gt;
A cluster or grid computing system  consists of a number of computers that are tightly coupled together. The manager or master controls the utilization of compute nodes.&lt;br /&gt;
&lt;br /&gt;
=== Job scheduler ===&lt;br /&gt;
&lt;br /&gt;
Common job schedulers are [https://slurm.schedmd.com/ SLURM], [http://www.adaptivecomputing.com/products/open-source/torque/ TORQUE], [http://www.pbspro.org/ PBS], [https://arc.liv.ac.uk/trac/SGE Son of Grid Engine], and [https://kubernetes.io/ kubernetes]&lt;br /&gt;
&lt;br /&gt;
See also [https://slurm.schedmd.com/rosetta.html Rosetta Stone of Workload Managers]&lt;br /&gt;
&lt;br /&gt;
A job consists of tasks, e.g. processing of a single raster map in a time series of many raster maps. Jobs are assigned to a queue and started as soon as a slot in the queue is free. Jobs are removed from the queue once they finished.&lt;br /&gt;
&lt;br /&gt;
=== GRASS on a cluster ===&lt;br /&gt;
&lt;br /&gt;
If you want to launch several GRASS jobs in parallel, you might consider to launch each job in its own mapset.&lt;br /&gt;
&lt;br /&gt;
* set up chunks of data to be processed (temporal or spatial, temporal chunks are usually easier to handle)&lt;br /&gt;
* write a script with the actual processing of one chunk&lt;br /&gt;
* write a script that initializes GRASS, creates a unique mapset, executes the script with the actual processing, and copies the results to a common mapset&lt;br /&gt;
* add that script as a task to a job, create one job for each data chunk&lt;br /&gt;
&lt;br /&gt;
The general concept is to create a script that &lt;br /&gt;
&lt;br /&gt;
# creates a unique temporary mapset&lt;br /&gt;
# creates a unique temporary GISRC file for this mapset&lt;br /&gt;
# does the processing in this mapset&lt;br /&gt;
# changes to the target mapset by updating the GISRC file, verify with g.gisenv&lt;br /&gt;
# copies results from the temporary mapset to the target mapset&lt;br /&gt;
# deletes the temporary mapset and GISRC file&lt;br /&gt;
&lt;br /&gt;
Such a script should not call grassXY and must be executable outside GRASS, because it is establishing a GRASS session, performing some processing, and closing the GRASS session, all by itself. See also [[GRASS_and_Shell|GRASS and Shell]].&lt;br /&gt;
&lt;br /&gt;
Such a script will take arguments to specify the particular data to be processed.&lt;br /&gt;
&lt;br /&gt;
A job specification for an HPC job scheduler would then contain this script with specific arguments.&lt;br /&gt;
&lt;br /&gt;
The common bottleneck when using GRASS on a cluster is often disk I/O. Try to start the jobs with nice/ionice to reduce strain on the storage devices.&lt;br /&gt;
&lt;br /&gt;
== Cloud computing ==&lt;br /&gt;
&lt;br /&gt;
GRASS GIS 7 is running in the cloud as web processing service backend. Have a look at:&lt;br /&gt;
&lt;br /&gt;
{{YouTube|jg2pb_Xjq8Y|desc=GRASS 7 in the cloud (by Sören Gebbert)}}&lt;br /&gt;
&lt;br /&gt;
This Open Cloud GIS has been set up in a private Amazon compatible cloud environment using:&lt;br /&gt;
* Ubuntu 10.04 LTS and 10.10 cloud server edition&lt;br /&gt;
* Eucalyptus Cloud&lt;br /&gt;
* GRASS GIS 7 latest svn&lt;br /&gt;
* PyWPS latest svn&lt;br /&gt;
* wps-grass-bridge latest svn&lt;br /&gt;
* QGIS 1.7 with a modified QWPS plugin&lt;br /&gt;
&lt;br /&gt;
== GRASS GIS on VPS ==&lt;br /&gt;
&lt;br /&gt;
Instructions to run GRASS GIS on a commercial VPS to do some memory-intensive operations:&lt;br /&gt;
&lt;br /&gt;
http://plantarum.ca/code/medium-performance-cluster/&lt;br /&gt;
&lt;br /&gt;
== Hints for NFS users ==&lt;br /&gt;
* AVOID script forking on the cluster (but inclusion via &amp;quot;. script.sh&amp;quot; works ok). This means that the GRASS_BATCH_JOB approach is prone to '''fail'''. It is highly recommended to simply set a series of environmental variables to define the GRASS session, see [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|here]] how to do that.&lt;br /&gt;
* be careful with concurrent file writing (use &amp;quot;lockfile&amp;quot; locking, the lockfile command is provided by [http://www.procmail.org/ procmail]);&lt;br /&gt;
* store as much temporary data as possible (even the final maps) on the local blade disks if you have.&lt;br /&gt;
* finally collect all results from local blade disks *after* the parallel job execution in a sequential collector job (I am writing that now) to not kill NFS. For example, Grid Engine offers a &amp;quot;hold&amp;quot; function to only execute the collector job after having done the rest.&lt;br /&gt;
* If all else fails, and the I/O load is not too great, consider using {{wikipedia|sshfs}} with ssh passkeys instead of NFS.&lt;br /&gt;
* In some situations it is necessary to preserve the same directory structure on all nodes, and symlinks are a nice way to do that, but some (closed source 3rd party which will remain nameless) software insists on expanding symlinks. In this situation the [http://code.google.com/p/bindfs/ bindfs] FUSE extension can help. It is safer to use than &amp;quot;mount&amp;quot; binds, and you don't have to be root to set them up. As with ''sshfs'' there is a performance penalty so it may not be appropriate in high I/O situations.&lt;br /&gt;
&lt;br /&gt;
== Error: Too many open files ==&lt;br /&gt;
&lt;br /&gt;
When working with long time series and {{cmd|r.series}} starts to complain that files are missing/not readable or the message&lt;br /&gt;
 Too many open files&lt;br /&gt;
&lt;br /&gt;
For a solution, see [[Large_raster_data_processing#Number_of_open_files_limitation]]&lt;br /&gt;
&lt;br /&gt;
== Misc Tips &amp;amp; Tricks ==&lt;br /&gt;
See the poor-man's multi-processing script on the [[Parallelizing Scripts]] wiki page. This approach has been used in the {{AddonCmd|r3.in.xyz}} addon script.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
This Wiki:&lt;br /&gt;
* [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|GRASS batch jobs]] (by settings env. variables)&lt;br /&gt;
* The [[OpenMP]] wiki page.&lt;br /&gt;
* The [[Parallelizing Scripts]] wiki page.&lt;br /&gt;
* [[GPU]] computing&lt;br /&gt;
&lt;br /&gt;
Elsewhere:&lt;br /&gt;
* [http://gfoss.blogspot.com/2008/11/building-cluster-for-grass-gis-and.html Building a cluster for GRASS GIS and other software from the OSGeo stack]&lt;br /&gt;
* https://research.csc.fi/supercomputers-and-gis&lt;br /&gt;
&lt;br /&gt;
[[Category:Parallelization]]&lt;br /&gt;
[[Category: massive data analysis]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25067</id>
		<title>Parallel GRASS jobs</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25067"/>
		<updated>2018-03-10T21:35:17Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* GRASS on a cluster */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Parallel GRASS jobs ==&lt;br /&gt;
&lt;br /&gt;
NOTE: GRASS 6 libraries are NOT thread safe (except for GPDE, see below).&lt;br /&gt;
&lt;br /&gt;
GRASS doesn't perform any locking on the files within a GRASS&lt;br /&gt;
database, so the user may end up with one process reading a file while&lt;br /&gt;
another process is in the middle of writing it. The most problematic&lt;br /&gt;
case is the WIND file, which contains the [[current region]], although&lt;br /&gt;
there are others.&lt;br /&gt;
&lt;br /&gt;
If a user wants to run multiple commands concurrently, steps need to &lt;br /&gt;
be taken to ensure that this type of conflict doesn't happen. For the&lt;br /&gt;
current region, the user can use the WIND_OVERRIDE environment variable to&lt;br /&gt;
specify a named region which should be used instead of the WIND file.&lt;br /&gt;
&lt;br /&gt;
Or the user can use the GRASS_REGION environment variable to specify the&lt;br /&gt;
region parameters (the syntax is the same as the WIND file, but with&lt;br /&gt;
newlines replaced with semicolons). With this approach, the region can&lt;br /&gt;
only be read, not modified.&lt;br /&gt;
&lt;br /&gt;
Problems can also arise if the user reads files from another mapset while&lt;br /&gt;
another session is modifying those files. The WIND file isn't an issue&lt;br /&gt;
here, nor are the files containing raster data (which are updated&lt;br /&gt;
atomically), but the various support files may be.&lt;br /&gt;
&lt;br /&gt;
See below for ways around these limitations.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
This you should know about GRASS' behaviour concerning multiple jobs:&lt;br /&gt;
* You can run '''multiple processes''' in '''multiple locations''' ([http://grass.osgeo.org/grass64/manuals/html64_user/helptext.html what's that?]). ''Peaceful coexistence.''&lt;br /&gt;
* You can run multiple processes in the same mapset, but only if the region is untouched. If you are unsure, it's recommended to  launch each job in its own mapset within the location.&lt;br /&gt;
* You can run '''multiple processes''' in the '''same location''', but in '''different mapsets'''. ''Peaceful coexistence.''&lt;br /&gt;
&lt;br /&gt;
=== Approach ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are at least two approaches of &amp;quot;poor man&amp;quot; parallelization without modifying GRASS source code:&lt;br /&gt;
* split map into spatial chunks (possibly with overlap to gain smooth results)&lt;br /&gt;
* time series: run each map elaboration on a different node.&lt;br /&gt;
&lt;br /&gt;
See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
== Working with tiles ==&lt;br /&gt;
&lt;br /&gt;
Huge map reprojection example:&lt;br /&gt;
&lt;br /&gt;
'''Q:''' I'd like to try splitting a large raster into small chunks and then projecting each one separately, sending the project command to the background. The problem is that, if the GRASS command changes the region settings, things might not work.&lt;br /&gt;
&lt;br /&gt;
'''A:''' {{cmd|r.proj}} doesn't change the region.&lt;br /&gt;
&lt;br /&gt;
Processing the map in chunks requires setting a different region for&lt;br /&gt;
each command. That can be done by creating named regions and using the&lt;br /&gt;
WIND_OVERRIDE environment variable, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
       g.region ... save=region1&lt;br /&gt;
       g.region ... save=region2&lt;br /&gt;
       ...&lt;br /&gt;
       WIND_OVERRIDE=region1 r.proj ... &amp;amp;&lt;br /&gt;
       WIND_OVERRIDE=region2 r.proj ... &amp;amp;&lt;br /&gt;
       ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(for python see the grass.use_temp_region() function)&lt;br /&gt;
&lt;br /&gt;
The main factor which is likely to affect parallelism is the fact that the processes won't share their caches, so there'll be some degree of inefficiency if there's substantial overlap between the source areas for the processes.&lt;br /&gt;
&lt;br /&gt;
If you have more than one such map to project, processing entire maps in parallel might be a better choice (so that you get N maps projected in 10 hours rather than 1 map in 10/N hours).&lt;br /&gt;
&lt;br /&gt;
== Parallelized code ==&lt;br /&gt;
&lt;br /&gt;
=== OpenMP ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-openmp&lt;br /&gt;
&lt;br /&gt;
==== GPDE using OpenMP ====&lt;br /&gt;
&lt;br /&gt;
The only parallelized library in GRASS &amp;gt;=6.3 is GRASS Partial Differential Equations Library (GPDE) and the gmath library in GRASS 7. Read more in [[OpenMP]].&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass73/manuals/libpython/pygrass.modules.interface.html?highlight=parallelmodulequeue#pygrass.modules.interface.module.ParallelModuleQueue PyGRASS ParallelModuleQueue]&lt;br /&gt;
&lt;br /&gt;
=== pthreads ===&lt;br /&gt;
&lt;br /&gt;
Note: only used in the r.mapcalc ''parser''!&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-pthread&lt;br /&gt;
&lt;br /&gt;
The ''parser'' of {{cmd|r.mapcalc}} in GRASS 7 has been parallelized using GNU {{wikipedia|pthreads}}. The computation itself is executed serially.&lt;br /&gt;
&lt;br /&gt;
=== Bourne and Python Scripts ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Often very easy &amp;amp; can be done without modification to the main source code.&lt;br /&gt;
&lt;br /&gt;
* See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
=== OpenMPI ===&lt;br /&gt;
&lt;br /&gt;
Good for a multi-system cluster connected by a fast network.&lt;br /&gt;
&lt;br /&gt;
The {{AddonCmd|GIPE}} ''i.vi.mpi'' addon module has been created as a MPI ({{wikipedia|Message Passing Interface}}) implementation of the {{AddonCmd|GIPE}} ''i.vi'' addon module.&lt;br /&gt;
* See also the [[Agriculture and HPC]] wiki page.&lt;br /&gt;
&lt;br /&gt;
=== MPI Programming ===&lt;br /&gt;
&lt;br /&gt;
There is a sample implementation at module level in [http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.vi.mpi i.vi.mpi]&lt;br /&gt;
&lt;br /&gt;
=== GPU Programming ===&lt;br /&gt;
&lt;br /&gt;
Good for certain kinds of calculations (e.g. ray-tracing) on a single system with a fast graphics card.&lt;br /&gt;
&lt;br /&gt;
There is a version of the {{cmd|r.sun}} module which has been modified to use {{wikipedia|OpenCL}}. (works; still experimental)&lt;br /&gt;
&lt;br /&gt;
* See [[GPU]]&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
  ./configure --with-opencl&lt;br /&gt;
&lt;br /&gt;
== Cluster and Grid computing ==&lt;br /&gt;
&lt;br /&gt;
A cluster or grid computing system  consists of a number of computers that are tightly coupled together. The manager or master controls the utilization of compute nodes.&lt;br /&gt;
&lt;br /&gt;
=== Job scheduler ===&lt;br /&gt;
&lt;br /&gt;
Common job schedulers are [https://slurm.schedmd.com/ SLURM], [http://www.adaptivecomputing.com/products/open-source/torque/ TORQUE], [http://www.pbspro.org/ PBS], [https://arc.liv.ac.uk/trac/SGE Son of Grid Engine], and [https://kubernetes.io/ kubernetes]&lt;br /&gt;
&lt;br /&gt;
See also [https://slurm.schedmd.com/rosetta.html Rosetta Stone of Workload Managers]&lt;br /&gt;
&lt;br /&gt;
A job consists of tasks, e.g. processing of a single raster map in a time series of many raster maps. Jobs are assigned to a queue and started as soon as a slot in the queue is free. Jobs are removed from the queue once they finished.&lt;br /&gt;
&lt;br /&gt;
=== GRASS on a cluster ===&lt;br /&gt;
&lt;br /&gt;
If you want to launch several GRASS jobs in parallel, you might consider to launch each job in its own mapset.&lt;br /&gt;
&lt;br /&gt;
* set up chunks of data to be processed (temporal or spatial, temporal chunks are usually easier to handle)&lt;br /&gt;
* write a script with the actual processing of one chunk&lt;br /&gt;
* write a script that initializes GRASS, creates a unique mapset, executes the script with the actual processing, and copies the results to a common mapset&lt;br /&gt;
* add that script as a task to a job, create one job for each data chunk&lt;br /&gt;
&lt;br /&gt;
The general concept is to create a script that &lt;br /&gt;
&lt;br /&gt;
# creates a unique temporary mapset&lt;br /&gt;
# creates a unique temporary GISRC file for this mapset&lt;br /&gt;
# does the processing in this mapset&lt;br /&gt;
# changes to the target mapset by updating the GISRC file, verify with g.gisenv&lt;br /&gt;
# copies results from the temporary mapset to the target mapset&lt;br /&gt;
# deletes the temporary mapset and GISRC file&lt;br /&gt;
&lt;br /&gt;
Such a script should not call grassXY and must be executable outside GRASS, because it is establishing a GRASS session, performing some processing, and closing the GRASS session, all by itself.&lt;br /&gt;
&lt;br /&gt;
Such a script will take arguments to specify the particular data to be processed.&lt;br /&gt;
&lt;br /&gt;
A job specification for an HPC job scheduler would then contain this script with specific arguments.&lt;br /&gt;
&lt;br /&gt;
The common bottleneck when using GRASS on a cluster is often disk I/O. Try to start the jobs with nice/ionice to reduce strain on the storage devices.&lt;br /&gt;
&lt;br /&gt;
== Cloud computing ==&lt;br /&gt;
&lt;br /&gt;
GRASS GIS 7 is running in the cloud as web processing service backend. Have a look at:&lt;br /&gt;
&lt;br /&gt;
{{YouTube|jg2pb_Xjq8Y|desc=GRASS 7 in the cloud (by Sören Gebbert)}}&lt;br /&gt;
&lt;br /&gt;
This Open Cloud GIS has been set up in a private Amazon compatible cloud environment using:&lt;br /&gt;
* Ubuntu 10.04 LTS and 10.10 cloud server edition&lt;br /&gt;
* Eucalyptus Cloud&lt;br /&gt;
* GRASS GIS 7 latest svn&lt;br /&gt;
* PyWPS latest svn&lt;br /&gt;
* wps-grass-bridge latest svn&lt;br /&gt;
* QGIS 1.7 with a modified QWPS plugin&lt;br /&gt;
&lt;br /&gt;
== GRASS GIS on VPS ==&lt;br /&gt;
&lt;br /&gt;
Instructions to run GRASS GIS on a commercial VPS to do some memory-intensive operations:&lt;br /&gt;
&lt;br /&gt;
http://plantarum.ca/code/medium-performance-cluster/&lt;br /&gt;
&lt;br /&gt;
== Hints for NFS users ==&lt;br /&gt;
* AVOID script forking on the cluster (but inclusion via &amp;quot;. script.sh&amp;quot; works ok). This means that the GRASS_BATCH_JOB approach is prone to '''fail'''. It is highly recommended to simply set a series of environmental variables to define the GRASS session, see [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|here]] how to do that.&lt;br /&gt;
* be careful with concurrent file writing (use &amp;quot;lockfile&amp;quot; locking, the lockfile command is provided by [http://www.procmail.org/ procmail]);&lt;br /&gt;
* store as much temporary data as possible (even the final maps) on the local blade disks if you have.&lt;br /&gt;
* finally collect all results from local blade disks *after* the parallel job execution in a sequential collector job (I am writing that now) to not kill NFS. For example, Grid Engine offers a &amp;quot;hold&amp;quot; function to only execute the collector job after having done the rest.&lt;br /&gt;
* If all else fails, and the I/O load is not too great, consider using {{wikipedia|sshfs}} with ssh passkeys instead of NFS.&lt;br /&gt;
* In some situations it is necessary to preserve the same directory structure on all nodes, and symlinks are a nice way to do that, but some (closed source 3rd party which will remain nameless) software insists on expanding symlinks. In this situation the [http://code.google.com/p/bindfs/ bindfs] FUSE extension can help. It is safer to use than &amp;quot;mount&amp;quot; binds, and you don't have to be root to set them up. As with ''sshfs'' there is a performance penalty so it may not be appropriate in high I/O situations.&lt;br /&gt;
&lt;br /&gt;
== Error: Too many open files ==&lt;br /&gt;
&lt;br /&gt;
When working with long time series and {{cmd|r.series}} starts to complain that files are missing/not readable or the message&lt;br /&gt;
 Too many open files&lt;br /&gt;
&lt;br /&gt;
For a solution, see [[Large_raster_data_processing#Number_of_open_files_limitation]]&lt;br /&gt;
&lt;br /&gt;
== Misc Tips &amp;amp; Tricks ==&lt;br /&gt;
See the poor-man's multi-processing script on the [[Parallelizing Scripts]] wiki page. This approach has been used in the {{AddonCmd|r3.in.xyz}} addon script.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
This Wiki:&lt;br /&gt;
* [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|GRASS batch jobs]] (by settings env. variables)&lt;br /&gt;
* The [[OpenMP]] wiki page.&lt;br /&gt;
* The [[Parallelizing Scripts]] wiki page.&lt;br /&gt;
* [[GPU]] computing&lt;br /&gt;
&lt;br /&gt;
Elsewhere:&lt;br /&gt;
* [http://gfoss.blogspot.com/2008/11/building-cluster-for-grass-gis-and.html Building a cluster for GRASS GIS and other software from the OSGeo stack]&lt;br /&gt;
* https://research.csc.fi/supercomputers-and-gis&lt;br /&gt;
&lt;br /&gt;
[[Category:Parallelization]]&lt;br /&gt;
[[Category: massive data analysis]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Working_with_GRASS_without_starting_it_explicitly&amp;diff=25066</id>
		<title>Working with GRASS without starting it explicitly</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Working_with_GRASS_without_starting_it_explicitly&amp;diff=25066"/>
		<updated>2018-03-10T21:23:15Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: change paragraph title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GRASS GIS modules and the import of GRASS Python packages works only in a specific environmental settings (GRASS session). This settings is ensured by starting GRASS GIS application which prepares this GRASS session for you. It is possible to set up you system in the way that the GRASS session will be always active (i.e. the GRASS startup script is not running, just the environmental settings are done). People often prefer to set up the GRASS environment in their script or program and this is what this article discuss. However, it must be noted that the the generally preferred (and easy) way is to create scripts and programs as GRASS modules which means that your don't have to bother with setting up the environment since the GRASS module should be always invoked only in GRASS session.&lt;br /&gt;
&lt;br /&gt;
== GRASS sessions ==&lt;br /&gt;
&lt;br /&gt;
It is possible to access GRASS modules without explicitly starting a &amp;quot;GRASS session&amp;quot;. GRASS libraries require certain [http://grass.osgeo.org/grass72/manuals/variables.html environment variables] to be set. In fact a &amp;quot;GRASS session&amp;quot; is just a set of processes (e.g. a shell and/or GUI) which have the necessary environment settings, specifically:&lt;br /&gt;
&lt;br /&gt;
* '''GISBASE''' needs to be set to the top-level directory of the GRASS installation.&lt;br /&gt;
* '''GISRC''' needs to contain the absolute path to a file containing settings for '''GISDBASE''', '''LOCATION_NAME''' and '''MAPSET'''.&lt;br /&gt;
* '''PATH''' needs to include '''$GISBASE/bin''' and '''$GISBASE/scripts'''.&lt;br /&gt;
&lt;br /&gt;
If the GRASS libraries are shared libraries, the loader needs to be able to find them. This normally means that '''LD_LIBRARY_PATH''' (Linux, Solaris), '''DYLD_LIBRARY_PATH''' (MacOSX) or '''PATH''' (Windows) need to contain '''$GISBASE/lib''', although there are other means to the same end (e.g. on Linux, putting $GISBASE/lib (with $GISBASE replaced by its actual value) into /etc/ld.so.conf then running ldconfig).&lt;br /&gt;
&lt;br /&gt;
Some libraries and modules use other variables. More information for most of them is available in the file ''$GISBASE/docs/html/variables.html''. The display libraries used by ''d.*'' commands use additional variables, which are documented along with the individual drivers.&lt;br /&gt;
&lt;br /&gt;
=== Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
You can run GRASS scripts non-interactively from outside of a GRASS session with the GRASS_BATCH_JOB environment variable. When GRASS is started with this environment variable set it will automatically run the contents of the script given in the variable, then close the GRASS session when complete. In this way full lock-checking, GRASS variables setup, and temporary file cleaning tasks are still performed.&lt;br /&gt;
&lt;br /&gt;
See the [[GRASS_and_Shell#GRASS_Batch_jobs|Batch jobs]] section of the GRASS shell-help wiki page for details.&lt;br /&gt;
&lt;br /&gt;
=== Starting a GRASS session and terminating it automatically ===&lt;br /&gt;
&lt;br /&gt;
A GRASS session can be started and terminated automatically with the -e flag.&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 7.2.x you can execute commands from outside by passing the command to be executed (or a script with a collection of GRASS GIS commands) to the --exec flag:&lt;br /&gt;
&lt;br /&gt;
Creating a new Location based on a geodata file's projection (-c) and exit (-e) immediately:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grass72 -c elevation.tiff -e /path/to/grassdata/test1/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Linking external raster data to PERMANENT Mapset:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grass72 /path/to/grassdata/test1/PERMANENT/ -e --exec r.external input=basins.tiff output=basins&lt;br /&gt;
grass72 /path/to/grassdata/test1/PERMANENT/ -e --exec r.external input=elevation.tiff output=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get statistics for one raster map:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grass72 /path/to/grassdata/test1/PERMANENT/ -e --exec r.univar map=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Start a GRASS session but do not terminate it automatically ====&lt;br /&gt;
&lt;br /&gt;
Compare the rasters visually:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grass72 /path/to/grassdata/test1/PERMANENT/ --exec g.gui.mapswipe first=elevation second=basins&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read more in the [https://grass.osgeo.org/grass72/manuals/grass7.html#batch-jobs-with-the-exec-interface manual].&lt;br /&gt;
&lt;br /&gt;
==== Python examples ====&lt;br /&gt;
&lt;br /&gt;
For details on GRASS GIS Python programming, see also [[GRASS Python Scripting Library]].&lt;br /&gt;
&lt;br /&gt;
===== Python: GRASS GIS 7 with an external library: grass-session =====&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/zarch/grass-session &amp;quot;grass-session&amp;quot; Python library] is under development. To contribute at the code, documentation and testing it is possible to install the current development version using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pip install git+https://github.com/zarch/grass-session.git&lt;br /&gt;
# in future, the stable &amp;quot;grass-session&amp;quot; release will be available with:&lt;br /&gt;
# pip install grass-session&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then write &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
# filename: test_session.py&lt;br /&gt;
&lt;br /&gt;
from grass_session import Session&lt;br /&gt;
from grass.script import core as gcore&lt;br /&gt;
&lt;br /&gt;
# create a new location from EPSG code (can also be a GeoTIFF or SHP or ... file)&lt;br /&gt;
with Session(gisdb=&amp;quot;/tmp&amp;quot;, location=&amp;quot;location&amp;quot;,&lt;br /&gt;
             create_opts=&amp;quot;EPSG:4326&amp;quot;):&lt;br /&gt;
   # do something in permanent&lt;br /&gt;
   print(gcore.parse_command(&amp;quot;g.gisenv&amp;quot;, flags=&amp;quot;s&amp;quot;))&lt;br /&gt;
# {u'GISDBASE': u&amp;quot;'/tmp/';&amp;quot;,&lt;br /&gt;
#  u'LOCATION_NAME': u&amp;quot;'epsg3035';&amp;quot;,&lt;br /&gt;
#  u'MAPSET': u&amp;quot;'PERMANENT';&amp;quot;,}&lt;br /&gt;
&lt;br /&gt;
# create a new mapset in an existing location&lt;br /&gt;
with Session(gisdb=&amp;quot;/tmp&amp;quot;, location=&amp;quot;location&amp;quot;, mapset=&amp;quot;test&amp;quot;,&lt;br /&gt;
             create_opts=&amp;quot;&amp;quot;):&lt;br /&gt;
    # do something in the test mapset.&lt;br /&gt;
    print(gcore.parse_command(&amp;quot;g.gisenv&amp;quot;, flags=&amp;quot;s&amp;quot;))&lt;br /&gt;
# {u'GISDBASE': u&amp;quot;'/tmp/';&amp;quot;,&lt;br /&gt;
#  u'LOCATION_NAME': u&amp;quot;'epsg3035';&amp;quot;,&lt;br /&gt;
#  u'MAPSET': u&amp;quot;'test';&amp;quot;,}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass-session library looks at the &amp;lt;tt&amp;gt;GRASSBIN&amp;lt;/tt&amp;gt; environmental variable. If the variable is not set, the library tries to use the current stable release of GRASS GIS (e.g. &amp;lt;tt&amp;gt;grass74&amp;lt;/tt&amp;gt; on Linux for the 7.4 release).&lt;br /&gt;
For instance, to execute the previous example using a custom installation of 7.5 version, write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
GRASSBIN=$HOME/.local/bin/grass75 python test_session.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Hint: find the path to the GRASS GIS package start script =====&lt;br /&gt;
&lt;br /&gt;
Hint: in order to find the '''path to the GRASS GIS package''', launch it with &amp;lt;tt&amp;gt; --config path&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Linux&lt;br /&gt;
grass72 --config path&lt;br /&gt;
/usr/bin/grass-7.2.0&lt;br /&gt;
&lt;br /&gt;
# Windows&lt;br /&gt;
C:\&amp;gt;grass72.bat --config path&lt;br /&gt;
C:\OSGeo4W\apps\grass\grass-7.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Python: GRASS GIS 7 with existing location =====&lt;br /&gt;
&lt;br /&gt;
See the example in the [https://grass.osgeo.org/grass72/manuals/libpython/script.html#module-script.setup documentation] or the script which initializes the session and lists available raster and vector maps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import os&lt;br /&gt;
import sys&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# path to the GRASS GIS launch script&lt;br /&gt;
# MS Windows&lt;br /&gt;
grass7bin_win = r'C:\OSGeo4W\bin\grass72svn.bat'&lt;br /&gt;
# uncomment when using standalone WinGRASS installer&lt;br /&gt;
# grass7bin_win = r'C:\Program Files (x86)\GRASS GIS 7.2.0\grass72.bat'&lt;br /&gt;
# Linux&lt;br /&gt;
grass7bin_lin = 'grass72'&lt;br /&gt;
# Mac OS X&lt;br /&gt;
# this is TODO&lt;br /&gt;
grass7bin_mac = '/Applications/GRASS/GRASS-7.2.app/'&lt;br /&gt;
&lt;br /&gt;
# DATA&lt;br /&gt;
# define GRASS DATABASE&lt;br /&gt;
# add your path to grassdata (GRASS GIS database) directory&lt;br /&gt;
gisdb = os.path.join(os.path.expanduser(&amp;quot;~&amp;quot;), &amp;quot;grassdata&amp;quot;)&lt;br /&gt;
# the following path is the default path on MS Windows&lt;br /&gt;
# gisdb = os.path.join(os.path.expanduser(&amp;quot;~&amp;quot;), &amp;quot;Documents/grassdata&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# specify (existing) location and mapset&lt;br /&gt;
location = &amp;quot;nc_spm_08&amp;quot;&lt;br /&gt;
mapset   = &amp;quot;user1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
########### SOFTWARE&lt;br /&gt;
if sys.platform.startswith('linux'):&lt;br /&gt;
    # we assume that the GRASS GIS start script is available and in the PATH&lt;br /&gt;
    # query GRASS 7 itself for its GISBASE&lt;br /&gt;
    grass7bin = grass7bin_lin&lt;br /&gt;
elif sys.platform.startswith('win'):&lt;br /&gt;
    grass7bin = grass7bin_win&lt;br /&gt;
else:&lt;br /&gt;
    raise OSError('Platform not configured.')&lt;br /&gt;
&lt;br /&gt;
# query GRASS 7 itself for its GISBASE&lt;br /&gt;
startcmd = [grass7bin, '--config', 'path']&lt;br /&gt;
&lt;br /&gt;
p = subprocess.Popen(startcmd, shell=False,&lt;br /&gt;
                     stdout=subprocess.PIPE, stderr=subprocess.PIPE)&lt;br /&gt;
out, err = p.communicate()&lt;br /&gt;
if p.returncode != 0:&lt;br /&gt;
    print &amp;gt;&amp;gt;sys.stderr, &amp;quot;ERROR: Cannot find GRASS GIS 7 start script (%s)&amp;quot; % startcmd&lt;br /&gt;
    sys.exit(-1)&lt;br /&gt;
gisbase = out.strip('\n\r')&lt;br /&gt;
&lt;br /&gt;
# Set GISBASE environment variable&lt;br /&gt;
os.environ['GISBASE'] = gisbase&lt;br /&gt;
# the following not needed with trunk&lt;br /&gt;
os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'extrabin')&lt;br /&gt;
# add path to GRASS addons&lt;br /&gt;
home = os.path.expanduser(&amp;quot;~&amp;quot;)&lt;br /&gt;
os.environ['PATH'] += os.pathsep + os.path.join(home, '.grass7', 'addons', 'scripts')&lt;br /&gt;
&lt;br /&gt;
# define GRASS-Python environment&lt;br /&gt;
gpydir = os.path.join(gisbase, &amp;quot;etc&amp;quot;, &amp;quot;python&amp;quot;)&lt;br /&gt;
sys.path.append(gpydir)&lt;br /&gt;
&lt;br /&gt;
########### DATA&lt;br /&gt;
# Set GISDBASE environment variable&lt;br /&gt;
os.environ['GISDBASE'] = gisdb&lt;br /&gt;
 &lt;br /&gt;
# import GRASS Python bindings (see also pygrass)&lt;br /&gt;
import grass.script as gscript&lt;br /&gt;
import grass.script.setup as gsetup&lt;br /&gt;
 &lt;br /&gt;
###########&lt;br /&gt;
# launch session&lt;br /&gt;
gsetup.init(gisbase,&lt;br /&gt;
            gisdb, location, mapset)&lt;br /&gt;
 &lt;br /&gt;
gscript.message('Current GRASS GIS 7 environment:')&lt;br /&gt;
print gscript.gisenv()&lt;br /&gt;
 &lt;br /&gt;
gscript.message('Available raster maps:')&lt;br /&gt;
for rast in gscript.list_strings(type = 'rast'):&lt;br /&gt;
    print rast&lt;br /&gt;
 &lt;br /&gt;
gscript.message('Available vector maps:')&lt;br /&gt;
for vect in gscript.list_strings(type = 'vect'):&lt;br /&gt;
    print vect&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Python: GRASS GIS 7 without existing location using metadata only =====&lt;br /&gt;
&lt;br /&gt;
The script initializes the GRASS GIS session, creates a temporary GRASS location and lists available raster and vector maps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
# Python script to generate a new GRASS GIS 7 location simply from metadata&lt;br /&gt;
# Markus Neteler, 2014&lt;br /&gt;
&lt;br /&gt;
# ?? LINUX USAGE: First set LIBRARY SEARCH PATH&lt;br /&gt;
#export LD_LIBRARY_PATH=$(grass72 --config path)/lib&lt;br /&gt;
#python start_grass7_create_new_location_ADVANCED.py&lt;br /&gt;
&lt;br /&gt;
# some predefined variables&lt;br /&gt;
&lt;br /&gt;
# Windows&lt;br /&gt;
grass7path = r'C:\OSGeo4W\apps\grass\grass-7.2.svn'&lt;br /&gt;
grass7bin_win = r'C:\OSGeo4W\bin\grass72svn.bat'&lt;br /&gt;
# Linux&lt;br /&gt;
grass7bin_lin = 'grass72'&lt;br /&gt;
# MacOSX&lt;br /&gt;
grass7bin_mac = '/Applications/GRASS/GRASS-7.1.app/'&lt;br /&gt;
#myepsg = '4326' # latlong&lt;br /&gt;
myepsg = '3044' # ETRS-TM32, http://spatialreference.org/ref/epsg/3044/&lt;br /&gt;
#myfile = '/home/neteler/markus_repo/books/kluwerbook/data3rd/lidar/lidar_raleigh_nc_spm.shp'&lt;br /&gt;
myfile = '/data/maps/world_natural_earth_250m/europe_north_east.tif'&lt;br /&gt;
#myfile = r'C:\Dati\Padergnone\square_p95.tif'&lt;br /&gt;
&lt;br /&gt;
###########&lt;br /&gt;
import os&lt;br /&gt;
import sys&lt;br /&gt;
import subprocess&lt;br /&gt;
import shutil&lt;br /&gt;
import binascii&lt;br /&gt;
import tempfile&lt;br /&gt;
&lt;br /&gt;
########### SOFTWARE&lt;br /&gt;
if sys.platform.startswith('linux'):&lt;br /&gt;
    # we assume that the GRASS GIS start script is available and in the PATH&lt;br /&gt;
    # query GRASS 7 itself for its GISBASE&lt;br /&gt;
    grass7bin = grass7bin_lin&lt;br /&gt;
elif sys.platform.startswith('win'):&lt;br /&gt;
    grass7bin = grass7bin_win&lt;br /&gt;
else:&lt;br /&gt;
    OSError('Platform not configured.')&lt;br /&gt;
&lt;br /&gt;
startcmd = grass7bin + ' --config path'&lt;br /&gt;
&lt;br /&gt;
p = subprocess.Popen(startcmd, shell=True, &lt;br /&gt;
					 stdout=subprocess.PIPE, stderr=subprocess.PIPE)&lt;br /&gt;
out, err = p.communicate()&lt;br /&gt;
if p.returncode != 0:&lt;br /&gt;
	print &amp;gt;&amp;gt;sys.stderr, 'ERROR: %s' % err&lt;br /&gt;
	print &amp;gt;&amp;gt;sys.stderr, &amp;quot;ERROR: Cannot find GRASS GIS 7 start script (%s)&amp;quot; % startcmd&lt;br /&gt;
	sys.exit(-1)&lt;br /&gt;
if sys.platform.startswith('linux'):&lt;br /&gt;
	gisbase = out.strip('\n')&lt;br /&gt;
elif sys.platform.startswith('win'):&lt;br /&gt;
    if out.find(&amp;quot;OSGEO4W home is&amp;quot;) != -1:&lt;br /&gt;
		gisbase = out.strip().split('\n')[1]&lt;br /&gt;
    else:&lt;br /&gt;
		gisbase = out.strip('\n')&lt;br /&gt;
    os.environ['GRASS_SH'] = os.path.join(gisbase, 'msys', 'bin', 'sh.exe')&lt;br /&gt;
&lt;br /&gt;
# Set GISBASE environment variable&lt;br /&gt;
os.environ['GISBASE'] = gisbase&lt;br /&gt;
# define GRASS-Python environment&lt;br /&gt;
gpydir = os.path.join(gisbase, &amp;quot;etc&amp;quot;, &amp;quot;python&amp;quot;)&lt;br /&gt;
sys.path.append(gpydir)&lt;br /&gt;
########&lt;br /&gt;
# define GRASS DATABASE&lt;br /&gt;
if sys.platform.startswith('win'):&lt;br /&gt;
    gisdb = os.path.join(os.getenv('APPDATA', 'grassdata'))&lt;br /&gt;
else:&lt;br /&gt;
    gisdb = os.path.join(os.getenv('HOME', 'grassdata'))&lt;br /&gt;
&lt;br /&gt;
# override for now with TEMP dir&lt;br /&gt;
gisdb = os.path.join(tempfile.gettempdir(), 'grassdata')&lt;br /&gt;
try:&lt;br /&gt;
    os.stat(gisdb)&lt;br /&gt;
except:&lt;br /&gt;
    os.mkdir(gisdb)&lt;br /&gt;
&lt;br /&gt;
# location/mapset: use random names for batch jobs&lt;br /&gt;
string_length = 16&lt;br /&gt;
location = binascii.hexlify(os.urandom(string_length))&lt;br /&gt;
mapset   = 'PERMANENT'&lt;br /&gt;
location_path = os.path.join(gisdb, location)&lt;br /&gt;
&lt;br /&gt;
# Create new location (we assume that grass7bin is in the PATH)&lt;br /&gt;
#  from EPSG code:&lt;br /&gt;
startcmd = grass7bin + ' -c epsg:' + myepsg + ' -e ' + location_path&lt;br /&gt;
#  from SHAPE or GeoTIFF file&lt;br /&gt;
#startcmd = grass7bin + ' -c ' + myfile + ' -e ' + location_path&lt;br /&gt;
&lt;br /&gt;
print startcmd&lt;br /&gt;
p = subprocess.Popen(startcmd, shell=True, &lt;br /&gt;
                     stdout=subprocess.PIPE, stderr=subprocess.PIPE)&lt;br /&gt;
out, err = p.communicate()&lt;br /&gt;
if p.returncode != 0:&lt;br /&gt;
    print &amp;gt;&amp;gt;sys.stderr, 'ERROR: %s' % err&lt;br /&gt;
    print &amp;gt;&amp;gt;sys.stderr, 'ERROR: Cannot generate location (%s)' % startcmd&lt;br /&gt;
    sys.exit(-1)&lt;br /&gt;
else:&lt;br /&gt;
    print 'Created location %s' % location_path&lt;br /&gt;
&lt;br /&gt;
# Now the location with PERMANENT mapset exists.&lt;br /&gt;
&lt;br /&gt;
########&lt;br /&gt;
# Now we can use PyGRASS or GRASS Scripting library etc. after &lt;br /&gt;
# having started the session with gsetup.init() etc&lt;br /&gt;
&lt;br /&gt;
# Set GISDBASE environment variable&lt;br /&gt;
os.environ['GISDBASE'] = gisdb&lt;br /&gt;
&lt;br /&gt;
# Linux: Set path to GRASS libs (TODO: NEEDED?)&lt;br /&gt;
path = os.getenv('LD_LIBRARY_PATH')&lt;br /&gt;
dir  = os.path.join(gisbase, 'lib')&lt;br /&gt;
if path:&lt;br /&gt;
    path = dir + os.pathsep + path&lt;br /&gt;
else:&lt;br /&gt;
    path = dir&lt;br /&gt;
os.environ['LD_LIBRARY_PATH'] = path&lt;br /&gt;
&lt;br /&gt;
# language&lt;br /&gt;
os.environ['LANG'] = 'en_US'&lt;br /&gt;
os.environ['LOCALE'] = 'C'&lt;br /&gt;
&lt;br /&gt;
# Windows: NEEDED?&lt;br /&gt;
#path = os.getenv('PYTHONPATH')&lt;br /&gt;
#dirr = os.path.join(gisbase, 'etc', 'python')&lt;br /&gt;
#if path:&lt;br /&gt;
#    path = dirr + os.pathsep + path&lt;br /&gt;
#else:&lt;br /&gt;
#    path = dirr&lt;br /&gt;
#os.environ['PYTHONPATH'] = path&lt;br /&gt;
&lt;br /&gt;
#print os.environ&lt;br /&gt;
&lt;br /&gt;
## Import GRASS Python bindings&lt;br /&gt;
import grass.script as grass&lt;br /&gt;
import grass.script.setup as gsetup&lt;br /&gt;
&lt;br /&gt;
###########&lt;br /&gt;
# Launch session and do something&lt;br /&gt;
gsetup.init(gisbase, gisdb, location, mapset)&lt;br /&gt;
&lt;br /&gt;
# say hello&lt;br /&gt;
grass.message('--- GRASS GIS 7: Current GRASS GIS 7 environment:')&lt;br /&gt;
print grass.gisenv()&lt;br /&gt;
&lt;br /&gt;
# do something in GRASS now...&lt;br /&gt;
&lt;br /&gt;
grass.message('--- GRASS GIS 7: Checking projection info:')&lt;br /&gt;
in_proj = grass.read_command('g.proj', flags = 'jf')&lt;br /&gt;
&lt;br /&gt;
# selective proj parameter printing&lt;br /&gt;
kv = grass.parse_key_val(in_proj)&lt;br /&gt;
print kv&lt;br /&gt;
print kv['+proj']&lt;br /&gt;
&lt;br /&gt;
# print full proj parameter printing&lt;br /&gt;
in_proj = in_proj.strip()&lt;br /&gt;
grass.message(&amp;quot;--- Found projection parameters: '%s'&amp;quot; % in_proj)&lt;br /&gt;
&lt;br /&gt;
# show current region:&lt;br /&gt;
grass.message('--- GRASS GIS 7: Checking computational region info:')&lt;br /&gt;
in_region = grass.region()&lt;br /&gt;
grass.message(&amp;quot;--- Computational region: '%s'&amp;quot; % in_region)&lt;br /&gt;
&lt;br /&gt;
# do something else: r.mapcalc, v.rectify, ...&lt;br /&gt;
&lt;br /&gt;
# Finally remove the temporary batch location from disk&lt;br /&gt;
print 'Removing location %s' % location_path&lt;br /&gt;
shutil.rmtree(location_path)&lt;br /&gt;
&lt;br /&gt;
sys.exit(0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bash examples (GNU/Linux) ====&lt;br /&gt;
&lt;br /&gt;
'''''Note: see [[GRASS_and_Shell#GRASS_Batch_jobs|GRASS Batch jobs]] for a really easy approach.'''''&lt;br /&gt;
&lt;br /&gt;
Below an example of a '''~/.bash_profile''' script to set the required settings in order to access GRASS commands outside of a GRASS-session. Specifically it is for GRASS 7 (commented parts for GRASS 6.4.2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
# example for GRASS 7&lt;br /&gt;
export GISBASE=/usr/local/grass-7.2.svn&lt;br /&gt;
# example for GRASS 6.4.2&lt;br /&gt;
### export GISBASE=/usr/local/grass-6.4.2svn&lt;br /&gt;
&lt;br /&gt;
# GRASS 7&lt;br /&gt;
export GRASS_VERSION=&amp;quot;7.2.svn&amp;quot;&lt;br /&gt;
# GRASS 6.4.2&lt;br /&gt;
### export GRASS_VERSION=&amp;quot;6.4.2svn&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#generate GISRCRC&lt;br /&gt;
MYGISDBASE=$HOME/grassdata&lt;br /&gt;
MYLOC=nc_spm_08&lt;br /&gt;
MYMAPSET=user1&lt;br /&gt;
&lt;br /&gt;
# Set the global grassrc file to individual file name&lt;br /&gt;
MYGISRC=&amp;quot;$HOME/.grassrc.$GRASS_VERSION.$$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;GISDBASE: $MYGISDBASE&amp;quot; &amp;gt; &amp;quot;$MYGISRC&amp;quot;&lt;br /&gt;
echo &amp;quot;LOCATION_NAME: $MYLOC&amp;quot; &amp;gt;&amp;gt; &amp;quot;$MYGISRC&amp;quot;&lt;br /&gt;
echo &amp;quot;MAPSET: $MYMAPSET&amp;quot; &amp;gt;&amp;gt; &amp;quot;$MYGISRC&amp;quot;&lt;br /&gt;
echo &amp;quot;GRASS_GUI: text&amp;quot; &amp;gt;&amp;gt; &amp;quot;$MYGISRC&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
# path to GRASS settings file&lt;br /&gt;
export GISRC=$MYGISRC&lt;br /&gt;
export GRASS_PYTHON=python&lt;br /&gt;
export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
export GRASS_TRANSPARENT=TRUE&lt;br /&gt;
export GRASS_PNG_AUTO_WRITE=TRUE&lt;br /&gt;
export GRASS_GNUPLOT='gnuplot -persist'&lt;br /&gt;
export GRASS_WIDTH=640&lt;br /&gt;
export GRASS_HEIGHT=480&lt;br /&gt;
export GRASS_HTML_BROWSER=firefox&lt;br /&gt;
export GRASS_PAGER=cat&lt;br /&gt;
export GRASS_WISH=wish&lt;br /&gt;
        &lt;br /&gt;
export PATH=&amp;quot;$GISBASE/bin:$GISBASE/scripts:$PATH&amp;quot;&lt;br /&gt;
export LD_LIBRARY_PATH=&amp;quot;$GISBASE/lib&amp;quot;&lt;br /&gt;
export GRASS_LD_LIBRARY_PATH=&amp;quot;$LD_LIBRARY_PATH&amp;quot;&lt;br /&gt;
export PYTHONPATH=&amp;quot;$GISBASE/etc/python:$PYTHONPATH&amp;quot;&lt;br /&gt;
export MANPATH=$MANPATH:$GISBASE/man&lt;br /&gt;
&lt;br /&gt;
#For the temporal modules&lt;br /&gt;
export TGISDB_DRIVER=sqlite&lt;br /&gt;
export TGISDB_DATABASE=$MYGISDBASE/$MYLOC/PERMANENT/tgis/sqlite.db&lt;br /&gt;
&lt;br /&gt;
# test a command&lt;br /&gt;
g.list rast&lt;br /&gt;
&lt;br /&gt;
######### below not needed ########&lt;br /&gt;
# GRASS 7&lt;br /&gt;
tmp=/tmp/grass7-&amp;quot;`whoami`&amp;quot;-$GIS_LOCK&lt;br /&gt;
# GRASS 6.4.2&lt;br /&gt;
### tmp=/tmp/grass6-&amp;quot;`whoami`&amp;quot;-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
export GISRC=&amp;quot;$tmp/rc&amp;quot;&lt;br /&gt;
mkdir &amp;quot;$tmp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# GRASS 7&lt;br /&gt;
cp ~/.grass7/rc &amp;quot;$GISRC&amp;quot;&lt;br /&gt;
# GRASS 6.4.2&lt;br /&gt;
### cp ~/.grassrc6 &amp;quot;$GISRC&amp;quot;&lt;br /&gt;
######### END below not needed ########&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above script will allow GRASS commands to be used anywhere. Furthermore, if the '''~/.Xsession''' sources the bash startup scripts, the settings aren't limited to interactive shells, but also work for e.g. M-! in XEmacs). Each interactive shell gets a separate &amp;quot;session&amp;quot; (i.e. a separate $GISRC file), while GUI programs share a common session.&lt;br /&gt;
&lt;br /&gt;
Note, however, that '''~/.bash_profile''' is a personal initialization startup script and, thus, read during the login process. Any modifications to it will be read after (re-)login or explicitly sourcing it.&lt;br /&gt;
&lt;br /&gt;
At the end of the ~/.bash_profile file, the following lines can be added to ensure no duplication of entries in the PATH variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 PATH=`awk -F: '{for(i=1;i&amp;lt;=NF;i++){if(!($i in a)){a[$i];printf s$i;s=&amp;quot;:&amp;quot;}}}'&amp;lt;&amp;lt;&amp;lt;$PATH`&lt;br /&gt;
 PYTHONPATH=`awk -F: '{for(i=1;i&amp;lt;=NF;i++){if(!($i in a)){a[$i];printf s$i;s=&amp;quot;:&amp;quot;}}}'&amp;lt;&amp;lt;&amp;lt;$PYTHONPATH`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Important notes ===&lt;br /&gt;
&lt;br /&gt;
Launching a grassXY session could still permit access on GRASS modules of the version that is set with the above script. The reason being is that grassXY scripts (e.g.: grass64, grass65, grass72) prepend the GRASS directories to '''PATH''', '''LD_LIBRARY_PATH''', etc. They won't remove any entries which are already there. A solution to this is to ''switch'' between GRASS versions by using a script like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
        strippath()&lt;br /&gt;
        {&lt;br /&gt;
            (&lt;br /&gt;
            oldpath=&amp;quot;$1&amp;quot;&lt;br /&gt;
            newpath=&lt;br /&gt;
            IFS=:&lt;br /&gt;
            for dir in $oldpath ; do&lt;br /&gt;
                case &amp;quot;${dir}&amp;quot; in&lt;br /&gt;
                *grass*)&lt;br /&gt;
                        ;;&lt;br /&gt;
                *)&lt;br /&gt;
                        newpath=&amp;quot;$newpath:$dir&amp;quot;&lt;br /&gt;
                        ;;&lt;br /&gt;
                esac&lt;br /&gt;
            done&lt;br /&gt;
            echo &amp;quot;${newpath#:}&amp;quot;&lt;br /&gt;
            )&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        PATH=`strippath $PATH`&lt;br /&gt;
        &lt;br /&gt;
        export GISBASE=$PWD/dist.i686-pc-linux-gnu&lt;br /&gt;
        export PATH=&amp;quot;$GISBASE/bin:$GISBASE/scripts:$PATH&amp;quot;&lt;br /&gt;
        export LD_LIBRARY_PATH=&amp;quot;$GISBASE/lib&amp;quot;&lt;br /&gt;
        export PYTHONPATH=&amp;quot;$GISBASE/etc/python&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note: the above script needs to be &amp;quot;source&amp;quot;d; executing it won't work. It might also require some adjustments (e.g. the ''GISBASE'' variable).'''&lt;br /&gt;
&lt;br /&gt;
Using normal grass sessions commands are recorded in '''$GISDBASE/$LOCATION_NAME/$MAPSET/.bash_history'''. While working with &amp;quot;pure&amp;quot; bash, shell entries go in '''~/.bash_history'''. Merging existing &amp;quot;grass-bash_history(-ies)&amp;quot; with the bash history log, would probably be not a good idea. Perhaps it is wise(r) to use normal GRASS sessions when working on real projects. Nevertheless, it is upon the users preferences and expertise level to decide what is best.&lt;br /&gt;
&lt;br /&gt;
=== Hints and troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
Some hints for MS Windows users:&lt;br /&gt;
&lt;br /&gt;
# The Python interpreter (python.exe) needs to be in the PATH&lt;br /&gt;
# Python needs to be associated with the .py extension&lt;br /&gt;
# PATHEXT needs to include .py if you want to be able to omit the extension&lt;br /&gt;
&lt;br /&gt;
When everything works well, the installer should take care of all of these.&lt;br /&gt;
&lt;br /&gt;
To manage parallel sessions on Linux, use process ID (PID) as lock file number and set the GIS_LOCK variable, for example&lt;br /&gt;
&lt;br /&gt;
  export GIS_LOCK=$$&lt;br /&gt;
&lt;br /&gt;
in Bash.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* Instructions and discussion on [http://n2.nabble.com/can-I-access-mapset-outside-of-grass-by-using-python-td3405902.html#a3405902 how to access GRASS mapsets outside of a GRASS session] in the grass-user mailing list.&lt;br /&gt;
* removing duplicate entries in $PATH taken from [http://chunchung.blogspot.com/2007/11/remove-duplicate-paths-from-path-in.html]&lt;br /&gt;
&lt;br /&gt;
== GRASS databases ==&lt;br /&gt;
&lt;br /&gt;
(project file structure)&lt;br /&gt;
&lt;br /&gt;
=== Minimal mapsets ===&lt;br /&gt;
&lt;br /&gt;
within a functional LOCATION (see below) the minimal mapset is a subdirectory of the MAPSET's name, containing a WIND file. The WIND file can simply be copied from PERMANENT/DEFAULT_WIND. Optionally you can put a VAR file in there too to define the default database driver to use.&lt;br /&gt;
&lt;br /&gt;
* You can create a new mapset when starting GRASS with the -c flag. e.g.&lt;br /&gt;
 grass64 -c /path/to/location/new_mapset_name&lt;br /&gt;
&lt;br /&gt;
=== Minimal locations ===&lt;br /&gt;
&lt;br /&gt;
Within the GISDATABASE (which is simply a subdirectory some where), the minimum LOCATION consists of a directory giving the LOCATION its name, which in turn contains a PERMANENT subdirectory for the PERMANENT mapset. The PERMANENT mapset contains a few special files that regular mapsets don't. These are:&lt;br /&gt;
; PROJ_INFO: contains the location's projection information&lt;br /&gt;
; PROJ_UNITS: contains the location's map units definition&lt;br /&gt;
; DEFAULT_WIND: the default region (WINDow file). The format is identical to the WIND files created by g.region&lt;br /&gt;
; WIND: (optional?)&lt;br /&gt;
&lt;br /&gt;
* see also {{src|demolocation}} in the GRASS source code&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GRASS_and_Shell#GRASS_Batch_jobs|GRASS Batch jobs]]&lt;br /&gt;
&lt;br /&gt;
[[Category: FAQ]]&lt;br /&gt;
[[Category: Linking to other languages]]&lt;br /&gt;
[[Category: bash]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category: Python]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=OpenStreetMap&amp;diff=25029</id>
		<title>OpenStreetMap</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=OpenStreetMap&amp;diff=25029"/>
		<updated>2018-02-15T21:41:00Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Import OSM pbf: wiki formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OSM Homepage: http://www.openstreetmap.org/&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Import ==&lt;br /&gt;
&lt;br /&gt;
* [[GRASS_AddOns#v.in.osm]]  (fairly rough script)&lt;br /&gt;
&lt;br /&gt;
Conversion with {{wikipedia|Mapnik}} to raster tiles may work, but be very careful about projection issues, typically online web map tiles are not appropriate for GIS import.&lt;br /&gt;
&lt;br /&gt;
=== Data as shapefiles ===&lt;br /&gt;
&lt;br /&gt;
Get data from here:&lt;br /&gt;
* http://download.geofabrik.de/osm/ , or&lt;br /&gt;
* http://downloads.cloudmade.com/&lt;br /&gt;
&lt;br /&gt;
Then import with {{cmd|v.in.ogr}}&lt;br /&gt;
&lt;br /&gt;
=== Data from WMS ===&lt;br /&gt;
&lt;br /&gt;
* Web Map Service (WMS) for Europe: [http://mapbender.wheregroup.com/cgi-bin/mapserv?map=/data/umn/osm/osm_basic.map&amp;amp;VERSION=1.1.1&amp;amp;REQUEST=GetCapabilities&amp;amp;SERVICE=WMS GetCapabilities] to access the WMS&lt;br /&gt;
* Free/open world-wide server: http://www.mundialis.de/ows-mundialis/&lt;br /&gt;
&lt;br /&gt;
Then import with {{cmd|r.in.wms}}&lt;br /&gt;
&lt;br /&gt;
=== Data as OSM pbf ===&lt;br /&gt;
&lt;br /&gt;
Get data from here:&lt;br /&gt;
* http://download.geofabrik.de/osm/ , or&lt;br /&gt;
* all data at once from https://wiki.openstreetmap.org/wiki/Planet.osm about 40 GB compressed&lt;br /&gt;
&lt;br /&gt;
Read http://gdal.org/drv_osm.html. Create a OSM_CONFIG_FILE file, selecting tags. The options other_tags and all_tags should be disabled to avoid errors when creating attribute tables.&lt;br /&gt;
&lt;br /&gt;
When importing, use the layer and where options of {{cmd|v.in.ogr}} in order to import only the required features and in order to avoid topological problems.&lt;br /&gt;
&lt;br /&gt;
For example, import roads from some pbf file with&lt;br /&gt;
  v.in.ogr layer=lines where=&amp;quot;highway &amp;lt;&amp;gt; ' '&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Import landuse from some pbf file with&lt;br /&gt;
  v.in.ogr layer=multipolygons where=&amp;quot;landuse &amp;lt;&amp;gt; ' '&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Import landuse from some pbf file with&lt;br /&gt;
  v.in.ogr layer=multipolygons where=&amp;quot;landuse &amp;lt;&amp;gt; ' '&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Import administrative boundaries for a particular level with&lt;br /&gt;
  v.in.ogr layer=multipolygons where=&amp;quot;boundary = 'administrative' and admin_level = '&amp;lt;desired level'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=OSM vs. GRASS topology=&lt;br /&gt;
&lt;br /&gt;
OSM topological model is different to GRASS topological model. OSM topologically correct connections of  the lines can be on all nodes of the line. Unlike OSM, GRASS allows to connect lines only on their starting/end nodes.Therefore after the import it is needed to split lines into the smallest segments by &amp;quot;v.split vertices=2&amp;quot;. However after application of the v.split, there are too many lines and some of them are not necessary. Module {{cmd|version=71|v.build.polylines}} cats=same merges the extra lines into single polyline. &lt;br /&gt;
&lt;br /&gt;
Correct topological model is necessary e.g. to perform [[Vector network analysis]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
The following image represents roundabout after the import of the OSM shapefile from geofabrik. You can see that there is only one category number 917. It means that the roundabout circle is just one line and grass does not see all connections to the other lines, because they are not on the starting/end node of the circle.&lt;br /&gt;
&lt;br /&gt;
[[Image:01 roundabout before.png‎|center|700px|thumb|v.in.ogr output]] &lt;br /&gt;
&lt;br /&gt;
After the  application of v.split it gives too many one segment lines. It is clear form the following image:&lt;br /&gt;
&lt;br /&gt;
[[Image:02 roundabout split.png‎|center|700px|thumb|v.split output]]&lt;br /&gt;
&lt;br /&gt;
{{cmd|version=71|v.build.polylines}} merges unnecessary segments. All lines starts/ends on the intersections with other lines as can be seen on the following image:&lt;br /&gt;
&lt;br /&gt;
[[Image:03 roundabout after.png|center|700px|thumb|v.build.polylines output]]&lt;br /&gt;
&lt;br /&gt;
There is another possibility to use {{cmd|version=71|v.clean}} &amp;lt;tt&amp;gt;tool=break&amp;lt;/tt&amp;gt; but if there is e.g. a bridge then v.clean connects it to the roads going below it which is incorrect. The above described approach does not split the bridge there. See the difference on the following images:&lt;br /&gt;
&lt;br /&gt;
[[Image:Vclean difference.png|center|700px|thumb|Output of v.split -&amp;gt; v.build.polylines]]&lt;br /&gt;
[[Image:Vclean.png|center|700px|thumb|Output of v.clean tool=break]] &lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* [[Extrude 2D polygons to 3D]]&lt;br /&gt;
* [http://wiki.openstreetmap.org/wiki/Simplifying_OSM_Shapefiles_using_GRASS Simplifying OSM Shapefiles using GRASS]&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=OpenStreetMap&amp;diff=25028</id>
		<title>OpenStreetMap</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=OpenStreetMap&amp;diff=25028"/>
		<updated>2018-02-15T21:34:47Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: add pbf mport&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OSM Homepage: http://www.openstreetmap.org/&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Import ==&lt;br /&gt;
&lt;br /&gt;
* [[GRASS_AddOns#v.in.osm]]  (fairly rough script)&lt;br /&gt;
&lt;br /&gt;
Conversion with {{wikipedia|Mapnik}} to raster tiles may work, but be very careful about projection issues, typically online web map tiles are not appropriate for GIS import.&lt;br /&gt;
&lt;br /&gt;
=== Data as shapefiles ===&lt;br /&gt;
&lt;br /&gt;
Get data from here:&lt;br /&gt;
* http://download.geofabrik.de/osm/ , or&lt;br /&gt;
* http://downloads.cloudmade.com/&lt;br /&gt;
&lt;br /&gt;
Then import with {{cmd|v.in.ogr}}&lt;br /&gt;
&lt;br /&gt;
=== Data from WMS ===&lt;br /&gt;
&lt;br /&gt;
* Web Map Service (WMS) for Europe: [http://mapbender.wheregroup.com/cgi-bin/mapserv?map=/data/umn/osm/osm_basic.map&amp;amp;VERSION=1.1.1&amp;amp;REQUEST=GetCapabilities&amp;amp;SERVICE=WMS GetCapabilities] to access the WMS&lt;br /&gt;
* Free/open world-wide server: http://www.mundialis.de/ows-mundialis/&lt;br /&gt;
&lt;br /&gt;
Then import with {{cmd|r.in.wms}}&lt;br /&gt;
&lt;br /&gt;
=== Data as OSM pbf ===&lt;br /&gt;
&lt;br /&gt;
Get data from here:&lt;br /&gt;
* http://download.geofabrik.de/osm/ , or&lt;br /&gt;
* all data at once from https://wiki.openstreetmap.org/wiki/Planet.osm about 40 GB compressed&lt;br /&gt;
&lt;br /&gt;
Read http://gdal.org/drv_osm.html. Create a OSM_CONFIG_FILE file, selecting tags. The options other_tags and all_tags should be disabled to avoid errors when creating attribute tables.&lt;br /&gt;
&lt;br /&gt;
When importing, use the layer and where options of {{cmd|v.in.ogr}} in order to import only the required features and in order to avoid topological problems.&lt;br /&gt;
&lt;br /&gt;
For example, import roads from some pbf file with v.in.ogr layer=lines where=&amp;quot;highway &amp;lt;&amp;gt; ''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Import landuse from some pbf file with v.in.ogr layer=multipolygons where=&amp;quot;landuse &amp;lt;&amp;gt; ''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Import landuse from some pbf file with v.in.ogr layer=multipolygons where=&amp;quot;landuse &amp;lt;&amp;gt; ''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Import administrative boundaries for a particular level with v.in.ogr layer=multipolygons where=&amp;quot;boundary = 'administrative' and admin_level = '&amp;lt;desired level'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=OSM vs. GRASS topology=&lt;br /&gt;
&lt;br /&gt;
OSM topological model is different to GRASS topological model. OSM topologically correct connections of  the lines can be on all nodes of the line. Unlike OSM, GRASS allows to connect lines only on their starting/end nodes.Therefore after the import it is needed to split lines into the smallest segments by &amp;quot;v.split vertices=2&amp;quot;. However after application of the v.split, there are too many lines and some of them are not necessary. Module {{cmd|version=71|v.build.polylines}} cats=same merges the extra lines into single polyline. &lt;br /&gt;
&lt;br /&gt;
Correct topological model is necessary e.g. to perform [[Vector network analysis]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
The following image represents roundabout after the import of the OSM shapefile from geofabrik. You can see that there is only one category number 917. It means that the roundabout circle is just one line and grass does not see all connections to the other lines, because they are not on the starting/end node of the circle.&lt;br /&gt;
&lt;br /&gt;
[[Image:01 roundabout before.png‎|center|700px|thumb|v.in.ogr output]] &lt;br /&gt;
&lt;br /&gt;
After the  application of v.split it gives too many one segment lines. It is clear form the following image:&lt;br /&gt;
&lt;br /&gt;
[[Image:02 roundabout split.png‎|center|700px|thumb|v.split output]]&lt;br /&gt;
&lt;br /&gt;
{{cmd|version=71|v.build.polylines}} merges unnecessary segments. All lines starts/ends on the intersections with other lines as can be seen on the following image:&lt;br /&gt;
&lt;br /&gt;
[[Image:03 roundabout after.png|center|700px|thumb|v.build.polylines output]]&lt;br /&gt;
&lt;br /&gt;
There is another possibility to use {{cmd|version=71|v.clean}} &amp;lt;tt&amp;gt;tool=break&amp;lt;/tt&amp;gt; but if there is e.g. a bridge then v.clean connects it to the roads going below it which is incorrect. The above described approach does not split the bridge there. See the difference on the following images:&lt;br /&gt;
&lt;br /&gt;
[[Image:Vclean difference.png|center|700px|thumb|Output of v.split -&amp;gt; v.build.polylines]]&lt;br /&gt;
[[Image:Vclean.png|center|700px|thumb|Output of v.clean tool=break]] &lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* [[Extrude 2D polygons to 3D]]&lt;br /&gt;
* [http://wiki.openstreetmap.org/wiki/Simplifying_OSM_Shapefiles_using_GRASS Simplifying OSM Shapefiles using GRASS]&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25017</id>
		<title>Parallel GRASS jobs</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Parallel_GRASS_jobs&amp;diff=25017"/>
		<updated>2018-02-07T21:02:39Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Cluster and Grid computing: update, more generic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Parallel GRASS jobs ==&lt;br /&gt;
&lt;br /&gt;
NOTE: GRASS 6 libraries are NOT thread safe (except for GPDE, see below).&lt;br /&gt;
&lt;br /&gt;
GRASS doesn't perform any locking on the files within a GRASS&lt;br /&gt;
database, so the user may end up with one process reading a file while&lt;br /&gt;
another process is in the middle of writing it. The most problematic&lt;br /&gt;
case is the WIND file, which contains the [[current region]], although&lt;br /&gt;
there are others.&lt;br /&gt;
&lt;br /&gt;
If a user wants to run multiple commands concurrently, steps need to &lt;br /&gt;
be taken to ensure that this type of conflict doesn't happen. For the&lt;br /&gt;
current region, the user can use the WIND_OVERRIDE environment variable to&lt;br /&gt;
specify a named region which should be used instead of the WIND file.&lt;br /&gt;
&lt;br /&gt;
Or the user can use the GRASS_REGION environment variable to specify the&lt;br /&gt;
region parameters (the syntax is the same as the WIND file, but with&lt;br /&gt;
newlines replaced with semicolons). With this approach, the region can&lt;br /&gt;
only be read, not modified.&lt;br /&gt;
&lt;br /&gt;
Problems can also arise if the user reads files from another mapset while&lt;br /&gt;
another session is modifying those files. The WIND file isn't an issue&lt;br /&gt;
here, nor are the files containing raster data (which are updated&lt;br /&gt;
atomically), but the various support files may be.&lt;br /&gt;
&lt;br /&gt;
See below for ways around these limitations.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
This you should know about GRASS' behaviour concerning multiple jobs:&lt;br /&gt;
* You can run '''multiple processes''' in '''multiple locations''' ([http://grass.osgeo.org/grass64/manuals/html64_user/helptext.html what's that?]). ''Peaceful coexistence.''&lt;br /&gt;
* You can run multiple processes in the same mapset, but only if the region is untouched. If you are unsure, it's recommended to  launch each job in its own mapset within the location.&lt;br /&gt;
* You can run '''multiple processes''' in the '''same location''', but in '''different mapsets'''. ''Peaceful coexistence.''&lt;br /&gt;
&lt;br /&gt;
=== Approach ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are at least two approaches of &amp;quot;poor man&amp;quot; parallelization without modifying GRASS source code:&lt;br /&gt;
* split map into spatial chunks (possibly with overlap to gain smooth results)&lt;br /&gt;
* time series: run each map elaboration on a different node.&lt;br /&gt;
&lt;br /&gt;
See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
== Working with tiles ==&lt;br /&gt;
&lt;br /&gt;
Huge map reprojection example:&lt;br /&gt;
&lt;br /&gt;
'''Q:''' I'd like to try splitting a large raster into small chunks and then projecting each one separately, sending the project command to the background. The problem is that, if the GRASS command changes the region settings, things might not work.&lt;br /&gt;
&lt;br /&gt;
'''A:''' {{cmd|r.proj}} doesn't change the region.&lt;br /&gt;
&lt;br /&gt;
Processing the map in chunks requires setting a different region for&lt;br /&gt;
each command. That can be done by creating named regions and using the&lt;br /&gt;
WIND_OVERRIDE environment variable, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
       g.region ... save=region1&lt;br /&gt;
       g.region ... save=region2&lt;br /&gt;
       ...&lt;br /&gt;
       WIND_OVERRIDE=region1 r.proj ... &amp;amp;&lt;br /&gt;
       WIND_OVERRIDE=region2 r.proj ... &amp;amp;&lt;br /&gt;
       ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(for python see the grass.use_temp_region() function)&lt;br /&gt;
&lt;br /&gt;
The main factor which is likely to affect parallelism is the fact that the processes won't share their caches, so there'll be some degree of inefficiency if there's substantial overlap between the source areas for the processes.&lt;br /&gt;
&lt;br /&gt;
If you have more than one such map to project, processing entire maps in parallel might be a better choice (so that you get N maps projected in 10 hours rather than 1 map in 10/N hours).&lt;br /&gt;
&lt;br /&gt;
== Parallelized code ==&lt;br /&gt;
&lt;br /&gt;
=== OpenMP ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-openmp&lt;br /&gt;
&lt;br /&gt;
==== GPDE using OpenMP ====&lt;br /&gt;
&lt;br /&gt;
The only parallelized library in GRASS &amp;gt;=6.3 is GRASS Partial Differential Equations Library (GPDE) and the gmath library in GRASS 7. Read more in [[OpenMP]].&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass73/manuals/libpython/pygrass.modules.interface.html?highlight=parallelmodulequeue#pygrass.modules.interface.module.ParallelModuleQueue PyGRASS ParallelModuleQueue]&lt;br /&gt;
&lt;br /&gt;
=== pthreads ===&lt;br /&gt;
&lt;br /&gt;
Note: only used in the r.mapcalc ''parser''!&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
 ./configure --with-pthread&lt;br /&gt;
&lt;br /&gt;
The ''parser'' of {{cmd|r.mapcalc}} in GRASS 7 has been parallelized using GNU {{wikipedia|pthreads}}. The computation itself is executed serially.&lt;br /&gt;
&lt;br /&gt;
=== Bourne and Python Scripts ===&lt;br /&gt;
&lt;br /&gt;
Good for a single system with a multi-core CPU.&lt;br /&gt;
&lt;br /&gt;
Often very easy &amp;amp; can be done without modification to the main source code.&lt;br /&gt;
&lt;br /&gt;
* See the [[Parallelizing Scripts]] wiki page&lt;br /&gt;
&lt;br /&gt;
=== OpenMPI ===&lt;br /&gt;
&lt;br /&gt;
Good for a multi-system cluster connected by a fast network.&lt;br /&gt;
&lt;br /&gt;
The {{AddonCmd|GIPE}} ''i.vi.mpi'' addon module has been created as a MPI ({{wikipedia|Message Passing Interface}}) implementation of the {{AddonCmd|GIPE}} ''i.vi'' addon module.&lt;br /&gt;
* See also the [[Agriculture and HPC]] wiki page.&lt;br /&gt;
&lt;br /&gt;
=== MPI Programming ===&lt;br /&gt;
&lt;br /&gt;
There is a sample implementation at module level in [http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.vi.mpi i.vi.mpi]&lt;br /&gt;
&lt;br /&gt;
=== GPU Programming ===&lt;br /&gt;
&lt;br /&gt;
Good for certain kinds of calculations (e.g. ray-tracing) on a single system with a fast graphics card.&lt;br /&gt;
&lt;br /&gt;
There is a version of the {{cmd|r.sun}} module which has been modified to use {{wikipedia|OpenCL}}. (works; still experimental)&lt;br /&gt;
&lt;br /&gt;
* See [[GPU]]&lt;br /&gt;
&lt;br /&gt;
Configure GRASS 7 with:&lt;br /&gt;
  ./configure --with-opencl&lt;br /&gt;
&lt;br /&gt;
== Cluster and Grid computing ==&lt;br /&gt;
&lt;br /&gt;
A cluster or grid computing system  consists of a number of computers that are tightly coupled together. The manager or master controls the utilization of compute nodes.&lt;br /&gt;
&lt;br /&gt;
=== Job scheduler ===&lt;br /&gt;
&lt;br /&gt;
Common job schedulers are [https://slurm.schedmd.com/ SLURM], [http://www.adaptivecomputing.com/products/open-source/torque/ TORQUE], [http://www.pbspro.org/ PBS], [https://arc.liv.ac.uk/trac/SGE Son of Grid Engine], and [https://kubernetes.io/ kubernetes]&lt;br /&gt;
&lt;br /&gt;
See also [https://slurm.schedmd.com/rosetta.html Rosetta Stone of Workload Managers]&lt;br /&gt;
&lt;br /&gt;
A job consists of tasks, e.g. processing of a single raster map in a time series of many raster maps. Jobs are assigned to a queue and started as soon as a slot in the queue is free. Jobs are removed from the queue once they finished.&lt;br /&gt;
&lt;br /&gt;
=== GRASS on a cluster ===&lt;br /&gt;
&lt;br /&gt;
If you want to launch several GRASS jobs in parallel, you might consider to launch each job in its own mapset.&lt;br /&gt;
&lt;br /&gt;
* set up chunks of data to be processed (temporal or spatial, temporal chunks are usually easier to handle)&lt;br /&gt;
* write a script with the actual processing of one chunk&lt;br /&gt;
* write a script that initializes GRASS, creates a unique mapset, executes the script with the actual processing, and copies the results to a common mapset&lt;br /&gt;
* add that script as a task to a job, create one job for each data chunk&lt;br /&gt;
&lt;br /&gt;
The common bottleneck when using GRASS on a cluster is often disk I/O. Try to start the jobs with nice/ionice to reduce strain on the storage devices.&lt;br /&gt;
&lt;br /&gt;
== Cloud computing ==&lt;br /&gt;
&lt;br /&gt;
GRASS GIS 7 is running in the cloud as web processing service backend. Have a look at:&lt;br /&gt;
&lt;br /&gt;
{{YouTube|jg2pb_Xjq8Y|desc=GRASS 7 in the cloud (by Sören Gebbert)}}&lt;br /&gt;
&lt;br /&gt;
This Open Cloud GIS has been set up in a private Amazon compatible cloud environment using:&lt;br /&gt;
* Ubuntu 10.04 LTS and 10.10 cloud server edition&lt;br /&gt;
* Eucalyptus Cloud&lt;br /&gt;
* GRASS GIS 7 latest svn&lt;br /&gt;
* PyWPS latest svn&lt;br /&gt;
* wps-grass-bridge latest svn&lt;br /&gt;
* QGIS 1.7 with a modified QWPS plugin&lt;br /&gt;
&lt;br /&gt;
== GRASS GIS on VPS ==&lt;br /&gt;
&lt;br /&gt;
Instructions to run GRASS GIS on a commercial VPS to do some memory-intensive operations:&lt;br /&gt;
&lt;br /&gt;
http://plantarum.ca/code/medium-performance-cluster/&lt;br /&gt;
&lt;br /&gt;
== Hints for NFS users ==&lt;br /&gt;
* AVOID script forking on the cluster (but inclusion via &amp;quot;. script.sh&amp;quot; works ok). This means that the GRASS_BATCH_JOB approach is prone to '''fail'''. It is highly recommended to simply set a series of environmental variables to define the GRASS session, see [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|here]] how to do that.&lt;br /&gt;
* be careful with concurrent file writing (use &amp;quot;lockfile&amp;quot; locking, the lockfile command is provided by [http://www.procmail.org/ procmail]);&lt;br /&gt;
* store as much temporary data as possible (even the final maps) on the local blade disks if you have.&lt;br /&gt;
* finally collect all results from local blade disks *after* the parallel job execution in a sequential collector job (I am writing that now) to not kill NFS. For example, Grid Engine offers a &amp;quot;hold&amp;quot; function to only execute the collector job after having done the rest.&lt;br /&gt;
* If all else fails, and the I/O load is not too great, consider using {{wikipedia|sshfs}} with ssh passkeys instead of NFS.&lt;br /&gt;
* In some situations it is necessary to preserve the same directory structure on all nodes, and symlinks are a nice way to do that, but some (closed source 3rd party which will remain nameless) software insists on expanding symlinks. In this situation the [http://code.google.com/p/bindfs/ bindfs] FUSE extension can help. It is safer to use than &amp;quot;mount&amp;quot; binds, and you don't have to be root to set them up. As with ''sshfs'' there is a performance penalty so it may not be appropriate in high I/O situations.&lt;br /&gt;
&lt;br /&gt;
== Error: Too many open files ==&lt;br /&gt;
&lt;br /&gt;
When working with long time series and {{cmd|r.series}} starts to complain that files are missing/not readable or the message&lt;br /&gt;
 Too many open files&lt;br /&gt;
&lt;br /&gt;
For a solution, see [[Large_raster_data_processing#Number_of_open_files_limitation]]&lt;br /&gt;
&lt;br /&gt;
== Misc Tips &amp;amp; Tricks ==&lt;br /&gt;
See the poor-man's multi-processing script on the [[Parallelizing Scripts]] wiki page. This approach has been used in the {{AddonCmd|r3.in.xyz}} addon script.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
This Wiki:&lt;br /&gt;
* [[GRASS_and_Shell#Automated_batch_jobs:_Setting_the_GRASS_environmental_variables|GRASS batch jobs]] (by settings env. variables)&lt;br /&gt;
* The [[OpenMP]] wiki page.&lt;br /&gt;
* The [[Parallelizing Scripts]] wiki page.&lt;br /&gt;
* [[GPU]] computing&lt;br /&gt;
&lt;br /&gt;
Elsewhere:&lt;br /&gt;
* [http://gfoss.blogspot.com/2008/11/building-cluster-for-grass-gis-and.html Building a cluster for GRASS GIS and other software from the OSGeo stack]&lt;br /&gt;
* https://research.csc.fi/supercomputers-and-gis&lt;br /&gt;
&lt;br /&gt;
[[Category:Parallelization]]&lt;br /&gt;
[[Category: massive data analysis]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25016</id>
		<title>GRASS and Shell</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25016"/>
		<updated>2018-02-07T17:01:14Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Automated batch jobs: Setting the GRASS environmental variables: update for GRASS7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information about GRASS GIS' own shell setup and use. &lt;br /&gt;
&lt;br /&gt;
For information about scripting for GRASS, please refer to the page [http://grasswiki.osgeo.org/wiki/Shell_scripting Shell scripting].&lt;br /&gt;
&lt;br /&gt;
== Automated batch jobs: Setting the GRASS environmental variables ==&lt;br /&gt;
&lt;br /&gt;
''Main article: [[Working with GRASS without starting it explicitly]]''&lt;br /&gt;
&lt;br /&gt;
This section applies to jobs which shall set the entire GRASS environment.&lt;br /&gt;
You have to set a couple of variables to enable GRASS command to run from outside GRASS:&lt;br /&gt;
&lt;br /&gt;
   # Example in bash shell syntax:&lt;br /&gt;
 &lt;br /&gt;
   # path to GRASS binaries and libraries:&lt;br /&gt;
   export GISBASE=/usr/lib64/grass74&lt;br /&gt;
 &lt;br /&gt;
   export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts&lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib&lt;br /&gt;
   &lt;br /&gt;
   # set PYTHONPATH to include the GRASS Python lib&lt;br /&gt;
   if [ ! &amp;quot;$PYTHONPATH&amp;quot; ] ; then&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python&amp;quot;&lt;br /&gt;
   else&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python:$PYTHONPATH&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
   export PYTHONPATH&lt;br /&gt;
 &lt;br /&gt;
   # use process ID (PID) as lock file number:&lt;br /&gt;
   export GIS_LOCK=$$&lt;br /&gt;
 &lt;br /&gt;
   # settings for graphical output to PNG file (optional)&lt;br /&gt;
   export GRASS_PNGFILE=/tmp/grass6output.png&lt;br /&gt;
   export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
   export GRASS_WIDTH=900&lt;br /&gt;
   export GRASS_HEIGHT=1200&lt;br /&gt;
   export GRASS_PNG_COMPRESSION=1&lt;br /&gt;
   export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with the last used GISDBASE, LOCATION_NAME, and MAPSET&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=$HOME/.grassrc7&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with a different GISDBASE, LOCATION_NAME, and/or MAPSET&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=/tmp/grass7-${USER}-$GIS_LOCK/gisrc&lt;br /&gt;
   # remove any leftover files/folder&lt;br /&gt;
   rm -fr /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
   mkdir /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
   # set GISDBASE, LOCATION_NAME, and/or MAPSET&lt;br /&gt;
   echo &amp;quot;GISDBASE: /path/to/some/grassdata&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   echo &amp;quot;LOCATION_NAME: some_location&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   echo &amp;quot;MAPSET: some_mapset&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
   # start in text mode&lt;br /&gt;
   echo &amp;quot;GRASS_GUI: text&amp;quot; &amp;gt;&amp;gt;$GISRC&lt;br /&gt;
&lt;br /&gt;
The following three settings are only recommended if you will be calling the script from another program - e.g. a PHP web page using system() or exec()&lt;br /&gt;
&lt;br /&gt;
   export HOME=/var/www&lt;br /&gt;
   export USER=www-data&lt;br /&gt;
   export GROUP=www-data&lt;br /&gt;
&lt;br /&gt;
Now you can test:&lt;br /&gt;
&lt;br /&gt;
   # this should print the GRASS version used:&lt;br /&gt;
   g.version&lt;br /&gt;
   # check GISDBASE, LOCATION_NAME, and MAPSET&lt;br /&gt;
   g.gisenv&lt;br /&gt;
   # other calculations go here ...&lt;br /&gt;
&lt;br /&gt;
If this works, you can launch other GRASS commands. The approach works within Shell scripts and also in the command line terminal.&lt;br /&gt;
&lt;br /&gt;
When done, you should cleanup internal tmp files like this:&lt;br /&gt;
&lt;br /&gt;
   # run GRASS' cleanup routine&lt;br /&gt;
   $GISBASE/etc/clean_temp&lt;br /&gt;
 &lt;br /&gt;
   # remove session tmp directory:&lt;br /&gt;
   rm -rf /tmp/grass7-${USER}-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changing the prompt:'''&lt;br /&gt;
&lt;br /&gt;
   PS1_BACKUP=&amp;quot;$PS1&amp;quot;&lt;br /&gt;
   export PS1=&amp;quot;GRASS 6&amp;gt; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once you are done, you can set it back (see also next hint about unsetting variables):&lt;br /&gt;
   export PS1=&amp;quot;$PS1_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Unsetting variables after usage:'''&lt;br /&gt;
&lt;br /&gt;
   Using the &amp;quot;unset VARNAME&amp;quot; command you get rid of it:&lt;br /&gt;
   unset GISBASE&lt;br /&gt;
   unset GISRC&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
* GRASS shell script job to generate a [http://grass.fbk.eu/spearfish/php_grass_earthquakes.php Recent Earthquakes Map] (get the [http://grass.fbk.eu/spearfish/grass_earthquakes.sh grass_earthquakes.sh shell script])&lt;br /&gt;
&lt;br /&gt;
=== Parallel GRASS jobs ===&lt;br /&gt;
&lt;br /&gt;
See [[Parallel GRASS jobs]] for Grid Engine, PBS etc.&lt;br /&gt;
&lt;br /&gt;
=== GRASS Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 6.4, there is an alternative method to easily run jobs in GRASS from a collection of commands in a shell script file. Just define the environmental variable GRASS_BATCH_JOB with the shell script file containing GRASS (or whatever) commands, preferably with full path. Then launch GRASS and it will be executed. It is best to launch GRASS in &amp;lt;tt&amp;gt;-text&amp;lt;/tt&amp;gt; mode and to provide gisdbase/location/mapset as parameters. The job script needs executable file permissions (&amp;lt;tt&amp;gt;chmod&amp;lt;/tt&amp;gt; on Unix). In order to get readable percentage output during the processing (0..2..4... 100%), we set the environment variable GRASS_MESSAGE_FORMAT to &amp;quot;plain&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#### 1) PREPARATION&lt;br /&gt;
# First we generate a script which contains the command(s) to be executed:&lt;br /&gt;
# for convenience, we save the file in our HOME directory&lt;br /&gt;
## You may use also a text editor for this, here we use the &amp;quot;echo&amp;quot; shell command&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
# set computational region, here: UTM32N coordinates&lt;br /&gt;
g.region n=4900000 s=4800000 w=700000 e=800000 res=100&lt;br /&gt;
v.random mymap3000 n=3000&lt;br /&gt;
v.out.ogr input=mymap3000 output=mymap3000.shp&amp;quot; &amp;gt; $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# verify the content of the file&lt;br /&gt;
cat $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# make it user executable (this is important, use 'chmod' or via file manager)&lt;br /&gt;
chmod u+x $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# create a directory (may be elsewhere) to hold the location used for processing&lt;br /&gt;
mkdir -p $HOME/grassdata&lt;br /&gt;
&lt;br /&gt;
# create new temporary location for the job, exit after creation of this location&lt;br /&gt;
grass70 -c epsg:32632 $HOME/grassdata/mytemploc_utm32n -e&lt;br /&gt;
&lt;br /&gt;
#### 2) USING THE BATCH JOB&lt;br /&gt;
# define job file as environmental variable&lt;br /&gt;
export GRASS_BATCH_JOB=&amp;quot;$HOME/my_grassjob.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# now we can use this new location and run the job defined via GRASS_BATCH_JOB&lt;br /&gt;
grass70 $HOME/grassdata/mytemploc_utm32n/PERMANENT&lt;br /&gt;
&lt;br /&gt;
#### 3) CLEANUP&lt;br /&gt;
# switch back to interactive mode, for the next GRASS GIS session&lt;br /&gt;
unset GRASS_BATCH_JOB&lt;br /&gt;
&lt;br /&gt;
# delete temporary location (consider to export results first in your batch job)&lt;br /&gt;
rm -rf $HOME/grassdata/mytemploc_utm32n&lt;br /&gt;
&lt;br /&gt;
# Now you can use the resulting SHAPE file &amp;quot;mymap3000.shp&amp;quot; elsewhere.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass70 command starts GRASS in the given mapset, executes the contents of the job file and leaves GRASS. Since the normal startup/closure is used, all internal tmp files are properly removed.&lt;br /&gt;
&lt;br /&gt;
Note: The $HOME variable (or the ~ shortcut) cannot be used in the batch job itself since the variables are not available here.&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
* Another set of GRASS shell scripts to run the job to generate another version of the [http://adhoc.osgeo.osuosl.org/grass/alternate_projections/earthquakes_wintri.png Recent Earthquakes Map] (find the setup files in the [https://trac.osgeo.org/grass/browser/grass-promo/tutorials/batch_processing &amp;quot;batch_processing&amp;quot; tutorials section] of the GRASS SVN)&lt;br /&gt;
&lt;br /&gt;
=== Unattended execution ===&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|GNU_Screen}} is another ''extremely'' valuable tool if you need to detatch and leave long-running processes unattended. It is well worth your time to learn how to use it if you run scripts on remote systems. There are many good tutorials on the web.&lt;br /&gt;
: Usage:&lt;br /&gt;
:: Run &amp;quot;screen&amp;quot; in the terminal. You will reach again the command line but now in screen mode. Now start GRASS. &lt;br /&gt;
::: - To disconnect from the session press Control-A, Control-D.&lt;br /&gt;
::: - To list your screens type &amp;quot;screen -ls&amp;quot; (to find it back)&lt;br /&gt;
::: - To reconnect with a disconnected screen run &amp;quot;screen -r [identifier]&amp;quot; (the &amp;quot;identifier&amp;quot; you need only if you have several screens running)&lt;br /&gt;
:: Enjoy.&lt;br /&gt;
&lt;br /&gt;
* Along with the &amp;quot;{{wikipedia|nohup}}&amp;quot; (no hang-up) command you can login to your machine, launch the job and leave the machine again. &lt;br /&gt;
The process will continue after you logged off when you start it with nohup:&lt;br /&gt;
        nohup grass64 ~/grassdata/spearfish60/neteler/ &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Receive a notification when finished ===&lt;br /&gt;
&lt;br /&gt;
Maybe put email notification at the end of 'my_grassjob.sh' using the &amp;quot;mail&amp;quot; or the &amp;quot;mutt&amp;quot; program, for example like this:&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;Finished at `date`&amp;quot; &amp;gt; /tmp/done.txt &amp;amp;&amp;amp; \&lt;br /&gt;
        EDITOR=touch mutt -s &amp;quot;Job done&amp;quot; \&lt;br /&gt;
        me@mydomain.org &amp;lt; /tmp/done.txt &amp;amp;&amp;amp; rm -f /tmp/done.txt&lt;br /&gt;
&lt;br /&gt;
or like this:&lt;br /&gt;
        mail -s &amp;quot;GRASS job $0 finished&amp;quot; me@mydomain.org &amp;lt;&amp;lt;EOF&lt;br /&gt;
          GRASS GIS has finished the batch job $0&lt;br /&gt;
        EOF&lt;br /&gt;
&lt;br /&gt;
or simply like this:&lt;br /&gt;
        echo &amp;quot;GRASS GIS has finished the batch job $0&amp;quot; | mail -s &amp;quot;GRASS job finished&amp;quot; me@mydomain.org&lt;br /&gt;
&lt;br /&gt;
== Stupid pet tricks (don't use them!) ==&lt;br /&gt;
&lt;br /&gt;
Note: This is highly discouraged. Keep fingers off from manually modifying the content of a GRASS GIS mapset (at least don't complain if you break things).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;;Quick cd to the MAPSET directory&lt;br /&gt;
To make a quick little function called 'g.cd' to change into the mapset dir, add this to &amp;lt;tt&amp;gt;~/.grass.bashrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.cd()&lt;br /&gt;
{&lt;br /&gt;
  MAPSET=`g.gisenv get=MAPSET`&lt;br /&gt;
  LOCATION_NAME=`g.gisenv get=LOCATION_NAME`&lt;br /&gt;
  GISDBASE=`g.gisenv get=GISDBASE`&lt;br /&gt;
  LOCATION=&amp;quot;$GISDBASE/$LOCATION_NAME/$MAPSET&amp;quot;&lt;br /&gt;
  cd &amp;quot;$LOCATION/$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that you can also do like: &amp;quot;&amp;lt;tt&amp;gt;g.cd colr/&amp;lt;/tt&amp;gt;&amp;quot; to get to the color tables directory, or &amp;quot;&amp;lt;tt&amp;gt;g.cd ..&amp;lt;/tt&amp;gt;&amp;quot; to get to the LOCATION directory.&lt;br /&gt;
&lt;br /&gt;
Another method would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  alias g.home='cd `dirname &amp;quot;$HISTFILE&amp;quot;`'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Simpler command completion from command history&lt;br /&gt;
&lt;br /&gt;
Add this to a file called &amp;lt;tt&amp;gt;~/.inputrc&amp;lt;/tt&amp;gt; in your home dir:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
set prefer-visible-bell&lt;br /&gt;
&lt;br /&gt;
# -------- Bind page up/down wih history search ---------&lt;br /&gt;
&amp;quot;\e[5~&amp;quot;: history-search-backward&lt;br /&gt;
&amp;quot;\e[6~&amp;quot;: history-search-forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can type a bit of a command and use PgUp and PgDn to cycle through the command history which matches in a way less clumsy that Ctrl-r. Also it tells to make the shell flash on alarm instead of sending a beep to the speaker (making tab-completion compatible with your office mates).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Generic Shell script tutorials:&lt;br /&gt;
* [http://tldp.org/LDP/abs/abs-guide.pdf Advance bash-scripting guide]&lt;br /&gt;
* [http://www.linuxconfig.org/Bash_scripting_Tutorial Bash scripting Tutorial]&lt;br /&gt;
&lt;br /&gt;
GRASS Shell script tutorials:&lt;br /&gt;
* [http://www.grassbook.org/examples_menu3rd.php GRASS Book script examples]&lt;br /&gt;
* [http://www.grassbook.org/unix_commands_table.php List of important UNIX system commands]&lt;br /&gt;
&lt;br /&gt;
Misc:&lt;br /&gt;
* [[Script portability]]&lt;br /&gt;
* Other GRASS environment {{cmd|variables}}&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[Working with GRASS without starting it explicitly]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Linking to other languages]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25013</id>
		<title>GRASS and Shell</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25013"/>
		<updated>2018-02-05T13:45:10Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Automated batch jobs: Setting the GRASS environmental variables: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information about GRASS GIS' own shell setup and use. &lt;br /&gt;
&lt;br /&gt;
For information about scripting for GRASS, please refer to the page [http://grasswiki.osgeo.org/wiki/Shell_scripting Shell scripting].&lt;br /&gt;
&lt;br /&gt;
== Automated batch jobs: Setting the GRASS environmental variables ==&lt;br /&gt;
&lt;br /&gt;
''Main article: [[Working with GRASS without starting it explicitly]]''&lt;br /&gt;
&lt;br /&gt;
This section applies to jobs which shall set the entire GRASS environment.&lt;br /&gt;
You have to set a couple of variables to enable GRASS command to run from outside GRASS:&lt;br /&gt;
&lt;br /&gt;
   # Example in bash shell syntax:&lt;br /&gt;
 &lt;br /&gt;
   # path to GRASS binaries and libraries:&lt;br /&gt;
   export GISBASE=/usr/lib64/grass74&lt;br /&gt;
 &lt;br /&gt;
   export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts&lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib&lt;br /&gt;
   &lt;br /&gt;
   # set PYTHONPATH to include the GRASS Python lib&lt;br /&gt;
   if [ ! &amp;quot;$PYTHONPATH&amp;quot; ] ; then&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python&amp;quot;&lt;br /&gt;
   else&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python:$PYTHONPATH&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
   export PYTHONPATH&lt;br /&gt;
&lt;br /&gt;
   # use process ID (PID) as lock file number:&lt;br /&gt;
   export GIS_LOCK=$$&lt;br /&gt;
 &lt;br /&gt;
   # settings for graphical output to PNG file (optional)&lt;br /&gt;
   export GRASS_PNGFILE=/tmp/grass6output.png&lt;br /&gt;
   export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
   export GRASS_WIDTH=900&lt;br /&gt;
   export GRASS_HEIGHT=1200&lt;br /&gt;
   export GRASS_PNG_COMPRESSION=1&lt;br /&gt;
   export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with the last used settings&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=$HOME/.grassrc7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   # The following three settings are only recommended if you will be calling&lt;br /&gt;
   # the script from another program - e.g. a PHP web page using system() or exec()&lt;br /&gt;
   export HOME=/var/www&lt;br /&gt;
   export USER=www-data&lt;br /&gt;
   export GROUP=www-data&lt;br /&gt;
&lt;br /&gt;
Now you can test:&lt;br /&gt;
&lt;br /&gt;
   # this should print the GRASS version used:&lt;br /&gt;
   g.version&lt;br /&gt;
   # other calculations go here ...&lt;br /&gt;
&lt;br /&gt;
You should cleanup internal tmp files like this:&lt;br /&gt;
&lt;br /&gt;
   # run GRASS' cleanup routine&lt;br /&gt;
   $GISBASE/etc/clean_temp&lt;br /&gt;
 &lt;br /&gt;
   # remove session tmp directory:&lt;br /&gt;
   rm -rf /tmp/grass6-$USER-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
If this works, you can launch other GRASS commands. The approach works within Shell scripts and also in the command line terminal.&lt;br /&gt;
&lt;br /&gt;
'''Changing the prompt:'''&lt;br /&gt;
&lt;br /&gt;
   PS1_BACKUP=&amp;quot;$PS1&amp;quot;&lt;br /&gt;
   export PS1=&amp;quot;GRASS 6&amp;gt; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once you are done, you can set it back (see also next hint about unsetting variables):&lt;br /&gt;
   export PS1=&amp;quot;$PS1_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Unsetting variables after usage:'''&lt;br /&gt;
&lt;br /&gt;
   Using the &amp;quot;unset VARNAME&amp;quot; command you get rid of it:&lt;br /&gt;
   unset GISBASE&lt;br /&gt;
   unset GISRC&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
* GRASS shell script job to generate a [http://grass.fbk.eu/spearfish/php_grass_earthquakes.php Recent Earthquakes Map] (get the [http://grass.fbk.eu/spearfish/grass_earthquakes.sh grass_earthquakes.sh shell script])&lt;br /&gt;
&lt;br /&gt;
=== Parallel GRASS jobs ===&lt;br /&gt;
&lt;br /&gt;
See [[Parallel GRASS jobs]] for Grid Engine, PBS etc.&lt;br /&gt;
&lt;br /&gt;
=== GRASS Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 6.4, there is an alternative method to easily run jobs in GRASS from a collection of commands in a shell script file. Just define the environmental variable GRASS_BATCH_JOB with the shell script file containing GRASS (or whatever) commands, preferably with full path. Then launch GRASS and it will be executed. It is best to launch GRASS in &amp;lt;tt&amp;gt;-text&amp;lt;/tt&amp;gt; mode and to provide gisdbase/location/mapset as parameters. The job script needs executable file permissions (&amp;lt;tt&amp;gt;chmod&amp;lt;/tt&amp;gt; on Unix). In order to get readable percentage output during the processing (0..2..4... 100%), we set the environment variable GRASS_MESSAGE_FORMAT to &amp;quot;plain&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#### 1) PREPARATION&lt;br /&gt;
# First we generate a script which contains the command(s) to be executed:&lt;br /&gt;
# for convenience, we save the file in our HOME directory&lt;br /&gt;
## You may use also a text editor for this, here we use the &amp;quot;echo&amp;quot; shell command&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
# set computational region, here: UTM32N coordinates&lt;br /&gt;
g.region n=4900000 s=4800000 w=700000 e=800000 res=100&lt;br /&gt;
v.random mymap3000 n=3000&lt;br /&gt;
v.out.ogr input=mymap3000 output=mymap3000.shp&amp;quot; &amp;gt; $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# verify the content of the file&lt;br /&gt;
cat $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# make it user executable (this is important, use 'chmod' or via file manager)&lt;br /&gt;
chmod u+x $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# create a directory (may be elsewhere) to hold the location used for processing&lt;br /&gt;
mkdir -p $HOME/grassdata&lt;br /&gt;
&lt;br /&gt;
# create new temporary location for the job, exit after creation of this location&lt;br /&gt;
grass70 -c epsg:32632 $HOME/grassdata/mytemploc_utm32n -e&lt;br /&gt;
&lt;br /&gt;
#### 2) USING THE BATCH JOB&lt;br /&gt;
# define job file as environmental variable&lt;br /&gt;
export GRASS_BATCH_JOB=&amp;quot;$HOME/my_grassjob.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# now we can use this new location and run the job defined via GRASS_BATCH_JOB&lt;br /&gt;
grass70 $HOME/grassdata/mytemploc_utm32n/PERMANENT&lt;br /&gt;
&lt;br /&gt;
#### 3) CLEANUP&lt;br /&gt;
# switch back to interactive mode, for the next GRASS GIS session&lt;br /&gt;
unset GRASS_BATCH_JOB&lt;br /&gt;
&lt;br /&gt;
# delete temporary location (consider to export results first in your batch job)&lt;br /&gt;
rm -rf $HOME/grassdata/mytemploc_utm32n&lt;br /&gt;
&lt;br /&gt;
# Now you can use the resulting SHAPE file &amp;quot;mymap3000.shp&amp;quot; elsewhere.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass70 command starts GRASS in the given mapset, executes the contents of the job file and leaves GRASS. Since the normal startup/closure is used, all internal tmp files are properly removed.&lt;br /&gt;
&lt;br /&gt;
Note: The $HOME variable (or the ~ shortcut) cannot be used in the batch job itself since the variables are not available here.&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
* Another set of GRASS shell scripts to run the job to generate another version of the [http://adhoc.osgeo.osuosl.org/grass/alternate_projections/earthquakes_wintri.png Recent Earthquakes Map] (find the setup files in the [https://trac.osgeo.org/grass/browser/grass-promo/tutorials/batch_processing &amp;quot;batch_processing&amp;quot; tutorials section] of the GRASS SVN)&lt;br /&gt;
&lt;br /&gt;
=== Unattended execution ===&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|GNU_Screen}} is another ''extremely'' valuable tool if you need to detatch and leave long-running processes unattended. It is well worth your time to learn how to use it if you run scripts on remote systems. There are many good tutorials on the web.&lt;br /&gt;
: Usage:&lt;br /&gt;
:: Run &amp;quot;screen&amp;quot; in the terminal. You will reach again the command line but now in screen mode. Now start GRASS. &lt;br /&gt;
::: - To disconnect from the session press Control-A, Control-D.&lt;br /&gt;
::: - To list your screens type &amp;quot;screen -ls&amp;quot; (to find it back)&lt;br /&gt;
::: - To reconnect with a disconnected screen run &amp;quot;screen -r [identifier]&amp;quot; (the &amp;quot;identifier&amp;quot; you need only if you have several screens running)&lt;br /&gt;
:: Enjoy.&lt;br /&gt;
&lt;br /&gt;
* Along with the &amp;quot;{{wikipedia|nohup}}&amp;quot; (no hang-up) command you can login to your machine, launch the job and leave the machine again. &lt;br /&gt;
The process will continue after you logged off when you start it with nohup:&lt;br /&gt;
        nohup grass64 ~/grassdata/spearfish60/neteler/ &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Receive a notification when finished ===&lt;br /&gt;
&lt;br /&gt;
Maybe put email notification at the end of 'my_grassjob.sh' using the &amp;quot;mail&amp;quot; or the &amp;quot;mutt&amp;quot; program, for example like this:&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;Finished at `date`&amp;quot; &amp;gt; /tmp/done.txt &amp;amp;&amp;amp; \&lt;br /&gt;
        EDITOR=touch mutt -s &amp;quot;Job done&amp;quot; \&lt;br /&gt;
        me@mydomain.org &amp;lt; /tmp/done.txt &amp;amp;&amp;amp; rm -f /tmp/done.txt&lt;br /&gt;
&lt;br /&gt;
or like this:&lt;br /&gt;
        mail -s &amp;quot;GRASS job $0 finished&amp;quot; me@mydomain.org &amp;lt;&amp;lt;EOF&lt;br /&gt;
          GRASS GIS has finished the batch job $0&lt;br /&gt;
        EOF&lt;br /&gt;
&lt;br /&gt;
or simply like this:&lt;br /&gt;
        echo &amp;quot;GRASS GIS has finished the batch job $0&amp;quot; | mail -s &amp;quot;GRASS job finished&amp;quot; me@mydomain.org&lt;br /&gt;
&lt;br /&gt;
== Stupid pet tricks (don't use them!) ==&lt;br /&gt;
&lt;br /&gt;
Note: This is highly discouraged. Keep fingers off from manually modifying the content of a GRASS GIS mapset (at least don't complain if you break things).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;;Quick cd to the MAPSET directory&lt;br /&gt;
To make a quick little function called 'g.cd' to change into the mapset dir, add this to &amp;lt;tt&amp;gt;~/.grass.bashrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.cd()&lt;br /&gt;
{&lt;br /&gt;
  MAPSET=`g.gisenv get=MAPSET`&lt;br /&gt;
  LOCATION_NAME=`g.gisenv get=LOCATION_NAME`&lt;br /&gt;
  GISDBASE=`g.gisenv get=GISDBASE`&lt;br /&gt;
  LOCATION=&amp;quot;$GISDBASE/$LOCATION_NAME/$MAPSET&amp;quot;&lt;br /&gt;
  cd &amp;quot;$LOCATION/$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that you can also do like: &amp;quot;&amp;lt;tt&amp;gt;g.cd colr/&amp;lt;/tt&amp;gt;&amp;quot; to get to the color tables directory, or &amp;quot;&amp;lt;tt&amp;gt;g.cd ..&amp;lt;/tt&amp;gt;&amp;quot; to get to the LOCATION directory.&lt;br /&gt;
&lt;br /&gt;
Another method would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  alias g.home='cd `dirname &amp;quot;$HISTFILE&amp;quot;`'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Simpler command completion from command history&lt;br /&gt;
&lt;br /&gt;
Add this to a file called &amp;lt;tt&amp;gt;~/.inputrc&amp;lt;/tt&amp;gt; in your home dir:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
set prefer-visible-bell&lt;br /&gt;
&lt;br /&gt;
# -------- Bind page up/down wih history search ---------&lt;br /&gt;
&amp;quot;\e[5~&amp;quot;: history-search-backward&lt;br /&gt;
&amp;quot;\e[6~&amp;quot;: history-search-forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can type a bit of a command and use PgUp and PgDn to cycle through the command history which matches in a way less clumsy that Ctrl-r. Also it tells to make the shell flash on alarm instead of sending a beep to the speaker (making tab-completion compatible with your office mates).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Generic Shell script tutorials:&lt;br /&gt;
* [http://tldp.org/LDP/abs/abs-guide.pdf Advance bash-scripting guide]&lt;br /&gt;
* [http://www.linuxconfig.org/Bash_scripting_Tutorial Bash scripting Tutorial]&lt;br /&gt;
&lt;br /&gt;
GRASS Shell script tutorials:&lt;br /&gt;
* [http://www.grassbook.org/examples_menu3rd.php GRASS Book script examples]&lt;br /&gt;
* [http://www.grassbook.org/unix_commands_table.php List of important UNIX system commands]&lt;br /&gt;
&lt;br /&gt;
Misc:&lt;br /&gt;
* [[Script portability]]&lt;br /&gt;
* Other GRASS environment {{cmd|variables}}&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[Working with GRASS without starting it explicitly]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Linking to other languages]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25012</id>
		<title>GRASS and Shell</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25012"/>
		<updated>2018-02-05T13:43:51Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Automated batch jobs: Setting the GRASS environmental variables: +PYTHONPATH&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information about GRASS GIS' own shell setup and use. &lt;br /&gt;
&lt;br /&gt;
For information about scripting for GRASS, please refer to the page [http://grasswiki.osgeo.org/wiki/Shell_scripting Shell scripting].&lt;br /&gt;
&lt;br /&gt;
== Automated batch jobs: Setting the GRASS environmental variables ==&lt;br /&gt;
&lt;br /&gt;
''Main article: [[Working with GRASS without starting it explicitly]]''&lt;br /&gt;
&lt;br /&gt;
This section applies to jobs which shall set the entire GRASS environment.&lt;br /&gt;
You have to set a couple of variables to enable GRASS command to run from outside GRASS:&lt;br /&gt;
&lt;br /&gt;
   # Example in bash shell syntax:&lt;br /&gt;
 &lt;br /&gt;
   # path to GRASS binaries and libraries:&lt;br /&gt;
   export GISBASE=/usr/lib64/grass74&lt;br /&gt;
 &lt;br /&gt;
   export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts&lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib&lt;br /&gt;
&lt;br /&gt;
   # set PYTHONPATH to include the GRASS Python lib&lt;br /&gt;
   if [ ! &amp;quot;$PYTHONPATH&amp;quot; ] ; then&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python&amp;quot;&lt;br /&gt;
   else&lt;br /&gt;
      PYTHONPATH=&amp;quot;$GISBASE/etc/python:$PYTHONPATH&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
   export PYTHONPATH&lt;br /&gt;
&lt;br /&gt;
   # use process ID (PID) as lock file number:&lt;br /&gt;
   export GIS_LOCK=$$&lt;br /&gt;
 &lt;br /&gt;
   # settings for graphical output to PNG file (optional)&lt;br /&gt;
   export GRASS_PNGFILE=/tmp/grass6output.png&lt;br /&gt;
   export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
   export GRASS_WIDTH=900&lt;br /&gt;
   export GRASS_HEIGHT=1200&lt;br /&gt;
   export GRASS_PNG_COMPRESSION=1&lt;br /&gt;
   export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with the last used settings&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=$HOME/.grassrc7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   # The following three settings are only recommended if you will be calling&lt;br /&gt;
   # the script from another program - e.g. a PHP web page using system() or exec()&lt;br /&gt;
   export HOME=/var/www&lt;br /&gt;
   export USER=www-data&lt;br /&gt;
   export GROUP=www-data&lt;br /&gt;
&lt;br /&gt;
Now you can test:&lt;br /&gt;
&lt;br /&gt;
   # this should print the GRASS version used:&lt;br /&gt;
   g.version&lt;br /&gt;
   # other calculations go here ...&lt;br /&gt;
&lt;br /&gt;
You should cleanup internal tmp files like this:&lt;br /&gt;
&lt;br /&gt;
   # run GRASS' cleanup routine&lt;br /&gt;
   $GISBASE/etc/clean_temp&lt;br /&gt;
 &lt;br /&gt;
   # remove session tmp directory:&lt;br /&gt;
   rm -rf /tmp/grass6-$USER-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
If this works, you can launch other GRASS commands. The approach works within Shell scripts and also in the command line terminal.&lt;br /&gt;
&lt;br /&gt;
'''Changing the prompt:'''&lt;br /&gt;
&lt;br /&gt;
   PS1_BACKUP=&amp;quot;$PS1&amp;quot;&lt;br /&gt;
   export PS1=&amp;quot;GRASS 6&amp;gt; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once you are done, you can set it back (see also next hint about unsetting variables):&lt;br /&gt;
   export PS1=&amp;quot;$PS1_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Unsetting variables after usage:'''&lt;br /&gt;
&lt;br /&gt;
   Using the &amp;quot;unset VARNAME&amp;quot; command you get rid of it:&lt;br /&gt;
   unset GISBASE&lt;br /&gt;
   unset GISRC&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
* GRASS shell script job to generate a [http://grass.fbk.eu/spearfish/php_grass_earthquakes.php Recent Earthquakes Map] (get the [http://grass.fbk.eu/spearfish/grass_earthquakes.sh grass_earthquakes.sh shell script])&lt;br /&gt;
&lt;br /&gt;
=== Parallel GRASS jobs ===&lt;br /&gt;
&lt;br /&gt;
See [[Parallel GRASS jobs]] for Grid Engine, PBS etc.&lt;br /&gt;
&lt;br /&gt;
=== GRASS Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 6.4, there is an alternative method to easily run jobs in GRASS from a collection of commands in a shell script file. Just define the environmental variable GRASS_BATCH_JOB with the shell script file containing GRASS (or whatever) commands, preferably with full path. Then launch GRASS and it will be executed. It is best to launch GRASS in &amp;lt;tt&amp;gt;-text&amp;lt;/tt&amp;gt; mode and to provide gisdbase/location/mapset as parameters. The job script needs executable file permissions (&amp;lt;tt&amp;gt;chmod&amp;lt;/tt&amp;gt; on Unix). In order to get readable percentage output during the processing (0..2..4... 100%), we set the environment variable GRASS_MESSAGE_FORMAT to &amp;quot;plain&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#### 1) PREPARATION&lt;br /&gt;
# First we generate a script which contains the command(s) to be executed:&lt;br /&gt;
# for convenience, we save the file in our HOME directory&lt;br /&gt;
## You may use also a text editor for this, here we use the &amp;quot;echo&amp;quot; shell command&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
# set computational region, here: UTM32N coordinates&lt;br /&gt;
g.region n=4900000 s=4800000 w=700000 e=800000 res=100&lt;br /&gt;
v.random mymap3000 n=3000&lt;br /&gt;
v.out.ogr input=mymap3000 output=mymap3000.shp&amp;quot; &amp;gt; $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# verify the content of the file&lt;br /&gt;
cat $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# make it user executable (this is important, use 'chmod' or via file manager)&lt;br /&gt;
chmod u+x $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# create a directory (may be elsewhere) to hold the location used for processing&lt;br /&gt;
mkdir -p $HOME/grassdata&lt;br /&gt;
&lt;br /&gt;
# create new temporary location for the job, exit after creation of this location&lt;br /&gt;
grass70 -c epsg:32632 $HOME/grassdata/mytemploc_utm32n -e&lt;br /&gt;
&lt;br /&gt;
#### 2) USING THE BATCH JOB&lt;br /&gt;
# define job file as environmental variable&lt;br /&gt;
export GRASS_BATCH_JOB=&amp;quot;$HOME/my_grassjob.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# now we can use this new location and run the job defined via GRASS_BATCH_JOB&lt;br /&gt;
grass70 $HOME/grassdata/mytemploc_utm32n/PERMANENT&lt;br /&gt;
&lt;br /&gt;
#### 3) CLEANUP&lt;br /&gt;
# switch back to interactive mode, for the next GRASS GIS session&lt;br /&gt;
unset GRASS_BATCH_JOB&lt;br /&gt;
&lt;br /&gt;
# delete temporary location (consider to export results first in your batch job)&lt;br /&gt;
rm -rf $HOME/grassdata/mytemploc_utm32n&lt;br /&gt;
&lt;br /&gt;
# Now you can use the resulting SHAPE file &amp;quot;mymap3000.shp&amp;quot; elsewhere.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass70 command starts GRASS in the given mapset, executes the contents of the job file and leaves GRASS. Since the normal startup/closure is used, all internal tmp files are properly removed.&lt;br /&gt;
&lt;br /&gt;
Note: The $HOME variable (or the ~ shortcut) cannot be used in the batch job itself since the variables are not available here.&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
* Another set of GRASS shell scripts to run the job to generate another version of the [http://adhoc.osgeo.osuosl.org/grass/alternate_projections/earthquakes_wintri.png Recent Earthquakes Map] (find the setup files in the [https://trac.osgeo.org/grass/browser/grass-promo/tutorials/batch_processing &amp;quot;batch_processing&amp;quot; tutorials section] of the GRASS SVN)&lt;br /&gt;
&lt;br /&gt;
=== Unattended execution ===&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|GNU_Screen}} is another ''extremely'' valuable tool if you need to detatch and leave long-running processes unattended. It is well worth your time to learn how to use it if you run scripts on remote systems. There are many good tutorials on the web.&lt;br /&gt;
: Usage:&lt;br /&gt;
:: Run &amp;quot;screen&amp;quot; in the terminal. You will reach again the command line but now in screen mode. Now start GRASS. &lt;br /&gt;
::: - To disconnect from the session press Control-A, Control-D.&lt;br /&gt;
::: - To list your screens type &amp;quot;screen -ls&amp;quot; (to find it back)&lt;br /&gt;
::: - To reconnect with a disconnected screen run &amp;quot;screen -r [identifier]&amp;quot; (the &amp;quot;identifier&amp;quot; you need only if you have several screens running)&lt;br /&gt;
:: Enjoy.&lt;br /&gt;
&lt;br /&gt;
* Along with the &amp;quot;{{wikipedia|nohup}}&amp;quot; (no hang-up) command you can login to your machine, launch the job and leave the machine again. &lt;br /&gt;
The process will continue after you logged off when you start it with nohup:&lt;br /&gt;
        nohup grass64 ~/grassdata/spearfish60/neteler/ &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Receive a notification when finished ===&lt;br /&gt;
&lt;br /&gt;
Maybe put email notification at the end of 'my_grassjob.sh' using the &amp;quot;mail&amp;quot; or the &amp;quot;mutt&amp;quot; program, for example like this:&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;Finished at `date`&amp;quot; &amp;gt; /tmp/done.txt &amp;amp;&amp;amp; \&lt;br /&gt;
        EDITOR=touch mutt -s &amp;quot;Job done&amp;quot; \&lt;br /&gt;
        me@mydomain.org &amp;lt; /tmp/done.txt &amp;amp;&amp;amp; rm -f /tmp/done.txt&lt;br /&gt;
&lt;br /&gt;
or like this:&lt;br /&gt;
        mail -s &amp;quot;GRASS job $0 finished&amp;quot; me@mydomain.org &amp;lt;&amp;lt;EOF&lt;br /&gt;
          GRASS GIS has finished the batch job $0&lt;br /&gt;
        EOF&lt;br /&gt;
&lt;br /&gt;
or simply like this:&lt;br /&gt;
        echo &amp;quot;GRASS GIS has finished the batch job $0&amp;quot; | mail -s &amp;quot;GRASS job finished&amp;quot; me@mydomain.org&lt;br /&gt;
&lt;br /&gt;
== Stupid pet tricks (don't use them!) ==&lt;br /&gt;
&lt;br /&gt;
Note: This is highly discouraged. Keep fingers off from manually modifying the content of a GRASS GIS mapset (at least don't complain if you break things).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;;Quick cd to the MAPSET directory&lt;br /&gt;
To make a quick little function called 'g.cd' to change into the mapset dir, add this to &amp;lt;tt&amp;gt;~/.grass.bashrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.cd()&lt;br /&gt;
{&lt;br /&gt;
  MAPSET=`g.gisenv get=MAPSET`&lt;br /&gt;
  LOCATION_NAME=`g.gisenv get=LOCATION_NAME`&lt;br /&gt;
  GISDBASE=`g.gisenv get=GISDBASE`&lt;br /&gt;
  LOCATION=&amp;quot;$GISDBASE/$LOCATION_NAME/$MAPSET&amp;quot;&lt;br /&gt;
  cd &amp;quot;$LOCATION/$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that you can also do like: &amp;quot;&amp;lt;tt&amp;gt;g.cd colr/&amp;lt;/tt&amp;gt;&amp;quot; to get to the color tables directory, or &amp;quot;&amp;lt;tt&amp;gt;g.cd ..&amp;lt;/tt&amp;gt;&amp;quot; to get to the LOCATION directory.&lt;br /&gt;
&lt;br /&gt;
Another method would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  alias g.home='cd `dirname &amp;quot;$HISTFILE&amp;quot;`'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Simpler command completion from command history&lt;br /&gt;
&lt;br /&gt;
Add this to a file called &amp;lt;tt&amp;gt;~/.inputrc&amp;lt;/tt&amp;gt; in your home dir:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
set prefer-visible-bell&lt;br /&gt;
&lt;br /&gt;
# -------- Bind page up/down wih history search ---------&lt;br /&gt;
&amp;quot;\e[5~&amp;quot;: history-search-backward&lt;br /&gt;
&amp;quot;\e[6~&amp;quot;: history-search-forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can type a bit of a command and use PgUp and PgDn to cycle through the command history which matches in a way less clumsy that Ctrl-r. Also it tells to make the shell flash on alarm instead of sending a beep to the speaker (making tab-completion compatible with your office mates).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Generic Shell script tutorials:&lt;br /&gt;
* [http://tldp.org/LDP/abs/abs-guide.pdf Advance bash-scripting guide]&lt;br /&gt;
* [http://www.linuxconfig.org/Bash_scripting_Tutorial Bash scripting Tutorial]&lt;br /&gt;
&lt;br /&gt;
GRASS Shell script tutorials:&lt;br /&gt;
* [http://www.grassbook.org/examples_menu3rd.php GRASS Book script examples]&lt;br /&gt;
* [http://www.grassbook.org/unix_commands_table.php List of important UNIX system commands]&lt;br /&gt;
&lt;br /&gt;
Misc:&lt;br /&gt;
* [[Script portability]]&lt;br /&gt;
* Other GRASS environment {{cmd|variables}}&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[Working with GRASS without starting it explicitly]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Linking to other languages]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25011</id>
		<title>GRASS and Shell</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_and_Shell&amp;diff=25011"/>
		<updated>2018-02-05T13:41:37Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Update Automated batch jobs: Setting the GRASS environmental variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information about GRASS GIS' own shell setup and use. &lt;br /&gt;
&lt;br /&gt;
For information about scripting for GRASS, please refer to the page [http://grasswiki.osgeo.org/wiki/Shell_scripting Shell scripting].&lt;br /&gt;
&lt;br /&gt;
== Automated batch jobs: Setting the GRASS environmental variables ==&lt;br /&gt;
&lt;br /&gt;
''Main article: [[Working with GRASS without starting it explicitly]]''&lt;br /&gt;
&lt;br /&gt;
This section applies to jobs which shall set the entire GRASS environment.&lt;br /&gt;
You have to set a couple of variables to enable GRASS command to run from outside GRASS:&lt;br /&gt;
&lt;br /&gt;
   # Example in bash shell syntax:&lt;br /&gt;
 &lt;br /&gt;
   # path to GRASS binaries and libraries:&lt;br /&gt;
   export GISBASE=/usr/lib64/grass74&lt;br /&gt;
 &lt;br /&gt;
   export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts&lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib&lt;br /&gt;
 &lt;br /&gt;
   # use process ID (PID) as lock file number:&lt;br /&gt;
   export GIS_LOCK=$$&lt;br /&gt;
 &lt;br /&gt;
   # settings for graphical output to PNG file (optional)&lt;br /&gt;
   export GRASS_PNGFILE=/tmp/grass6output.png&lt;br /&gt;
   export GRASS_TRUECOLOR=TRUE&lt;br /&gt;
   export GRASS_WIDTH=900&lt;br /&gt;
   export GRASS_HEIGHT=1200&lt;br /&gt;
   export GRASS_PNG_COMPRESSION=1&lt;br /&gt;
   export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
&lt;br /&gt;
Define a GRASS session with the last used settings&lt;br /&gt;
&lt;br /&gt;
   # path to GRASS settings file&lt;br /&gt;
   export GISRC=$HOME/.grassrc7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   # The following three settings are only recommended if you will be calling&lt;br /&gt;
   # the script from another program - e.g. a PHP web page using system() or exec()&lt;br /&gt;
   export HOME=/var/www&lt;br /&gt;
   export USER=www-data&lt;br /&gt;
   export GROUP=www-data&lt;br /&gt;
&lt;br /&gt;
Now you can test:&lt;br /&gt;
&lt;br /&gt;
   # this should print the GRASS version used:&lt;br /&gt;
   g.version&lt;br /&gt;
   # other calculations go here ...&lt;br /&gt;
&lt;br /&gt;
You should cleanup internal tmp files like this:&lt;br /&gt;
&lt;br /&gt;
   # run GRASS' cleanup routine&lt;br /&gt;
   $GISBASE/etc/clean_temp&lt;br /&gt;
 &lt;br /&gt;
   # remove session tmp directory:&lt;br /&gt;
   rm -rf /tmp/grass6-$USER-$GIS_LOCK&lt;br /&gt;
&lt;br /&gt;
If this works, you can launch other GRASS commands. The approach works within Shell scripts and also in the command line terminal.&lt;br /&gt;
&lt;br /&gt;
'''Changing the prompt:'''&lt;br /&gt;
&lt;br /&gt;
   PS1_BACKUP=&amp;quot;$PS1&amp;quot;&lt;br /&gt;
   export PS1=&amp;quot;GRASS 6&amp;gt; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once you are done, you can set it back (see also next hint about unsetting variables):&lt;br /&gt;
   export PS1=&amp;quot;$PS1_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Unsetting variables after usage:'''&lt;br /&gt;
&lt;br /&gt;
   Using the &amp;quot;unset VARNAME&amp;quot; command you get rid of it:&lt;br /&gt;
   unset GISBASE&lt;br /&gt;
   unset GISRC&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
* GRASS shell script job to generate a [http://grass.fbk.eu/spearfish/php_grass_earthquakes.php Recent Earthquakes Map] (get the [http://grass.fbk.eu/spearfish/grass_earthquakes.sh grass_earthquakes.sh shell script])&lt;br /&gt;
&lt;br /&gt;
=== Parallel GRASS jobs ===&lt;br /&gt;
&lt;br /&gt;
See [[Parallel GRASS jobs]] for Grid Engine, PBS etc.&lt;br /&gt;
&lt;br /&gt;
=== GRASS Batch jobs ===&lt;br /&gt;
&lt;br /&gt;
Since GRASS GIS 6.4, there is an alternative method to easily run jobs in GRASS from a collection of commands in a shell script file. Just define the environmental variable GRASS_BATCH_JOB with the shell script file containing GRASS (or whatever) commands, preferably with full path. Then launch GRASS and it will be executed. It is best to launch GRASS in &amp;lt;tt&amp;gt;-text&amp;lt;/tt&amp;gt; mode and to provide gisdbase/location/mapset as parameters. The job script needs executable file permissions (&amp;lt;tt&amp;gt;chmod&amp;lt;/tt&amp;gt; on Unix). In order to get readable percentage output during the processing (0..2..4... 100%), we set the environment variable GRASS_MESSAGE_FORMAT to &amp;quot;plain&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#### 1) PREPARATION&lt;br /&gt;
# First we generate a script which contains the command(s) to be executed:&lt;br /&gt;
# for convenience, we save the file in our HOME directory&lt;br /&gt;
## You may use also a text editor for this, here we use the &amp;quot;echo&amp;quot; shell command&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;export GRASS_MESSAGE_FORMAT=plain&lt;br /&gt;
# set computational region, here: UTM32N coordinates&lt;br /&gt;
g.region n=4900000 s=4800000 w=700000 e=800000 res=100&lt;br /&gt;
v.random mymap3000 n=3000&lt;br /&gt;
v.out.ogr input=mymap3000 output=mymap3000.shp&amp;quot; &amp;gt; $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# verify the content of the file&lt;br /&gt;
cat $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# make it user executable (this is important, use 'chmod' or via file manager)&lt;br /&gt;
chmod u+x $HOME/my_grassjob.sh&lt;br /&gt;
&lt;br /&gt;
# create a directory (may be elsewhere) to hold the location used for processing&lt;br /&gt;
mkdir -p $HOME/grassdata&lt;br /&gt;
&lt;br /&gt;
# create new temporary location for the job, exit after creation of this location&lt;br /&gt;
grass70 -c epsg:32632 $HOME/grassdata/mytemploc_utm32n -e&lt;br /&gt;
&lt;br /&gt;
#### 2) USING THE BATCH JOB&lt;br /&gt;
# define job file as environmental variable&lt;br /&gt;
export GRASS_BATCH_JOB=&amp;quot;$HOME/my_grassjob.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# now we can use this new location and run the job defined via GRASS_BATCH_JOB&lt;br /&gt;
grass70 $HOME/grassdata/mytemploc_utm32n/PERMANENT&lt;br /&gt;
&lt;br /&gt;
#### 3) CLEANUP&lt;br /&gt;
# switch back to interactive mode, for the next GRASS GIS session&lt;br /&gt;
unset GRASS_BATCH_JOB&lt;br /&gt;
&lt;br /&gt;
# delete temporary location (consider to export results first in your batch job)&lt;br /&gt;
rm -rf $HOME/grassdata/mytemploc_utm32n&lt;br /&gt;
&lt;br /&gt;
# Now you can use the resulting SHAPE file &amp;quot;mymap3000.shp&amp;quot; elsewhere.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The grass70 command starts GRASS in the given mapset, executes the contents of the job file and leaves GRASS. Since the normal startup/closure is used, all internal tmp files are properly removed.&lt;br /&gt;
&lt;br /&gt;
Note: The $HOME variable (or the ~ shortcut) cannot be used in the batch job itself since the variables are not available here.&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
* Another set of GRASS shell scripts to run the job to generate another version of the [http://adhoc.osgeo.osuosl.org/grass/alternate_projections/earthquakes_wintri.png Recent Earthquakes Map] (find the setup files in the [https://trac.osgeo.org/grass/browser/grass-promo/tutorials/batch_processing &amp;quot;batch_processing&amp;quot; tutorials section] of the GRASS SVN)&lt;br /&gt;
&lt;br /&gt;
=== Unattended execution ===&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|GNU_Screen}} is another ''extremely'' valuable tool if you need to detatch and leave long-running processes unattended. It is well worth your time to learn how to use it if you run scripts on remote systems. There are many good tutorials on the web.&lt;br /&gt;
: Usage:&lt;br /&gt;
:: Run &amp;quot;screen&amp;quot; in the terminal. You will reach again the command line but now in screen mode. Now start GRASS. &lt;br /&gt;
::: - To disconnect from the session press Control-A, Control-D.&lt;br /&gt;
::: - To list your screens type &amp;quot;screen -ls&amp;quot; (to find it back)&lt;br /&gt;
::: - To reconnect with a disconnected screen run &amp;quot;screen -r [identifier]&amp;quot; (the &amp;quot;identifier&amp;quot; you need only if you have several screens running)&lt;br /&gt;
:: Enjoy.&lt;br /&gt;
&lt;br /&gt;
* Along with the &amp;quot;{{wikipedia|nohup}}&amp;quot; (no hang-up) command you can login to your machine, launch the job and leave the machine again. &lt;br /&gt;
The process will continue after you logged off when you start it with nohup:&lt;br /&gt;
        nohup grass64 ~/grassdata/spearfish60/neteler/ &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Receive a notification when finished ===&lt;br /&gt;
&lt;br /&gt;
Maybe put email notification at the end of 'my_grassjob.sh' using the &amp;quot;mail&amp;quot; or the &amp;quot;mutt&amp;quot; program, for example like this:&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;Finished at `date`&amp;quot; &amp;gt; /tmp/done.txt &amp;amp;&amp;amp; \&lt;br /&gt;
        EDITOR=touch mutt -s &amp;quot;Job done&amp;quot; \&lt;br /&gt;
        me@mydomain.org &amp;lt; /tmp/done.txt &amp;amp;&amp;amp; rm -f /tmp/done.txt&lt;br /&gt;
&lt;br /&gt;
or like this:&lt;br /&gt;
        mail -s &amp;quot;GRASS job $0 finished&amp;quot; me@mydomain.org &amp;lt;&amp;lt;EOF&lt;br /&gt;
          GRASS GIS has finished the batch job $0&lt;br /&gt;
        EOF&lt;br /&gt;
&lt;br /&gt;
or simply like this:&lt;br /&gt;
        echo &amp;quot;GRASS GIS has finished the batch job $0&amp;quot; | mail -s &amp;quot;GRASS job finished&amp;quot; me@mydomain.org&lt;br /&gt;
&lt;br /&gt;
== Stupid pet tricks (don't use them!) ==&lt;br /&gt;
&lt;br /&gt;
Note: This is highly discouraged. Keep fingers off from manually modifying the content of a GRASS GIS mapset (at least don't complain if you break things).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;;Quick cd to the MAPSET directory&lt;br /&gt;
To make a quick little function called 'g.cd' to change into the mapset dir, add this to &amp;lt;tt&amp;gt;~/.grass.bashrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.cd()&lt;br /&gt;
{&lt;br /&gt;
  MAPSET=`g.gisenv get=MAPSET`&lt;br /&gt;
  LOCATION_NAME=`g.gisenv get=LOCATION_NAME`&lt;br /&gt;
  GISDBASE=`g.gisenv get=GISDBASE`&lt;br /&gt;
  LOCATION=&amp;quot;$GISDBASE/$LOCATION_NAME/$MAPSET&amp;quot;&lt;br /&gt;
  cd &amp;quot;$LOCATION/$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that you can also do like: &amp;quot;&amp;lt;tt&amp;gt;g.cd colr/&amp;lt;/tt&amp;gt;&amp;quot; to get to the color tables directory, or &amp;quot;&amp;lt;tt&amp;gt;g.cd ..&amp;lt;/tt&amp;gt;&amp;quot; to get to the LOCATION directory.&lt;br /&gt;
&lt;br /&gt;
Another method would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  alias g.home='cd `dirname &amp;quot;$HISTFILE&amp;quot;`'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Simpler command completion from command history&lt;br /&gt;
&lt;br /&gt;
Add this to a file called &amp;lt;tt&amp;gt;~/.inputrc&amp;lt;/tt&amp;gt; in your home dir:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
set prefer-visible-bell&lt;br /&gt;
&lt;br /&gt;
# -------- Bind page up/down wih history search ---------&lt;br /&gt;
&amp;quot;\e[5~&amp;quot;: history-search-backward&lt;br /&gt;
&amp;quot;\e[6~&amp;quot;: history-search-forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can type a bit of a command and use PgUp and PgDn to cycle through the command history which matches in a way less clumsy that Ctrl-r. Also it tells to make the shell flash on alarm instead of sending a beep to the speaker (making tab-completion compatible with your office mates).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Generic Shell script tutorials:&lt;br /&gt;
* [http://tldp.org/LDP/abs/abs-guide.pdf Advance bash-scripting guide]&lt;br /&gt;
* [http://www.linuxconfig.org/Bash_scripting_Tutorial Bash scripting Tutorial]&lt;br /&gt;
&lt;br /&gt;
GRASS Shell script tutorials:&lt;br /&gt;
* [http://www.grassbook.org/examples_menu3rd.php GRASS Book script examples]&lt;br /&gt;
* [http://www.grassbook.org/unix_commands_table.php List of important UNIX system commands]&lt;br /&gt;
&lt;br /&gt;
Misc:&lt;br /&gt;
* [[Script portability]]&lt;br /&gt;
* Other GRASS environment {{cmd|variables}}&lt;br /&gt;
* [[GRASS and Python]]&lt;br /&gt;
* [[Working with GRASS without starting it explicitly]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Linking to other languages]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Bonn_2018&amp;diff=25004</id>
		<title>GRASS GIS Community Sprint Bonn 2018</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Bonn_2018&amp;diff=25004"/>
		<updated>2018-01-27T22:27:02Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* +Metz In person */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{toc|right}}&lt;br /&gt;
&lt;br /&gt;
The '''GRASS GIS community''' will join the general '''OSGeo Code Sprint''' at BaseCamp in Bonn, following the annual FOSSGIS conference (German Speaking OSGeo Local Chapter conference in Bonn, Germany)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:GRASS_GIS_Code_Sprint_2018.png|320px]] &lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timing, Venue  ==&lt;br /&gt;
&lt;br /&gt;
OSGeo Code Sprint: '''March 18 - 25, 2018 at BaseCamp. Bonn, Germany'''.&lt;br /&gt;
&lt;br /&gt;
== Sponsors ==&lt;br /&gt;
&lt;br /&gt;
Please check more info on the Bonn Code Sprint 2018 [https://wiki.osgeo.org/wiki/OSGeo_Code_Sprint_2018 here].&lt;br /&gt;
&lt;br /&gt;
We also welcome direct '''financial contributions''' to help reducing travelling and accommodation expenses for GRASS developers with far arrival If you are interested to sponsor the GRASS Community Sprint, please read about&lt;br /&gt;
&lt;br /&gt;
:::'''sponsoring the GRASS project''' at '''[http://grass.osgeo.org/donations http://grass.osgeo.org/donations]'''&lt;br /&gt;
&lt;br /&gt;
Note that it is also possible to &amp;lt;b&amp;gt;buy a round of beer for the developers with a quick click&amp;lt;/b&amp;gt; using the PayPal &amp;quot;Buy [pizza/beer/...] Now&amp;quot; button [[Image:Btn_donate_SM.gif|center|link=http://grass.osgeo.org/donations/]]&lt;br /&gt;
&lt;br /&gt;
For any questions, please contact [[User:Neteler|Markus Neteler]] &amp;lt;tt&amp;gt;&amp;lt;neteler at osgeo.org&amp;gt;&amp;lt;/tt&amp;gt;. Any surplus at the end of the event will be turned over to the GRASS GIS project.&lt;br /&gt;
&lt;br /&gt;
This GRASS GIS Community Sprint is a great occasion for you to support the development of GRASS. With your contribution you'll enable more developers to meet. The community sprint is an important opportunity for the GRASS developers to discuss and collaboratively resolve bugs, plan the direction for the project and work on new features. Please see below for the more detailed agenda. The developers and contributors are donating their valuable time, so it would be great if in-kind funding can be made available from within the community to cover out-of-pocket expenses. All of the work that takes place at the community sprint will be directly contributed back into the GRASS project to the benefit of everyone who uses it.&lt;br /&gt;
This Bonn event is especially interesting since '''important OSGeo projects come together'''!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agenda - What we plan to do ==&lt;br /&gt;
&lt;br /&gt;
=== Move to Git ===&lt;br /&gt;
&lt;br /&gt;
* Choose among different options: OSGeo Git, Github, GitLab&lt;br /&gt;
* Participants are invited to study Git in advance :-)&lt;br /&gt;
&lt;br /&gt;
=== New website ===&lt;br /&gt;
&lt;br /&gt;
* Choose among different options: Wordpress, Sphinx, ... ?&lt;br /&gt;
&lt;br /&gt;
=== Port wxGUI to wxPython 4 ===&lt;br /&gt;
&lt;br /&gt;
* Finish porting wxGUI code to the new wxPython 4&lt;br /&gt;
* It also includes porting code to Python 3&lt;br /&gt;
&lt;br /&gt;
=== Finish complete Python 3 support === &lt;br /&gt;
&lt;br /&gt;
* Includes also wxGUI support for wxPython 4&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
== Planned participation ==&lt;br /&gt;
&lt;br /&gt;
For organizational reasons, please '''additionally register''' at: https://wiki.osgeo.org/wiki/OSGeo_Code_Sprint_2018#Participants  &amp;lt;&amp;lt;--- important!&lt;br /&gt;
&lt;br /&gt;
=== In person ===&lt;br /&gt;
&lt;br /&gt;
Please add your name here or contact [[User:Lucadelu|Luca Delucchi]] &amp;lt;tt&amp;gt;&amp;lt;lucadeluge at gmail com&amp;gt;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|width=100px|'''Arrival'''&lt;br /&gt;
|width=100px|'''Departure'''&lt;br /&gt;
|'''Topic'''&lt;br /&gt;
|width=75px|'''T-Shirt'''&lt;br /&gt;
|'''Notes'''&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|[[User:Neteler|Markus Neteler]]&lt;br /&gt;
|Germany&lt;br /&gt;
|18.3.&lt;br /&gt;
|25.3.&lt;br /&gt;
|Migration to git discussion, GRASS GIS 8&lt;br /&gt;
|M&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|[[User:Ychemin|Yann Chemin]]&lt;br /&gt;
|France&lt;br /&gt;
|18.3.&lt;br /&gt;
|25.3.&lt;br /&gt;
|ISIS-GRASS, Planetary projections, i.ortho.photo, bundle blocks, GRASS GIS 8&lt;br /&gt;
|XL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|[[User:Landa|Martin Landa]]&lt;br /&gt;
|Czech Republic&lt;br /&gt;
|18.3.&lt;br /&gt;
|25.3.&lt;br /&gt;
|Migration to git discussion, website discussion, GRASS GIS 8&lt;br /&gt;
|L&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Stefan Blumentrath&lt;br /&gt;
|Germany/Norway&lt;br /&gt;
|??.??.&lt;br /&gt;
|25.3.&lt;br /&gt;
|Flexible&lt;br /&gt;
|L&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|[[User:Veroandreo|Veronica Andreo]]&lt;br /&gt;
|Argentina/Netherlands&lt;br /&gt;
|18.3&lt;br /&gt;
|??.??&lt;br /&gt;
|TGRASS, Documentation, website discussion&lt;br /&gt;
|S&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|[[User:Lucadelu|Luca Delucchi]]&lt;br /&gt;
|Italy&lt;br /&gt;
|18.3&lt;br /&gt;
|??.??&lt;br /&gt;
|Migration to git discussion, TGRASS, testsuite, website discussion&lt;br /&gt;
|L&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|[[User:Mlennert|Moritz Lennert]]&lt;br /&gt;
|Italy&lt;br /&gt;
|18.3&lt;br /&gt;
|21.3&lt;br /&gt;
|Migration to git discussion, website discussion, GRASS 8, new GRASS GIS startup, work on OBIA addons, ...&lt;br /&gt;
|M&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|Markus Metz&lt;br /&gt;
|Germany&lt;br /&gt;
|18.3.&lt;br /&gt;
|22.3.&lt;br /&gt;
|Migration to git discussion, website discussion, GRASS 8, new GRASS GIS startup&lt;br /&gt;
|M&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|#&lt;br /&gt;
|... &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Via IRC chat ===&lt;br /&gt;
&lt;br /&gt;
(IRC is a nice archaic chat system, see [[IRC]])&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|-&lt;br /&gt;
|Add&lt;br /&gt;
|your&lt;br /&gt;
|self..&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Individual Preparation ==&lt;br /&gt;
&lt;br /&gt;
* Bring your own computer&lt;br /&gt;
* Bring [http://en.wikipedia.org/wiki/Mains_electricity_by_country your power connector adapter] if needed (photo: [https://en.wikipedia.org/wiki/File:Schuko_plug_and_socket.png Germany]). See also http://www.power-plugs-sockets.com/&lt;br /&gt;
* Install subversion and the compiler tools, and come with a working GRASS development environment if possible.&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&lt;br /&gt;
We have to remember to take at least one group photo! :-)&lt;br /&gt;
&lt;br /&gt;
== Reports ==&lt;br /&gt;
&lt;br /&gt;
See [[Talk:GRASS_Community_Sprint_Bonn_2018]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
* ''Is the GRASS Community Sprint just a coding event?''&lt;br /&gt;
** It is mainly a coding and documentation event. It is a working session for people who are already participants in the GRASS project and/or are committed to improving the GRASS project.&lt;br /&gt;
** On demand we can do some presentations of current working GRASS implementation and new upcoming features to spread the idea of Open Source GIS software&lt;br /&gt;
* ''Is the GRASS Community Sprint for developers only?''&lt;br /&gt;
** No: anybody can help, with testing, checking out bugs and fixes, documentation and more.&lt;br /&gt;
* ''Where can I get help and more information about the community sprint?''&lt;br /&gt;
** Contact [[User:Lucadelu|Luca Delucchi]] &amp;lt;tt&amp;gt;&amp;lt;lucadeluge at gmail com&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Workshops]]&lt;br /&gt;
[[Category: Code Sprint]]&lt;br /&gt;
[[Category: 2018]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Autumn_2017&amp;diff=24823</id>
		<title>GRASS GIS Community Sprint Autumn 2017</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Community_Sprint_Autumn_2017&amp;diff=24823"/>
		<updated>2017-10-26T20:05:03Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: + Markus Metz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{toc|right}}&lt;br /&gt;
GRASS people, let's meet! Because until the [[GRASS Community Sprint Bonn 2018|GRASS Community Sprint in March 2018]] there's still a looong way to go and there are topics that have been on the agenda for quite some time already... but especially because it is always so nice and fun to meet :D&lt;br /&gt;
&lt;br /&gt;
== Purpose and Agenda ==&lt;br /&gt;
&lt;br /&gt;
Discuss and tackle topics such as:&lt;br /&gt;
&lt;br /&gt;
* Specs for GRASS GIS 8&lt;br /&gt;
* What's missing for 7.4.0&lt;br /&gt;
* Set up new website (asap) with responsive design&lt;br /&gt;
* Migration to git&lt;br /&gt;
* Include/invite more core devs&lt;br /&gt;
* Review and (possible) integration of GSoC 2017 work&lt;br /&gt;
* Outreach:&lt;br /&gt;
** possibility of a survey to know who uses GRASS GIS&lt;br /&gt;
** offer more GRASS GIS courses&lt;br /&gt;
** more online material, use Sphinx&lt;br /&gt;
** generate tons of 1min videos&lt;br /&gt;
&lt;br /&gt;
== Sponsors ==&lt;br /&gt;
&lt;br /&gt;
If you are interested to sponsor the GRASS Community Sprint, please read about&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; '''sponsoring the GRASS project at [http://grass.osgeo.org/donations/ http://grass.osgeo.org/donations/]'''&amp;lt;br&amp;gt;&lt;br /&gt;
and, if needed, contact [[User:Neteler|Markus Neteler]] &amp;lt;tt&amp;gt;&amp;lt;neteler at osgeo.org&amp;gt;&amp;lt;/tt&amp;gt;. Any surplus at the end of the event will be turned over to the GRASS GIS project.&lt;br /&gt;
&lt;br /&gt;
The GRASS Community Sprint is a great occasion for you to support the development of GRASS. With your contribution you'll enable more developers to meet. The community sprint is an important opportunity for the GRASS developers to discuss and collaboratively resolve bugs, plan the direction for the project and work on new features. The developers and contributors are donating their valuable time, so it would be great if in-kind funding can be made available from within the community to cover out-of-pocket expenses. All of the work that takes place at the community sprint will be directly contributed back into the GRASS project to the benefit of everyone who uses it.&lt;br /&gt;
&lt;br /&gt;
=== Thanks to our sponsors ===&lt;br /&gt;
&lt;br /&gt;
== Venue ==&lt;br /&gt;
&lt;br /&gt;
* To be defined&lt;br /&gt;
&lt;br /&gt;
== Accommodation and Costs ==&lt;br /&gt;
&lt;br /&gt;
* To be defined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Agenda - What we plan to do ==&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The program is generally open for your ideas. Please edit this wiki page!&lt;br /&gt;
&lt;br /&gt;
* Preparation of GRASS GIS 7.4.0 new stable release&lt;br /&gt;
* Discuss start of GRASS GIS 8&lt;br /&gt;
* GSOC results integration&lt;br /&gt;
&lt;br /&gt;
... YOUR IDEA HERE ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Planned participation ==&lt;br /&gt;
&lt;br /&gt;
For organizational reasons (i.e. define place and date), please '''additionally register''' at: https://beta.doodle.com/poll/p4a8wmtcpw6c9m9s&lt;br /&gt;
&lt;br /&gt;
=== In person ===&lt;br /&gt;
&lt;br /&gt;
Please add your name here:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|width=100px|'''Arrival'''&lt;br /&gt;
|width=100px|'''Departure'''&lt;br /&gt;
|'''Topic'''&lt;br /&gt;
|width=75px|'''T-Shirt'''&lt;br /&gt;
|'''Notes'''&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|[[User:Veroandreo|Veronica Andreo]]&lt;br /&gt;
|Netherlands&lt;br /&gt;
|Fri 10&lt;br /&gt;
|Mon 13&lt;br /&gt;
|Doc, testing, GCI &lt;br /&gt;
|S &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|[[User:Neteler|Markus Neteler]]&lt;br /&gt;
|Germany&lt;br /&gt;
|Sat 11th&lt;br /&gt;
|Mon 13th&lt;br /&gt;
|See agenda :)&lt;br /&gt;
|M&lt;br /&gt;
|Will be travelling back from SFCon Bolzano, hence arriving on Sat&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|[https://wiki.osgeo.org/wiki/User:Mmetz Markus Metz]]&lt;br /&gt;
|Germany&lt;br /&gt;
|Fri 10&lt;br /&gt;
|Mon 13&lt;br /&gt;
|GRASS 7.4, 8&lt;br /&gt;
|M&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Via IRC chat ===&lt;br /&gt;
&lt;br /&gt;
(IRC is a nice archaic chat system, see [[IRC]])&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;   border=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot; rules=&amp;quot;all&amp;quot; style=&amp;quot;margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#edf9c7; font-size:95%; empty-cells:show;&amp;quot; &lt;br /&gt;
|width=50px|'''No'''&lt;br /&gt;
|width=130px|'''Participant '''&lt;br /&gt;
|width=100px|'''Country'''&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|[[User:Ychemin|Yann Chemin]]&lt;br /&gt;
|France&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Individual Preparation ==&lt;br /&gt;
&lt;br /&gt;
* Bring your own computer&lt;br /&gt;
* Bring [http://en.wikipedia.org/wiki/Mains_electricity_by_country your power connector adapter] if needed. See also http://www.power-plugs-sockets.com/&lt;br /&gt;
* Install subversion and the compiler tools, and come with a working GRASS development environment if possible.&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&lt;br /&gt;
Remember to take at least one group photo! :-)&lt;br /&gt;
&lt;br /&gt;
== Reports ==&lt;br /&gt;
&lt;br /&gt;
See [[Talk:GRASS_GIS_Community_Sprint_Autumn_2017]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
* ''Is the GRASS Community Sprint just a coding event?''&lt;br /&gt;
** It is mainly a coding and documentation event. It is a working session for people who are already participants in the GRASS project and/or are committed to improving the GRASS project.&lt;br /&gt;
** On demand we can do some presentations of current working GRASS implementation and new upcoming features to spread the idea of Open Source GIS software&lt;br /&gt;
* ''Is the GRASS Community Sprint for developers only?''&lt;br /&gt;
** No: anybody can help, with testing, checking out bugs and fixes, documentation and more.&lt;br /&gt;
* ''Where can I get help and more information about the community sprint?''&lt;br /&gt;
** Contact [[User:Veroandreo|Veronica Andreo]] &amp;lt;tt&amp;gt;&amp;lt;veroandreo at gmail com&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Workshops]]&lt;br /&gt;
[[Category: Code Sprint]]&lt;br /&gt;
[[Category: 2017]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=SENTINEL&amp;diff=24797</id>
		<title>SENTINEL</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=SENTINEL&amp;diff=24797"/>
		<updated>2017-10-20T12:16:41Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: Sentinel import: explain how to account for NULL cells and edge artefacts, and how to align the computational region&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Sentinel 2= &lt;br /&gt;
&lt;br /&gt;
Sentinel-2 is an Earth observation mission developed by [https://en.wikipedia.org/wiki/European_Space_Agency ESA] as part of the [https://en.wikipedia.org/wiki/Copernicus_Programme Copernicus Programme] to perform terrestrial observations in support of services such as forest monitoring, land cover changes detection, and natural disaster management. It consists of two identical satellites, [https://en.wikipedia.org/wiki/Sentinel-2A Sentinel-2A] and [https://en.wikipedia.org/wiki/Sentinel-2B Sentinel-2B]. Details about the mission, user and technical guides as well as other documentation can be found at the ESA dedicated website [https://sentinel.esa.int/web/sentinel/missions/sentinel-2] and a number of other sites.&lt;br /&gt;
&lt;br /&gt;
==Overview of Sentinel-2 mission capabilities==&lt;br /&gt;
&lt;br /&gt;
Sentinel-2 mission has the following features:&lt;br /&gt;
* Multi-spectral data with ''13 bands'' in the visible, near infrared (NIR), and short wave infrared (SWIR).&lt;br /&gt;
* Systematic global coverage of land surfaces from 56° S to 84° N, coastal waters, and all of the Mediterranean Sea&lt;br /&gt;
* Revisiting every ''5 days'' under the same viewing angles. At high latitudes, Sentinel-2 swath overlaps and some regions are observed twice or more every 5 days, but with different viewing angles.&lt;br /&gt;
* Spatial resolutions of 10 m (Bands 2, 3, 4 and 8 - Blue, Green, Red and NIR), 20 m (Bands 5, 6 and 7 - Red Edge bands, Band 8A - Narrow infrared and Bands 11 and 12 - SWIR) and 60 m (Bands 1 - Coastal aerosol, Band 9 - Water vapour and Band 10 - SWIR/Cirrus)&lt;br /&gt;
* 290 km field of view&lt;br /&gt;
* Free and open data policy&lt;br /&gt;
&lt;br /&gt;
==Sentinel-2 products==&lt;br /&gt;
&lt;br /&gt;
* '''Level-1B''' product provides radiometrically corrected imagery in Top-Of-Atmosphere (TOA) radiance values and in sensor geometry. Level-1B product is composed of an ensemble of granules that are 25 km across track (AC) by 23 km along track (AL). Additionally, this product includes the refined geometry which is used to generate the Level-1C product. Level-1B pixel coordinates refer to the centre of each pixel.&lt;br /&gt;
&lt;br /&gt;
* '''Level-1C''' product is composed of 100 km² single tiles (ortho-images in UTM/WGS84 projection). The Level-1C product results from using a Digital Elevation Model (DEM) to project the image in cartographic coordinates. Per-pixel radiometric measurements are provided in TOA reflectances with all parameters to transform them into radiances. Level-1C products are resampled with a constant Ground Sampling Distance (GSD) of 10, 20 and 60 m depending on the native resolution of the different spectral bands. In Level-1C products, pixel coordinates refer to the upper left corner of the pixel. Before September 2016, Level-1C was delivered as multi-tile product.&lt;br /&gt;
&lt;br /&gt;
* '''Level-2A''' product provides Bottom Of Atmosphere (BOA) reflectance images derived from the associated Level-1C products. Therefore, each Level-2A product is also a 100 km² tile in cartographic geometry (UTM/WGS84 projection). BOA reflectances in Level-2A products are scaled by a factor of 10000.&lt;br /&gt;
&lt;br /&gt;
==Data download==&lt;br /&gt;
&lt;br /&gt;
Sentinel-2 data might be obtained from the [https://scihub.copernicus.eu/ Copernicus Open Access Hub], either by using the online interactive interface and browsing to your area of interest or by means of the API Hub. There are several other sites from which it is possible to download Sentinel-2 imagery as well. Here, some of them:&lt;br /&gt;
&lt;br /&gt;
* [http://apps.sentinel-hub.com/eo-browser/ Sentinel-app]&lt;br /&gt;
* [http://sentinel-pds.s3-website.eu-central-1.amazonaws.com/ Amazon S3]&lt;br /&gt;
* [https://code-de.org/ Copernicus Data and Exploitation Platform – Deutschland (CODE-DE)]&lt;br /&gt;
* [https://maps.mundialis.de/ mundialis]&lt;br /&gt;
* [https://remotepixel.ca/projects/satellitesearch.html RemotePixel]&lt;br /&gt;
* [https://lv.eosda.com Land Viewer]&lt;br /&gt;
&lt;br /&gt;
For those preferring or needing to download data via the API, there also exist several options: &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ibamacsr/sentinelsat/ sentinelsat]: Python utilities to access the API of Copernicus Sentinels Scientific Data Hub (useful for all Sentinel satellite imagery)&lt;br /&gt;
* [https://github.com/olivierhagolle/Sentinel-download/ Sentinel-download]: Automated download of Sentinel-2 L1C data from ESA (through wget)&lt;br /&gt;
&lt;br /&gt;
==Data pre-processing==&lt;br /&gt;
&lt;br /&gt;
As from May 2017, ESA started to provide Level 2A products for Europe and they will reprocess the archive during this year (2017). However, it is (still) possible to download Level-1C products and customize the atmospheric correction by using different algorithms (i.e.: 6S, 6SV, [http://rsgislib.org/arcsi/ arcsi]) and/or a different DEM (Sen2Cor uses STRM 90m by default).&lt;br /&gt;
&lt;br /&gt;
==Sentinel-2 in GRASS GIS==&lt;br /&gt;
&lt;br /&gt;
To exemplify the handling of Sentinel-2 data with GRASS GIS, we will use S2 L1C scene from North Carolina (NC) from November 2016. Here are the details:&lt;br /&gt;
&lt;br /&gt;
 S2A_OPER_PRD_MSIL1C_PDMC_20161111T123605_R097_V20161110T160502_20161110T160502&lt;br /&gt;
 830f2a5a-9914-427c-b4e0-69c6c14c71d4&lt;br /&gt;
 2016-11-10T15:05:02Z&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 S2A_OPER_PRD_MSIL1C_PDMC_20161001T232624_R097_V20161001T160052_20161001T160426&lt;br /&gt;
 44b7fb4c-d2d7-4739-9b8e-3639659505db&lt;br /&gt;
 2016-10-01T16:00:52.000Z&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the zipped folder delivered by ESA, the data itself is hidden under: &lt;br /&gt;
 S2A_OPER_PRD_MSIL1C_PDMC_20161111T123605_R097_V20161110T160502_20161110T160502.SAFE/GRANULE/S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_N02.04/IMG_DATA/&lt;br /&gt;
&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B01.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B02.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B03.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B04.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B05.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B06.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B07.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B08.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B09.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B10.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B11.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B12.jp2&lt;br /&gt;
 S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B8A.jp2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- explain naming --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Import data===&lt;br /&gt;
&lt;br /&gt;
Sentinel-2 data comes in JPEG2000 format that can be easily imported into GRASS GIS either by means of {{cmd|r.in.gdal}} (in a UTM location) or using {{cmd|r.import}} that provides reprojection on the fly. In this example, we will use {{cmd|r.import}} to reproject and import into the NC sample location delivered with GRASS GIS. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for map in `ls *.jp2` ; do&lt;br /&gt;
 outmap=`basename $map .jp2`&lt;br /&gt;
 r.import input=$map output=$outmap&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you prefer shorter map names, then it is possible to use {{cmd|g.rename}} or the add-on {{AddonCmd|g.rename.many}}. The other option is editing the file names before importing with sed, for example. Let us keep the S2A, date and band number parts only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for map in `ls *.jp2` ; do&lt;br /&gt;
 outmap1=`basename $map .jp2`&lt;br /&gt;
 outmap2=`echo $outmap1 | sed s/OPER_MSI_L1C_TL_MTI__//g | sed s/T210803_A007244_T17SPV//g`&lt;br /&gt;
 r.import input=$map output=$outmap2&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output resolution estimated by {{cmd|r.import}} is slightly different than the nominal resolution of Sentinel-2 bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
r.info S2A_20161110_B08 -g | grep res&lt;br /&gt;
nsres=9.80178836938829&lt;br /&gt;
ewres=9.80224757766693&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to set the proper resolution at import by means of the resolution and resolution_value options in {{cmd|r.import}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for i in 02 03 04 08 ; do&lt;br /&gt;
 g.message message=&amp;quot;importing band ${i} with R 10m&amp;quot;&lt;br /&gt;
 r.import S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B${i}.jp2 out=S2A_20161110_B${i} resolution=value resolution_value=10 extent=input&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
for i in 05 06 07 8A 11 12 ; do &lt;br /&gt;
  g.message message=&amp;quot;importing band ${i} with R 20m&amp;quot;&lt;br /&gt;
  r.import S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B${i}.jp2 out=S2A_20161110_B${i} resolution=value resolution_value=20 extent=input&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
for i in 01 09 10 ; do &lt;br /&gt;
 g.message message=&amp;quot;importing band ${i} with R 60m&amp;quot;&lt;br /&gt;
 r.import S2A_OPER_MSI_L1C_TL_MTI__20161110T210803_A007244_T17SPV_B${i}.jp2 out=S2A_20161110_B${i} resolution=value resolution_value=60 extent=input&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, nodata are not encoded in the Sentinel data and need to be set manually by replacing 0 with NULL. &lt;br /&gt;
This should be done in the original projection, before reprojecting the data.&lt;br /&gt;
&lt;br /&gt;
In L2A products, there are artefacts along edges of swath paths, cell values are too low, caused by a bug in sen2cor. &lt;br /&gt;
All cells that are bordering a NULL cell must be set to NULL. This step might need to be repeated twice.&lt;br /&gt;
&lt;br /&gt;
Because neighboring Sentinel tiles are overlapping each other, file sizes can be reduced by patching together neighboring tiles with &lt;br /&gt;
the same datatake sensing start time.&lt;br /&gt;
&lt;br /&gt;
Before the actual reprojection, the computational region must be set properly. In the original projection, &lt;br /&gt;
four 10 meter cells fall exactly into one 20 meter cell, and nine 20 meter cells fall exactly into one 60 meter cell. &lt;br /&gt;
This can be achieved by first setting the region to the input extents (obtained with {{cmd|r.proj}} -g), then &lt;br /&gt;
aligning the region to a resolution of 60 meter, after that setting the region's resolution to the actual resolution of &lt;br /&gt;
the input band, this time without alignment. Alternatively, a reference grid can be created and the region for the current &lt;br /&gt;
input can then be aligned to that reference grid.&lt;br /&gt;
&lt;br /&gt;
Now the data can be reprojected, preferably with method=bicubic_f or method=lanczos_f to avoid sawtooth patterns &lt;br /&gt;
of linear features which can appear with method=nearest (default).&lt;br /&gt;
&lt;br /&gt;
===Atmospheric correction with {{cmd|i.atcorr}}===&lt;br /&gt;
&lt;br /&gt;
Example here&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
===Apply cloud mask===&lt;br /&gt;
Example here&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Estimate diverse indices===&lt;br /&gt;
&lt;br /&gt;
Given that Sentinel-2 MSI comes with 3 red edge bands, it allows to estimate several other vegetation indices, aside from the most classic ones. There is a quite exhaustive list at the [http://www.sentinel-hub.com/eotaxonomy/indices?page=1 Sentinel Hub] website.&lt;br /&gt;
&lt;br /&gt;
* EVI = 2.5*(B08 - B04) / (B08 + 6*B04 - 7.5*B02 + 1) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/evi-enhanced-vegetation-index-0] --&amp;gt;&lt;br /&gt;
* ARVI = (B08 - (2*B04 - B02)) / (B08 + (2*B04 - B02)) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/arvi] --&amp;gt;&lt;br /&gt;
* NDII = (B08 - B11) / (B08 + B11) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/ndii] --&amp;gt;&lt;br /&gt;
* MSI = B11 / B08 &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/msi] --&amp;gt;&lt;br /&gt;
* PSRI-NIR = (B04 - B02) / B08 &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/psri-nir-plant-senescence-reflectance-index-near-infra-red] --&amp;gt;&lt;br /&gt;
* NDVI-GREEN = B03 * (B08 - B04) / (B08 + B04) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/ndvi-green-normalized-difference-vegetation-index-green] --&amp;gt;&lt;br /&gt;
* MTCI = (B06 - B05) / (B05 - B04) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/mtci-meris-terrestrial-chlorophyll-index] --&amp;gt;&lt;br /&gt;
* IRECI = (B07 - B04) * B06 / B05 &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/ireci-inverted-red-edge-chlorophyll-index] --&amp;gt;&lt;br /&gt;
* GRVI1 = (B04 - B03) / (B04 + B03) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/grvi1-green-red-vegetation-index] --&amp;gt;&lt;br /&gt;
* GNDVI = (B08 - B03) / (B08 + B03) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/gndvi-green-normalized-difference-vegetation-index] --&amp;gt;&lt;br /&gt;
* EVI2 = 2.5 * (B08 - B04) / (B08 + 2.4 * B04 + 1) &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/evi2-enhanced-vegetation-index-2] --&amp;gt;&lt;br /&gt;
* ChlRE = B05 / B08 &amp;lt;!-- [http://www.sentinel-hub.com/eoproducts/chl-red-edge-chlorophyll-red-edge] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Classification===&lt;br /&gt;
&lt;br /&gt;
Example here&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
IMAGICO.DE blog&lt;br /&gt;
* [http://blog.imagico.de/sentinel-2-having-a-first-look-at-the-data-part-1/ First look at Sentinel data]&lt;br /&gt;
* [http://blog.imagico.de/who-is-moving-the-cheese-again/ Who is moving the cheese again?]&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category: Tutorial]]&lt;br /&gt;
[[Category: Image processing]]&lt;br /&gt;
[[Category: Sentinel]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24769</id>
		<title>HOWTO import SRTM elevation data</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24769"/>
		<updated>2017-09-24T21:46:23Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Import of CGIAR SRTM void-filled tiles */  update the update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Background: [http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission]&lt;br /&gt;
&lt;br /&gt;
== Available data ==&lt;br /&gt;
&lt;br /&gt;
[http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission] - several SRTM Data Versions and Products are available. An overview of the different versions is given in figure 2 in the [https://lpdaac.usgs.gov/sites/default/files/public/measures/docs/NASA_SRTM_V3.pdf SRTM user guide].&lt;br /&gt;
* JPL/NASA Version 1 - SRTM non-void filled, unedited elevation data (US: 1 arc-second (approximately 30 meters); global at 3 arc-seconds (approximately 90 meters)). Available at [https://dds.cr.usgs.gov/srtm/version1/ https://dds.cr.usgs.gov/srtm/version1/].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTM NGA Version 2 - SRTM non-void filled], edited elevation data (spike and pit removal, water body leveling, and coastline definition). Available in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTMVF NGA Version 2 - SRTM partially void filled]. Available at 1 and 3 arc-seconds resolution in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://dds.cr.usgs.gov/srtm/version2_1/ JPL/NASA Version 2.1] (non-void-filled) corrects some minor errors found in the NGA SRTM Version 2 product. Available for the US at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM1/ 1 arc-second] (approximately 30 meters) and global at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ 3 arc-seconds] (approximately 90 meters).&lt;br /&gt;
* '''JPL/NASA Version 3 SRTM global elevation data''' provide '''global coverage of completely void filled''' data at resolutions of [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3_v003 3 arc-seconds] (approximately 90 meters) and [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003 1 arc-second] (approximately30 meters). The corresponding [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmswbd_v003 water body data] have also been updated.&lt;br /&gt;
&lt;br /&gt;
SRTM data available through the [http://earthexplorer.usgs.gov/ USGS EarthExplorer] are NGA SRTM version 2. If in doubt, use [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table JPL/NASA Version 3 SRTM global elevation data].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
* Older SRTM: http://www2.jpl.nasa.gov/srtm/ (SRTM V1 + SRTM V2 home page) |  http://dds.cr.usgs.gov/srtm/ (JPL/NASA SRTM V1 + V2.1 data download)&lt;br /&gt;
* https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table NASA MEaSUREs Products (SRTM V3 and more)&lt;br /&gt;
: ([http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL1.003/2000.02.11/ 1 arc-second] and [http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/ 3 arc-seconds] which are a huge file lists)&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
GRASS GIS installations usually contain a location 'demolocation' which is in Latitude-Longitude, suitable for SRTM import.&lt;br /&gt;
&lt;br /&gt;
== Which SRTM tile to take? ==&lt;br /&gt;
&lt;br /&gt;
SRTM tiles are of 1 degree by 1 degree size. The SRTM filename contains the coordinates which refer to the center of the lower left pixel (e.g., N51E010: lower left cell center at 10E, 51N). To identify a tile name, a grid can be easily visualized in the GRASS monitor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
d.grid size=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Import of original SRTM tiles in HGT format ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via GUI menu ===&lt;br /&gt;
&lt;br /&gt;
You can easily import many SRTM files in one step:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:WxGUI bulk raster import1.png|400px|thumb|Bulk import of SRTM via menu]]&lt;br /&gt;
|| &lt;br /&gt;
[[Image:WxGUI bulk srtm import.jpg|300px|thumb|Bulk import of SRTM via menu (remember to add 'hgt' into the extension field)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This menu function calls internally the [http://www.gdal.org/frmt_various.html#SRTMHGT SRTM driver of GDAL].&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via command line ===&lt;br /&gt;
&lt;br /&gt;
Use the {{cmd|r.in.srtm}} module for automated import into a Latitude-Longitude location.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M.H. Bowman. ''Mapping freely available high resolution global elevation and vector data in GRASS.'' GRASS Newsletter, Vol.3, pp 7-10, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] ]&lt;br /&gt;
&lt;br /&gt;
== Import of CGIAR SRTM void-filled tiles ==&lt;br /&gt;
&lt;br /&gt;
CGIAR SRTM is a heavily edited version of the original SRTM data. Differences to the original SRTM data can be substantial.&lt;br /&gt;
&lt;br /&gt;
* SRTM 90 data in GeoTIFF format are available from http://srtm.csi.cgiar.org/. These come in 5 degree by 5 degree tiles. Horizontal resolution: 3 arc second (90 m at equator). Coverage: world. Import with {{cmd|r.in.gdal}}&lt;br /&gt;
&lt;br /&gt;
Update: note that [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table JPL/NASA] (see on top of this page) offers global 1 arc-second resolution SRTM V3 data which are void filled.&lt;br /&gt;
&lt;br /&gt;
== Import of multiple SRTM tiles in one step (mosaiking) ==&lt;br /&gt;
&lt;br /&gt;
To simplify the import of multiple SRTM tiles, the tiles can be mosaicked first with gdalwarp:&lt;br /&gt;
&lt;br /&gt;
Original SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # unzip all&lt;br /&gt;
 for i in *.hgt.zip ; do unzip  $i ; done&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.hgt srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
CGIAR SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.tif srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Void filling of original SRTM tiles ==&lt;br /&gt;
&lt;br /&gt;
The module {{cmd|r.fillnulls}} can be used. See [http://grass.osgeo.org/grass61/screenshots/images/srtm_trento_voidfill.png screenshot]&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M. Neteler, 2005. ''SRTM and VMAP0 data in OGR and GRASS.'' GRASS Newsletter, Vol.3, pp 2-6, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] | [http://grass.osgeo.org/newsletter/GRASSNews_vol3_erratum.txt Erratum 1/2006 (txt)] ]&lt;br /&gt;
&lt;br /&gt;
''Update 2014'': better use the already void filled SRTM V3 1 arc-second for global coverage (~30 meters) data (get from NASA EarthExplorer, see above)&lt;br /&gt;
&lt;br /&gt;
== Import of SRTM tiles with reprojection on the fly ==&lt;br /&gt;
&lt;br /&gt;
Instead of processing SRTM in a different location, it can be imported right away into the location of interest (e.g. UTM or whatever other projection) through reprojecting on the fly with bilinear resampling using {{cmd|r.import}}.&lt;br /&gt;
&lt;br /&gt;
Example for North Carolina sample dataset with newest 1 arc-second for global coverage (~30 meters). You get the SRTM V3 1 arc-second global data from EarthExplorer (http://earthexplorer.usgs.gov/). The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# set computational region to e.g. Landsat channel 3:&lt;br /&gt;
g.region raster=lsat7_2000_30 -p&lt;br /&gt;
&lt;br /&gt;
# Import with reprojection on the fly. Recommended parameters:&lt;br /&gt;
# resample   Resampling method to use for reprojection -  bilinear&lt;br /&gt;
# extent   Output raster map extent&lt;br /&gt;
#    - region: extent of current region&lt;br /&gt;
# resolution   Resolution of output raster map&lt;br /&gt;
#    - region: current region resolution - limit to g.region setting from above&lt;br /&gt;
r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp resample=bilinear \&lt;br /&gt;
  extent=region resolution=region title=&amp;quot;SRTM V3 resampled to Landsat7 resolution&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# beautify colors:&lt;br /&gt;
r.colors srtmv3_resamp color=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Shuttle_Radar_Topography_Mission SRTM] in Wikipedia&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Geodata]]&lt;br /&gt;
[[Category: Import]]&lt;br /&gt;
[[Category:Raster]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24768</id>
		<title>HOWTO import SRTM elevation data</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24768"/>
		<updated>2017-09-24T21:41:32Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Download */  update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Background: [http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission]&lt;br /&gt;
&lt;br /&gt;
== Available data ==&lt;br /&gt;
&lt;br /&gt;
[http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission] - several SRTM Data Versions and Products are available. An overview of the different versions is given in figure 2 in the [https://lpdaac.usgs.gov/sites/default/files/public/measures/docs/NASA_SRTM_V3.pdf SRTM user guide].&lt;br /&gt;
* JPL/NASA Version 1 - SRTM non-void filled, unedited elevation data (US: 1 arc-second (approximately 30 meters); global at 3 arc-seconds (approximately 90 meters)). Available at [https://dds.cr.usgs.gov/srtm/version1/ https://dds.cr.usgs.gov/srtm/version1/].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTM NGA Version 2 - SRTM non-void filled], edited elevation data (spike and pit removal, water body leveling, and coastline definition). Available in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTMVF NGA Version 2 - SRTM partially void filled]. Available at 1 and 3 arc-seconds resolution in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://dds.cr.usgs.gov/srtm/version2_1/ JPL/NASA Version 2.1] (non-void-filled) corrects some minor errors found in the NGA SRTM Version 2 product. Available for the US at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM1/ 1 arc-second] (approximately 30 meters) and global at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ 3 arc-seconds] (approximately 90 meters).&lt;br /&gt;
* '''JPL/NASA Version 3 SRTM global elevation data''' provide '''global coverage of completely void filled''' data at resolutions of [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3_v003 3 arc-seconds] (approximately 90 meters) and [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003 1 arc-second] (approximately30 meters). The corresponding [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmswbd_v003 water body data] have also been updated.&lt;br /&gt;
&lt;br /&gt;
SRTM data available through the [http://earthexplorer.usgs.gov/ USGS EarthExplorer] are NGA SRTM version 2. If in doubt, use [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table JPL/NASA Version 3 SRTM global elevation data].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
* Older SRTM: http://www2.jpl.nasa.gov/srtm/ (SRTM V1 + SRTM V2 home page) |  http://dds.cr.usgs.gov/srtm/ (JPL/NASA SRTM V1 + V2.1 data download)&lt;br /&gt;
* https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table NASA MEaSUREs Products (SRTM V3 and more)&lt;br /&gt;
: ([http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL1.003/2000.02.11/ 1 arc-second] and [http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/ 3 arc-seconds] which are a huge file lists)&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
GRASS GIS installations usually contain a location 'demolocation' which is in Latitude-Longitude, suitable for SRTM import.&lt;br /&gt;
&lt;br /&gt;
== Which SRTM tile to take? ==&lt;br /&gt;
&lt;br /&gt;
SRTM tiles are of 1 degree by 1 degree size. The SRTM filename contains the coordinates which refer to the center of the lower left pixel (e.g., N51E010: lower left cell center at 10E, 51N). To identify a tile name, a grid can be easily visualized in the GRASS monitor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
d.grid size=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Import of original SRTM tiles in HGT format ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via GUI menu ===&lt;br /&gt;
&lt;br /&gt;
You can easily import many SRTM files in one step:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:WxGUI bulk raster import1.png|400px|thumb|Bulk import of SRTM via menu]]&lt;br /&gt;
|| &lt;br /&gt;
[[Image:WxGUI bulk srtm import.jpg|300px|thumb|Bulk import of SRTM via menu (remember to add 'hgt' into the extension field)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This menu function calls internally the [http://www.gdal.org/frmt_various.html#SRTMHGT SRTM driver of GDAL].&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via command line ===&lt;br /&gt;
&lt;br /&gt;
Use the {{cmd|r.in.srtm}} module for automated import into a Latitude-Longitude location.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M.H. Bowman. ''Mapping freely available high resolution global elevation and vector data in GRASS.'' GRASS Newsletter, Vol.3, pp 7-10, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] ]&lt;br /&gt;
&lt;br /&gt;
== Import of CGIAR SRTM void-filled tiles ==&lt;br /&gt;
&lt;br /&gt;
* SRTM 90 data in GeoTIFF format are available from http://srtm.csi.cgiar.org/. These come in 5 degree by 5 degree tiles. Horizontal resolution: 3 arc second (90 m at equator). Coverage: world. Import with {{cmd|r.in.gdal}}&lt;br /&gt;
&lt;br /&gt;
Update: note that NASA EarthExplorer (see on top of this page) offers ~ 30m resolution SRTM V3 data which are void filled.&lt;br /&gt;
&lt;br /&gt;
== Import of multiple SRTM tiles in one step (mosaiking) ==&lt;br /&gt;
&lt;br /&gt;
To simplify the import of multiple SRTM tiles, the tiles can be mosaicked first with gdalwarp:&lt;br /&gt;
&lt;br /&gt;
Original SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # unzip all&lt;br /&gt;
 for i in *.hgt.zip ; do unzip  $i ; done&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.hgt srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
CGIAR SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.tif srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Void filling of original SRTM tiles ==&lt;br /&gt;
&lt;br /&gt;
The module {{cmd|r.fillnulls}} can be used. See [http://grass.osgeo.org/grass61/screenshots/images/srtm_trento_voidfill.png screenshot]&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M. Neteler, 2005. ''SRTM and VMAP0 data in OGR and GRASS.'' GRASS Newsletter, Vol.3, pp 2-6, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] | [http://grass.osgeo.org/newsletter/GRASSNews_vol3_erratum.txt Erratum 1/2006 (txt)] ]&lt;br /&gt;
&lt;br /&gt;
''Update 2014'': better use the already void filled SRTM V3 1 arc-second for global coverage (~30 meters) data (get from NASA EarthExplorer, see above)&lt;br /&gt;
&lt;br /&gt;
== Import of SRTM tiles with reprojection on the fly ==&lt;br /&gt;
&lt;br /&gt;
Instead of processing SRTM in a different location, it can be imported right away into the location of interest (e.g. UTM or whatever other projection) through reprojecting on the fly with bilinear resampling using {{cmd|r.import}}.&lt;br /&gt;
&lt;br /&gt;
Example for North Carolina sample dataset with newest 1 arc-second for global coverage (~30 meters). You get the SRTM V3 1 arc-second global data from EarthExplorer (http://earthexplorer.usgs.gov/). The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# set computational region to e.g. Landsat channel 3:&lt;br /&gt;
g.region raster=lsat7_2000_30 -p&lt;br /&gt;
&lt;br /&gt;
# Import with reprojection on the fly. Recommended parameters:&lt;br /&gt;
# resample   Resampling method to use for reprojection -  bilinear&lt;br /&gt;
# extent   Output raster map extent&lt;br /&gt;
#    - region: extent of current region&lt;br /&gt;
# resolution   Resolution of output raster map&lt;br /&gt;
#    - region: current region resolution - limit to g.region setting from above&lt;br /&gt;
r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp resample=bilinear \&lt;br /&gt;
  extent=region resolution=region title=&amp;quot;SRTM V3 resampled to Landsat7 resolution&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# beautify colors:&lt;br /&gt;
r.colors srtmv3_resamp color=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Shuttle_Radar_Topography_Mission SRTM] in Wikipedia&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Geodata]]&lt;br /&gt;
[[Category: Import]]&lt;br /&gt;
[[Category:Raster]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24767</id>
		<title>HOWTO import SRTM elevation data</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24767"/>
		<updated>2017-09-24T21:35:53Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Available data */  update liinks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Background: [http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission]&lt;br /&gt;
&lt;br /&gt;
== Available data ==&lt;br /&gt;
&lt;br /&gt;
[http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission] - several SRTM Data Versions and Products are available. An overview of the different versions is given in figure 2 in the [https://lpdaac.usgs.gov/sites/default/files/public/measures/docs/NASA_SRTM_V3.pdf SRTM user guide].&lt;br /&gt;
* JPL/NASA Version 1 - SRTM non-void filled, unedited elevation data (US: 1 arc-second (approximately 30 meters); global at 3 arc-seconds (approximately 90 meters)). Available at [https://dds.cr.usgs.gov/srtm/version1/ https://dds.cr.usgs.gov/srtm/version1/].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTM NGA Version 2 - SRTM non-void filled], edited elevation data (spike and pit removal, water body leveling, and coastline definition). Available in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTMVF NGA Version 2 - SRTM partially void filled]. Available at 1 and 3 arc-seconds resolution in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://dds.cr.usgs.gov/srtm/version2_1/ JPL/NASA Version 2.1] (non-void-filled) corrects some minor errors found in the NGA SRTM Version 2 product. Available for the US at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM1/ 1 arc-second] (approximately 30 meters) and global at [https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ 3 arc-seconds] (approximately 90 meters).&lt;br /&gt;
* '''JPL/NASA Version 3 SRTM global elevation data''' provide '''global coverage of completely void filled''' data at resolutions of [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3_v003 3 arc-seconds] (approximately 90 meters) and [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003 1 arc-second] (approximately30 meters). The corresponding [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmswbd_v003 water body data] have also been updated.&lt;br /&gt;
&lt;br /&gt;
SRTM data available through the [http://earthexplorer.usgs.gov/ USGS EarthExplorer] are NGA SRTM version 2. If in doubt, use [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table JPL/NASA Version 3 SRTM global elevation data].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
* Older SRTM: http://www2.jpl.nasa.gov/srtm/ (SRTM V1 + SRTM V2 home page) |  http://dds.cr.usgs.gov/srtm/ (SRTM V2 data download)&lt;br /&gt;
* https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table NASA MEaSUREs Products (SRTM V3 and more)&lt;br /&gt;
: ([http://e4ftl01.cr.usgs.gov/SRTM/ FTP] - therein SRTMGL3.003/2000.02.11/ which is a huge file list)&lt;br /&gt;
* Map based search: [http://earthexplorer.usgs.gov/ EarthExplorer] can be used to search, preview, and download Shuttle Radar Topography Mission (SRTM) 1 Arc-Second Global data. The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
GRASS GIS installations usually contain a location 'demolocation' which is in Latitude-Longitude, suitable for SRTM import.&lt;br /&gt;
&lt;br /&gt;
== Which SRTM tile to take? ==&lt;br /&gt;
&lt;br /&gt;
SRTM tiles are of 1 degree by 1 degree size. The SRTM filename contains the coordinates which refer to the center of the lower left pixel (e.g., N51E010: lower left cell center at 10E, 51N). To identify a tile name, a grid can be easily visualized in the GRASS monitor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
d.grid size=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Import of original SRTM tiles in HGT format ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via GUI menu ===&lt;br /&gt;
&lt;br /&gt;
You can easily import many SRTM files in one step:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:WxGUI bulk raster import1.png|400px|thumb|Bulk import of SRTM via menu]]&lt;br /&gt;
|| &lt;br /&gt;
[[Image:WxGUI bulk srtm import.jpg|300px|thumb|Bulk import of SRTM via menu (remember to add 'hgt' into the extension field)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This menu function calls internally the [http://www.gdal.org/frmt_various.html#SRTMHGT SRTM driver of GDAL].&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via command line ===&lt;br /&gt;
&lt;br /&gt;
Use the {{cmd|r.in.srtm}} module for automated import into a Latitude-Longitude location.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M.H. Bowman. ''Mapping freely available high resolution global elevation and vector data in GRASS.'' GRASS Newsletter, Vol.3, pp 7-10, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] ]&lt;br /&gt;
&lt;br /&gt;
== Import of CGIAR SRTM void-filled tiles ==&lt;br /&gt;
&lt;br /&gt;
* SRTM 90 data in GeoTIFF format are available from http://srtm.csi.cgiar.org/. These come in 5 degree by 5 degree tiles. Horizontal resolution: 3 arc second (90 m at equator). Coverage: world. Import with {{cmd|r.in.gdal}}&lt;br /&gt;
&lt;br /&gt;
Update: note that NASA EarthExplorer (see on top of this page) offers ~ 30m resolution SRTM V3 data which are void filled.&lt;br /&gt;
&lt;br /&gt;
== Import of multiple SRTM tiles in one step (mosaiking) ==&lt;br /&gt;
&lt;br /&gt;
To simplify the import of multiple SRTM tiles, the tiles can be mosaicked first with gdalwarp:&lt;br /&gt;
&lt;br /&gt;
Original SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # unzip all&lt;br /&gt;
 for i in *.hgt.zip ; do unzip  $i ; done&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.hgt srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
CGIAR SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.tif srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Void filling of original SRTM tiles ==&lt;br /&gt;
&lt;br /&gt;
The module {{cmd|r.fillnulls}} can be used. See [http://grass.osgeo.org/grass61/screenshots/images/srtm_trento_voidfill.png screenshot]&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M. Neteler, 2005. ''SRTM and VMAP0 data in OGR and GRASS.'' GRASS Newsletter, Vol.3, pp 2-6, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] | [http://grass.osgeo.org/newsletter/GRASSNews_vol3_erratum.txt Erratum 1/2006 (txt)] ]&lt;br /&gt;
&lt;br /&gt;
''Update 2014'': better use the already void filled SRTM V3 1 arc-second for global coverage (~30 meters) data (get from NASA EarthExplorer, see above)&lt;br /&gt;
&lt;br /&gt;
== Import of SRTM tiles with reprojection on the fly ==&lt;br /&gt;
&lt;br /&gt;
Instead of processing SRTM in a different location, it can be imported right away into the location of interest (e.g. UTM or whatever other projection) through reprojecting on the fly with bilinear resampling using {{cmd|r.import}}.&lt;br /&gt;
&lt;br /&gt;
Example for North Carolina sample dataset with newest 1 arc-second for global coverage (~30 meters). You get the SRTM V3 1 arc-second global data from EarthExplorer (http://earthexplorer.usgs.gov/). The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# set computational region to e.g. Landsat channel 3:&lt;br /&gt;
g.region raster=lsat7_2000_30 -p&lt;br /&gt;
&lt;br /&gt;
# Import with reprojection on the fly. Recommended parameters:&lt;br /&gt;
# resample   Resampling method to use for reprojection -  bilinear&lt;br /&gt;
# extent   Output raster map extent&lt;br /&gt;
#    - region: extent of current region&lt;br /&gt;
# resolution   Resolution of output raster map&lt;br /&gt;
#    - region: current region resolution - limit to g.region setting from above&lt;br /&gt;
r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp resample=bilinear \&lt;br /&gt;
  extent=region resolution=region title=&amp;quot;SRTM V3 resampled to Landsat7 resolution&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# beautify colors:&lt;br /&gt;
r.colors srtmv3_resamp color=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Shuttle_Radar_Topography_Mission SRTM] in Wikipedia&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Geodata]]&lt;br /&gt;
[[Category: Import]]&lt;br /&gt;
[[Category:Raster]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24766</id>
		<title>HOWTO import SRTM elevation data</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_import_SRTM_elevation_data&amp;diff=24766"/>
		<updated>2017-09-24T21:30:49Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Available data */  update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Background: [http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission]&lt;br /&gt;
&lt;br /&gt;
== Available data ==&lt;br /&gt;
&lt;br /&gt;
[http://www2.jpl.nasa.gov/srtm/ Space Shuttle Radar Topography Mission] - several SRTM Data Versions and Products are available. An overview of the different versions is given in figure 2 in the [https://lpdaac.usgs.gov/sites/default/files/public/measures/docs/NASA_SRTM_V3.pdf SRTM user guide].&lt;br /&gt;
* JPL/NASA Version 1 - SRTM non-void filled, unedited elevation data (US: 1 arc-second (approximately 30 meters); global at 3 arc-seconds (approximately 90 meters)). Available at [https://dds.cr.usgs.gov/srtm/version1/ https://dds.cr.usgs.gov/srtm/version1/].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTM NGA Version 2 - SRTM non-void filled], edited elevation data (spike and pit removal, water body leveling, and coastline definition). Available in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* [https://lta.cr.usgs.gov/SRTMVF NGA Version 2 - SRTM partially void filled]. Available at 1 and 3 arc-seconds resolution in the USGS long-term archive through the [http://earthexplorer.usgs.gov/ EarthExplorer].&lt;br /&gt;
* JPL/NASA Version 2.1 corrects some minor errors found in the NGA SRTM Version 2 product ([https://dds.cr.usgs.gov/srtm/version2_1/SRTM1/ US: 1 arc-second] (approximately 30 meters); [https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ global at 3 arc-seconds] (approximately 90 meters))&lt;br /&gt;
* '''JPL/NASA Version 3 SRTM global elevation data''' provide '''global coverage of completely void filled''' data at resolutions of [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3_v003 3 arc-seconds] (approximately 90 meters) and [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003 1 arc-second] (approximately30 meters). The corresponding [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmswbd_v003 water body data] have also been updated.&lt;br /&gt;
&lt;br /&gt;
SRTM data available through the [http://earthexplorer.usgs.gov/ USGS EarthExplorer] are NGA SRTM version 2. If in doubt, use [https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table JPL/NASA Version 3 SRTM global elevation data].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
* Older SRTM: http://www2.jpl.nasa.gov/srtm/ (SRTM V1 + SRTM V2 home page) |  http://dds.cr.usgs.gov/srtm/ (SRTM V2 data download)&lt;br /&gt;
* https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table NASA MEaSUREs Products (SRTM V3 and more)&lt;br /&gt;
: ([http://e4ftl01.cr.usgs.gov/SRTM/ FTP] - therein SRTMGL3.003/2000.02.11/ which is a huge file list)&lt;br /&gt;
* Map based search: [http://earthexplorer.usgs.gov/ EarthExplorer] can be used to search, preview, and download Shuttle Radar Topography Mission (SRTM) 1 Arc-Second Global data. The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
GRASS GIS installations usually contain a location 'demolocation' which is in Latitude-Longitude, suitable for SRTM import.&lt;br /&gt;
&lt;br /&gt;
== Which SRTM tile to take? ==&lt;br /&gt;
&lt;br /&gt;
SRTM tiles are of 1 degree by 1 degree size. The SRTM filename contains the coordinates which refer to the center of the lower left pixel (e.g., N51E010: lower left cell center at 10E, 51N). To identify a tile name, a grid can be easily visualized in the GRASS monitor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
d.grid size=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Import of original SRTM tiles in HGT format ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via GUI menu ===&lt;br /&gt;
&lt;br /&gt;
You can easily import many SRTM files in one step:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:WxGUI bulk raster import1.png|400px|thumb|Bulk import of SRTM via menu]]&lt;br /&gt;
|| &lt;br /&gt;
[[Image:WxGUI bulk srtm import.jpg|300px|thumb|Bulk import of SRTM via menu (remember to add 'hgt' into the extension field)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This menu function calls internally the [http://www.gdal.org/frmt_various.html#SRTMHGT SRTM driver of GDAL].&lt;br /&gt;
&lt;br /&gt;
=== Importing multiple SRTM files via command line ===&lt;br /&gt;
&lt;br /&gt;
Use the {{cmd|r.in.srtm}} module for automated import into a Latitude-Longitude location.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M.H. Bowman. ''Mapping freely available high resolution global elevation and vector data in GRASS.'' GRASS Newsletter, Vol.3, pp 7-10, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] ]&lt;br /&gt;
&lt;br /&gt;
== Import of CGIAR SRTM void-filled tiles ==&lt;br /&gt;
&lt;br /&gt;
* SRTM 90 data in GeoTIFF format are available from http://srtm.csi.cgiar.org/. These come in 5 degree by 5 degree tiles. Horizontal resolution: 3 arc second (90 m at equator). Coverage: world. Import with {{cmd|r.in.gdal}}&lt;br /&gt;
&lt;br /&gt;
Update: note that NASA EarthExplorer (see on top of this page) offers ~ 30m resolution SRTM V3 data which are void filled.&lt;br /&gt;
&lt;br /&gt;
== Import of multiple SRTM tiles in one step (mosaiking) ==&lt;br /&gt;
&lt;br /&gt;
To simplify the import of multiple SRTM tiles, the tiles can be mosaicked first with gdalwarp:&lt;br /&gt;
&lt;br /&gt;
Original SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # unzip all&lt;br /&gt;
 for i in *.hgt.zip ; do unzip  $i ; done&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.hgt srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
CGIAR SRTM tiles:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 # create mosaik (optionally reproject on the fly with -t_srs)&lt;br /&gt;
 gdalwarp *.tif srtm_mosaik.tif&lt;br /&gt;
 # import&lt;br /&gt;
 r.in.gdal input=srtm_mosaik output=srtm_mosaik&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Void filling of original SRTM tiles ==&lt;br /&gt;
&lt;br /&gt;
The module {{cmd|r.fillnulls}} can be used. See [http://grass.osgeo.org/grass61/screenshots/images/srtm_trento_voidfill.png screenshot]&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* M. Neteler, 2005. ''SRTM and VMAP0 data in OGR and GRASS.'' GRASS Newsletter, Vol.3, pp 2-6, June 2005. [ [http://grass.osgeo.org/newsletter/GRASSNews_vol3.pdf PDF] | [http://grass.osgeo.org/newsletter/GRASSNews_vol3_erratum.txt Erratum 1/2006 (txt)] ]&lt;br /&gt;
&lt;br /&gt;
''Update 2014'': better use the already void filled SRTM V3 1 arc-second for global coverage (~30 meters) data (get from NASA EarthExplorer, see above)&lt;br /&gt;
&lt;br /&gt;
== Import of SRTM tiles with reprojection on the fly ==&lt;br /&gt;
&lt;br /&gt;
Instead of processing SRTM in a different location, it can be imported right away into the location of interest (e.g. UTM or whatever other projection) through reprojecting on the fly with bilinear resampling using {{cmd|r.import}}.&lt;br /&gt;
&lt;br /&gt;
Example for North Carolina sample dataset with newest 1 arc-second for global coverage (~30 meters). You get the SRTM V3 1 arc-second global data from EarthExplorer (http://earthexplorer.usgs.gov/). The collections are located under the Digital Elevation category.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# set computational region to e.g. Landsat channel 3:&lt;br /&gt;
g.region raster=lsat7_2000_30 -p&lt;br /&gt;
&lt;br /&gt;
# Import with reprojection on the fly. Recommended parameters:&lt;br /&gt;
# resample   Resampling method to use for reprojection -  bilinear&lt;br /&gt;
# extent   Output raster map extent&lt;br /&gt;
#    - region: extent of current region&lt;br /&gt;
# resolution   Resolution of output raster map&lt;br /&gt;
#    - region: current region resolution - limit to g.region setting from above&lt;br /&gt;
r.import input=n35_w079_1arc_v3.tif output=srtmv3_resamp resample=bilinear \&lt;br /&gt;
  extent=region resolution=region title=&amp;quot;SRTM V3 resampled to Landsat7 resolution&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# beautify colors:&lt;br /&gt;
r.colors srtmv3_resamp color=elevation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Shuttle_Radar_Topography_Mission SRTM] in Wikipedia&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Geodata]]&lt;br /&gt;
[[Category: Import]]&lt;br /&gt;
[[Category:Raster]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23824</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23824"/>
		<updated>2016-12-01T21:29:04Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: +r.seasons, +r.resamp.tps, -r.stream.extract&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.bioclim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.bioclim|version=7}} calculates various bioclimatic indices from monthly temperature and optional precipitation time series (see http://worldclim.org/bioclim). The time series can be averages for several years or monthly values for a specific year. In any case all 12 months must be provided. If a precipitation time series is not provided, only those indices based on temperature are calculated.&lt;br /&gt;
&lt;br /&gt;
==== r.bitpattern ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.catchment ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
'''(more modules missing here, for now see manual above or fix this Wiki page!)'''&lt;br /&gt;
&lt;br /&gt;
==== r.category.trim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.category.trim|version=7}}: Export the categories, category labels and colour codes (RGB) as csv file or as a QGIS colour map file. When required, removes non-existing categories and their colour definitions. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.change.info ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.change.info|version=7}} detects changes in landscape structure using methods from decision tree induction (machine learning). These methods are largely based on concepts of information theory. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.droka ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.droka|version=7}}: This script defines rockfall zones from a digital elevation model (DEM) and vector layer containing starting point or points.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Filipello and Daniele Strigaro &lt;br /&gt;
&lt;br /&gt;
==== r.euro.ecosystem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.euro.ecosystem|version=7}} Sets colors and category labels of European ecosystem raster data sets.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.fidimo|version=7}}: [http://jradinger.wordpress.com/fidimo/ FIDIMO] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
==== r.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flexure|version=7}}: r.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is an addon to create a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Maning Sambale, Stefan Sylla (original script) and Paulo van Breugel (present script)&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.lfp ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.lfp|version=7}} creates a longest flow path raster map using a drainage direction raster map and the coordinates of an outlet point. The module internally runs &amp;lt;em&amp;gt;r.stream.distance&amp;lt;/em&amp;gt; twice to calculate flow length downstream and upstream raster maps, and combines them to get the longest flow path. An input drainage map can be created using {{cmd|r.watershed}} or {{cmd|r.stream.extract}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.meb ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.meb|version=7}}: The multivariate environmental bias (MEB) takes the medium conditions in an area N and computes how much conditions in a subset of N (S) deviate from these medium conditions.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, Function to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS), which represents how similar a point is to a reference set of points, with respect to a set of predictor variables&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.niche.similarity|version=7}}: Module to quantify niche similarity or overlap between all pairs of input raster layers, using an index based on Warren et al. (2008) or the index proposed by Schoeners D (Schoener, 1968).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.northerness.easterness ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.northerness.easterness|version=7}}: Calculations of northerness, easterness and the interaction between northerness and slope.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.quantile.ref ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.quantile.ref|version=7}} calculates the quantile of a current observation compared to a time series of previous observations. This can be used to compare e.g current temperature or rainfall to previously recorded temperature or rainfall and to answer the question if the current observation is unusually low or high or even lower or higher than ever observed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.random.weight ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.random.weight|version=7}}: Generates a raster layer with a weighted random selection of the raster cells (selected cells are assigned a value 1, other a value 0). The user needs to provide a weight raster layer, which defines for each cell the the weight (probablity to be selected).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.recode.attr ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.recode.attr|version=7}}: To reclass/recode a raster layer based on values in a csv table.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' calculates linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.resamp.tps ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.resamp.tps|version=7}}''' does spatial TPS interpolation with optional covariables.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.roughness.vector ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.roughness.vector|version=7}}''' is a module to calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann and Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.seasons ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.seasons|version=7}}''' extracts the number of seasons as well as their start and end dates from a time series according to a given threshold and a minimum season length. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.series.diversity ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.diversity|version=7}}''' is a module that computes one or more biodiversity indices based on the values of a series of 2 or more input layers. Indices currently implemented are Species richness, Shannon index, Effective number of species (ENS), Pielou's eveness or equitability index, Inverse Simpson index (Simpson's Reciprocal Index), and the Gini-Simpson index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.series.lwr ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.lwr|version=7}}''' uses a local weighted regression (LWR) on a time series to 1) remove outliers, 2) fill gaps int the time series by fitting a polynomial function of user-defined order to the observations. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.smooth.seg ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.smooth.seg|version=7}}''' generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. The module implements the Mumford-Shah variational model for image segmentation.&lt;br /&gt;
&lt;br /&gt;
An overview of the underlying theory with some applications can be found  &lt;br /&gt;
[http://dx.doi.org/10.1016/j.isprsjprs.2012.02.005 here (Journal paper)]. &amp;lt;br&amp;gt;&lt;br /&gt;
Other examples of use of the module can be found &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/sw here (Web page)] and &lt;br /&gt;
[http://download.osgeo.org/osgeo/foss4g/2009/SPREP/2Thu/Parkside%20GO4/1500/Thu%20G04%201545%20Zatelli.pdf here (Presentation @ FOSS4G 2009 - pdf)]. &amp;lt;br&amp;gt;&lt;br /&gt;
For details on the numerical implementation see &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/misc/vitti_phd.pdf here (PhD thesis - pdf)].&lt;br /&gt;
&lt;br /&gt;
In GRASS 6 the module was named &amp;quot;r.seg&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In GRASS 7 the module was formerly named &amp;quot;r.segment&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.variables ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.variables|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network. &lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.stream.watersheds ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.watersheds|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.valley.bottom ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.valley.bottom|version=7}}: Calculation of a Multi-resolution Valley Bottom Flatness (MrVBF) index.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.vif====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vif|version=7}}, Compute the variance inflaction factor (VIF) and the square root of the VIF. The variable with the highest VIF will be dropped and the VIF will be recomputed. This will be repeated till an user-defined VIF threshold value is reached.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23696</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23696"/>
		<updated>2016-11-03T20:31:31Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: +r.series.lwr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.bioclim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.bioclim|version=7}} calculates various bioclimatic indices from monthly temperature and optional precipitation time series (see http://worldclim.org/bioclim). The time series can be averages for several years or monthly values for a specific year. In any case all 12 months must be provided. If a precipitation time series is not provided, only those indices based on temperature are calculated.&lt;br /&gt;
&lt;br /&gt;
==== r.bitpattern ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.catchment ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
'''(more modules missing here, for now see manual above or fix this Wiki page!)'''&lt;br /&gt;
&lt;br /&gt;
==== r.category.trim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.category.trim|version=7}}: Export the categories, category labels and colour codes (RGB) as csv file or as a QGIS colour map file. When required, removes non-existing categories and their colour definitions. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.change.info ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.change.info|version=7}} detects changes in landscape structure using methods from decision tree induction (machine learning). These methods are largely based on concepts of information theory. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.droka ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.droka|version=7}}: This script defines rockfall zones from a digital elevation model (DEM) and vector layer containing starting point or points.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Filipello and Daniele Strigaro &lt;br /&gt;
&lt;br /&gt;
==== r.euro.ecosystem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.euro.ecosystem|version=7}} Sets colors and category labels of European ecosystem raster data sets.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.fidimo|version=7}}: [http://jradinger.wordpress.com/fidimo/ FIDIMO] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
==== r.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flexure|version=7}}: r.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is an addon to create a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Maning Sambale, Stefan Sylla (original script) and Paulo van Breugel (present script)&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.lfp ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.lfp|version=7}} creates a longest flow path raster map using a drainage direction raster map and the coordinates of an outlet point. The module internally runs &amp;lt;em&amp;gt;r.stream.distance&amp;lt;/em&amp;gt; twice to calculate flow length downstream and upstream raster maps, and combines them to get the longest flow path. An input drainage map can be created using {{cmd|r.watershed}} or {{cmd|r.stream.extract}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.meb ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.meb|version=7}}: The multivariate environmental bias (MEB) takes the medium conditions in an area N and computes how much conditions in a subset of N (S) deviate from these medium conditions.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, Function to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS), which represents how similar a point is to a reference set of points, with respect to a set of predictor variables&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.niche.similarity|version=7}}: Module to quantify niche similarity or overlap between all pairs of input raster layers, using an index based on Warren et al. (2008) or the index proposed by Schoeners D (Schoener, 1968).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.northerness.easterness ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.northerness.easterness|version=7}}: Calculations of northerness, easterness and the interaction between northerness and slope.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.quantile.ref ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.quantile.ref|version=7}} calculates the quantile of a current observation compared to a time series of previous observations. This can be used to compare e.g current temperature or rainfall to previously recorded temperature or rainfall and to answer the question if the current observation is unusually low or high or even lower or higher than ever observed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.random.weight ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.random.weight|version=7}}: Generates a raster layer with a weighted random selection of the raster cells (selected cells are assigned a value 1, other a value 0). The user needs to provide a weight raster layer, which defines for each cell the the weight (probablity to be selected).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.recode.attr ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.recode.attr|version=7}}: To reclass/recode a raster layer based on values in a csv table.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.roughness.vector ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.roughness.vector|version=7}}''' is a module to calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann and Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.series.diversity ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.diversity|version=7}}''' is a module that computes one or more biodiversity indices based on the values of a series of 2 or more input layers. Indices currently implemented are Species richness, Shannon index, Effective number of species (ENS), Pielou's eveness or equitability index, Inverse Simpson index (Simpson's Reciprocal Index), and the Gini-Simpson index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.series.lwr ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.lwr|version=7}}''' uses a local weighted regression (LWR) on a time series to 1) remove outliers, 2) fill gaps int the time series by fitting a polynomial function of user-defined order to the observations. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.smooth.seg ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.smooth.seg|version=7}}''' generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. The module implements the Mumford-Shah variational model for image segmentation.&lt;br /&gt;
&lt;br /&gt;
An overview of the underlying theory with some applications cab be found  &lt;br /&gt;
[http://dx.doi.org/10.1016/j.isprsjprs.2012.02.005 here (Journal paper)]. &amp;lt;br&amp;gt;&lt;br /&gt;
Other examples of use of the module can be found &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/sw here (Web page)] and &lt;br /&gt;
[http://download.osgeo.org/osgeo/foss4g/2009/SPREP/2Thu/Parkside%20GO4/1500/Thu%20G04%201545%20Zatelli.pdf here (Presentation @ FOSS4G 2009 - pdf)]. &amp;lt;br&amp;gt;&lt;br /&gt;
For details on the numerical implementation see &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/misc/vitti_phd.pdf here (PhD thesis - pdf)].&lt;br /&gt;
&lt;br /&gt;
In GRASS 6 the module was named &amp;quot;r.seg&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In GRASS 7 the module was formerly named &amp;quot;r.segment&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.extract|version=7}}: Stream network extraction.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.variables ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.variables|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network. &lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.stream.watersheds ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.watersheds|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.valley.bottom ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.valley.bottom|version=7}}: Calculation of a Multi-resolution Valley Bottom Flatness (MrVBF) index.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.vif====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vif|version=7}}, Compute the variance inflaction factor (VIF) and the square root of the VIF. The variable with the highest VIF will be dropped and the VIF will be recomputed. This will be repeated till an user-defined VIF threshold value is reached.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23693</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23693"/>
		<updated>2016-10-28T13:54:09Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MOD09A1/MYD09A1 version 6: no bitshift needed for qa&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the MODLAND QA bits, use&lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
To extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. On the other hand, MODLAND QA bits sometimes indicate pixel &amp;quot;... not produced for other reasons, some or all bands ...&amp;quot;. In this case, the band-specific data quality needs to be checked. That means pixels should only be discarded if both MODLAND QA &amp;gt; 1 and band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 8 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The nodata (NULL) value is set to 0 (zero) which is not mentioned in the documentation, but set in the hdf file and recognized by GDAL. Unfortunately, the value 0 (zero) also indicates highest quality pixels. In order to preserve pixels with value 0 (zero), the nodata value needs to be changed with &amp;quot;gdalbuildvrt -srcnodata 255 -vrtnodata 255&amp;quot; or with &amp;quot;gdal_translate -a_nodata 255&amp;quot; or after import into GRASS with &amp;quot;r.null null=255&amp;quot;. After that, pixels with a QC value of 0 and a valid LST value are of highest quality, while pixels with a QC value of 0 and an invalid LST value can be set to NULL. &lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
 lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The VI usefulness bits are sometimes indicating 1111 = &amp;quot;Not useful for any other reason/not processed&amp;quot;, even for a reasonable VI value and MODLAND QA bits indicating good quality. Therefore the VI usefulness should be used with care, or not at all. The MODLAND QA bits extracted with&lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels with qa &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23692</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23692"/>
		<updated>2016-10-28T12:50:33Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MOD09A1/MYD09A1 version 6: use both MODLAND QA and band data quality&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the MODLAND QA bits, use&lt;br /&gt;
&lt;br /&gt;
 qa = (quality &amp;gt;&amp;gt;&amp;gt; 0) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
The shift by 0 bits is used here to force r.mapcalc to cast quality to unsigned int 32 bit, otherwise the result might not be correct (implementation-defined).&lt;br /&gt;
&lt;br /&gt;
To extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. On the other hand, MODLAND QA bits sometimes indicate pixel &amp;quot;... not produced for other reasons, some or all bands ...&amp;quot;. In this case, the band-specific data quality needs to be checked. That means pixels should only be discarded if both MODLAND QA &amp;gt; 1 and band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 8 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The nodata (NULL) value is set to 0 (zero) which is not mentioned in the documentation, but set in the hdf file and recognized by GDAL. Unfortunately, the value 0 (zero) also indicates highest quality pixels. In order to preserve pixels with value 0 (zero), the nodata value needs to be changed with &amp;quot;gdalbuildvrt -srcnodata 255 -vrtnodata 255&amp;quot; or with &amp;quot;gdal_translate -a_nodata 255&amp;quot; or after import into GRASS with &amp;quot;r.null null=255&amp;quot;. After that, pixels with a QC value of 0 and a valid LST value are of highest quality, while pixels with a QC value of 0 and an invalid LST value can be set to NULL. &lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
 lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The VI usefulness bits are sometimes indicating 1111 = &amp;quot;Not useful for any other reason/not processed&amp;quot;, even for a reasonable VI value and MODLAND QA bits indicating good quality. Therefore the VI usefulness should be used with care, or not at all. The MODLAND QA bits extracted with&lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels with qa &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23691</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23691"/>
		<updated>2016-10-27T20:01:27Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MOD13Q1/MYD13Q1 version 6: update quality filtering&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 8 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The nodata (NULL) value is set to 0 (zero) which is not mentioned in the documentation, but set in the hdf file and recognized by GDAL. Unfortunately, the value 0 (zero) also indicates highest quality pixels. In order to preserve pixels with value 0 (zero), the nodata value needs to be changed with &amp;quot;gdalbuildvrt -srcnodata 255 -vrtnodata 255&amp;quot; or with &amp;quot;gdal_translate -a_nodata 255&amp;quot; or after import into GRASS with &amp;quot;r.null null=255&amp;quot;. After that, pixels with a QC value of 0 and a valid LST value are of highest quality, while pixels with a QC value of 0 and an invalid LST value can be set to NULL. &lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
 lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The VI usefulness bits are sometimes indicating 1111 = &amp;quot;Not useful for any other reason/not processed&amp;quot;, even for a reasonable VI value and MODLAND QA bits indicating good quality. Therefore the VI usefulness should be used with care, or not at all. The MODLAND QA bits extracted with&lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels with qa &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23690</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23690"/>
		<updated>2016-10-26T20:21:35Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MOD11A1/MYD11A1 version 6: handle QC fill value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 8 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The nodata (NULL) value is set to 0 (zero) which is not mentioned in the documentation, but set in the hdf file and recognized by GDAL. Unfortunately, the value 0 (zero) also indicates highest quality pixels. In order to preserve pixels with value 0 (zero), the nodata value needs to be changed with &amp;quot;gdalbuildvrt -srcnodata 255 -vrtnodata 255&amp;quot; or with &amp;quot;gdal_translate -a_nodata 255&amp;quot; or after import into GRASS with &amp;quot;r.null null=255&amp;quot;. After that, pixels with a QC value of 0 and a valid LST value are of highest quality, while pixels with a QC value of 0 and an invalid LST value can be set to NULL. &lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
 lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The MODLAND QA bits are sometimes indicating low quality or pixel not produced, even for a reasonable VI value and usefulness indicating good quality. Therefore the MODLAND QA bits should be used with care, or not at all. The VI usefulness extracted with&lt;br /&gt;
&lt;br /&gt;
 usefulness = (quality &amp;gt;&amp;gt; 2) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23689</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23689"/>
		<updated>2016-10-26T12:22:17Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MOD11A1/MYD11A1 version 6 change qc data type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 8 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
  lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The MODLAND QA bits are sometimes indicating low quality or pixel not produced, even for a reasonable VI value and usefulness indicating good quality. Therefore the MODLAND QA bits should be used with care, or not at all. The VI usefulness extracted with&lt;br /&gt;
&lt;br /&gt;
 usefulness = (quality &amp;gt;&amp;gt; 2) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23688</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23688"/>
		<updated>2016-10-26T07:20:27Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Quality Control +MOD11A1 + MOD13Q1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (7 = noisy detector or 8 = dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
==== MOD11A1/MYD11A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Land Surface Temperature (LST) at 1 km resolution, daily&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdatasets are &amp;quot;QC_Day&amp;quot; and &amp;quot;QC_Night&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: Mandatory QA flag&lt;br /&gt;
* bits 2 - 3: Data quality flag&lt;br /&gt;
* bits 4 - 5: Emissivity error flag &lt;br /&gt;
* bits 6 - 7: LST error flag&lt;br /&gt;
&lt;br /&gt;
The most useful bit fields are the &amp;quot;Mandatory QA flag&amp;quot;, extracted with &lt;br /&gt;
&lt;br /&gt;
 qa = quality &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
and the &amp;quot;LST error flag&amp;quot;, extracted with&lt;br /&gt;
&lt;br /&gt;
  lst_error = (quality &amp;gt;&amp;gt; 6) &amp;amp; 3&lt;br /&gt;
&lt;br /&gt;
==== MOD13Q1/MYD13Q1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Vegetation indices (NDVI and EVI) at 250 meter resolution for every 16 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;250m 16 days VI Quality&amp;quot;. The type is unsigned int 16 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: VI usefulness&lt;br /&gt;
* bits 6 - 7: Aerosol Quantity &lt;br /&gt;
* bit 8: Adjacent cloud detected&lt;br /&gt;
* bit 9: Atmosphere BRDF Correction&lt;br /&gt;
* bit 10: Mixed Clouds&lt;br /&gt;
* bits 11 - 13: Land/Water Mask&lt;br /&gt;
* bit 14: Possible snow/ice&lt;br /&gt;
* bit 15: Possible shadow&lt;br /&gt;
&lt;br /&gt;
The MODLAND QA bits are sometimes indicating low quality or pixel not produced, even for a reasonable VI value and usefulness indicating good quality. Therefore the MODLAND QA bits should be used with care, or not at all. The VI usefulness extracted with&lt;br /&gt;
&lt;br /&gt;
 usefulness = (quality &amp;gt;&amp;gt; 2) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
is sufficient to filter out bad quality pixels.&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23687</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23687"/>
		<updated>2016-10-25T21:41:53Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Land Products Quality Control: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
 bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;Sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
 band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (noisy detector or dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23686</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23686"/>
		<updated>2016-10-25T21:36:29Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Land Products Quality Control: r.mapcalc expressions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb (first start bit is 0) and number of bits from start bit = nb is the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression using standard math:&lt;br /&gt;
&lt;br /&gt;
bitfield = (quality / (2 ^ sb)) % (2 ^ nb)&lt;br /&gt;
&lt;br /&gt;
or in bit operation notation:&lt;br /&gt;
&lt;br /&gt;
bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;Sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (noisy detector or dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance).&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23685</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23685"/>
		<updated>2016-10-25T21:14:42Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Land +quality control&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== MODIS Land Products Quality Control ===&lt;br /&gt;
&lt;br /&gt;
A number of MODIS Land products include a quality subdataset that is bit-encoded: different bit ranges represent different quality assessments.&lt;br /&gt;
&lt;br /&gt;
The general formula to extract a specific bit range for start bit = sb and number of bits from start bit = nb is&lt;br /&gt;
&lt;br /&gt;
the modulus of (quality divided by 2 to the power of the first start bit) by 2 to the power of number of bits - 1, or as r.mapcalc expression:&lt;br /&gt;
&lt;br /&gt;
bitfield = (quality &amp;gt;&amp;gt; sb) &amp;amp; ((1 &amp;lt;&amp;lt; nb) - 1)&lt;br /&gt;
&lt;br /&gt;
==== MOD09A1/MYD09A1 version 6 ====&lt;br /&gt;
&lt;br /&gt;
Surface reflectance of MODIS bands 1 - 7 at 500 meter resolution for every 8 days&lt;br /&gt;
&lt;br /&gt;
The name of the quality control subdataset is &amp;quot;Sur_refl_qc_500m&amp;quot;. The type is unsigned int 32 bit, and the contents are&lt;br /&gt;
* bits 0 - 1: MODLAND QA bits&lt;br /&gt;
* bits 2 - 5: band 1 data quality &lt;br /&gt;
* bits 6 - 9: band 2 data quality &lt;br /&gt;
* bits 10 - 13: band 3 data quality &lt;br /&gt;
* bits 14 - 17: band 4 data quality &lt;br /&gt;
* bits 18 - 21: band 5 data quality &lt;br /&gt;
* bits 22 - 25: band 6 data quality &lt;br /&gt;
* bits 26 - 29 band 7 data quality &lt;br /&gt;
* bit 30: atmospheric correction performe &lt;br /&gt;
* bit 31: adjacency correction performed &lt;br /&gt;
&lt;br /&gt;
Here, the quality subdataset is of type unsigned int 32 bit, therefore you need to use '&amp;gt;&amp;gt;&amp;gt;' instead of '&amp;gt;&amp;gt;' in r.mapcalc expressions. For example, to extract the quality of band 2, use&lt;br /&gt;
&lt;br /&gt;
band2_quality = (quality &amp;gt;&amp;gt;&amp;gt; 6) &amp;amp; 15&lt;br /&gt;
&lt;br /&gt;
* See the user guide at https://lpdaac.usgs.gov/sites/default/files/public/product_documentation/mod09_user_guide_v1.4.pdf&lt;br /&gt;
&lt;br /&gt;
The band quality might indicate lower quality (noisy detector or dead detector), even though the MODLAND QA bits indicate ideal quality on all bands. If in doubt, the MODLAND QA bits are right and the band quality bits are wrong. That means if the MODLAND QA bits indicate ideal quality, the band values are most probably useful even if a given band quality indicates less than ideal band quality: discard a band value if MODLAND QA &amp;gt; 1 and if band quality &amp;gt; 8 (maybe band quality &amp;gt; 12 for high tolerance). &lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23684</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23684"/>
		<updated>2016-10-25T20:27:39Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Aqua -&amp;gt; MODIS Ocean&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Ocean ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23683</id>
		<title>MODIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=MODIS&amp;diff=23683"/>
		<updated>2016-10-25T20:26:49Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: MODIS Terra -&amp;gt; MODIS Land&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
* [http://modis.gsfc.nasa.gov/ About MODIS]&lt;br /&gt;
&lt;br /&gt;
There are two satellites, Aqua and Terra which carry the MODIS sensor as payload. The Moderate Resolution Imaging Spectroradiometer (MODIS) is a 36-channel from visible to thermal-infrared sensor that was launched as part of the Terra satellite payload in December 1999 and Aqua satellite (May 2002). The Terra satellite passes twice a day (at about 10:30am, and 22:30pm local time), also the Aqua satellite passes twice a day (at about 01:30am, and 13:30pm local time).&lt;br /&gt;
&lt;br /&gt;
'''Details about the sensor'''&lt;br /&gt;
(compiled from various sources)&lt;br /&gt;
&lt;br /&gt;
MODIS (MODerate resolution Imaging Spectroradiometer) is a whiskbroom multi-spectral sensor (across track scanner) on board the satellites Terra and Aqua that measures 36 spectral frequencies of light. Its swath is 2330 km (across track) by 10° of latitude (along track at nadir). Their circular, sun-synchronous, near polar orbit takes about 99 min. which means that the same region is acquired several times during daylight. However, at nadir observations of the same region are taken every 16 days. A complete earth scan is achieved every 1.2 days. Due to its large swath geometric distortions occur at the scan edges. The pixel size grows with the scan angle, by a factor of 8 at the edge of scan, making the shape of each scan-stripe look like a bow-tie. Successively, the scan-stripes being wider at the edges of the scan, overlap each other. This overlap creates a double-vision effect on the edges of the scan, as each point of the Earth’s surface appears in two adjacent scans. This distortion emphasises the line where scan-stripes meet and, thus, magnifies small differences between the sides of the scan mirror.&lt;br /&gt;
&lt;br /&gt;
MODIS Sinusoidal Grid SHAPE files can be downloaded [http://gis.cri.fmach.it/modis-sinusoidal-gis-files/ here]&lt;br /&gt;
&lt;br /&gt;
== MODIS Land ==&lt;br /&gt;
&lt;br /&gt;
MODIS Land provides many data products including:&lt;br /&gt;
* Daily Surface Reflectance&lt;br /&gt;
* Snow coverage&lt;br /&gt;
* NDVI / EVI Vegetation index&lt;br /&gt;
* Land Surface Temperature (LST)&lt;br /&gt;
* Atmosphere Daily Global Products&lt;br /&gt;
* many more&lt;br /&gt;
&lt;br /&gt;
Most products are created separately for the different MODIS sensors onboard the TERRA (MOD products) and AQUA (MYD products) satellites. Many products are also available as a combined MODIS product (MCD products).&lt;br /&gt;
&lt;br /&gt;
See [http://modis-land.gsfc.nasa.gov/ MODIS Land Team Home Page]&lt;br /&gt;
&lt;br /&gt;
=== Advanced MODIS LST time series reconstruction ===&lt;br /&gt;
&lt;br /&gt;
* See http://www.geodati.fmach.it/eurolst.html (LST dataset download)&lt;br /&gt;
&lt;br /&gt;
== MODIS Aqua ==&lt;br /&gt;
&lt;br /&gt;
Sea surface color, temperature, and derivative images&lt;br /&gt;
* http://oceancolor.gsfc.nasa.gov/PRODUCTS/&lt;br /&gt;
&lt;br /&gt;
The following examples assume you want to import multiple images at once, and so use shell scripting loops.  They also assume input files are SMI (Standard Mapped Image) format, as produced by the Ocean Color group (http://oceancolor.gsfc.nasa.gov).&lt;br /&gt;
&lt;br /&gt;
=== SST (Level 3) ===&lt;br /&gt;
&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/cgi/l3&lt;br /&gt;
: You'll probably want the Standard Mapped Image (SMI) file version, not the Binned (BIN) one.&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023532002360.L3m_8D_SST_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 353: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 360: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * 8D: 8 day ensemble&lt;br /&gt;
 * SST: Sea Surface Temperature product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023532002360.L3m_8D_SST_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
Example of SST metadata from gdalinfo:&lt;br /&gt;
  Parameter=Sea Surface Temperature&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=deg-C&lt;br /&gt;
  Scaling Equation=(Slope*l3m_data) + Intercept = Parameter value&lt;br /&gt;
  Slope=0.000717185&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=-2&lt;br /&gt;
  Scaled Data Maximum=45&lt;br /&gt;
  Data Minimum=-1.999999&lt;br /&gt;
  Data Maximum=37.06&lt;br /&gt;
 Subdatasets:&lt;br /&gt;
  SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:0&lt;br /&gt;
  SUBDATASET_1_DESC=[4320x8640] l3m_data (16-bit unsigned integer)&lt;br /&gt;
  SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:&amp;quot;A20023532002360.L3m_8D_SST_4&amp;quot;:1&lt;br /&gt;
  SUBDATASET_2_DESC=[4320x8640] l3m_qual (8-bit unsigned integer)&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
GRASS can be quite strict about moving maps around between differing map projections. Because GDAL does not automatically georeference HDF4 images, we need to apply the georeferencing information manually. This is a slight chore, but means fewer errors due to projection mis-matches later on. Everything we need to know is given in the data file's meta-data, as seen with &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Method 0 =====&lt;br /&gt;
&lt;br /&gt;
The USGS/NASA's [https://lpdaac.usgs.gov/tools/modis_reprojection_tool MODIS Reprojection Tool] (MRT) support reprojection for Level 3 data or [https://lpdaac.usgs.gov/tools/modis_reprojection_tool_swath MODIS Swath Reprojection Tool] for Level 1B or 2 data and can be used to create a GeoTiff. This requires the [ftp://ladsweb.nascom.nasa.gov/allData/5/MOD03/ geolocation angles].&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
Use GDAL tools to prepare the dataset and create a GeoTiff which can be directly imported into GRASS.&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?&lt;br /&gt;
: -- Encode with +ellps=sphere (?) or epsg:32662?, see http://lists.osgeo.org/pipermail/gdal-dev/2007-September/014134.html or http://thread.gmane.org/gmane.comp.gis.gdal.devel/12666''&lt;br /&gt;
: FIXME: gdalinfo: &amp;quot;  Map Projection=Equidistant Cylindrical&amp;quot;&lt;br /&gt;
: Use &amp;quot;&amp;lt;tt&amp;gt;+nadgrids=@null&amp;lt;/tt&amp;gt;&amp;quot; trick?? http://proj.maptools.org/faq.html#sphere_as_wgs84&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to extract the desired data array from the HDF4 file and convert into a GeoTiff. While creating the GeoTiff specify the map projection, bounding box, and no-data information. Then import this GeoTiff using the {{cmd|r.in.gdal}} module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
Note: this shell script is best stored in a text file and then executed:&lt;br /&gt;
 for file in A*SST_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0  ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
Import raw HDF4 data into a &amp;lt;strike&amp;gt;XY location, clean it up, then copy into a lat/lon location&amp;lt;/strike&amp;gt; lat/lon location using the new {{cmd|r.in.gdal|version=65}} &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; flag in GRASS 6.5+. This is more work than method 1 but demonstrates using GRASS tools to do the manipulation instead of GDAL tools (the result should be the same).&lt;br /&gt;
&lt;br /&gt;
====== Extract ======&lt;br /&gt;
&lt;br /&gt;
Because the HDF4 data file contains multiple data arrays we need to extract the one we are interested in. In this example we extract the &amp;quot;data&amp;quot; layer but not the &amp;quot;quality&amp;quot; layer, and output a GeoTIFF file using GDAL's &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; tool, using the appropriate SUBDATASET NAME:&lt;br /&gt;
&lt;br /&gt;
 for file in *SST_4 ; do&lt;br /&gt;
   gdal_translate HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:0 ${file}_unproj.tif&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
====== Import ======&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in *unproj.tif ; do&lt;br /&gt;
   BASE=`basename $file _unproj.tif`&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$BASE&lt;br /&gt;
   r.region $BASE n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but using &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; instead of moving the mapset manually. See the more detailed explanation in the Chlorophyll section below.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to temperature in degrees C. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=0.000717185&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.degC = ($Slope * $map) + $Intercept&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.degC&amp;quot; units=&amp;quot;deg-C&amp;quot;&lt;br /&gt;
   #r.colors &amp;quot;${map}.degC&amp;quot; color=bcyr  # fairly nice&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
 r.univar A20023532002360.L3m_8D_SST_4.degC&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
Although the standard &amp;lt;tt&amp;gt;bcyr&amp;lt;/tt&amp;gt; color map looks nice, for a ''very'' nice image we can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted temperatures are -2-45 deg C.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same scaling function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to temperature values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS SST&amp;quot; &amp;gt; palette_sst.gcolors&lt;br /&gt;
 Slope=0.000717185&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_sst.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         (Slope * (($1 +1)^2 -1) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_sst.gcolors&lt;br /&gt;
 # better: edit last rule to be 45.000719 206:206:206&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*SST_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.degC&amp;quot; rules=palette_sst.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Apply a quality mask ====&lt;br /&gt;
&lt;br /&gt;
If there is cloud cover, the satellite will show the temperature at the top of the cloud, not at the sea surface. The HDF data comes with a quality layer and we can use it to restrict the data only to areas with the highest confidence.&lt;br /&gt;
&lt;br /&gt;
Select the file:&lt;br /&gt;
 file=T2010235.L3m_DAY_SST_4km&lt;br /&gt;
 echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Extract the quality layer from the HDF data file:&lt;br /&gt;
 gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
   -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
   HDF4_SDS:UNKNOWN:&amp;quot;$file&amp;quot;:1  ${file}.qual_prep.tif&lt;br /&gt;
&lt;br /&gt;
Import the extracted GeoTiff with {{cmd|r.in.gdal}}:&lt;br /&gt;
 r.in.gdal in=${file}.qual_prep.tif out=$file.qual&lt;br /&gt;
&lt;br /&gt;
Set up some color rules to cover the quality status categories using {{cmd|r.colors}}:&lt;br /&gt;
 r.colors $file.qual col=rules &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 green&lt;br /&gt;
   1 yellow &lt;br /&gt;
   2 red&lt;br /&gt;
   255 black&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Assign quality map category labels with {{cmd|r.category}}:&lt;br /&gt;
 r.category $file.qual rules=- &amp;lt;&amp;lt; EOF&lt;br /&gt;
 0:best quality&lt;br /&gt;
 1:not as good quality&lt;br /&gt;
 2:rather bad quality&lt;br /&gt;
 3:pretty bad quailty&lt;br /&gt;
 4:254:really bad quality&lt;br /&gt;
 255:unusable quality&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
Setup a MASK map to only show the best quality data using a {{cmd|r.reclass}} virtual raster:&lt;br /&gt;
 r.reclass in=$file.qual out=MASK --o &amp;lt;&amp;lt; EOF&lt;br /&gt;
   0 = 1     good quality&lt;br /&gt;
   * = NULL&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
With the ''MASK'' map in place, redrawing the map display (or any other raster processing) will only occur for the good data cells.&lt;br /&gt;
&lt;br /&gt;
=== Chlorophyll-a (Level 3) ===&lt;br /&gt;
==== Get the data ====&lt;br /&gt;
* Get data in HDF4 format from http://oceancolor.gsfc.nasa.gov/PRODUCTS/L3_chlo.html&lt;br /&gt;
&lt;br /&gt;
File names look like: &amp;lt;tt&amp;gt;A20023352002365.L3m_MO_CHLO_4&amp;lt;/tt&amp;gt;&lt;br /&gt;
:''key:''&lt;br /&gt;
 * A: MODIS/Aqua&lt;br /&gt;
 * 2002: Year at start&lt;br /&gt;
 * 335: Julian day at start&lt;br /&gt;
 * 2002: Year at end&lt;br /&gt;
 * 365: Julian day at end&lt;br /&gt;
 * L3m: Level 3 data, mapped (Plate carrée)&lt;br /&gt;
 * MO: One month ensemble&lt;br /&gt;
 * CHLO: Chlorophyll ''a'' concentration product&lt;br /&gt;
 * 4: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Decompress ====&lt;br /&gt;
Run this command in the command line:&lt;br /&gt;
 bzip2 -d A20023352002365.L3m_MO_CHLO_4.bz2&lt;br /&gt;
&lt;br /&gt;
==== Check ====&lt;br /&gt;
Use [http://www.gdal.org GDAL's] &amp;lt;tt&amp;gt;gdalinfo&amp;lt;/tt&amp;gt; tool to view the HDF file's meta-data. Run this command in the command line:&lt;br /&gt;
 gdalinfo A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
Example of CHLO metadata from gdalinfo:&lt;br /&gt;
  Parameter=Chlorophyll a concentration&lt;br /&gt;
  Measure=Mean&lt;br /&gt;
  Units=mg m^-3&lt;br /&gt;
  Scaling=logarithmic&lt;br /&gt;
  Scaling Equation=Base**((Slope*l3m_data) + Intercept) = Parameter value&lt;br /&gt;
  Base=10&lt;br /&gt;
  Slope=5.813776e-05&lt;br /&gt;
  Intercept=-2&lt;br /&gt;
  Scaled Data Minimum=0.01&lt;br /&gt;
  Scaled Data Maximum=64.5654&lt;br /&gt;
  Data Minimum=0.002637&lt;br /&gt;
  Data Maximum=99.99774&lt;br /&gt;
&lt;br /&gt;
==== Import ====&lt;br /&gt;
&lt;br /&gt;
===== Method 1 =====&lt;br /&gt;
&lt;br /&gt;
* Create a Lat/Lon GRASS location and mapset&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;gdal_translate&amp;lt;/tt&amp;gt; to convert the HDF4 data into a GeoTiff, and specify map projection, bounding box, and no-data information. Then import this GeoTiff using the &amp;lt;tt&amp;gt;r.in.gdal&amp;lt;/tt&amp;gt; module. In this example we set the projection to be lat/lon WGS84 (EPSG code 4326), even though this may not be entirely correct.&lt;br /&gt;
&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
   gdal_translate -a_srs &amp;quot;+init=epsg:4326&amp;quot; -a_nodata 65535 \&lt;br /&gt;
     -a_ullr -180 90 180 -90 -co &amp;quot;COMPRESS=PACKBITS&amp;quot; \&lt;br /&gt;
     $file ${file}_prep.tif&lt;br /&gt;
 &lt;br /&gt;
   r.in.gdal in=${file}_prep.tif out=$file&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 2 =====&lt;br /&gt;
&lt;br /&gt;
''Update: in GRASS 6.5 and newer you can now use the {{cmd|r.in.gdal|version=65}} `-l` flag to import unreferenced maps directly into a lat/lon location. You must then immediately run {{cmd|r.region}} to correct the map's region bounds.''&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;lt;strike&amp;gt;simple XY&amp;lt;/strike&amp;gt; lat/lon GRASS location and mapset&lt;br /&gt;
* Import the imagery and set image bounds and resolution:&lt;br /&gt;
 for file in A*_MO_CHLO_4 ; do&lt;br /&gt;
   echo &amp;quot;map: $file&amp;quot;&lt;br /&gt;
   r.in.gdal -l in=$file out=$file&lt;br /&gt;
   r.region $file n=90 s=-90 w=-180 e=180&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 g.list rast&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
* Convert the simple XY location into a Lat/Lon location&lt;br /&gt;
: ''Plate carrée, or WGS84? -- Does it matter with data at the km scale?''&lt;br /&gt;
: Modify the location's projection settings with g.setproj? (run that from the PERMANENT mapset)&lt;br /&gt;
''Hack:'': after import move the mapset dir into a world_ll location, then edit the mapset's WIND file and change the &amp;lt;tt&amp;gt;proj:&amp;lt;/tt&amp;gt; line from 0 to 3. (0 is unprojected, 3 is LL) You also have to edit each file header in the $MAPSET/cellhd/ directory.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove NULLs&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.null $map setnull=65535&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===== Method 3 =====&lt;br /&gt;
&lt;br /&gt;
Like method 2 above, but instead of moving the mapset directory in the file system use {{cmd|i.rectify}} to move the maps into the target Lat/Lon location. After importing the images, setting their bounds, and removing NULLs, add all images to an imagery group with the {{cmd|i.group}} module. Run {{cmd|i.target}} and select a lat/lon location. The idea here is to run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; with a first-order transform, where the transform uses a scaling factor of 1.0 and rotation of 0.0, i.e. no change at all. The trick is to set those. Usually you would use {{cmd|i.points}} or the GUI georeferencing tool to set those, and here you can add a few points by hand if you like. But the POINTS file in the group's data directory should use identical coordinates for both source and destination. ''Hack:'' edit the POINTS file by hand to make it so, using the four corners and 0,0 at the center of the image. Finally run &amp;lt;tt&amp;gt;i.rectify&amp;lt;/tt&amp;gt; to push the image into the target location.&lt;br /&gt;
&lt;br /&gt;
==== Processing ====&lt;br /&gt;
&lt;br /&gt;
* Convert to chlorophyll ''a'' concentration. Note slope and intercept are taken from the image's metadata using gdalinfo.&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   echo &amp;quot;$map&amp;quot;&lt;br /&gt;
   g.region rast=$map&lt;br /&gt;
   #r.info -r $map&lt;br /&gt;
   Slope=5.813776e-05&lt;br /&gt;
   Intercept=-2&lt;br /&gt;
   r.mapcalc &amp;quot;${map}.chlor_A = 10^(($Slope * $map) + $Intercept)&amp;quot;&lt;br /&gt;
   r.support &amp;quot;${map}.chlor_A&amp;quot; units=&amp;quot;mg m^-3&amp;quot;&lt;br /&gt;
   #r.colors -e &amp;quot;${map}.chlor_A&amp;quot; color=bcyr  # :-(&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
* Check:&lt;br /&gt;
 r.info A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
 r.univar A20023352002365.L3m_MO_CHLO_4.chlor_A&lt;br /&gt;
&lt;br /&gt;
==== Set colors ====&lt;br /&gt;
&lt;br /&gt;
The chlorophyll maps are logarithmic which poses some challenges to rendering nice colors. (the unconverted import image displays nicely with a linear color map) We can use Goddard's OceanColor palettes from http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html&lt;br /&gt;
&lt;br /&gt;
Those are given in 0-255 range, the imported HDF4 data is 0-65535, and the converted chlorophyll ''a'' concentration is 0-65 mg/m^3.&lt;br /&gt;
&lt;br /&gt;
* Use the UNIX awk tool to convert each color rule with the same exponential function we used to convert the data, and save it to a rules file:&lt;br /&gt;
 # scale 0-255 to 0-65535 and then convert to chlor-a values&lt;br /&gt;
 echo &amp;quot;# Color rules for MODIS Chloropyll-a&amp;quot; &amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 Slope=5.813776e-05&lt;br /&gt;
 Intercept=-2&lt;br /&gt;
 cat palette_chl_etc.txt | grep -v '^#' | \&lt;br /&gt;
   awk -v Slope=$Slope -v Intercept=$Intercept \&lt;br /&gt;
     '{ printf(&amp;quot;%f %d:%d:%d\n&amp;quot;, \&lt;br /&gt;
         10^((Slope * (($1 +1)^2 -1)) + Intercept), $2, $3, $4)}' \&lt;br /&gt;
   &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 echo &amp;quot;nv black&amp;quot; &amp;gt;&amp;gt; palette_chl_etc.gcolors&lt;br /&gt;
 # better: edit last rule to be 64.574061 100:0:0&lt;br /&gt;
&lt;br /&gt;
The processed color rules file is here: [http://trac.osgeo.org/grass/browser/grass-addons/raster/r.colors.tools/palettes]&lt;br /&gt;
&lt;br /&gt;
* Apply color rules to imported maps:&lt;br /&gt;
&lt;br /&gt;
 for map in `g.mlist rast pat=*MO_CHLO_4` ; do&lt;br /&gt;
   r.colors &amp;quot;${map}.chlor_A&amp;quot; rules=palette_chl_etc.gcolors&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Removing holes ===&lt;br /&gt;
&lt;br /&gt;
See [[AVHRR]].&lt;br /&gt;
&lt;br /&gt;
* If it's land cover classes, {{cmd|r.fillnulls}} will produce nonsense data: floating point. Rather use {{cmd|r.neighbors}} with a modal filter, {{cmd|r.patch}} the original with the filtered map. This will replace NULLs with the most common surrounding land cover type.&lt;br /&gt;
&lt;br /&gt;
=== Rolling composite ===&lt;br /&gt;
&lt;br /&gt;
Create a rolling 28 day composite:&lt;br /&gt;
&lt;br /&gt;
Say you have weekly satellite data but there is a lot of NULL cells where there was cloud cover that day. You can fill these holes by looking for valid data in the previous week's image, and if again you find clouds, look in week prior to that, etc., up to 4 weeks have past, after which point if any holes remain give up and leave it unfilled. You can do this quite simply with r.patch:&lt;br /&gt;
&lt;br /&gt;
 r.patch output=rolling28day.date input=newest,last_week,2weeks_ago,3weeks_ago&lt;br /&gt;
&lt;br /&gt;
NULL data cells are filled using the maps in the given '''input=''' order.&lt;br /&gt;
&lt;br /&gt;
=== MODIS SWATH ===&lt;br /&gt;
&lt;br /&gt;
Here an alternative to MODIS SWATH TOOL using GDAL:&lt;br /&gt;
* https://gis.stackexchange.com/questions/81361/how-to-reproject-modis-swath-data-to-wgs84?rq=1&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[SeaWiFS]]&lt;br /&gt;
* [[AVHRR]]&lt;br /&gt;
* [http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html Decimal/Binary Conversion Tool] for MODIS QA bitpatterns&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
&lt;br /&gt;
* Alexandris, N. (2011). Burned area mapping via non-centered Principal Components Analysis using public domain data and free open source software. Department of Remote Sensing &amp;amp; Landscape Information Systems, Faculty of Forest and Environmental Sciences, Albert-Ludwigs-University, Freiburg im Breisgau, Germany. Dissertation [http://www.freidok.uni-freiburg.de/volltexte/8399 Entry at freidok.uni-freiburg.de]&lt;br /&gt;
* Carpi G., Cagnacci F., Neteler M., Rizzoli A, 2008: ''Tick infestation on roe deer in relation to geographic and remotely-sensed climatic variables in a tick-borne encephalitis endemic area''. Epidemiology and Infection, 136, pp. 1416-1424. ([http://www.ncbi.nlm.nih.gov/pubmed/18081949 PubMed])&lt;br /&gt;
* Metz, M., Rocchini, D., Neteler, M., 2014. Surface Temperatures at the Continental Scale: Tracking Changes with Remote Sensing at Unprecedented Detail. Remote Sensing 6, 3822–3840 ([http://dx.doi.org/10.3390/rs6053822 DOI], [http://www.mdpi.com/2072-4292/6/5/3822 Abstract], [http://www.mdpi.com/2072-4292/6/5/3822/pdf PDF]). Dataset download: http://gis.cri.fmach.it/eurolst&lt;br /&gt;
* Neteler, M., 2005: ''Time series processing of MODIS satellite data for landscape epidemiological applications''. International Journal of Geoinformatics, 1(1), pp. 133-138 ([http://creativecity.gscc.osaka-cu.ac.jp/IJG/article/download/325/326 PDF])&lt;br /&gt;
* Neteler, M., 2010: ''Estimating daily Land Surface Temperatures in mountainous environments by reconstructed MODIS LST data''. Remote Sensing 2(1), 333-351. ([http://dx.doi.org/10.3390/rs1020333 DOI], [http://www.mdpi.com/2072-4292/2/1/333 Abstract], [http://www.mdpi.com/2072-4292/2/1/333/pdf PDF])&lt;br /&gt;
* Neteler, M., Roiz, D., Rocchini, D., Castellani, C. and Rizzoli, A. (2011). Terra and Aqua satellites track tiger mosquito invasion: modeling the potential distribution of Aedes albopictus in north-eastern Italy. International Journal of Health Geographics, 10:49 ([http://dx.doi.org/10.1186/1476-072X-10-49 DOI] | [http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-49.pdf PDF])&lt;br /&gt;
* Neteler, M., Metz, M., Rocchini, D., Rizzoli, A., Flacio, E., Engeler, L., Guidi, V., Lüthy, P., Tonolla, M. (2013): Is Switzerland suitable for the invasion of Aedes albopictus? PLoS ONE 8(12): e82090. [[http://dx.doi.org/10.1371/journal.pone.0082090 DOI] | [http://www.plosone.org/article/fetchObject.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0082090&amp;amp;representation=PDF PDF]]&lt;br /&gt;
* Roiz D., Neteler M., Castellani C., Arnoldi D., Rizzoli A., 2011: ''Climatic Factors Driving Invasion of the Tiger Mosquito (Aedes albopictus) into New Areas of Trentino, Northern Italy''. PLoS ONE. 6(4): e14800. ([http://dx.plos.org/10.1371/journal.pone.0014800 DOI] - [http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0014800&amp;amp;representation=PDF PDF])&lt;br /&gt;
* Zorer, R., Rocchini, D., Metz, M., Delucchi, L., Zottele, F., Meggio, F., Neteler, M. (2013): Daily MODIS Land Surface Temperature Data for the Analysis of the Heat Requirements of Grapevine Varieties. IEEE Transactions on Geoscience and Remote Sensing 51, 2128–2135. ([http://dx.doi.org/10.1109/TGRS.2012.2226465 DOI])&lt;br /&gt;
&lt;br /&gt;
[[Category: Geodata]]&lt;br /&gt;
[[Category:Image processing]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=23466</id>
		<title>AddOns/GRASS7/vector</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=23466"/>
		<updated>2016-08-25T18:59:46Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: +v.surf.tps, +Author&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/vector/&lt;br /&gt;
&lt;br /&gt;
==== v.area.weigh ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.area.weigh|version=7}} creates a raster surface from vector areas using known cell weights and preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count with the area's population concentrated on the known location of urban areas.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.build.pg ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.build.pg|version=7}} builds PostGIS topology for feature tables linked via v.external.&lt;br /&gt;
&lt;br /&gt;
==== v.centerline ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.centerline|version=7}} takes a map of vector lines and creates a new map containing a central line&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Moritz Lennert&lt;br /&gt;
&lt;br /&gt;
==== v.centerpoint ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.centerpoint|version=7}} calculates various center points for points, lines and areas: center of gravity, geometric median etc.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.class.mlpy ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.class.mlpy|version=7}} classifies vector features. It is an interface to the [http://mlpy.sourceforge.net mlpy library] (Machine Learning Python). Classification is supervised and based on attribute table data. Geometry is not used. A training dataset is always required.&lt;br /&gt;
&lt;br /&gt;
==== v.colors2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.colors|version=7}} is much like r.colors, but may be used for vector maps.&lt;br /&gt;
&lt;br /&gt;
==== v.concave.hull ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.concave.hull|version=7}} creates a concave hull describing the shape of point clouds.&lt;br /&gt;
&lt;br /&gt;
==== v.delaunay3d ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.delaunay3d|version=7}} creates a 3D triangulation from an input vector map containing points or centroids.&lt;br /&gt;
&lt;br /&gt;
Requires [http://www.cgal.org CGAL library].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Martin Landa&lt;br /&gt;
&lt;br /&gt;
==== v.external.all ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.external.all|version=7}} creates (using v.external) in the current mapset new pseudo-vector maps for all OGR layers from given OGR datasource (dsn option).&lt;br /&gt;
&lt;br /&gt;
==== v.fixed.segmentpoints ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.fixed.segmentpoints|version=7}} creates segment points along a vector line with fixed distances by using the v.segment module.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== v.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.flexure|version=7}}: v.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== v.habitat.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.habitat.dem|version=7}} calculates DEM and solar derived characteristics of habitat polygons.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== v.in.gbif ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.gbif|version=7}} imports GBIF species distribution data via GDAL vector VRT.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== v.in.geopaparazzi ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.geopaparazzi|version=7}} imports all elements saved into [http://code.google.com/p/geopaparazzi/ Geopaparazzi].&lt;br /&gt;
&lt;br /&gt;
==== v.in.natura2000 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.natura2000|version=7}} imports Natura 2000 (sqlite/spatialite) GIS data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== v.in.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.ply|version=7}} is a C program that imports a PLY file and writes it as GRASS vector map.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.in.redlist ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.redlist|version=7}} imports IUCN Red List Spatial Data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== v.in.redwg ====&lt;br /&gt;
&lt;br /&gt;
: [http://lists.gnu.org/archive/html/info-libredwg/2010-08/msg00000.html v.in.redwg imports DWG files into GRASS.], see also [https://svn.osgeo.org/grass/grass-addons/grass7/vector/v.in.redwg here]&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Rodrigo Rodrigues da Silva&lt;br /&gt;
&lt;br /&gt;
==== v.in.wfs2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.wfs2|version=7}} imports OGC WFS maps (Web Feature Service) from external servers.&lt;br /&gt;
&lt;br /&gt;
==== v.isochrones ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.isochrones|version=7}} takes a map of roads and starting points and creates isochrone polygons around the starting points&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Moritz Lennert&lt;br /&gt;
&lt;br /&gt;
==== v.lidar.mcc ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.lidar.mcc|version=7}} applies a Multi Curvature Classification procedure on LiDAR point clouds e.g. for filtering vegetation returns. The module is also usable for discrete LiDAR.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath&lt;br /&gt;
&lt;br /&gt;
==== v.maxent.swd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.maxent.swd|version=7}} Produce a set of text file (SWD file) which can be used as input to MaxEnt 3.3.3. It may also provide the input data presence and absence/background for other modelling tools&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== v.median ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.median|version=7}} create the median point of a cloud of point.&lt;br /&gt;
&lt;br /&gt;
==== v.neighborhoodmatrix ====&lt;br /&gt;
{{AddonSrc|vector|v.neighborhoodmatrix|version=7}} exports a csv file with the neighborhood matrix of polygons&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Moritz Lennert&lt;br /&gt;
&lt;br /&gt;
==== v.net.salesman.opt ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.net.salesman.opt|version=7}} estimates the optimal route to visit nodes on a vector network and optionally tries to improve the result.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.out.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.out.ply|version=7}} is a C program that exports a GRASS vector map as PLY file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.ply.rectify ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.ply.rectify|version=7}} imports a PLY point cloud, georeferences and exports it. The first three vertex properties must be the x, y, z coordinates with property names &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot;, in this order.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.surf.icw ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.icw|version=7}}:&lt;br /&gt;
Inverse cost weighting is like inverse distance weighted (IDW) interpolation, but uses cost instead of shortest Euclidean distance. In this way solid barriers and molasses zones may be correctly taken into account.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.surf.tps ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.tps|version=7}}:&lt;br /&gt;
Multivariate thin plate spline interpolation of sparse points with smoothing.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.to.lines ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.to.lines|version=7}}:&lt;br /&gt;
converts vector polygons (boundaries) to lines as well as vector points to lines via triangulations.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi&lt;br /&gt;
&lt;br /&gt;
==== v.surf.mass ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.mass|version=7}} creates a raster surface from vector areas, preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count. ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.surf.mass/v.surf.mass.html manual page])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.what.spoly ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.what.spoly|version=7}} Queries vector map with overlaping &amp;quot;spaghetti&amp;quot; polygons (e.g. Landsat footprints) at given location ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.what.spoly/v.what.spoly.html manual page])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23365</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23365"/>
		<updated>2016-08-10T19:45:38Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* r.bioclim update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.bioclim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.bioclim|version=7}} calculates various bioclimatic indices from monthly temperature and optional precipitation time series (see http://worldclim.org/bioclim). The time series can be averages for several years or monthly values for a specific year. In any case all 12 months must be provided. If a precipitation time series is not provided, only those indices based on temperature are calculated.&lt;br /&gt;
&lt;br /&gt;
==== r.bitpattern ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.catchment ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
'''(more modules missing here, for now see manual above or fix this Wiki page!)'''&lt;br /&gt;
&lt;br /&gt;
==== r.category.trim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.category.trim|version=7}}: Export the categories, category labels and colour codes (RGB) as csv file or as a QGIS colour map file. When required, removes non-existing categories and their colour definitions. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.change.info ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.change.info|version=7}} detects changes in landscape structure using methods from decision tree induction (machine learning). These methods are largely based on concepts of information theory. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.droka ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.droka|version=7}}: This script defines rockfall zones from a digital elevation model (DEM) and vector layer containing starting point or points.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Filipello and Daniele Strigaro &lt;br /&gt;
&lt;br /&gt;
==== r.euro.ecosystem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.euro.ecosystem|version=7}} Sets colors and category labels of European ecosystem raster data sets.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.fidimo|version=7}}: [http://jradinger.wordpress.com/fidimo/ FIDIMO] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
==== r.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flexure|version=7}}: r.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is an addon to create a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Maning Sambale, Stefan Sylla (original script) and Paulo van Breugel (present script)&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.lfp ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.lfp|version=7}} creates a longest flow path raster map using a drainage direction raster map and the coordinates of an outlet point. The module internally runs &amp;lt;em&amp;gt;r.stream.distance&amp;lt;/em&amp;gt; twice to calculate flow length downstream and upstream raster maps, and combines them to get the longest flow path. An input drainage map can be created using {{cmd|r.watershed}} or {{cmd|r.stream.extract}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.meb ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.meb|version=7}}: The multivariate environmental bias (MEB) takes the medium conditions in an area N and computes how much conditions in a subset of N (S) deviate from these medium conditions.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, Function to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS), which represents how similar a point is to a reference set of points, with respect to a set of predictor variables&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.niche.similarity|version=7}}: Module to quantify niche similarity or overlap between all pairs of input raster layers, using an index based on Warren et al. (2008) or the index proposed by Schoeners D (Schoener, 1968).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.northerness.easterness ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.northerness.easterness|version=7}}: Calculations of northerness, easterness and the interaction between northerness and slope.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.quantile.ref ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.quantile.ref|version=7}} calculates the quantile of a current observation compared to a time series of previous observations. This can be used to compare e.g current temperature or rainfall to previously recorded temperature or rainfall and to answer the question if the current observation is unusually low or high or even lower or higher than ever observed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.random.weight ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.random.weight|version=7}}: Generates a raster layer with a weighted random selection of the raster cells (selected cells are assigned a value 1, other a value 0). The user needs to provide a weight raster layer, which defines for each cell the the weight (probablity to be selected).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.recode.attr ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.recode.attr|version=7}}: To reclass/recode a raster layer based on values in a csv table.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.roughness.vector ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.roughness.vector|version=7}}''' is a module to calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann and Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.series.diversity ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.diversity|version=7}}''' is a module that computes one or more biodiversity indices based on the values of a series of 2 or more input layers. Indices currently implemented are Species richness, Shannon index, Effective number of species (ENS), Pielou's eveness or equitability index, Inverse Simpson index (Simpson's Reciprocal Index), and the Gini-Simpson index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.smooth.seg ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.smooth.seg|version=7}}''' generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. The module implements the Mumford-Shah variational model for image segmentation.&lt;br /&gt;
&lt;br /&gt;
An overview of the underlying theory with some applications cab be found  &lt;br /&gt;
[http://dx.doi.org/10.1016/j.isprsjprs.2012.02.005 here (Journal paper)]. &amp;lt;br&amp;gt;&lt;br /&gt;
Other examples of use of the module can be found &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/sw here (Web page)] and &lt;br /&gt;
[http://download.osgeo.org/osgeo/foss4g/2009/SPREP/2Thu/Parkside%20GO4/1500/Thu%20G04%201545%20Zatelli.pdf here (Presentation @ FOSS4G 2009 - pdf)]. &amp;lt;br&amp;gt;&lt;br /&gt;
For details on the numerical implementation see &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/misc/vitti_phd.pdf here (PhD thesis - pdf)].&lt;br /&gt;
&lt;br /&gt;
In GRASS 6 the module was named &amp;quot;r.seg&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In GRASS 7 the module was formerly named &amp;quot;r.segment&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.extract|version=7}}: Stream network extraction.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.variables ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.variables|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network. &lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.stream.watersheds ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.watersheds|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.valley.bottom ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.valley.bottom|version=7}}: Calculation of a Multi-resolution Valley Bottom Flatness (MrVBF) index.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.vif====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vif|version=7}}, Compute the variance inflaction factor (VIF) and the square root of the VIF. The variable with the highest VIF will be dropped and the VIF will be recomputed. This will be repeated till an user-defined VIF threshold value is reached.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23364</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=23364"/>
		<updated>2016-08-10T19:38:04Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: +r.quantile.ref&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.bioclim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.bioclim|version=7}} calculates various bioclimatic indices from monthly temperature and optional precipitation time series. The time series can be averages for several years or monthly values for a specific year. In any case all 12 months must be provided. It a precipitation time series is not provided, only those indices based on temperature are calculated. The names of the output maps are &amp;lt;output&amp;gt;.bio01, &amp;lt;output&amp;gt;.bio02, &amp;lt;output&amp;gt;.bio03, etc. &lt;br /&gt;
&lt;br /&gt;
==== r.bitpattern ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.catchment ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
'''(more modules missing here, for now see manual above or fix this Wiki page!)'''&lt;br /&gt;
&lt;br /&gt;
==== r.category.trim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.category.trim|version=7}}: Export the categories, category labels and colour codes (RGB) as csv file or as a QGIS colour map file. When required, removes non-existing categories and their colour definitions. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.change.info ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.change.info|version=7}} detects changes in landscape structure using methods from decision tree induction (machine learning). These methods are largely based on concepts of information theory. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.droka ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.droka|version=7}}: This script defines rockfall zones from a digital elevation model (DEM) and vector layer containing starting point or points.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Filipello and Daniele Strigaro &lt;br /&gt;
&lt;br /&gt;
==== r.euro.ecosystem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.euro.ecosystem|version=7}} Sets colors and category labels of European ecosystem raster data sets.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.fidimo|version=7}}: [http://jradinger.wordpress.com/fidimo/ FIDIMO] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
==== r.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flexure|version=7}}: r.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is an addon to create a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Maning Sambale, Stefan Sylla (original script) and Paulo van Breugel (present script)&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.lfp ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.lfp|version=7}} creates a longest flow path raster map using a drainage direction raster map and the coordinates of an outlet point. The module internally runs &amp;lt;em&amp;gt;r.stream.distance&amp;lt;/em&amp;gt; twice to calculate flow length downstream and upstream raster maps, and combines them to get the longest flow path. An input drainage map can be created using {{cmd|r.watershed}} or {{cmd|r.stream.extract}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.meb ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.meb|version=7}}: The multivariate environmental bias (MEB) takes the medium conditions in an area N and computes how much conditions in a subset of N (S) deviate from these medium conditions.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, Function to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS), which represents how similar a point is to a reference set of points, with respect to a set of predictor variables&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.niche.similarity|version=7}}: Module to quantify niche similarity or overlap between all pairs of input raster layers, using an index based on Warren et al. (2008) or the index proposed by Schoeners D (Schoener, 1968).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.northerness.easterness ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.northerness.easterness|version=7}}: Calculations of northerness, easterness and the interaction between northerness and slope.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.quantile.ref ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.quantile.ref|version=7}} calculates the quantile of a current observation compared to a time series of previous observations. This can be used to compare e.g current temperature or rainfall to previously recorded temperature or rainfall and to answer the question if the current observation is unusually low or high or even lower or higher than ever observed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.random.weight ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.random.weight|version=7}}: Generates a raster layer with a weighted random selection of the raster cells (selected cells are assigned a value 1, other a value 0). The user needs to provide a weight raster layer, which defines for each cell the the weight (probablity to be selected).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.recode.attr ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.recode.attr|version=7}}: To reclass/recode a raster layer based on values in a csv table.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.roughness.vector ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.roughness.vector|version=7}}''' is a module to calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann and Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.series.diversity ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.diversity|version=7}}''' is a module that computes one or more biodiversity indices based on the values of a series of 2 or more input layers. Indices currently implemented are Species richness, Shannon index, Effective number of species (ENS), Pielou's eveness or equitability index, Inverse Simpson index (Simpson's Reciprocal Index), and the Gini-Simpson index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.smooth.seg ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.smooth.seg|version=7}}''' generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. The module implements the Mumford-Shah variational model for image segmentation.&lt;br /&gt;
&lt;br /&gt;
An overview of the underlying theory with some applications cab be found  &lt;br /&gt;
[http://dx.doi.org/10.1016/j.isprsjprs.2012.02.005 here (Journal paper)]. &amp;lt;br&amp;gt;&lt;br /&gt;
Other examples of use of the module can be found &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/sw here (Web page)] and &lt;br /&gt;
[http://download.osgeo.org/osgeo/foss4g/2009/SPREP/2Thu/Parkside%20GO4/1500/Thu%20G04%201545%20Zatelli.pdf here (Presentation @ FOSS4G 2009 - pdf)]. &amp;lt;br&amp;gt;&lt;br /&gt;
For details on the numerical implementation see &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/misc/vitti_phd.pdf here (PhD thesis - pdf)].&lt;br /&gt;
&lt;br /&gt;
In GRASS 6 the module was named &amp;quot;r.seg&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In GRASS 7 the module was formerly named &amp;quot;r.segment&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.extract|version=7}}: Stream network extraction.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.variables ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.variables|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network. &lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.stream.watersheds ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.watersheds|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.valley.bottom ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.valley.bottom|version=7}}: Calculation of a Multi-resolution Valley Bottom Flatness (MrVBF) index.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.vif====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vif|version=7}}, Compute the variance inflaction factor (VIF) and the square root of the VIF. The variable with the highest VIF will be dropped and the VIF will be recomputed. This will be repeated till an user-defined VIF threshold value is reached.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=22524</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=22524"/>
		<updated>2016-02-18T21:49:25Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: G7 addons +r.change.info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
* '''[http://grass.osgeo.org/grass70/manuals/addons/ GRASS GIS 7 Addons Manual pages] - a complete overview of available Addons'''&lt;br /&gt;
* [https://trac.osgeo.org/grass/browser/grass-addons Browse the Svn add-ons code in the Trac system]&lt;br /&gt;
* For addon installation, simply use {{cmd|g.extension}}&lt;br /&gt;
* Source code download: get all addons from the svn repository with:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.bioclim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.bioclim|version=7}} calculates various bioclimatic indices from monthly temperature and optional precipitation time series. The time series can be averages for several years or monthly values for a specific year. In any case all 12 months must be provided. It a precipitation time series is not provided, only those indices based on temperature are calculated. The names of the output maps are &amp;lt;output&amp;gt;.bio01, &amp;lt;output&amp;gt;.bio02, &amp;lt;output&amp;gt;.bio03, etc. &lt;br /&gt;
&lt;br /&gt;
==== r.bitpattern ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.catchment ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
'''(more modules missing here, for now see manual above or fix this Wiki page!)'''&lt;br /&gt;
&lt;br /&gt;
==== r.category.trim ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.category.trim|version=7}}: Export the categories, category labels and colour codes (RGB) as csv file or as a QGIS colour map file. When required, removes non-existing categories and their colour definitions. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.change.info ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.change.info|version=7}} detects changes in landscape structure using methods from decision tree induction (machine learning). These methods are largely based on concepts of information theory. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.droka ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.droka|version=7}}: This script defines rockfall zones from a digital elevation model (DEM) and vector layer containing starting point or points.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Filipello and Daniele Strigaro &lt;br /&gt;
&lt;br /&gt;
==== r.euro.ecosystem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.euro.ecosystem|version=7}} Sets colors and category labels of European ecosystem raster data sets.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.fidimo|version=7}}: [http://jradinger.wordpress.com/fidimo/ FIDIMO] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
==== r.flexure ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flexure|version=7}}: r.flexure is used to calculate how the lithosphere bends under geologic loads. It is an interface for the [https://github.com/awickert/gFlex gFlex] model, which must be downloaded and installed in order for it to work.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andrew Wickert&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is an addon to create a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Maning Sambale, Stefan Sylla (original script) and Paulo van Breugel (present script)&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.lfp ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.lfp|version=7}} creates a longest flow path raster map using a drainage direction raster map and the coordinates of an outlet point. The module internally runs &amp;lt;em&amp;gt;r.stream.distance&amp;lt;/em&amp;gt; twice to calculate flow length downstream and upstream raster maps, and combines them to get the longest flow path. An input drainage map can be created using {{cmd|r.watershed}} or {{cmd|r.stream.extract}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.meb ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.meb|version=7}}: The multivariate environmental bias (MEB) takes the medium conditions in an area N and computes how much conditions in a subset of N (S) deviate from these medium conditions.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, Function to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS), which represents how similar a point is to a reference set of points, with respect to a set of predictor variables&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.niche.similarity|version=7}}: Module to quantify niche similarity or overlap between all pairs of input raster layers, using an index based on Warren et al. (2008) or the index proposed by Schoeners D (Schoener, 1968).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.northerness.easterness ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.northerness.easterness|version=7}}: Calculations of northerness, easterness and the interaction between northerness and slope.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.random.weight ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.random.weight|version=7}}: Generates a raster layer with a weighted random selection of the raster cells (selected cells are assigned a value 1, other a value 0). The user needs to provide a weight raster layer, which defines for each cell the the weight (probablity to be selected).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.recode.attr ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.recode.attr|version=7}}: To reclass/recode a raster layer based on values in a csv table.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.roughness.vector ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.roughness.vector|version=7}}''' is a module to calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann and Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.series.diversity ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.series.diversity|version=7}}''' is a module that computes one or more biodiversity indices based on the values of a series of 2 or more input layers. Indices currently implemented are Species richness, Shannon index, Effective number of species (ENS), Pielou's eveness or equitability index, Inverse Simpson index (Simpson's Reciprocal Index), and the Gini-Simpson index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.smooth.seg ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.smooth.seg|version=7}}''' generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. The module implements the Mumford-Shah variational model for image segmentation.&lt;br /&gt;
&lt;br /&gt;
An overview of the underlying theory with some applications cab be found  &lt;br /&gt;
[http://dx.doi.org/10.1016/j.isprsjprs.2012.02.005 here (Journal paper)]. &amp;lt;br&amp;gt;&lt;br /&gt;
Other examples of use of the module can be found &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/sw here (Web page)] and &lt;br /&gt;
[http://download.osgeo.org/osgeo/foss4g/2009/SPREP/2Thu/Parkside%20GO4/1500/Thu%20G04%201545%20Zatelli.pdf here (Presentation @ FOSS4G 2009 - pdf)]. &amp;lt;br&amp;gt;&lt;br /&gt;
For details on the numerical implementation see &lt;br /&gt;
[http://www.ing.unitn.it/~vittia/misc/vitti_phd.pdf here (PhD thesis - pdf)].&lt;br /&gt;
&lt;br /&gt;
In GRASS 6 the module was named &amp;quot;r.seg&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In GRASS 7 the module was formerly named &amp;quot;r.segment&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.extract|version=7}}: Stream network extraction.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.variables ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.variables|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network. &lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.stream.watersheds ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.watersheds|version=7}}: Sub-watershed and sub-stream delineation based on the drainage direction and a gridded stream network&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giuseppe Amatulli &amp;amp; Sami Domisch&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.valley.bottom ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.valley.bottom|version=7}}: Calculation of a Multi-resolution Valley Bottom Flatness (MrVBF) index.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Helmut Kudrnovsky&lt;br /&gt;
&lt;br /&gt;
==== r.vif====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vif|version=7}}, Compute the variance inflaction factor (VIF) and the square root of the VIF. The variable with the highest VIF will be dropped and the VIF will be recomputed. This will be repeated till an user-defined VIF threshold value is reached.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=20369</id>
		<title>AddOns/GRASS7/raster</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/raster&amp;diff=20369"/>
		<updated>2014-04-09T06:38:12Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: remove r.clump2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/raster/&lt;br /&gt;
&lt;br /&gt;
==== r.agent ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.agent|version=7}} shall provide an inital base for organizing worlds with raster playgrounds and agents in. Still under development.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Lustenberger&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.area|version=7}} can be used to remove, areas smaller than treshold, reclass according areas (similar to r.reclass area, but work in cells, not hectares and allow create more classes)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.basin|version=7}} generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.convert ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.crater ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.crater|version=7}}: estimates the size of a gravity dominated impact crater or the projectile that made it.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== r.damflood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.damflood|version=7}}: The definition of flooding areas is of considerable importance for both the risk analysis and the emergency management.&lt;br /&gt;
This command is an embedded GRASS GIS hydrodynamic 2D model that allows to obtain flooding area due to a failure of a dam, given the geometry of the reservoir and of the downstream area, the initial conditions and the dam breach geometry.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi and Massimiliano Cannata&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as r.terraflow or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.flip|version=7}} Flips a raster map&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.forestfrag|version=7}} is a shell script that creates a forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). The index is computed using an moving window of user-defined size (default = 3).&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Maning Sambale, Stefan Sylla and Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.logic|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.set|version=7}}&lt;br /&gt;
* {{AddonSrc|raster|r.fuzzy.system|version=7}}&lt;br /&gt;
&lt;br /&gt;
==== r.gdd ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.gdd|version=7}} calculates (accumulated) growing degree days (GDDs) and Winkler indices from several input maps with temperature data for different times of the day.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hants ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hants|version=7}} performs a harmonic analysis of time series in order to estimate missing values and identify outliers. For each input map, an output map with the suffix suffix (default: _hants) is created.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hazard.flood|version=7}} is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
==== r.houghtransform ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.hydrodem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.hydrodem|version=7}} applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as {{cmd|r.terraflow}} or third-party software, full sink removal is recommended.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.srtm.region ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.in.srtm.region|version=7}} for download and import of SRTM for the current region. If needed, tiles are patched together and optionally holes interpolated.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms2 ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.massmov ====&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.mess====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.mess|version=7}}, a shell script to compute the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS). It uses R and spgrass6 package.&lt;br /&gt;
Runs on grass 6.4 and 7.0 (tested on Linux only).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
==== r.modis ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.modis|version=7}}''': The '''r.modis''' suite is a toolset to import MODIS satellite data in GRASS GIS. It uses the [http://gis.cri.fmach.it/pymodis/ pyModis library] and the MODIS Reprojection Tool software to convert, mosaik and process MODIS data. It is written in Python language for GRASS 7, developed during the Google Summer of Code 2011.&lt;br /&gt;
&lt;br /&gt;
See also [[R.modis]]:&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi (GSoC mentor: Markus Neteler)&lt;br /&gt;
&lt;br /&gt;
==== r.regression.series ====&lt;br /&gt;
&lt;br /&gt;
'''{{AddonSrc|raster|r.regression.series|version=7}}''' is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.basins|version=7}}: Calculate basins according user input.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.channel ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.channel|version=7}}: Calculate some local properties of the stream network. It is supplementary module for r.stream.order and r.stream.distance to investigate channel subsystem.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.distance|version=7}}: Calculate distance to and elevation above streams and outlets according user input. It can work in stream mode where target are streams and outlets mode where targets are outlets.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.extract|version=7}}: Stream network extraction.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.order|version=7}}: Calculate Strahler's and Horton's stream order Hack's main streams and Shreeve's stream magnitude. It uses r.watershed or r.stream.extract output files: stream, direction and optionally accumulation. Output data can be either from r.watershed or r.stream.extract but not from both together.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.segment ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.segment|version=7}}: The module is designed to inverstigate network lineaments and calculate angle relations between tributaries and its major streams.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.slope ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.slope|version=7}}: Calculates the difference between elevation of current cell and downstream cell, gradient and max curvature on the basis of a flow direction map. It can be used to calculate the directional slope using a flow direction map.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.snap ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.snap|version=7}}: is a supplementary module for r.stream.extract and r.stream.basins to correct position of outlets or stream initial points as they do not lie on the streamlines.&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.stream.stats|version=7}}: Calculate Horton's and optionally Hack's statistics according to user input.&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.threshold|version=7}} finds optimal threshold for stream extraction.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.tiled ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.to.vect.tiled|version=7}} vectorizes the input raster map and produces several tiled vector maps covering the current region. Vectorizing a large raster map with {{cmd|r.to.vect}} can require a lot of memory. In these cases,&amp;lt;em&amp;gt;r.to.vect.tiled&amp;lt;/em&amp;gt; can reduce memory usage by vectorizing each tile separately.&lt;br /&gt;
&lt;br /&gt;
==== r.vol.dem ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|raster|r.vol.dem|version=7}} interpolates a voxel model from a series of DEMs by flood filling the voxel space in between.&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS_6&amp;diff=20368</id>
		<title>AddOns/GRASS 6</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS_6&amp;diff=20368"/>
		<updated>2014-04-09T06:36:46Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: remove r.clump2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [[AddOns]] {{bullet}} [[AddOns/GRASS 7]] {{bullet}} [[AddOns/GRASS 5]] {{bullet}} [[AddOns/GRASS 4]]&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/&lt;br /&gt;
__TOC__&lt;br /&gt;
=== Vector add-ons ===&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector&lt;br /&gt;
&lt;br /&gt;
==== v.adehabitat.clusthr, v.adehabitat.kernelUD, v.adehabitat.mcp ====&lt;br /&gt;
&lt;br /&gt;
: Tools to calculate home ranges of animals&lt;br /&gt;
: '''Author:''' Clement Calenge&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/adehabitat&lt;br /&gt;
&lt;br /&gt;
==== v.append ====&lt;br /&gt;
&lt;br /&gt;
: [http://web.archive.org/web/20060914172621/http://www.public.asu.edu/~cmbarton/files/grass_scripts/v.append v.append] is a shell script combining two vector files AND their associated attribute tables. The vector files should be of the same type and, for best results, should have identically formatted attribute tables.&lt;br /&gt;
: ''Note'': also module ''v.patch'' can be used for this task. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Barton&lt;br /&gt;
&lt;br /&gt;
==== v.autokrige ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.autokrige/v.autokrige.py v.autokrige] achieves automatic ordinary kriging from GRASS sites (vector point data), using R with spgrass6 (RGRASS) and automap packages.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Mathieu Grelier&lt;br /&gt;
&lt;br /&gt;
==== v.breach ====&lt;br /&gt;
&lt;br /&gt;
: Creates vector maps of lines and points of continously lowering elevation down the input watercourses, based on the underlying input raster DEM.&lt;br /&gt;
&lt;br /&gt;
: Available via [http://grass.osgeo.org/grass64/manuals/g.extension.html g.extension] or [https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.breach/ SVN].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Maciej Sieczka&lt;br /&gt;
&lt;br /&gt;
==== v.colors ====&lt;br /&gt;
&lt;br /&gt;
: {{cmd|v.colors}} ''moved into main archive''&lt;br /&gt;
&lt;br /&gt;
==== v.count.points.sh ====&lt;br /&gt;
&lt;br /&gt;
: [http://wiki.iosa.it/dokuwiki/spatial_analysis:feature_count v.count.points.sh] counts point features in areas, generates table good as input to {{cmd|d.vect.chart}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefano Costa&lt;br /&gt;
&lt;br /&gt;
==== v.curvature ====&lt;br /&gt;
&lt;br /&gt;
: {{AddonSrc|vector|v.curvature|version=6}} calculates average curvature along a segment given by from/to distance measured along the line specified by category.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Radim Blazek&lt;br /&gt;
&lt;br /&gt;
==== v.digatt ====&lt;br /&gt;
&lt;br /&gt;
: [http://src.geo.uni-augsburg.de/download/grass/v.digatt v.digatt] (shell script) Interactively assign numeric table attributes to series of vector objects. It is meant to be effective by avoiding to type in the attribute value for all single objects again and again. The user is prompted for typing in an attribute value which is assigned to all objects selected by mouseclick afterwards. Next the display is redrawn after updating the table column. Zooming allows to change the region before the old value can be reused or a new one can be typed in (or copied by mouse from another object) in order to assign it to the next series of objects etc. It is tested not very extensively yet. Therefore better work with a copy of your map and consider using v.digit or d.what.vect -e alternatively. [http://src.geo.uni-augsburg.de/download/grass/v.digatt.png screenshot].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Andreas Philipp&lt;br /&gt;
&lt;br /&gt;
==== v.dip ====&lt;br /&gt;
&lt;br /&gt;
: [http://marcin.slodkowski.googlepages.com/v.dip.tgz v.dip] creates points of thickness vectors from the vectors of strike and dip angles. The v.dip is the main ANSI C core program. Program so-called v.dip can run without GRASS environment.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Marcin Slodkowski&lt;br /&gt;
&lt;br /&gt;
==== v.flip ====&lt;br /&gt;
&lt;br /&gt;
: Flips the direction of selected vector lines (redundant since GRASS 6.3 - there is &amp;quot;v.edit tool=flip&amp;quot;; and later there came the v.digit GUI flipping tool as well).&lt;br /&gt;
&lt;br /&gt;
: Available via [http://grass.osgeo.org/grass64/manuals/g.extension.html g.extension] or [https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.flip/ SVN].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Maciej Sieczka&lt;br /&gt;
&lt;br /&gt;
==== v.group ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.shockfamily.net/cedric/grass/v.group v.group] generates a new vector map with the same geometry as an existing map. The new map has categories and a table based on grouping by the values in certain columns of the existing map's table. The values in these columns are preserved in the table for the new map. It's like a v.reclass that preserves data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Cedric Shock&lt;br /&gt;
&lt;br /&gt;
==== v.in.gama ====&lt;br /&gt;
&lt;br /&gt;
: Converts [http://www.gnu.org/software/gama/ GNU GaMa] XML output file to a GRASS vector map layer.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Martin Landa&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.in.gama&lt;br /&gt;
&lt;br /&gt;
==== v.in.geodesic ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.geodesic v.in.geodesic] is a shell script which will create a new vector map containing a great circle line. The user may either define a beginning and end coordinate, or define a starting coordinate along with initial azimuth and desired line length.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.in.geoplot ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.geoplot v.in.geoplot] converts a [http://www.geoscan-research.co.uk/page9.html/ Geoplot] ASCII export file to a GRASS vector map layer.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Benjamin Ducke&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.in.geoplot&lt;br /&gt;
&lt;br /&gt;
==== v.in.gshhs ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.gshhs v.in.gshhs] imports [http://www.soest.hawaii.edu/pwessel/gshhs/index.html GSHHS] shorelines into a GRASS vector map. GSHHS data are automatically reprojected to the current location.&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' several, updated to GRASS 6 by Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.in.marxan ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.marxan v.in.marxan] is a python script that imports Marxan output data for display in a vector grid file prepared using v.out.marxan. &lt;br /&gt;
: ''see also the [http://www.uq.edu.au/marxan/ Marxan] &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Trevor Wiens&lt;br /&gt;
&lt;br /&gt;
==== v.in.mbsys_fnv ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.mbsys_fnv v.in.mbsys_fnv] imports [[MB-System]] navigation files into a GRASS vector map. You can choose from swath area coverage, track lines (including outer port/starboard edges), all bounds as points, etc. An attribute database is created containing the vital statistics of the specified feature such as track length or swath coverage (geodesic), start stop time and location, pitch, roll, heave, etc. See also the [[#v.in.p190]] addon.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.in.ncdc ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.ncdc v.in.ncdc] imports an [http://www.ncdc.noaa.gov NCDC] stn file (station data) into a GRASS vector map.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== v.in.osm ====&lt;br /&gt;
&lt;br /&gt;
: [http://kripton.kripserver.net/software/v.in.osm/ v.in.osm]: OpenStreetMap import into GRASS. Yet only supports deprecated API 0.4, will be modified to work with API 0.5 some time soon.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jannis Achstetter&lt;br /&gt;
&lt;br /&gt;
: See also [http://hamish.bowman.googlepages.com/gpsdrivefiles#osm osm2grass.sh] by H Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.in.osm2 ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.osm2 v.in.osm2]: OpenStreetMap import into GRASS. Supports current API 0.6, downloads using the [http://wiki.openstreetmap.org/wiki/Xapi Xapi] interface and imports using GpsBabel 1.3.5 or newer. GpsBabel restricts to either nodes or ways being imported at a time, not both. Use {{cmd|v.patch}} to rejoin them. (''work in progress'')&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.in.ovl ====&lt;br /&gt;
&lt;br /&gt;
: [http://grasslab.gisix.com/scripts/v.in.ovl/ v.in.ovl] is a shell script that imports an ASCII vector file created with TOP10|25|50 or similar products.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Peter Löwe&lt;br /&gt;
&lt;br /&gt;
==== v.in.p190 ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.p190 v.in.p190] is a shell script that imports 'Centre of Source' &amp;quot;S&amp;quot; navigation data from seismic P1/90 (UKOOA) data files and writes either GRASS vector points or vector lines format. Optionally it will export the navigation data into .csv text files as well. ''Currently in the functional prototype stage, some assembly is required. See inside the shell script for details.'' For working with SEG-Y data, see also the [[#v.in.mbsys_fnv]] addon.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.in.ply ====&lt;br /&gt;
&lt;br /&gt;
* GRASS 6: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.ply v.in.ply] is a shell script that imports a PLY file and writes it as GRASS vector points. For a much more advanced version, see the GRASS 7 version.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler&lt;br /&gt;
&lt;br /&gt;
==== v.in.postgis ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.in.postgis/v.in.postgis.py v.in.postgis] Create a GRASS layer from any sql query on PostGIS data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Mathieu Grelier&lt;br /&gt;
&lt;br /&gt;
==== v.in.redwg ====&lt;br /&gt;
&lt;br /&gt;
: [http://lists.gnu.org/archive/html/info-libredwg/2010-08/msg00000.html v.in.redwg imports DWG files into GRASS.]&lt;br /&gt;
:'''Author:''' Rodrigo Rodrigues da Silva&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.in.redwg&lt;br /&gt;
&lt;br /&gt;
==== v.krige ====&lt;br /&gt;
&lt;br /&gt;
: [[V.krige_GSoC_2009 | v.krige]] aims to integrate R functions for kriging (packages automap, gstat, geoR) in a trasparent way. '''Moved into trunk/devbr6 code (r40048)'''&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Anne Ghisla, as Google Summer of Code 2009 project&lt;br /&gt;
&lt;br /&gt;
: See also [[GRASS_AddOns#v.autokrige]] by Mathieu Grelier&lt;br /&gt;
&lt;br /&gt;
==== v.lda.py ====&lt;br /&gt;
* '''Spatial Analysis Tools'''&lt;br /&gt;
&lt;br /&gt;
: [http://www.public.asu.edu/~cmbarton/files/grass_scripts/v.lda.py v.lda.py] is a Python script for calculating Ian Johnson's (U. Sidney) Local Density Analysis values. This can be used in two ways. When only one vector points file is entered, it serves to measure clustering of point data at different neighborhood radii. When two different point files are entered, it measures the the co-occurence of the points from the two files. There is an option to export the data into a cvs format file for easy plotting in a spreadsheet or statistical program like R.&lt;br /&gt;
&lt;br /&gt;
==== v.nn.py ====&lt;br /&gt;
* '''Spatial Analysis Tools'''&lt;br /&gt;
&lt;br /&gt;
: [http://www.public.asu.edu/~cmbarton/files/grass_scripts/v.nn.py v.nn.py] is a Python script for calculating the nearest neighbor coefficient of a single vector points file--as an index of clustering--or of two points files--to provide an index of the correspondence between the points in one file and points in a different file.&lt;br /&gt;
&lt;br /&gt;
==== v.ldm ====&lt;br /&gt;
:[https://raw.github.com/amuriy/GRASS-scripts/master/v.ldm v.ldm] Shell script to compute &amp;quot;Linear Directional Mean&amp;quot; of vector lines, to display LDM graphics on the graphic monitor, and optionally to save it to vector line and update attribute table with LDM parameters.&lt;br /&gt;
:See [http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/How_Linear_Directional_Mean_works/005p0000001r000000/ this link] for full LDM description.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.ldm/&lt;br /&gt;
&lt;br /&gt;
==== v.line.center ====&lt;br /&gt;
&lt;br /&gt;
: Creates a points vector map with each point located in the middle of the length of the input vector line.&lt;br /&gt;
&lt;br /&gt;
: Available via [http://grass.osgeo.org/grass64/manuals/g.extension.html g.extension] or [https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.line.center/ SVN].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Maciej Sieczka&lt;br /&gt;
&lt;br /&gt;
==== v.lmeasure ====&lt;br /&gt;
&lt;br /&gt;
: [http://web.archive.org/web/20060827192321/http://ngeo.de/grassstuff/v.lmeasure v.lmeasure] and [http://web.archive.org/web/20060827060303/http://ngeo.de/grassstuff/v.revlmeasure v.revlmeasure] are two perl scripts that place equidistant vector points along a given arbitrary vector line starting from the beginning or end of the vector line, respectively. Resulting  vector points are labeled with the distance from origin.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Mats Schuh&lt;br /&gt;
&lt;br /&gt;
==== v.mainchannel ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.strahler/v.mainchannel.html v.mainchannel] is a shell script which finds the main channel of a basin starting from the vector file of the stream network.&lt;br /&gt;
: '''Author:''' Ivan Marchesini, Annalisa Minelli&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.strahler/v.mainchannel.sh&lt;br /&gt;
&lt;br /&gt;
==== v.mk_circle ====&lt;br /&gt;
&lt;br /&gt;
: [http://tekmap.ns.ca/blog/grass_mk_circle v.mk_circle] is a program to create a closed vector at a user defined location and size. The program supports output of different shapes, open boundaries and closed centroids, and will accept multiple locations and sizes from an ASCII file or standard input. GRASS 7 version is also available.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Bob Covill&lt;br /&gt;
&lt;br /&gt;
==== v.mkhexgrid ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.mkhexgrid v.mkhexgrid] is a python script that creates a hexagonal grid the size of the selected region using user specified side lengths or areas. This has been updated 2011-09-14. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Trevor Wiens&lt;br /&gt;
&lt;br /&gt;
==== v.out.ascii.db ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.out.ascii.db v.out.ascii.db] is a shell script for exporting vector point data coordinates and selected attribute columns to either a file or to the console.&lt;br /&gt;
: ''Superseded in GRASS 6.4 by the new v.out.ascii columns= option.''&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.out.ascii.mat ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.out.ascii.mat v.out.ascii.mat] is a shell script for exporting vector polygon and polyline data into an ASCII text file suitable for loading into Matlab (or [http://www.gnu.org/software/octave/ Octave]).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.out.geoserver ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.wgug.org/index.php?option=com_content&amp;amp;view=article&amp;amp;id=56&amp;amp;Itemid=9 v.out.geoserver] is a shell script for exporting vector data to [http://geoserver.org GeoServer] directly. It uses: v.out.ogr, curl, zip and GeoServer REST interface.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Pawel Netzel&lt;br /&gt;
&lt;br /&gt;
==== v.out.gmt ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.out.gmt v.out.gmt] is a shell script that exports a polygon vector file into GMT xy file. psbasemap code was copied from Hamish's r.out.gmt.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho, Hamish Bowman, Dylan Beaudette&lt;br /&gt;
&lt;br /&gt;
==== v.out.kml ====&lt;br /&gt;
&lt;br /&gt;
: [http://grasslab.gisix.com/scripts/v.out.kml/ v.out.kml] is a shell script that exports a vector file into a KML file for Google Earth or Worldwind. see also [[#r.out.kml|r.out.kml]] and [[#r.out.gmap|r.out.gmap]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Peter Löwe&lt;br /&gt;
&lt;br /&gt;
==== v.out.marxan ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.out.marxan v.out.marxan] is a python script that prepares vector layers and exports GRASS vector attributes and adjacency information as Marxan input files. Output from Marxan simulations can be imported using v.in.marxan. &lt;br /&gt;
: ''see also the [http://www.uq.edu.au/marxan/ Marxan] &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Trevor Wiens&lt;br /&gt;
&lt;br /&gt;
==== v.out.ply ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.out.ply v.out.ply] is a shell script that exports a GRASS vector points cloud into a PLY file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler&lt;br /&gt;
&lt;br /&gt;
==== v.out.svg ====&lt;br /&gt;
&lt;br /&gt;
: [http://svg.cc/assvg/grass.html v.out.svg] is a module that exports SVG notation along with optional attribute data directly from GRASS 6.x vector layers. Now part of [http://svn.osgeo.org/grass/grass/trunk/vector/v.out.svg/ grass6-svn].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Klaus Förster&lt;br /&gt;
&lt;br /&gt;
==== v.points.cog ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.points.cog v.points.cog] is a shell script which will create a new point at the center of gravity of each cluster of input points or centroids, grouped by attribute. Among other things this is useful for labeling swarms of points.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.profile ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.profile v.profile] is vector map profiling tool similar to r.profile. This module will print out distance and attributes to points/lines along profiling line. It's also usefull to determine places where raster profile crosses vector features (i.e. where to place river marker on river walley crossection).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Maris Nartiss&lt;br /&gt;
&lt;br /&gt;
==== v.random.cover ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.random.cover v.random.cover] is a shell script for creating random points constrained within an irregularly shaped vector area. (v.random places points only in current region rectangle). Optionally the user can upload raster values at the points. See also '&amp;lt;tt&amp;gt;r.random cover= vector_output=&amp;lt;/tt&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.rasterbounds ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/programs v.rasterbounds] is a shell script for creating polygon-vector file of rasterfile boundaries. The best version of GRASS is 6.1+. If you are using GRASS &amp;lt; 6.1, you  have to be in the same mapset as your raster maps are from.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== v.rast.stats2 ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.rast.stats2 v.rast.stats2] is an adapted version of the GRASS module v.rast.stats. It uses the grass addon [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.univar.zonal r.univar.zonal] to speed up calculation of univariate statistics from a GRASS raster map based on vector polygons.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Markus Neteler, Otto Dassau&lt;br /&gt;
&lt;br /&gt;
==== v.sample.buffer ====&lt;br /&gt;
* ''Currently unavailable. Being re-written in python. Target for inclusion in addons svn is January 2011''&lt;br /&gt;
''v.sample.buffer'' is a shell script that samples rasters in buffers of a specified size around features in a specified vector file. Sampling results are added as attributes to the vector file. This script was designed for sampling vegetation indices and DEM derived attributes for bird point counts. Sampling results can be one or more basic statistics such as mean, range, max, etc.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Trevor Wiens&lt;br /&gt;
&lt;br /&gt;
==== v.select.region ====&lt;br /&gt;
&lt;br /&gt;
: [ftp://gsca.nrcan.gc.ca/outgoing/Patton/Grass/Scripts/v.select.region.tar.bz2 v.select.region] is a shell script that prints out the names of all vectors matching an input search pattern that has geometry (points, line, areas) that fall within a region bounded by an existing vector map, or within the current Grass region.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Eric Patton&lt;br /&gt;
&lt;br /&gt;
==== v.selmany ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/vector/v.selmany/v.selmany v.selmany] is a shell script that allows to interactively select a set of vector objects on a given layer, then assign them attribute values in a connected database table. The script runs on the command line prompt and within a graphic monitor ; it does not work with DBF driver.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Vincent Bain&lt;br /&gt;
&lt;br /&gt;
==== v.surf.icw ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.surf.icw v.surf.icw] is an IDW [[interpolation]] method using true distance cost instead of euclidean shortest distance, i.e. ''as the fish swims around an island'' not ''as the bird flies''. This will cleanly travel around hard barriers and a cost surface map may be used to model expensive-cross barriers. Input data points do not need direct line of sight to be considered, but should be kept to less than one hundred as the module becomes very computationally expensive. A number of radial basis function options are available. ([http://grass.osgeo.org/wiki/Image:Inlets_03_SurfSal_icw_big.png screenshot])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.surf.idwpow ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.geospatial.it/allegri/grass/v.surf.idwpow.zip v.surf.idwpow] integrates the common v.surf.idw algorithm with the exponential parameter for the distance weights&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giovanni Allegri&lt;br /&gt;
&lt;br /&gt;
==== v.surf.krige [deprecated: use v.autokrige instead] ====&lt;br /&gt;
&lt;br /&gt;
: v.surf.krige is a script that do a surface interpolation from vector point data by Kriging method. The interpolated value of a cell is determined by using an omnidirectional variogram model fitted starting from model parameter given by user shown from the experimental semi variogram produced by v.variogram. The script can perform also the Leave-One-out cross validation to test the variogram model &amp;quot;fitted by eye&amp;quot; and an automatic fitted variogram model. The cross validation helps the user to choose the best variogram model to interpolate own data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Pierluigi De Rosa.&lt;br /&gt;
&lt;br /&gt;
==== v.strahler ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.pois.org/florian/downloads/grass/v.strahler.tgz v.strahler] is a module that calculates the Strahler Order for all lines of a given dendritic network.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Florian Kindl. Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.strahler&lt;br /&gt;
&lt;br /&gt;
==== v.swathwidth ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.swathwidth v.swathwidth] creates a vector map representing the sea bottom coverage of a multibeam (swath) sonar survey.&lt;br /&gt;
: ([http://david.p.finlayson.googlepages.com/swathwidth Screenshots])&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' David Finlayson, Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.thickness ====&lt;br /&gt;
&lt;br /&gt;
: [http://marcin.slodkowski.googlepages.com/v.thickness.tgz v.thickness] creates points of thickness vectors from the vectors of strike and dip angles.The v.thickness is GUI GRASS script for v.dip.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Marcin Slodkowski&lt;br /&gt;
&lt;br /&gt;
==== v.transect.kia ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.transect.kia v.transect.kia] calculates kilometric abundance indexes (KIA), a common indirect presence index used in wildlife monitoring along line transect surveys.&lt;br /&gt;
: Path lenghts can be corrected by draping on a DEM, different type of point objects can be weighted according to their relative importance, and paths can be  segmented using a further polygon vector (to calculate, say, abundances per elevation range or per habitat class).&lt;br /&gt;
: The module is written in bash and needs a GRASS install compiled with sqlite support.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Clara Tattoni and Damiano G. Preatoni&lt;br /&gt;
&lt;br /&gt;
==== v.transects ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.transects v.transects] is a python script that creates a set of equidistant lines (transects) that are perpendicular to an input vector line file. Points and quadrilateral areas are alternative outputs. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Eric Hardin&lt;br /&gt;
&lt;br /&gt;
==== v.trees3d ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/programs/ v.trees3d] is a module for making 3D trees from input vector point file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== v.triangle ====&lt;br /&gt;
: [https://raw.github.com/amuriy/GRASS-scripts/a7df12d996abfe6461f509fce6feb6c869af2d5e/v.triangle v.triangle] -- front-end for &amp;lt;Triangle&amp;gt; utility (http://www.cs.cmu.edu/~quake/triangle.html) of J.R. Shewchuk. &lt;br /&gt;
&lt;br /&gt;
Makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. In GIS terminology, it produces 2D TIN, optionally with &amp;quot;breaklines&amp;quot;. &lt;br /&gt;
For more details see GRASS-wiki page [http://grass.osgeo.org/wiki/TIN_with_breaklines TIN with breaklines].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== v.trimesh ====&lt;br /&gt;
: [http://www.valledemexico.ambitiouslemon.com/vtrimesh.html v.trimesh] creates a triangular mesh from a vector map using areal constraints for refinement. It uses Jonathan Shewchuk's Triangle library.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jaime Carrera&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.trimesh/&lt;br /&gt;
&lt;br /&gt;
'''''IMPORTANT''': The needed &amp;quot;[http://www.cs.cmu.edu/~quake/triangle.html Triangle]&amp;quot; library (by Jonathan Richard Shewchunk) is not GPL compatible (since it is not free for commercial use) so must be sourced and this addon module compiled by the end user.''&lt;br /&gt;
&lt;br /&gt;
==== v.to.averline ====&lt;br /&gt;
&lt;br /&gt;
: [https://raw.github.com/amuriy/GRASS-scripts/a7df12d996abfe6461f509fce6feb6c869af2d5e/v.to.averline v.to.averline] is a shell script to find &amp;quot;average&amp;quot; line(s) of input vector map. It works with simple algorithm stated [http://forums.arcgis.com/threads/26757-quot-Averaging-quot-lines?p=88781&amp;amp;viewfull=1#post88781 here] (2 methods -- average distance to vectors sampling or average number of vectors segments).     &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== v.to.equidist ====&lt;br /&gt;
&lt;br /&gt;
: [https://raw.github.com/amuriy/GRASS-scripts/master/v.to.equidist v.to.equidist] is a shell script that generates vector points or line segments along a given vector line(s) with the equal distances (uses v.segment)   &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== v.what.rast.buffer ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/vector/v.what.rast.buffer v.what.rast.buffer] is a script that calculates univariate statistics of raster map(s) from buffers around vector points. Results are written to a file. Resolution is taken from each input map.&lt;br /&gt;
: ''see also the [http://starspan.casil.ucdavis.edu StarSpan] software&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.variogram ====&lt;br /&gt;
* [deprecated: use v.autokrige instead]&lt;br /&gt;
&lt;br /&gt;
: v.variogram is a script that create an omnidirectional experimental semi-variogram. This scripts require R-statistics software installed on your machine. Now the script is updated to run on spgrass6 &amp;gt;= 0.3 and sp &amp;gt;= 0.9 [http://grass.osgeo.org/pipermail/statsgrass/2006-October/000455.html reply].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Ivan Marchesini, Pierluigi De Rosa.&lt;br /&gt;
&lt;br /&gt;
==== v.vect.stats ====&lt;br /&gt;
&lt;br /&gt;
: {{cmd|v.vect.stats}} counts the number of points falling into each polygon and optionally calculates statistics from numeric point attributes for each polygon. &lt;br /&gt;
&lt;br /&gt;
Update 12/2012: v.vect.stats is now included in core GRASS 6.4.3, 6.5, and GRASS 7.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== AniMove ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.faunalia.it/animov/ AniMove] is software for analysis of animal movement and ranging behaviour using QGIS+GRASS+R.&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Support by Faunalia.it&lt;br /&gt;
&lt;br /&gt;
==== Utilities ====&lt;br /&gt;
&lt;br /&gt;
===== Shapemerge =====&lt;br /&gt;
&lt;br /&gt;
: [http://perrygeo.googlecode.com/svn/trunk/gis-bin/shpmerge.sh shpmerge] merges all the shapefiles in the current directory into a single output shapefile&lt;br /&gt;
&lt;br /&gt;
:'''Authors:''' Perrygeo&lt;br /&gt;
&lt;br /&gt;
=== Raster add-ons ===&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
&lt;br /&gt;
 svn co http://svn.osgeo.org/grass/grass-addons/grass6/raster&lt;br /&gt;
&lt;br /&gt;
==== Raplat ====&lt;br /&gt;
&lt;br /&gt;
GRASS-RaPlaT: The Radio Planning Tool for GRASS GIS system developed by support of Slovenian largest mobile operator Mobitel. It is especially designed for radio coverage calculation of GSM/UMTS systems, but can be applied also to other wireless systems in the frequency range 400 MHz – 2.4 GHz (e.g. TETRA, WiFi). Its structure is modular and characterized by high level of flexibility and adaptability. &lt;br /&gt;
&lt;br /&gt;
 * Documentation: http://commsys.ijs.si/en/component/content/article/54-software/149-user-manual&lt;br /&gt;
 * Software: http://commsys.ijs.si/en/software/grass-raplat&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Department of Communication Systems, Jozef Stefan Institue, Jamova 39, SI-1000 Ljubljana, Slovenia&lt;br /&gt;
&lt;br /&gt;
==== r.area ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.area r.area] Very simple module. Calculates area size (in cells) for every individual category in input raster map and write number of cells as the value of each cell in the area. Optionally writes a binary coverage map and sets a minimum area threshold. Works well with {{cmd|r.clump}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
==== r.basin ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.basin/ r.basin] Generates the main morphometric parameters of the basin starting from the digital elevation model and the coordinates of the basin's closing section (see [http://grass.osgeo.org/wiki/R.basin wiki] for howto).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo, Massimo Di Stefano&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.basin/&lt;br /&gt;
&lt;br /&gt;
==== r.bilateral ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/files/programs/grass/r.bilateral.tgz r.bilateral] Bilateral filter is an edge-preserving filter, which combines domain and range filtering. It is written in C language.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== r.broscoe ====&lt;br /&gt;
&lt;br /&gt;
: r.broscoe.sh calculates waerden test and t test statistics for some values of threshold area on a single basin, according to A.J.Broscoe theory (1959). Dependence: v.strahler package.&lt;br /&gt;
: '''Authors:''' Ivan Marchesini, Annalisa Minelli&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/vector/v.strahler/&lt;br /&gt;
&lt;br /&gt;
==== r.boxcount ====&lt;br /&gt;
&lt;br /&gt;
: r.boxcount and r.boxcount.sh calculate the fractal dimension for a given map. These are versions for grass6 of [http://www.ucl.ac.uk/~tcrnmar/ Mark Lake's modules] for grass43.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Mark Lake, grass6 port: Florian Kindl.&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.boxcount/&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.boxcount.sh/&lt;br /&gt;
&lt;br /&gt;
==== r.burn.frict ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.burn.frict r.burn.frict] converts vector geometries to raster cells, using a simple anti-aliasing method to close &amp;quot;gaps&amp;quot; between diagonal cells. Useful for &amp;quot;burning&amp;quot; vector geometries into a friction surface, making sure that simulated movement does not &amp;quot;slip&amp;quot; through converted cells that have only diagonal neighbours.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Benjamin Ducke&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.burn.frict&lt;br /&gt;
&lt;br /&gt;
==== r.clump4p ====&lt;br /&gt;
&lt;br /&gt;
: [http://sil.uc.edu/downloads.html#software r.clump4p] is a C module similar to r.clump. It has an option to clump diagonal cells. It is also parallelized and completes much faster than r.clump.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' P. Netzel and T.F. Stepinski&lt;br /&gt;
&lt;br /&gt;
==== r.colors.out_sld ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.colors.out_sld r.colors.out_sld] is a shell script used to export the color table associated with a raster map layer to an OGC [http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/rasters.html SLD] XML file, for use with [[GeoServer]] and the ilk.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.colors.out_vtk ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.colors.out_vtk r.colors.out_vtk] is a shell script used to export the color table associated with a raster map layer to a {{wikipedia|VTK}} XML file. (see also [[Help with 3D]])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.colors.quantiles ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.colors.quantiles/r.colors.quantiles r.colors.quantiles] is a shell script used to create raster colors rules based on nquantiles. It uses R and spgrass6 package (RGRASS).&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Mathieu Grelier&lt;br /&gt;
&lt;br /&gt;
==== r.colors.stddev ====&lt;br /&gt;
&lt;br /&gt;
: [http://hamish.bowman.googlepages.com/grass_color_maps r.colors.stddev] ''moved into main archive''&lt;br /&gt;
&lt;br /&gt;
==== r.connectivity.distance ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.distance r.connectivity.distance] is a shell script, which is - as a part of the r.connectivity.* tool-chain - intended to make connectivity analysis based on graph-theory more easily available to conservation planning. r.connectivity.distance computes the (cost) distance between all habitat patches of an input vector map within a user defined euclidean distance threshold.&amp;lt;BR&amp;gt;See also [[#r.connectivity.network]] and  [[#r.connectivity.corridors]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath, [http://www.nina.no NINA]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.distance/&lt;br /&gt;
&lt;br /&gt;
==== r.connectivity.network ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.network r.connectivity.network] is a shell script, which is - as a part of the r.connectivity.* tool-chain - intended to make connectivity analysis based on graph-theory more easily available to conservation planning. r.connectivity.network performs the (core) network analysis and computes connectivity measures for a set of habitat patches based on graph-theory (usig the igraph-package in R).&amp;lt;BR&amp;gt;See also [[#r.connectivity.distance]] and  [[#r.connectivity.corridors]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath, [http://www.nina.no NINA]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.network/&lt;br /&gt;
&lt;br /&gt;
==== r.connectivity.corridors ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.corridors r.connectivity.corridors] is a shell script, which is - as a part of the r.connectivity.* tool-chain - intended to make connectivity analysis based on graph-theory more easily available to conservation planning. r.connectivity.corridors computes corridors between habitat patches for edges from r.connectivity.network based on (cost) distance raster maps from r.connectivity.distance and assigns user defined weight to the corridors.&amp;lt;BR&amp;gt;See also [[#r.connectivity.distance]] and  [[#r.connectivity.network]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath, [http://www.nina.no NINA]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.connectivity.corridors/&lt;br /&gt;
&lt;br /&gt;
==== r.convergence ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.convergence r.convergence] calculates topographic convergence index (TCI), useful to detect lineaments represented by channel/ridge systems.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
==== r.convergence_angle ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.convergence_angle r.convergence_angle] creates a raster map containing the convergence angle at each grid cell in the current region. This is the angle between true north and grid north and is handy for rotating gridded u,v velocity component data between the current map projection and geographic coordinates. It requires the PROJ.4 utilities to be installed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.cpt2grass ====&lt;br /&gt;
&lt;br /&gt;
: [http://hamish.bowman.googlepages.com/grass_color_maps r.cpt2grass] is a GRASS script for importing a [http://www.soest.hawaii.edu/gmt/ GMT] .cpt color table into GRASS. It can save to a text file suitable for r.colors or automatically apply the color table to a raster map.&amp;lt;BR&amp;gt;For a large collection of GMT .cpt files see http://sview01.wiredworkplace.net/pub/cpt-city/&lt;br /&gt;
: Other palette ideas from [http://geography.uoregon.edu/datagraphics/color_scales.htm Univ. Oregon] and [http://oceancolor.gsfc.nasa.gov/PRODUCTS/colorbars.html NASA/Goddard's OceanColor] (latter partially translated for use with GRASS on the [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.colors.tools/palettes grass-addons SVN]).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.csr ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.csr r.csr] integrates several Grass programs to produce colored, shaded-relief rasters in one step. Accepts single or multiple elevation/bathymetry maps as input; optionally will fill data holidays with 3x3 median filter, multiple times, if required; can apply color maps from a) input raster, b) another raster in MAPSET, or c) from a rules file; otherwise, rainbow colorbar is applied. Output colored, shaded-relief rasters can optionally be exported to tiff format if the appropriate flag is given. Shading parameters can be modified, though useful defaults are given.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Eric Patton&lt;br /&gt;
&lt;br /&gt;
==== r.cva ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.ucl.ac.uk/~tcrnmar/GIS/r.cva.html r.cva] is a cumulative viewshed analysis module. It is an advanced version of the {{cmd|r.los}} program.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' [http://www.ucl.ac.uk/~tcrnmar/ Mark Lake]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
  svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.cva/&lt;br /&gt;
&lt;br /&gt;
==== r.denoise ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.denoise r.denoise] denoises (smooths/despeckles) topographic data, particular DEMs derived from radar data (including SRTM), using Xianfang Sun's [http://www.cs.cf.ac.uk/meshfiltering/index_files/Page342.htm denoising algorithm].  It is designed to preserve sharp edges and to denoise with minimal changes to the original data.  See the [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.denoise/description.html manual pages] for details.  Further information on Sun's denoising algorithm, including an example, is available [http://personalpages.manchester.ac.uk/staff/neil.mitchell/mdenoise/ here].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' John Stevenson&lt;br /&gt;
&lt;br /&gt;
==== r.dominant_dir.m and r.calc_terraflow_dir.m ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.terraflow.tools dominant_dir.m and calc_terraflow_dir.m] are two Matlab scripts for determining the dominant flow direction from a r.terraflow MFD map and converting into a GRASS aspect map for use with d.rast.arrow, etc.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.diversity ====&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.diversity/ r.diversity] calculates selected diversity indices by calling various r.li commands.This script uses the [http://grass.osgeo.org/grass64/manuals/html64_user/r.li.pielou.html Pielou], [http://grass.osgeo.org/grass64/manuals/html64_user/r.li.renyi.html Renyi], [http://grass.osgeo.org/grass64/manuals/html64_user/r.li.shannon.html Shannon] and [http://grass.osgeo.org/grass64/manuals/html64_user/r.li.simpson.html Simpson] indices. The output is a map for each index. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi, Duccio Rocchini&lt;br /&gt;
&lt;br /&gt;
==== r.eucdist ====&lt;br /&gt;
&lt;br /&gt;
: [http://david.p.finlayson.googlepages.com/r.eucdist r.eucdist] creates a raster map estimating the euclidean distance from known cells.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' David Finlayson&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.fidimo ====&lt;br /&gt;
&lt;br /&gt;
: [http://jradinger.wordpress.com/fidimo/ FIDIMO (r.fidimo)] is a raster tool to model fish dispersal in river networks. Therefore, empirical leptokurtic fish dispersal kernels are used to model movement distances in rasterized river networks, considering movement barriers. FIDIMO allows predicting and simulating spatio-temporal patterns of fish dispersal. &lt;br /&gt;
&lt;br /&gt;
Radinger, J., Kail, J. and Wolter, C. (2013) FIDIMO – A Free and Open Source GIS based dispersal model for riverine fish. ''Ecological Informatics'' 1–10. DOI: [http://dx.doi.org/10.1016/j.ecoinf.2013.06.002 10.1016/j.ecoinf.2013.06.002]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.fidimo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.findtheriver ====&lt;br /&gt;
&lt;br /&gt;
: r.findtheriver finds the nearest stream pixel to a coordinate pair using an upstream accumulating area (UAA) raster map.  This is necessary because the coordinates for streamflow gages are often not perfectly registered to the topography represented by a digital elevation model (DEM) map.  Written in C for GRASS 6.x.  For support contact brian_miles@unc.edu&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Brian Miles&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.findtheriver/&lt;br /&gt;
&lt;br /&gt;
==== r.flip ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.flip r.flip] is a shell script which will flip a raster array's rows north-for-south. The eastern edge remains in the east, and the western edge remains in the west.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.forestfrag ====&lt;br /&gt;
&lt;br /&gt;
: [http://dl.dropbox.com/u/10445979/r.forestfrag.sh r.forestfrag.sh] creates forest fragmentation index from a GRASS raster map (where forest=1, non-forest=0) based on a method developed by Riitters et. al (2000). This version only runs on GRASS 6.4 and only with 3x3 moving window (shell-script has to be adjusted for other window-sizes). For a version that runs on GRASS 7.0 and which gives the option to choose the size of the moving window size, see [http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/raster#r.forestfrag r.forestfrag for GRASS7.0] &lt;br /&gt;
: '''Author:''' Maning Sambale, Stefan Sylla&lt;br /&gt;
&lt;br /&gt;
==== r.fragment ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.chrisgarstin.com/stuff/r.fragment r.fragment] fragments a raster into a user-defined set of smaller tiles according to an input number of rows and columns. &lt;br /&gt;
: '''Author:''' Eric Patton&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy ====&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.fuzzy r.fuzzy] Calculates membership of every cell in raster according membership function defined by user.&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy.logic ====&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.fuzzy.logic r.fuzzy.logic] Performs fuzzy operators (AND, OR, NOT, IMP) on membership's map using T-norms and T-conorms for 6 most popular families.&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
==== r.fuzzy.system ====&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.fuzzy.system r.fuzzy.system] Perform full fuzzy classification with 6 most popular fuzzy logic families and few methods of deffuzification.&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.fuzzy.system&lt;br /&gt;
&lt;br /&gt;
==== r.game_of_life ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.game_of_life r.game_of_life] is a shell script which runs Conway's classic Game of Life using GRASS raster modules. It is meant to demonstrate how easy it is to program cellular automata in GRASS as well as various 3D raster volume and time series visualization techniques.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.gauss ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.les-ejk.cz/files/programs/grass/r.gauss.tgz r.gauss] is Gaussian and Laplacian of Gaussian filter for GRASS. It is written in C language.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== r.gradgrid4 ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.uibk.ac.at/geographie/personal/mergili/gradgrid4.zip gradgrid4] is a tool for interpolating values of discrete data points to a raster map, applying a local regression approach with a predictor raster. The model is based on shell and python scripts as well as an R batchfile. It was tested on Fedora Core 6 with GRASS 6.2.1 and R 2.5.1, but should work under most UNIX systems. After unzipping the gradgrid4 folder, store it at any place in your local file system. In the subfolder docs you can find a manual and a publication draft with a detailed description of the concept and the example of an application. The subfolder testloc constitutes a GRASS location with test data.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Martin Mergili&lt;br /&gt;
&lt;br /&gt;
==== r.hazard.flood ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.hazard.flood/ r.hazard.flood] is an implementation of a fast procedure to detect flood prone areas. The exposure to flooding may be delineated by adopting a topographic index (TIm) computed from a DEM. The portion of a basin exposed to flood inundation is generally characterized by a TIm higher than a given threshold, tau. The threshold is automatically determinated from the cellsize. The proposed procedure may help in the delineation of flood prone areas especially in basins with marked topography. The use of the modified topographic index should not be considered as an alternative to standard hydrological-hydraulic simulations for flood mapping, but it may represent a useful and rapid tool for a preliminary delineation of flooding areas in ungauged basins and in areas where expensive and time consuming hydrological-hydraulic simulations are not affordable or economically convenient. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.hazard.flood/&lt;br /&gt;
&lt;br /&gt;
==== r.in.ign ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.in.ign/ r.in.ign] imports raster data from [http://api.ign.fr IGN WMTS stream service]. A transitory module, aiming at allowing french wmts support for GRASS 6.4. It is briefly documented [http://grass.osgeo.org/wiki/IGN_wmts_stream here].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Vincent Bain&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.in.ign/&lt;br /&gt;
&lt;br /&gt;
==== r.in.mb ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.tekmap.ns.ca/blog/multibeam_import r.in.mb] is a &amp;quot;GRASS/[[MB-System]] program designed to import ''mbio'' compatible multibeam sonar data directly into the GRASS GIS. The program is a modified version of {{cmd|r.in.xyz}}. Instead of reading an ASCII XYZ file, ''r.in.mb'' reads an MB-System compatible list file.&amp;quot; It can do automatic reprojection and minor hole filling. Options for restricting data according to line length, speed, acrosstrack width, beam number and survey mode (Simrad only). The default is to import bathymetry data, but optionally amplitude or sidescan sonar data can be loaded instead. GRASS 7 version is also available.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Bob Covill&lt;br /&gt;
&lt;br /&gt;
==== r.in.onearth ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.in.onearth r.in.onearth] &amp;lt;!-- old version: [http://www-pool.math.tu-berlin.de/~soeren/grass/modules/ r.in.onearth] --&amp;gt; for download and import satellite images direct from the NASA OnEarth WMS server into GRASS.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Soeren Gebbert, Markus Neteler, Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.in.swisstopo ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.in.swisstopo/ r.in.swisstopo] for importing swisstopo digital elevation model data into GRASS raster maps.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' J&amp;amp;uuml;rgen Hansmann&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.in.swisstopo/&lt;br /&gt;
&lt;br /&gt;
==== r.in.wms (.py) ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/files/programs/grass/r.in.wms.tgz r.in.wms] for download and import maps direct from  WMS servers into GRASS. This script is written in Python Programming language. Note GRASS 6.2+ provides a shell script version of r.in.wms, take care of which one is actually being run.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== r.in.xyz.auto ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.in.xyz.auto r.in.xyz.auto] runs the {{Cmd|r.in.xyz}} module, automatically setting up the region extent for you. ''For useful output it is strongly recommended to manually set the region resolution and bounds yourself instead of using this script.''&lt;br /&gt;
&lt;br /&gt;
: '''Author:'''  Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r3.in.xyz ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster3d/r3.in.xyz r3.in.xyz] creates a 3D raster map from an assemblage of many coordinates using univariate statistics. It is the 3D version of {{Cmd|r.in.xyz}}.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.inund.fluv ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.inund.fluv/ r.inund.fluv]This command allows to obtain a fluvial potentially inundation map given a high-resolution DTM of the area surrounding the river and a water surface profile calculated through an 1-D hydrodinamic model. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Roberto Marzocchi, Bianca Federici, Domenico Sguerso&lt;br /&gt;
&lt;br /&gt;
==== r.isoregions ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.isoregions/r.isoregions r.isoregions] allows isoregions creation from a GRASS raster map. &lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Mathieu Grelier&lt;br /&gt;
&lt;br /&gt;
==== r.interp.mask ====&lt;br /&gt;
&lt;br /&gt;
: [http://david.p.finlayson.googlepages.com/r.interp.mask r.interp.mask] Creates a user-specified buffer around interpolation points that can be used as a MASK to prevent or clip excessive extrapolation artifacts. This works much better than a standard convex hull around the points.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' David Finlayson&lt;br /&gt;
&lt;br /&gt;
==== r.ipso ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.ipso/ r.ipso] Produces the ipsometric and ipsographic curve related to a digital elevation model and prints the percentiles&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Margherita Di Leo, Massimo Di Stefano, Francesco Di Stefano&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.ipso/&lt;br /&gt;
&lt;br /&gt;
==== r.li ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.faunalia.it/download/r_li/ r.li] is a more flexible and faster replacement of the old r.le. '''''Moved into 6.3-SVN'''''.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Claudio Porta, Davide Spano, Serena Pallecchi, [http://www.faunalia.it Faunalia]&lt;br /&gt;
&lt;br /&gt;
==== r.local_max.pl ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/files/programs/local_max.pl Local maxima] is a Perl script for &amp;lt;code&amp;gt;r.mapcalc&amp;lt;/code&amp;gt;. It detects local maxima of the image.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== r.mandelbrot ====&lt;br /&gt;
&lt;br /&gt;
: [http://grasslab.gisix.com/scripts/r.mandelbrot r.mandelbrot] is a shell script to calculate the Mandelbrot set.- for GRASS versions 6.X.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Peter Löwe&lt;br /&gt;
&lt;br /&gt;
==== r.maxent.lambdas ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.maxent.lambdas r.maxent.lambdas] is a shell script to compute raw and/or logistic prediction maps from a lambdas file produced with MaxEnt 3.3.3e.&amp;lt;BR&amp;gt;See also [[#r.out.maxent_swd]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath, [http://www.nina.no NINA]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.maxent.lambdas/&lt;br /&gt;
&lt;br /&gt;
==== mcda ====&lt;br /&gt;
&lt;br /&gt;
: mcda suite is a toolset for geographics multi-criteria decision aiding and data analysis based on ELECTRE (r.mcda.electre), REGIME (r.mcda.regime) and FUZZY (r.mcda.fuzzy) algorithm. The module r.roughset is also included  for geographics rough set analisys and knowledge discovery based on rough set library. It is written in C language for GRASS versions 6.X.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Gianluca Massei (g_massa@libero.it ) - Antonio Boggia&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mcda.ahp/&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mcda.electre/&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mcda.fuzzy/&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mcda.roughset/&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mcda.regime/&lt;br /&gt;
&lt;br /&gt;
==== r.mess ====&lt;br /&gt;
&lt;br /&gt;
:The '''r.mess''' function computes the &amp;quot;Multivariate Environmental Similarity Surfaces&amp;quot; (MESS). It uses R and spgrass6 package &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.mess/&lt;br /&gt;
&lt;br /&gt;
==== r.mlv ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/files/programs/grass/r.mlv.tgz r.mlv] is Mean of least variance filter for GRASS. It is an edge-preserving (or even edge-enhacing) filter, which should serve for removing additive noise from images. It is written in C language.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== r.niche.similarity ====&lt;br /&gt;
&lt;br /&gt;
:The '''r.niche.similarity''' function computes two metrics to quantify niche similarity or overlap between all pairs of input raster layers: (D) the niche equivalency or similarity for two species following Warren et al. (2009) based on Schoeners D (Schoener, 1968). This metric ranges from 0 to 1, representing respectively no overlap and an identical distribution; (I) I similarity statistic of Warren et al. (2009), which is based on Hellinger Distances (van der Vaart, 1998). &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Paulo van Breugel&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.niche.similarity/&lt;br /&gt;
&lt;br /&gt;
==== r.obstruction, r.planning.static, r.planning.cinematic ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.ing.unitn.it/~grass/software.html r.obstruction, r.planning.static, r.planning.cinematic]: r.obstruction creates a polar obstruction map from a DTM. r.planning.static performs a static planning for GPS and Glonass surveys using the obstruction map created with r.obstruction. r.planning.cinematic performs a cinematic planning for GPS and Glonass surveys. (University of Trento, Faculty of Engineering)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Daniele Carli, Dimitri D'Inca', Gianluca Fruet, Domenico Sguerso, Paolo Zatelli&lt;br /&gt;
&lt;br /&gt;
==== r.out.colorbar ====&lt;br /&gt;
&lt;br /&gt;
: [http://tekmap.ns.ca/blog/colorbar_out r.out.colorbar] is an export program for saving GRASS raster colorbars to an image. The program uses GTK+ and cairographics. Supported export formats are PNG, PDF, and EPS. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Bob Covill&lt;br /&gt;
&lt;br /&gt;
==== r.out.jpeg ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.geospatial.it/allegri/grass/r.out.jpeg_ r.out.jpeg] is a simple GRASS script to export georeferenced JPEG images from rasters, keeping the associated color table. It is a two-step export: first a ppm file is created, then it is converted to jpeg usgin the &amp;quot;convert&amp;quot; command from ImageMagick&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Giovanni Allegri&lt;br /&gt;
&lt;br /&gt;
==== r.out.geoserver ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.wgug.org/index.php?option=com_content&amp;amp;view=article&amp;amp;id=56&amp;amp;Itemid=9 r.out.geoserver] exports GRASS raster layer to [http://geoserver.org GeoServer] and publishes it using WMS. The modul is a shell script. It uses: r.out.gdal, curl, xmlstarlet and GeoServer REST interface.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Pawel Netzel&lt;br /&gt;
&lt;br /&gt;
==== r.out.gmap ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.gmap r.out.gmap] outputs GRASS raster map into set of image tiles&lt;br /&gt;
following the tiling scheme of Google Maps and Microsoft Virtual Earth.&amp;lt;BR&amp;gt;Read more in the OSGeo Journal [http://www.osgeo.org/journal Volume 5 (2009, to appear)]&amp;lt;BR&amp;gt;see also [[#r.out.kml|r.out.kml]] and [[#v.out.kml|v.out.kml]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Tomas Cebecauer&lt;br /&gt;
&lt;br /&gt;
==== r.out.gmt ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.gmt r.out.gmt] is a GRASS script for exporting a GRASS raster map into a [http://www.soest.hawaii.edu/gmt/ GMT] grid file. It also creates a GMT color table from the data and can generate some GMT commands for plotting a postscript file. (code is experimental, but functional)&amp;lt;BR&amp;gt;see  also http://169.237.35.250/~dylan/grass_user_group/#GMT_and_GRASS-overview&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Hamish Bowman, Dylan Beaudette&lt;br /&gt;
&lt;br /&gt;
==== r.out.gmt2 ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.gmt2 r.out.gmt2] is a modified version of Hamish's r.out.gmt.  Added options for title, xlabel, ylabel, comment, and map width.  Removed any settings that can be changed by gmtset for more flexibility.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho, Hamish Bowman, Dylan Beaudette&lt;br /&gt;
&lt;br /&gt;
==== r.out.kap_template ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.kap_template r.out.kap_template] is a shell script that exports a raster map into a GeoTiff and a metadata text file suitable for use with KAP (BSB) raster nautical chart converter programs such as &amp;lt;tt&amp;gt;tif2bsb&amp;lt;/tt&amp;gt; (after verifying that you are legally entitled to use such a tool).&lt;br /&gt;
: '''''This is EXPERIMENTAL software. NOT FOR NAVIGATIONAL USE.'''''&lt;br /&gt;
: For an easy to use data viewer, see also the [http://www.opencpn.org OpenCPN] free navigational software.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.out.kml ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.kml r.out.kml] is a shell script that exports a raster map into a KML file and image for Google Earth or Worldwind. See also [[#v.out.kml|v.out.kml]] and [[#r.out.gmap|r.out.gmap]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.out.maxent_swd ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.out.maxent_swd r.out.maxent_swd] is a shell script to produce a set of SWD files as input to MaxEnt 3.3.3e using r.stats.&amp;lt;BR&amp;gt;See also [[#r.maxent.lambdas]]&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefan Blumentrath, [http://www.nina.no NINA]&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.out.maxent_swd/&lt;br /&gt;
&lt;br /&gt;
==== r.pack ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.pack r.pack] and [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.unpack r.unpack] are two GRASS scripts for transferring raster maps to another computer as a single compressed file including color table etc.&lt;br /&gt;
: An earlier version has been renamed as [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.pack/experiment r.pack.mat] and [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.unpack/experiment r.unpack.mat].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.patch.many ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.patch.many r.patch.many] is a shell script which will run {{Cmd|r.patch}} in parallel, to speed up cases where there the number of input maps is very large.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.pastro ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.pastro/ r.pastro] &lt;br /&gt;
Tools for the management of mobility in the mountain environment &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Andrea Cervetto, Damiano Natali, Tiziano Cosso, Roberto Marzocchi&lt;br /&gt;
&lt;br /&gt;
==== r.pi ====&lt;br /&gt;
&lt;br /&gt;
: [https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.pi/ r.pi] (raster patch index) provides various functions to analyse spatial attributes of a landscape. It has a focus on patch-based indices but delivers class-based indices as well. r.le and its successor r.li provide landscape indices.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Programming: Elshad Shirinov, Scientific concept: Dr. Martin Wegmann&lt;br /&gt;
&lt;br /&gt;
==== r.prominence ====&lt;br /&gt;
&lt;br /&gt;
: '''r.prominence''' calculates the average difference between a central cell and its neighbors. It approximated the terrain 'ruggedness' by looking at average differences in elevation within a given neighborhood.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Benjamin Ducke&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.prominence/&lt;br /&gt;
&lt;br /&gt;
==== r.rdfilter ====&lt;br /&gt;
&lt;br /&gt;
: [http://jradinger.wordpress.com/software/ r.rdfilter] computes a new raster map based on the application of a focal filter on the input raster map. Thus each cell value depends on the values of adjacent cells. Instead of the “moving window”-algorithm (e.g. {{cmd|r.neighbors}}), r.rdfilter is a “real distance”-filter based on GRASS’ {{cmd|r.cost}} tool.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Johannes Radinger&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.rdfilter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.refine ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.bowdoin.edu/~ltoma/research.html r.refine]: reduces a DEM to a TIN (takes as input a grid DEM and an error margin and simplifies it to the desired accuracy into a TIN)&lt;br /&gt;
Available via the source code repository [https://github.com/jonrtodd/r.refine]&lt;br /&gt;
: '''Authors:''' Laura Toma and Jonathan Todd&lt;br /&gt;
&lt;br /&gt;
==== r.rifs ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.ucl.ac.uk/~tcrnmar/ r.rifs]: r.rifs generates a raster map and/or image of a fractal by means of the specified random iterated function system.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Mark Lake&lt;br /&gt;
&lt;br /&gt;
==== r.rot90 ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.rot90 r.rot90] is a shell script which will rotate a raster array by 90 degrees clockwise.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.roughness ====&lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.sh r.roughness.sh] is a shell script to calculate the surface roughness of a DEM, using r.surf.area and v.surf.rst. (for GRASS versions 6.1 and above)&lt;br /&gt;
&lt;br /&gt;
[http://www.igc.usp.br/pessoais/guano/downloads/r.roughness60 r.roughness60] - for GRASS versions 6.0.X&lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.area r.roughness.window.area] - calculate surface roughness as the ratio of real (surface) area and planar area, using a moving-window approach.&lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector r.roughness.window.vector] - calculate surface roughness as vector dispersion, using a moving-window approach. Resulting maps are: Vector Strength (R) and Inverted Fisher's k parameter. &lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector.html r.roughness.window.vector.html] - provisional help page for r.roughness.window.vector.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Carlos Henrique Grohmann&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.roughness/&lt;br /&gt;
&lt;br /&gt;
==== r.roughset ====&lt;br /&gt;
&lt;br /&gt;
: r.roughset is a module for geographics rough set analisys and knowledge discovery based on rough set library. It is written in C language for GRASS versions 6.X.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Gianluca Massei (g_massa@libero.it ) - Antonio Boggia&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/mcda/r.roughset/&lt;br /&gt;
&lt;br /&gt;
==== r.seg ====&lt;br /&gt;
&lt;br /&gt;
: '''r.seg''' performs image segmentation and discontinuity detection (based on the Mumford-Shah variational model).&lt;br /&gt;
: The module generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. &lt;br /&gt;
: See [http://www.ing.unitn.it/~vittia/sw here] for details and examples.&lt;br /&gt;
&lt;br /&gt;
Available [http://www.ing.unitn.it/~vittia/sw here] and with improvements via SVN:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.seg/&lt;br /&gt;
&lt;br /&gt;
: '''Author''' Alfonso Vitti&lt;br /&gt;
&lt;br /&gt;
==== r.smoothpatch ====&lt;br /&gt;
&lt;br /&gt;
: [http://david.p.finlayson.googlepages.com/r.smoothpatch r.smoothpatch] creates a composite of two rasters using a distance-weighted average across the transition to smooth the edges.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' David Finlayson&lt;br /&gt;
&lt;br /&gt;
==== r.soils.texture ====&lt;br /&gt;
&lt;br /&gt;
: r.soils.texture is a module to define soils texture from sand and clay raster file with a schema text file (now FAO,USDA and ISSS are available). It is written in C language. - for GRASS versions 6.x - For bugs and suggest: g_massa@libero.it &lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Gianluca Massei&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.soils.texture/&lt;br /&gt;
&lt;br /&gt;
====r.split.line====&lt;br /&gt;
&lt;br /&gt;
: [https://raw.github.com/amuriy/GRASS-scripts/master/r.split.line r.split.line] is a shell script to split raster into parts with vector line(s).&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== r.stack ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stack r.stack] is a shell script used to patch all the raster maps in a time series (or burst 3D raster) together into a vertical stack, to aid multi-map analyses in modules where group input is not yet available.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.stream.angle ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.angle r.stream.angle] Divide stream network into straight line segments according users input. The module uses as input direction and stream network map produced by r.watershed and stream.extract or custom user input. See description for details.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.angle&lt;br /&gt;
&lt;br /&gt;
==== r.stream.basins ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.basins r.stream.basins] delineate basins according users input. It extends r.water.outlet funcionality to extracting more than one basin at one step. Module uses as input direction map produced stream network produced by r.stream.extract, r.watershed, r.stream.order or custom user input. See also [[R.stream.*]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.basins&lt;br /&gt;
&lt;br /&gt;
==== r.stream.del ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.del r.stream.del] Calculates downslope length of first order streams and delete them if it length (in pixels) is lower than the treeshold. It also join false segments left by deletion into one with category of upper. It uses r.watershed direction map and r.watershed stream map as input. The module is added only for r.watershed module, r.stream.extract has deleting of short streams build-in. During development of r.stream.* it will be probably abandoned due to duplicate functionality.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.del&lt;br /&gt;
&lt;br /&gt;
==== r.stream.distance ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.distance r.stream.distance] Calculates downslope distance and downslope elevation difference between current cell and stream or outlet cells. It uses r.watershed direction map, r.watershed or r.stream.extract stream map and optionally DEM as input. See also [[R.stream.*]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.distance&lt;br /&gt;
&lt;br /&gt;
==== r.stream.extract ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.extract r.stream.extract] extracts topologically clean stream networks from input elevation and optionally accumulation maps. Output is available as raster and vector and can be used as input for the other r.stream.* modules by Jarek Jasiewicz. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.extract&lt;br /&gt;
&lt;br /&gt;
==== r.stream.order ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.order r.stream.order] orders stream network outputed by r.watershed or r.stream.extract according Strahler, Shreve, Horton and Hack ordering systems. It require as input stream and direction map and optionally accumulation map. It handle both SFD and MFD modes but all data must have been produced with the same procedure. See also [[R.stream.*]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz, Markus Metz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.order&lt;br /&gt;
&lt;br /&gt;
==== r.stream.pos ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.pos r.stream.pos] Helper module for calculating local stream network properties and linear geostatistics. Mostly To use with R and other GRASS modules. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.pos&lt;br /&gt;
&lt;br /&gt;
==== r.stream.preview ====&lt;br /&gt;
&lt;br /&gt;
: In order to find a value of upslope area to be used as input to extract the river network using r.stream.extract or r.watershed, it is common to proceed by trial and error. [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.preview r.stream.preview] is useful for quickly display results for various tentatives of threshold values.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Margherita Di Leo&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.preview/&lt;br /&gt;
&lt;br /&gt;
==== r.stream.stats ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.stats r.stream.stats] calculate Hortonian statistics for Strahler or Horton stream network created by r.stream.order. It uses r.watershed direction map, DEM and r.stream.order's Strahler or Horton stream network as input. It outputs calculated statistics to standard output. See also [[R.stream.*]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jarek Jasiewicz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.stream.stats&lt;br /&gt;
&lt;br /&gt;
==== r.surf.nnbathy ====&lt;br /&gt;
&lt;br /&gt;
: GRASS Bourne shell script wrapper for `nnbathy', a raster interpolation utility providing triangulation, natural neighbor and non-Sibsonian natural neighbor algorithms, of Pavel Sakov's [http://code.google.com/p/nn-c/ nn] natural neighbor interpolation library.&lt;br /&gt;
&lt;br /&gt;
: Available via [http://grass.osgeo.org/grass64/manuals/g.extension.html g.extension] or [https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.surf.nnbathy/ SVN].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Maciej Sieczka&lt;br /&gt;
&lt;br /&gt;
==== r.surf.volcano ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.surf.volcano r.surf.volcano] creates an artificial surface resembling a seamount or cone volcano. The user can alter the size and shape of the mountain and optionally roughen its surface. Available decay functions are  polynomial, Gaussian, Lorentzian, logarithmic, and exponential.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.terracost ====&lt;br /&gt;
&lt;br /&gt;
[http://www.bowdoin.edu/~ltoma/research.html r.terracost] Scalable approach for computing least-cost-path surfaces on massive grid terrains.&amp;lt;BR&amp;gt;'''Lead author''': Laura Toma&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
  svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.terracost&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== r.threshold ====&lt;br /&gt;
&lt;br /&gt;
[http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.threshold/ r.threshold] Finds a first tentative value of upslope area to be used as input to extract the river network using r.stream.extract or r.watershed.&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
  svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.threshold&lt;br /&gt;
&lt;br /&gt;
==== r.tileset ====&lt;br /&gt;
&lt;br /&gt;
: ''{{cmd|r.tileset}} moved into main archive''&lt;br /&gt;
&lt;br /&gt;
==== r.to.vect.lines ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.to.vect.lines r.to.vect.lines] is a module to sample raster rows at regular intervals and turn them into 3D lines. e.g. to display in [[NVIZ]] as a wiggle plot.&lt;br /&gt;
: It demonstrates the use of [[Python_Ctypes_Examples|ctypes]] to access the GRASS C libraries from within a Python script. (treat as a work in progress)&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== r.traveltime ====&lt;br /&gt;
&lt;br /&gt;
: [http://jesbergwetter.twoday.net/stories/4845555/ r.traveltime] computes the travel time of surface runoff to an outlet. The program starts at the basin outlet and calculates the travel time at each raster cell recursively. A drainage area related threhold considers even  surface and also channel runoff. Travel times are derived by assuming kinematic wave approximation. The results can be used to derive a time-area function. This might be usefull for precipitation-runoff calculations (estimation of flood predictions) with a lumped hydrologic model (user-specified unit hydrograph).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Kristian Förster&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.traveltime&lt;br /&gt;
&lt;br /&gt;
==== r.univar.zonal ====&lt;br /&gt;
&lt;br /&gt;
Note: This addon is only needed for GRASS 6.3, its functionality has been added to r.univar in 6.4+ and 7.&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.univar.zonal r.univar.zonal] is similar to {{cmd|r.univar}}, but calculates statistics separately for each category(zone) present in the separate input map used to define zones (zonal statistics). The output can be like the one of r.univar or in easier to read table format and can be written to a file. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.univar.zonal&lt;br /&gt;
&lt;br /&gt;
==== r.viewshed ====&lt;br /&gt;
&lt;br /&gt;
: r.viewshed is a module for extremely fast line of sight analysis (replaces the slow r.los). It is written in C language for GRASS versions 6.X/7.x.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Laura Toma, USA&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.viewshed&lt;br /&gt;
&lt;br /&gt;
Once {{trac|390}} is solved, it will substitute r.los.&lt;br /&gt;
&lt;br /&gt;
==== r.wavelets ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.ing.unitn.it/~grass/software.html r.wavelets]: This package contains wavelets decomposition and reconstruction modules for the GRASS GIS: r.owave.dec computes the orthogonal wavelet transform of a raster map. r.owave.rec reconstructs a raster map from an orthogonal wavelet transform. r.biowave.dec computes the biorthogonal wavelet transform of a raster map. r.biowave.rec reconstructs a raster map from a biorthogonal wavelet transform.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Members of the University of Trento, Faculty of Engineering&lt;br /&gt;
&lt;br /&gt;
==== r.wf ====&lt;br /&gt;
&lt;br /&gt;
: [http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.wf/ r.wf] produces the Width Function of a basin. The Width Function W(x) gives the number of the cells in a basin at a flow distance x from the outlet (it is also referred as distance-area function). The distance is not the euclidean one, but it is measured along the flowpath towards the outlet.&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' Margherita Di Leo, Massimo Di Stefano, Francesco Di Stefano&lt;br /&gt;
&lt;br /&gt;
Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.wf/&lt;br /&gt;
&lt;br /&gt;
==== r.wind.sun ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.wind.sun r.wind.sun] Calculates visual impact (raster map) of aerogenerators and photovoltaic panels using an impact factor, based on the area covered by windfarm and panels respect the area of Human Field of View.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Annalisa Minelli, Ivan Marchesini&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.wind.sun&lt;br /&gt;
&lt;br /&gt;
==== r.xtent ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.xtent r.xtent] computes a raster map layer representing the Voronoi diagram, weighted Voronoi diagram or a more complex territorial partitioning of space around points (centers) in a vector input map, based on the XTENT formula.&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Benjamin Ducke&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.xtent&lt;br /&gt;
&lt;br /&gt;
==== r.zc.pl ====&lt;br /&gt;
&lt;br /&gt;
: [http://les-ejk.cz/files/programs/zc.pl Zero crossing] is a simple Perl script, finds the ,,zero crossings`` from the Laplacian of Gaussian filter (see above). It is really &amp;lt;em&amp;gt;very&amp;lt;/em&amp;gt; simple, the edges don't need to be really on that pixel, where they are detected, no interpolation is performed.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== GIPE ====&lt;br /&gt;
&lt;br /&gt;
: The GRASS Image Processing Environment (GIPE) has USLE, Energy-balance and radiance-reflectance correction models.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin (unless specified otherwise).&lt;br /&gt;
   &lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/gipe&lt;br /&gt;
&lt;br /&gt;
Remark: This is progressively moved to main GRASS SVN (aka GRASS 7)&lt;br /&gt;
&lt;br /&gt;
:* r.hydro.CASC2D, ported from GRASS 5.x version, is temporarily here waiting to return to main GRASS.&lt;br /&gt;
&lt;br /&gt;
:* r.soiltex2prop creates porosity, Saturated Hydraulic conductivity (Ksat) and wetting front pressure head (Hf) from percentage of sand and clay after Rawls et al., 1990. This is a must for r.hydro.CASC2D.&lt;br /&gt;
&lt;br /&gt;
:* i.biomass creates biomass growth map from fPAR, lightuse efficiency, water availability (or evap.fraction), Lat, doy and tsw.&lt;br /&gt;
&lt;br /&gt;
:* i.dn2ref.l7, r.dn2ref.ast create top of atmosphere reflectance for Landsat 7ETM+ and ASTER. These modules also have a flag for radiance output. Updated i.dn2ref.l7 to read .met calibration file.  &lt;br /&gt;
&lt;br /&gt;
:* i.dn2full.l[5,7] is an attempt to get all bands of Landsat[5,7] calibrated and corrected to either reflectance or temperature, reads only the .met file.  &lt;br /&gt;
&lt;br /&gt;
:* i.dn2potrad.l[5,7] is an attempt to get ET potential from DN of Landsat 7 (Careful! No Atmospheric correction!).  &lt;br /&gt;
&lt;br /&gt;
:* i.eb.* are a set of 10+ GRASS modules that together perform the main functions of  the SEBAL model (Bastiaanssen, 1995). Those functions include (but are not limited to) Soil heat flux, sensible heat flux, net radiation, evaporative fraction at satellite overpass, diurnal actual evapotranspiration, momentum roughness length, etc. These  modules are also part of any Energy-Balance related processing. &lt;br /&gt;
&lt;br /&gt;
:* i.evapo.potrad creates diurnal Potential evapotranspiration assuming all net radiation becomes ET, according to SEBAL model (Bastiaanssen, 1995). This module also has a flag for diurnal net radiation as required by SEBAL in i.eb.eta. &lt;br /&gt;
&lt;br /&gt;
:* i.evapo.SENAY creates actual evapotranspiration following the regional method of Senay (2007). &lt;br /&gt;
&lt;br /&gt;
:* i.lmf creates a Local Maximum Fitting on the temporal dimension of the multi-date input dataset, working, but more precision still to be added.&lt;br /&gt;
&lt;br /&gt;
:* i.vi.mpi is the mpi version of i.vi for cluster GRASS GIS education (no speed up here!) '''Author:''' Shamim Akhter &lt;br /&gt;
&lt;br /&gt;
:* i.modis.stateqa extracts State Quality Assessment information from Modis 500m (MOD09A) products.&lt;br /&gt;
&lt;br /&gt;
:* i.water creates a Water Mask from NDVI and Albedo, or specifically for Modis: NDVI and Band 7.&lt;br /&gt;
&lt;br /&gt;
:* i.wi creates a given Water Index (only one so far).&lt;br /&gt;
&lt;br /&gt;
==== HydroFOSS ====&lt;br /&gt;
&lt;br /&gt;
: HydroFOSS - a GIS embedded approach for Free &amp;amp; Open Source Hydrological modeling.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Massimiliano Cannata&lt;br /&gt;
 &lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/HydroFOSS/&lt;br /&gt;
&lt;br /&gt;
==== Hikereport ====&lt;br /&gt;
&lt;br /&gt;
: python script that computes length, cumulative uphill and downhill, average slopes on an interactively drawn path. Based on r.profile's output.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefano Negri&lt;br /&gt;
&lt;br /&gt;
 http://tracce.wordpress.com/?attachment_id=71&lt;br /&gt;
&lt;br /&gt;
=== Misc add-ons===&lt;br /&gt;
&lt;br /&gt;
==== m.eigensystem ====&lt;br /&gt;
&lt;br /&gt;
m.eigensystem - Computes eigen values and eigen vectors for square matrices.&lt;br /&gt;
&lt;br /&gt;
: http://svn.osgeo.org/grass/grass-addons/grass6/misc/m.eigensystem/&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Michael Shapiro&lt;br /&gt;
&lt;br /&gt;
===Database add-ons===&lt;br /&gt;
==== db.join ====&lt;br /&gt;
&lt;br /&gt;
: Table joining: join one table into another through common attributes&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler. Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
   svn co https://svn.osgeo.org/grass/grass-addons/grass6/database/db.join/&lt;br /&gt;
or&lt;br /&gt;
   g.extension db.join&lt;br /&gt;
&lt;br /&gt;
===General add-ons===&lt;br /&gt;
&lt;br /&gt;
==== Compare GRASS maps ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass7/general/g.compare.md5 g.compare.md5] Script to check if two GRASS maps are identical&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Luca Delucchi&lt;br /&gt;
&lt;br /&gt;
==== GRASS create location scripts ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/grass_create_location grass_create_location.sh] Script to generate a new GRASS location from GIS file (e.g. geoTIFF or SHAPE), wktfile or EPSG code.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler&lt;br /&gt;
&lt;br /&gt;
==== g.infer ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.infer g.infer] is a tool to create rule-based data-driven workflows from GRASS data layers and additional data sources. g.infer can modify existing GRASS data layers, can create new vector layers or can start additional additional GRASS modules. This is controlled by an inference process, which applies a knowledge base on a set of known facts (data). g.infer allows to set up Expert Systems from domain knowledge and GIS data layers.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Peter Löwe&lt;br /&gt;
&lt;br /&gt;
==== g.laptop.sh ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.gbd-consult.de/dassau/grass/g.laptop/g.laptop.sh g.laptop.sh] is an interactive shell script to extract raster and vector data from current Location into a new one. Data can be copied or extracted in current or original resolution and region extend. This script was written to extract smaller parts of a GRASS location to be able to present them on a laptop without the necessity to transfer huge data. Maps do not have to be in the same mapset.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Otto Dassau&lt;br /&gt;
&lt;br /&gt;
==== Readline completion ====&lt;br /&gt;
&lt;br /&gt;
: '''''Readline completion''''' for GRASS commands under the bash shell: [http://www.sorokine.info/grass-complete/ grass-complete] won't clutter the environment but needs to be installed; [http://dcalvelo.free.fr/grass/grass_rlcompleter.sh grass_rlcompleter.sh] needs almost no installation but will pollute the environment. Grass-Complete currently requires Bash version 2.05 for proper install.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexandre Sorokine (grass-complete), Daniel Calvelo (grass_rlcompleter.sh)&lt;br /&gt;
&lt;br /&gt;
==== g.name.sequence ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.name.sequence g.name.sequence] is a shell script which can print to &amp;lt;tt&amp;gt;stdout&amp;lt;/tt&amp;gt; a sequential series of map names for use with modules like {{cmd|r.series}}. It is a wrapper around the UNIX &amp;lt;tt&amp;gt;seq&amp;lt;/tt&amp;gt; power tool.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== g.region.grow ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.region.grow g.region.grow] is a shell script which expands or contracts the computational region by a fixed amount. It's a shortcut for &amp;quot;&amp;lt;tt&amp;gt;g.region n=n+X s=s-X e=e+X w=w-X&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== g.region.point ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.region.point g.region.point] is a shell script which resets the computational region to a square box around a given coordinate. It is intended for use within GRASS scripts to speed up processing by limiting expensive raster calculations to a small area of interest.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== g.linke_by_day ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.sun.tools/ g.linke_by_day] is a python script for [[r.sun]] which interpolates a Linke turbidity value for a given day of the year based on monthly values edited into the script.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== g.xlist ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.xlist g.xlist] is a C implementation of g.mlist. g.xlist searches for data files matching a pattern given by wildcards or POSIX Extended Regular Expressions. POSIX regex(3) functions are required.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== g.xremove ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/general/g.xremove g.xremove] is a C implementation of g.mremove. g.xremove removes data files matching a pattern given by wildcards or POSIX Extended Regular Expressions. POSIX regex(3) functions are required.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== g.region.ll ====&lt;br /&gt;
&lt;br /&gt;
: [https://bitbucket.org/afrigeri/grass-addons g.region.ll] sets the region in a projected location using longitudes and latitudes.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alessandro Frigeri&lt;br /&gt;
&lt;br /&gt;
=== Imagery add-ons ===&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery&lt;br /&gt;
&lt;br /&gt;
==== GIPE ====&lt;br /&gt;
&lt;br /&gt;
GIPE (see also above in raster section) provides:&lt;br /&gt;
i.biomass, i.dn2potrad.l5, i.dn2potrad.l7, i.dn2ref.ast, i.eb.deltat, i.eb.disp, i.eb.eta, i.eb.evapfr, i.eb.g0, i.eb.h0, i.eb.h_SEBAL01, i.eb.h_SEBAL95, i.eb.h_iter, i.eb.molength, i.eb.netrad, i.eb.psi, i.eb.rah, i.eb.rohair, i.eb.ublend, i.eb.ustar, i.eb.wetdrypix, i.eb.z0m, i.eb.z0m0, i.evapo.PT, i.evapo.TSA, i.evapo.potrad, i.evapo.senay, i.evapo.time_integration, i.lmf, i.modis.stateqa, i.sattime, i.vi.grid, i.vi.mpi, i.water, i.wi&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/gipe/&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Yann Chemin&lt;br /&gt;
&lt;br /&gt;
==== i.despeckle ====&lt;br /&gt;
&lt;br /&gt;
Applies SAR Speckle Filter to a raster power map.  Currently LEE, KUAN, Enhanced Lee and GAMMA filter are implemented.&lt;br /&gt;
&lt;br /&gt;
   g.extension i.despeckle&lt;br /&gt;
&lt;br /&gt;
==== i.homography ====&lt;br /&gt;
&lt;br /&gt;
Rectifies an image by computing a coordinate transformation for each pixel in the image based on the control points created by i.linespoints. The approach uses homography extended for corresponding lines.&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.homography&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Daniel Grasso, Bolzano, Italy, based on code written by Stefano Merler, ITC-irst, Italy&lt;br /&gt;
: '''Reference:''' M. Neteler, D. Grasso, I. Michelazzi, L. Miori, S. Merler, and C. Furlanello, 2005: An integrated toolbox for image registration, fusion and classification. International Journal of Geoinformatics, 1(1), pp. 51-61 [http://www.grassbook.org/neteler/papers/neteler2005_IJG_051-061_draft.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
==== i.linespoints ====&lt;br /&gt;
&lt;br /&gt;
An imagery command that enables the user to mark coordinate system points as well as lines on an image to be rectified and then input the coordinates of each point for creation of a coordinate transformation matrix. The transformation matrix is needed as input for the GRASS program i.homography.&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.linespoints&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Daniel Grasso, Bolzano, Italy, based on i.points&lt;br /&gt;
&lt;br /&gt;
==== i.landsat.dehaze ====&lt;br /&gt;
&lt;br /&gt;
Bandwise haze correction using tasscap4 (haze) and linear regression of a Landsat scene.&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.landsat.dehaze&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler&lt;br /&gt;
&lt;br /&gt;
==== i.landsat.toar ====&lt;br /&gt;
&lt;br /&gt;
Transform calibrated digital number of Landsat products to top-of-atmosphere radiance or top-of-atmosphere reflectance and temperature (band 6 of the sensors TM and ETM+). Optionally, used to calculate the at-surface radiance or reflectance with atmospheric correction (DOS method).&lt;br /&gt;
&lt;br /&gt;
--&amp;gt; moved to core GRASS (&amp;gt;= 6.4.2), see {{cmd|i.landsat.toar}}&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' E. Jorge Tizado&lt;br /&gt;
&lt;br /&gt;
==== i.landsat.acca ====&lt;br /&gt;
&lt;br /&gt;
Implements the Automated Cloud-Cover Assessment (ACCA) Algorithm from Irish (2000) with the constant values for pass filter one from Irish et al. (2006). To do this, it needs Landsat band numbers 2, 3, 4, 5, and 6 (or band 61 for Landsat-7 ETM+) which have already been processed from DN into reflectance and band-6 temperature with i.landsat.toar). &lt;br /&gt;
&lt;br /&gt;
--&amp;gt; moved to core GRASS (&amp;gt;= 6.4.2), see {{cmd|i.landsat.acca}}&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' E. Jorge Tizado&lt;br /&gt;
&lt;br /&gt;
==== i.landsat.trim ====&lt;br /&gt;
&lt;br /&gt;
: [https://raw.github.com/amuriy/GRASS-scripts/72f039073ff55b006b7aecbaa7870fac193dd9b3/i.landsat.trim i.landsat.trim] is a shell-script for GRASS 6.4.*, that trims the &amp;quot;fringe&amp;quot; from the borders of Landsat images, for each band separately or with the MASK where coverage exists for all bands. Optionally saves vector footprints of trimmed rasters and MASK. Works with Landsat 5, Landsat 7 (SLC-on).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== i.points.auto ====&lt;br /&gt;
&lt;br /&gt;
This module allows a search of GCP's on two raster-maps with differents levels of automation. The ''manual'' search is the default search, so it's possible to determine the GCP's manually with the mouse (like {{cmd|i.points}}). ''Semiautomated'' search: The user determines with the mouse some correspondent areas (with a discrete precision) in the two maps and the module searches itself the GCP's in these areas. ''Automated'' search: At the start of module the user has to load the maps that the algorithm uses to the search, so it is recommended to use the maps filtered with the filters DIVERSITY or STDDEV (of GRASS) with a window of 3x3 or 5x5 pixels. However, the algorithm sometimes works well with the original maps too.&lt;br /&gt;
&lt;br /&gt;
Note: This code is basically an improved i.points (from 2004). Subsequent changes in i.points haven's been ported here yet.&lt;br /&gt;
&lt;br /&gt;
svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.points.auto&lt;br /&gt;
&lt;br /&gt;
: '''Authors:''' based on i.points; additions by Ivan Michelazzi, Luca Miori (MSc theses at ITC-irst); Supervisors: Markus Neteler, Stefano Merler, ITC-irst 2003, 2004. [http://gisws.media.osaka-cu.ac.jp/grass04/viewpaper.php?id=37 PDF article]&lt;br /&gt;
&lt;br /&gt;
==== i.points.reproj ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/imagery/i.points.reproj i.points.reproj] is a shell script that will use cs2cs to reproject the target coordinates of a group's POINTS file. By running i.rectify directly to the new target projection, a generation of resampling data loss can be avoided (versus i.rectify + r.proj). On the other hand, i.rectify does not calculate cell resolution well if the map is to be rotated ([http://intevation.de/rt/webrt?serial_num=3296 bug #3296]), in those cases i.rectify+r.proj may be the better option.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== i.plr.py ====&lt;br /&gt;
&lt;br /&gt;
: [[I.plr.py|Probabilistic Label Relaxation]], written in Python&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Georg Kaspar&lt;br /&gt;
&lt;br /&gt;
==== i.pr ====&lt;br /&gt;
&lt;br /&gt;
: Image classification: implements k-NN (multiclass), classification trees (multiclass), maximum likelihood (multiclass), Support Vector Machines (binary), bagging versions of all the base classifiers, AdaBoost for binary trees and support vector machines. It allows feature manipulation (normalization, principal components,...). It also implements feature selection techniques (RFE, E-RFE,...), statistical tests on variables, tools for resampling (cross-validation and bootstrap) and cost-sensitive techniques for trees and support vector machines.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Stefano Merler. Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
   svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.pr&lt;br /&gt;
&lt;br /&gt;
==== i.spec.sam ====&lt;br /&gt;
&lt;br /&gt;
: Spectral Angle mapping&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler. Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
   svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.spec.sam/&lt;br /&gt;
&lt;br /&gt;
==== i.spec.unmix ====&lt;br /&gt;
&lt;br /&gt;
: Spectral unmixing&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Neteler. Available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
   svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.spec.unmix/&lt;br /&gt;
&lt;br /&gt;
==== i.topo.corr ====&lt;br /&gt;
: i.topo.corr is used to topographically correct reflectance from imagery files, e.g. obtained with i.landsat.toar (see above), using a sun illumination terrain model. This illumination model represents the cosine of the incident angle, i.e. the  angle between the normal to the ground and the sun rays. It can be obtained with {{cmd|r.sun}} (parameter incidout), and then calculating its cosine with float precision. Correction methods: cosine, minnaert, percent, c-factor.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt; moved to core GRASS (&amp;gt;= 6.4.2), see {{cmd|i.topo.corr}}&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' E. Jorge Tizado&lt;br /&gt;
&lt;br /&gt;
==== i.warp ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/imagery/i.warp i.warp] is a shell script that will use gdalwarp to rectify a raw input image using thin plate splines. The map should be imported into GRASS with r.in.gdal and GCPs set with i.points. Input is the raw image (GeoTIFF, JPEG, etc). Output is a GeoTIFF in the imagery group's target location's map projection. Requires a recent (early 2006) version of GRASS 6.1, or newer.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
=== Display add-ons ===&lt;br /&gt;
&lt;br /&gt;
See also&lt;br /&gt;
&lt;br /&gt;
 svn co http://svn.osgeo.org/grass/grass-addons/grass6/display&lt;br /&gt;
&lt;br /&gt;
==== d.anaglyph ====&lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.anaglyph d.anaglyph] is a module that will render [[Stereo_anaglyphs|stereographic anaglyph]] images in PNG format suitable for use with red/cyan glasses.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== d.barb ====&lt;br /&gt;
&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.barb d.barb] is a C module that will draw wind barbs, straw plots, and arrow plots from raster array or sparse vector point data. It can use either direction + magnitude, or u + v components as the input, and can produce a legend key. (''work in progress, but it's mostly there'')&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
Example: [http://bambi.otago.ac.nz/hamish/grass/screenshots/narr-a_221_20100629_1800_000_10m_winds.png Screenshot]&lt;br /&gt;
&lt;br /&gt;
==== d.edit.rast ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.edit.rast d.edit.rast] edits cells in an existing raster map displayed on the current monitor.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Huidae Cho&lt;br /&gt;
&lt;br /&gt;
==== d.frame.quarter ====&lt;br /&gt;
&lt;br /&gt;
: ('''obsolete''') [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.frame.split d.frame.quarter] is a shell script that will split the display into four quadrants (or sixths) using ''d.frame''. Individual frames are named ''uno, dos, tres, cuatro'', and ''full_screen''.&lt;br /&gt;
: Replaced by {{cmd|d.split.frame}} in main.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== d.frame.split ====&lt;br /&gt;
&lt;br /&gt;
: ''d.frame.split moved into main archive as {{cmd|d.split.frame}}''&lt;br /&gt;
&lt;br /&gt;
==== d.frontline ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.frontline d.frontline] is a shell script that draws frontlines on the graphics monitor using ''d.graph'' module and different types of symbols. Also it optionally saves frontline graphics to ''d.graph'' commands file and/or ''ps.map'' file (for later use with the &amp;quot;read&amp;quot; ''ps.map'' instruction)   &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
==== d.hyperlink ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.hyperlink d.hyperlink] is an interactive shell script that allows the viewing of hyperlinked images from a vector's attribute table in an external image viewer. Queries can be made via SQL statements or interactive mouse-clicking. The attribute table must be pre-populated with a column containing the image to link the vector to; the user also specifies the image folder in the current MAPSET where the images are located. The script currently supports gimp, Eye of Gnome, gthumb, gpdf, and Inkscape image viewers.&lt;br /&gt;
&lt;br /&gt;
: '''Author: '''Eric Patton&lt;br /&gt;
&lt;br /&gt;
==== d.mark ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.mark d.mark] is a shell script that quickly displays a marker on the display at a given coordinate.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== d.region.box ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.region.box d.region.box] is a shell script that quickly displays a box around the current region.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== d.stations ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.shortcuts   d.stations] is a shell script that quickly displays vector points (or sites for GRASS 5.4 and below).&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman &lt;br /&gt;
&lt;br /&gt;
==== d.varea ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/display/d.shortcuts d.varea] is a shell script that quickly displays vector areas.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== d.zoom.keys ====&lt;br /&gt;
&lt;br /&gt;
[https://raw.github.com/amuriy/GRASS-scripts/master/d.zoom.keys d.zoom.keys] is a shell (+awk) script that allows to change the current geographic region settings interactively, with a keyboard. Can use navigation in X-monitor (requires &amp;lt;xev&amp;gt; and &amp;lt;xdotool&amp;gt;) or terminal.&lt;br /&gt;
&lt;br /&gt;
NOTE: tested normally only on Linux (Ubuntu 10.04), on other systems &amp;lt;awk&amp;gt; and other tools may behave differently. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alexander Muriy&lt;br /&gt;
&lt;br /&gt;
Also available via SVN or {{cmd|g.extension}}:&lt;br /&gt;
&lt;br /&gt;
https://svn.osgeo.org/grass/grass-addons/grass6/display/d.zoom.keys/&lt;br /&gt;
&lt;br /&gt;
==== pd-GRASS ====&lt;br /&gt;
&lt;br /&gt;
: [http://www.ornl.gov/sci/gist/software/grass/ pd-GRASS]: Parallel Display for GRASS GIS&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Alex Sorokine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== [[IconSymbols]] ====&lt;br /&gt;
&lt;br /&gt;
* [[IconSymbols|Symbols]] which can be used with ''d.vect, d.graph'', and ''ps.map''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== p.in.labels ====&lt;br /&gt;
&lt;br /&gt;
: [http://tekmap.ns.ca/blog/import_label p.in.labels] is a program to import ASCII xyz (where z is a label) files as GRASS labels. Reads from stdin or existing file. &lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Bob Covill&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Postscript add-ons ===&lt;br /&gt;
&lt;br /&gt;
* ''See also [[ps.map scripts|ps.map samples and templates]]''.&lt;br /&gt;
&lt;br /&gt;
==== ps.atlas ====&lt;br /&gt;
&lt;br /&gt;
: [http://trac.osgeo.org/grass/browser/grass-addons/grass6/postscript/ps.atlas ps.atlas] is a shell script that makes more maps on current region according to input *.psmap file. General map can be stored as vector file. The resulting *.eps maps can be automatically converted to *.pdf files.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jachym Cepicky&lt;br /&gt;
&lt;br /&gt;
==== ps.output ====&lt;br /&gt;
&lt;br /&gt;
: [https://trac.osgeo.org/grass/browser/grass-addons/grass6/postscript/ps.output ps.output] is much like {{cmd|ps.map}} but with advanced decorations and ability for translucency. Here you can find a [[Ps.output|tutorial]].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Jorge Tizado&lt;br /&gt;
&lt;br /&gt;
==== [[AreaFillPatterns]] ====&lt;br /&gt;
&lt;br /&gt;
* Hatches for ps.map's vareas&lt;br /&gt;
&lt;br /&gt;
=== wxGUI add-ons ===&lt;br /&gt;
&lt;br /&gt;
See GRASS 7&lt;br /&gt;
&lt;br /&gt;
=== Dempster-Shafer modelling === &lt;br /&gt;
&lt;br /&gt;
See: http://svn.osgeo.org/grass/grass-addons/grass6/dst/&lt;br /&gt;
&lt;br /&gt;
Modules: dst.predict.run, m.dst.create, m.dst.source, m.dst.update, m.dst.view, r.categorize, r.dst.combine, r.dst.predict.bpn, v.random.sample, v.report.dist&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
* P. Verhagen, H. Kamermans, M. van Leusen &amp;amp; B. Ducke (2010). ''New developments in archaeological predictive modelling''. In: T. Bloemers, H. Kars, A. van der Valk &amp;amp; M. Wijnen (eds.): ''The Cultural Landscape &amp;amp; Heritage Paradox. Protection and Development of the Dutch Archaeological-Historical Landscape and its European Dimension'' (Landscape &amp;amp; Heritage Studies Proceedings), pp. 431-444. ([http://www.academia.edu/368596/P._Verhagen_H._Kamermans_M._van_Leusen_and_B._Ducke_2010_._New_developments_in_archaeological_predictive_modelling._In_T._Bloemers_H._Kars_A._van_der_Valk_and_M._Wijnen_eds._The_Cultural_Landscape_and_Heritage_Paradox._Protection_and_Development_of_the_Dutch_Archaeological-Historical_Landscape_and_its_European_Dimension_Landscape_and_Heritage_Studies_Proceedings_pp._431-444 PDF])&lt;br /&gt;
&lt;br /&gt;
===GRASS and UMN Mapserver===&lt;br /&gt;
&lt;br /&gt;
* [http://www.mail-archive.com/mapserver-users@lists.umn.edu/msg00086.html See interesting posting]&lt;br /&gt;
* See wiki [[GRASS and MapServer]] page&lt;br /&gt;
&lt;br /&gt;
{{AddOns}}&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=OpenMP&amp;diff=19775</id>
		<title>OpenMP</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=OpenMP&amp;diff=19775"/>
		<updated>2013-09-27T09:15:44Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Candidates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Multithreaded jobs in GRASS ==&lt;br /&gt;
&lt;br /&gt;
* see also the [[Parallel GRASS jobs]] and [[Parallelizing Scripts]] wiki pages.&lt;br /&gt;
&lt;br /&gt;
[http://openmp.org/wp/ OpenMP] is an implementation of multithreading, a method of parallelization whereby the master &amp;quot;thread&amp;quot; (a series of instructions executed consecutively) &amp;quot;forks&amp;quot; a specified number of slave &amp;quot;threads&amp;quot; and a task is divided among them (from [http://en.wikipedia.org/wiki/OpenMP wikipedia]). The job is distributed over the available processor cores (2-core, 4-core, ...).&lt;br /&gt;
&lt;br /&gt;
The (yet) only parallelized library in GRASS &amp;gt;=6.3 is GRASS Partial Differential Equations Library (GPDE). The library design is thread safe and supports threaded parallelism with OpenMP. The code is not yet widely used in GRASS. See the [http://download.osgeo.org/grass/grass6_progman/gpdelib.html gpde programmer's manual] for details.&lt;br /&gt;
&lt;br /&gt;
How to activate it with GCC &amp;gt;= 4.2 (compiler flag '-fopenmp' as well as library '-lgomp' are needed):&lt;br /&gt;
&lt;br /&gt;
 # GPDE with openMP support:&lt;br /&gt;
 &lt;br /&gt;
 cd lib/gpde/&lt;br /&gt;
 vim Makefile&lt;br /&gt;
 # uncomment the EXTRA_CFLAGS row and switch the two existing EXTRA_LIBS rows&lt;br /&gt;
&lt;br /&gt;
Integrated system-wide support for OpenMP via a --with-openmp ./configure flag has been requested in {{trac|657}} and the configure switch is now present in trunk (grass7).&lt;br /&gt;
&lt;br /&gt;
=== OpenMP support in GRASS 7 ===&lt;br /&gt;
&lt;br /&gt;
In GRASS version 7 the gpde and the gmath libraries are providing functions which are partly parallelized with OpenMP. All blas level 2 and 3 functions as well as many linear equation solver in the gmath library, are parallelized using OpenMP pragmas. Several numerical modules, which are using those functions, can now benefit from multi core systems (i.e.: {{cmd|r.proj|version=70}}, {{Cmd|r.gwflow|version=70}}, {{Cmd|r3.gwflow|version=70}}, {{Cmd|r.solute.transport|version=70}}). Other modules like {{Cmd|v.surf.bspline|version=70}} and {{Cmd|v.surf.rst|version=70}} have initial support  (via the LU solvers in the gmath library) but are still in the prototype stage and not very efficient yet.&lt;br /&gt;
&lt;br /&gt;
OpenMP flags are compiler dependent, thus OpenMP support should be set using C- and linker-flags before calling configure. &lt;br /&gt;
I.e: for gcc &amp;gt; 4.2: &lt;br /&gt;
&lt;br /&gt;
 CFLAGS=&amp;quot;-O3 -Wall -Werror-implicit-function-declaration -fno-common -fopenmp&amp;quot;&lt;br /&gt;
 LDFLAGS=&amp;quot;-lgomp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* ''Update'': in GRASS 7 you can now switch on OpenMP support with:&lt;br /&gt;
 ./configure --with-openmp&lt;br /&gt;
&lt;br /&gt;
This should enable OpenMP support in the libraries and ALL depending modules. &lt;br /&gt;
&lt;br /&gt;
You can test the OpenMP support when compiling the gpde and gmath tests by hand (switch into the test directories in the lib dirs and type make). The test library modules &amp;quot;test.gmath.lib&amp;quot; and &amp;quot;test.gpde.lib&amp;quot; should be available in the path after starting grass. &lt;br /&gt;
&lt;br /&gt;
The gmath lib test module &amp;quot;test.gmath.lib&amp;quot; provides additionally benchmarks for blas level 2 and 3 functions and for many solver. &lt;br /&gt;
&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib --help&lt;br /&gt;
 &lt;br /&gt;
 Description:&lt;br /&gt;
  Performs benchmarks, unit and integration tests for the gmath library&lt;br /&gt;
 &lt;br /&gt;
 Usage:&lt;br /&gt;
  test.gmath.lib [-uia] [unit=string] [integration=string] [rows=value]&lt;br /&gt;
    [solverbench=string] [blasbench=string] [--verbose] [--quiet]&lt;br /&gt;
 &lt;br /&gt;
 Flags:&lt;br /&gt;
   -u   Run all unit tests&lt;br /&gt;
   -i   Run all integration tests&lt;br /&gt;
   -a   Run all unit and integration tests&lt;br /&gt;
  --v   Verbose module output&lt;br /&gt;
  --q   Quiet module output&lt;br /&gt;
 &lt;br /&gt;
 Parameters:&lt;br /&gt;
          unit   Choose the unit tests to run&lt;br /&gt;
                 options: blas1,blas2,blas3,solver,ccmath,matconv&lt;br /&gt;
   integration   Choose the integration tests to run&lt;br /&gt;
                 options:&lt;br /&gt;
          rows   The size of the matrices and vectors for benchmarking&lt;br /&gt;
                 default: 1000&lt;br /&gt;
   solverbench   Choose solver benchmark&lt;br /&gt;
                 options: krylov,direct&lt;br /&gt;
     blasbench   Choose blas benchmark&lt;br /&gt;
                 options: blas2,blas3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I.e testing the speedup of the blas level 2 and 3 functions of the latest svn trunk of grass7, compiled with the flags mentioned above on a 8 core intel xeon system: &lt;br /&gt;
&lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 1&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas2 rows=5000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 2 benchmark ++&lt;br /&gt;
 Computation time G_math_Ax_sparse: 0.244123&lt;br /&gt;
 Computation time G_math_Ax_sband: 0.280636&lt;br /&gt;
 Computation time G_math_d_Ax: 0.134494&lt;br /&gt;
 Computation time G_math_d_Ax_by: 0.18556&lt;br /&gt;
 Computation time G_math_d_x_dyad: 0.268684&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 4&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas2 rows=5000 &lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 2 benchmark ++&lt;br /&gt;
 Computation time G_math_Ax_sparse: 0.072549&lt;br /&gt;
 Computation time G_math_Ax_sband: 0.192712&lt;br /&gt;
 Computation time G_math_d_Ax: 0.036652&lt;br /&gt;
 Computation time G_math_d_Ax_by: 0.047904&lt;br /&gt;
 Computation time G_math_d_x_dyad: 0.080534&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 1&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas3 rows=1000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 3 benchmark ++&lt;br /&gt;
 Computation time G_math_d_aA_B: 0.013263&lt;br /&gt;
 Computation time G_math_d_AB: 18.729&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 4&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas3 rows=1000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 3 benchmark ++&lt;br /&gt;
 Computation time G_math_d_aA_B: 0.006946&lt;br /&gt;
 Computation time G_math_d_AB: 4.80446&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
&lt;br /&gt;
== General code structure ==&lt;br /&gt;
&lt;br /&gt;
Example cited from &amp;quot;openMP tutorial&amp;quot; (see below):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
    #include &amp;lt;omp.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    int main ()  {&lt;br /&gt;
        int var1, var2, var3;&lt;br /&gt;
    &lt;br /&gt;
        Some serial code &lt;br /&gt;
        ...&lt;br /&gt;
   &lt;br /&gt;
        /* Beginning of parallel section. Fork a team of threads. */&lt;br /&gt;
        /* Specify variable scoping */&lt;br /&gt;
   &lt;br /&gt;
       #pragma omp parallel private(var1, var2) shared(var3)&lt;br /&gt;
       {&lt;br /&gt;
   &lt;br /&gt;
        /* Parallel section executed by all threads */&lt;br /&gt;
        ...&lt;br /&gt;
   &lt;br /&gt;
        /* All threads join master thread and disband */&lt;br /&gt;
       }  /* end pragma */&lt;br /&gt;
   &lt;br /&gt;
       /* Resume serial code */&lt;br /&gt;
       ...&lt;br /&gt;
   &lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in the Makefile, add something like this:&lt;br /&gt;
&lt;br /&gt;
   #openMP support&lt;br /&gt;
   EXTRA_CFLAGS=-fopenmp&lt;br /&gt;
   EXTRA_LIBS=$(GISLIB) -lgomp $(MATHLIB)&lt;br /&gt;
&lt;br /&gt;
* Examples:&lt;br /&gt;
: https://computing.llnl.gov/tutorials/openMP/exercise.html&lt;br /&gt;
&lt;br /&gt;
== Run time ==&lt;br /&gt;
&lt;br /&gt;
The default is to create as many threads as the system has processors. If you don't want that, you can control the number with the OMP_NUM_THREADS environment variable. For example to request 3 threads from a Bourne shell:&lt;br /&gt;
&lt;br /&gt;
 OMP_NUM_THREADS=3&lt;br /&gt;
 export OMP_NUM_THREADS&lt;br /&gt;
 &lt;br /&gt;
 g.module ...&lt;br /&gt;
&lt;br /&gt;
== Candidates ==&lt;br /&gt;
&lt;br /&gt;
It is important to understand which modules are '''processor bound''', and concentrate on them. i.e. do not needlessly complicate the code of non-long running processor bound or I/O-bound modules. Almost all of the GIS libraries are not thread-safe. Regardless, these are typically I/O bound not processor bound, so not critical to parallelize. It is expected that most of the CPU-bound loops which will benefit from parallelization will be found in the modules.&lt;br /&gt;
&lt;br /&gt;
A good place to start is by running a [[Bugs#Using_a_profiling_tool|profiling tool]] to find the worst offending functions and deal with them first. Blindly parallelizing every loop you can find has the potential to slow things down due to the overheads needed to create and destroy threads.&lt;br /&gt;
&lt;br /&gt;
* v.lidar: parallelize tcholDec() in {{src|lib/lidar/TcholBand.c}} (?moved)&lt;br /&gt;
: This would speed up the CPU-bound {{cmd|v.surf.bspline|version=70}} and {{cmd|v.lidar.edgedetection|version=70}} considerably. [Partially done in the gmath lib by Soeren?]&lt;br /&gt;
&lt;br /&gt;
* (suggestion) RST library and {{cmd|v.surf.rst|version=70}} [Partially done in the gmath lib by Hamish?]&lt;br /&gt;
: Please contact and coordinate with Helena Mitasova before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.watershed|version=70}}&lt;br /&gt;
: Please contact and coordinate with Markus Metz before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{Cmd|r.viewshed|version=70}}  (C++)&lt;br /&gt;
: Please contact and coordinate with Laura Toma before starting work on this.&lt;br /&gt;
: Should fix bug described in {{trac|390}} first and once that is done move module into the main repo.&lt;br /&gt;
&lt;br /&gt;
* (in progress) {{cmd|r.sun|version=70}} [Note, OpenCL GPU support already added by Seth Price as part of his Summer of Code project; OpenCL supports multi CPU as well as GPU; ./configure GRASS 7 --with-opencl]&lt;br /&gt;
: Please contact and coordinate with Markus Neteler / Jaro Hofierka before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.univar|version=70}} when run with multiple input maps. Send each input map to its own thread.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.neighbors|version=70}} particularly for large neighborhood sizes.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.mfilter|version=70}} particularly for large neighborhood sizes.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.texture|version=70}} particularly for multiple methods and/or large regions.&lt;br /&gt;
&lt;br /&gt;
== Complete ==&lt;br /&gt;
&lt;br /&gt;
* Add support to the build system in GRASS 7. (enable with `&amp;lt;tt&amp;gt;./configure --with-openmp&amp;lt;/tt&amp;gt;`)&lt;br /&gt;
:* GRASS 7 also has a &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; switch for `&amp;lt;tt&amp;gt;--with-pthread&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
* The GPDE library ({{src|lib/gpde/}}) has OpenMP support&lt;br /&gt;
&lt;br /&gt;
* The gmath library ({{src|lib/gmath/}}) has OpenMP support for grass blas level 1, 2 and 3 algorithms as well as several iterative and direct linear equation solver. This is a work in progress, and may not be very efficient currently. When finished, a parallelized LU solver will help with tasks like {{cmd|v.surf.rst|version=70}} and {{cmd|v.surf.bspline|version=70}}.&lt;br /&gt;
&lt;br /&gt;
* Experimental {{wikipedia|Pthread}} support for [http://thread.gmane.org/gmane.comp.gis.grass.devel/30313 r.mapcalc is now in GRASS 7svn]&lt;br /&gt;
&lt;br /&gt;
* Yann has added OpenMP support to {{cmd|i.atcorr|version=70}}. (not in SVN, since not working properly)&lt;br /&gt;
&lt;br /&gt;
* MarkusM has added OpenMP support to {{cmd|r.proj|version=70}} in GRASS 7 (and removed, since not working properly)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|pthreads}}&lt;br /&gt;
* [[GPU]] using {{wikipedia|OpenCL}} and {{wikipedia|CUDA}}&lt;br /&gt;
&lt;br /&gt;
* For some tasks it may be possible to easily parallelize at the module level. See [[Parallelizing Scripts]]&lt;br /&gt;
&lt;br /&gt;
; WARNING: not all GRASS modules and scripts are safe to have other things happening in the same mapset while they are running. Try at your own risk after performing a suitable safety audit. e.g. Make sure {{cmd|g.region|version=70}} is not run, externally (temporarily) changing the region settings.&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
&lt;br /&gt;
Neighborhood analysis performance using OpenMP and different compilers:&lt;br /&gt;
* [[OpenMP/Benchmarks]]&lt;br /&gt;
: http://trac.osgeo.org/grass/browser/sandbox/soeren/benchmarks/neighborhood_openmp/&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.loni.org/wiki/Introduction_to_OpenMP Introduction to OpenMP]&lt;br /&gt;
* [https://computing.llnl.gov/tutorials/openMP OpenMP tutorial]&lt;br /&gt;
* [http://developer.amd.com/Membership/Print.aspx?ArticleID=157&amp;amp;web=http%3a%2f%2fdeveloper.amd.com%2fdocumentation%2farticles Easy OpenMP tutorial showing multithreading a program by sections], as opposed to the usual loop examples.&lt;br /&gt;
* [http://developer.amd.com/documentation/articles/pages/1121200682.aspx Another, introducing loops]&lt;br /&gt;
&lt;br /&gt;
* [http://software.intel.com/en-us/articles/threading-models-for-high-performance-computing-pthreads-or-openmp/ Threading Models for High-Performance Computing: Pthreads or OpenMP?]&lt;br /&gt;
&lt;br /&gt;
* GRASS mailing list discussions:&lt;br /&gt;
** http://thread.gmane.org/gmane.comp.gis.grass.devel/16410/&lt;br /&gt;
** http://lists.osgeo.org/pipermail/grass-dev/2009-April/043375.html&lt;br /&gt;
&lt;br /&gt;
* [http://www.khronos.org/opencl/ OpenCL] ({{wikipedia|OpenCL}} Wikipedia entry)&lt;br /&gt;
&lt;br /&gt;
* idea: You ''might'' be able to run the mpd daemon and then launch jobs via &amp;lt;tt&amp;gt;[http://www.mcs.anl.gov/mpi/index.htm mpirun -np 4 &amp;lt;command&amp;gt;]&amp;lt;/tt&amp;gt; in order to make your quad-core into a mini self-contained Beowulf cluster.&lt;br /&gt;
&lt;br /&gt;
[[Category: Development]]&lt;br /&gt;
[[Category: Parallelization]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=OpenMP&amp;diff=19774</id>
		<title>OpenMP</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=OpenMP&amp;diff=19774"/>
		<updated>2013-09-27T08:51:52Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: add candidates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Multithreaded jobs in GRASS ==&lt;br /&gt;
&lt;br /&gt;
* see also the [[Parallel GRASS jobs]] and [[Parallelizing Scripts]] wiki pages.&lt;br /&gt;
&lt;br /&gt;
[http://openmp.org/wp/ OpenMP] is an implementation of multithreading, a method of parallelization whereby the master &amp;quot;thread&amp;quot; (a series of instructions executed consecutively) &amp;quot;forks&amp;quot; a specified number of slave &amp;quot;threads&amp;quot; and a task is divided among them (from [http://en.wikipedia.org/wiki/OpenMP wikipedia]). The job is distributed over the available processor cores (2-core, 4-core, ...).&lt;br /&gt;
&lt;br /&gt;
The (yet) only parallelized library in GRASS &amp;gt;=6.3 is GRASS Partial Differential Equations Library (GPDE). The library design is thread safe and supports threaded parallelism with OpenMP. The code is not yet widely used in GRASS. See the [http://download.osgeo.org/grass/grass6_progman/gpdelib.html gpde programmer's manual] for details.&lt;br /&gt;
&lt;br /&gt;
How to activate it with GCC &amp;gt;= 4.2 (compiler flag '-fopenmp' as well as library '-lgomp' are needed):&lt;br /&gt;
&lt;br /&gt;
 # GPDE with openMP support:&lt;br /&gt;
 &lt;br /&gt;
 cd lib/gpde/&lt;br /&gt;
 vim Makefile&lt;br /&gt;
 # uncomment the EXTRA_CFLAGS row and switch the two existing EXTRA_LIBS rows&lt;br /&gt;
&lt;br /&gt;
Integrated system-wide support for OpenMP via a --with-openmp ./configure flag has been requested in {{trac|657}} and the configure switch is now present in trunk (grass7).&lt;br /&gt;
&lt;br /&gt;
=== OpenMP support in GRASS 7 ===&lt;br /&gt;
&lt;br /&gt;
In GRASS version 7 the gpde and the gmath libraries are providing functions which are partly parallelized with OpenMP. All blas level 2 and 3 functions as well as many linear equation solver in the gmath library, are parallelized using OpenMP pragmas. Several numerical modules, which are using those functions, can now benefit from multi core systems (i.e.: {{cmd|r.proj|version=70}}, {{Cmd|r.gwflow|version=70}}, {{Cmd|r3.gwflow|version=70}}, {{Cmd|r.solute.transport|version=70}}). Other modules like {{Cmd|v.surf.bspline|version=70}} and {{Cmd|v.surf.rst|version=70}} have initial support  (via the LU solvers in the gmath library) but are still in the prototype stage and not very efficient yet.&lt;br /&gt;
&lt;br /&gt;
OpenMP flags are compiler dependent, thus OpenMP support should be set using C- and linker-flags before calling configure. &lt;br /&gt;
I.e: for gcc &amp;gt; 4.2: &lt;br /&gt;
&lt;br /&gt;
 CFLAGS=&amp;quot;-O3 -Wall -Werror-implicit-function-declaration -fno-common -fopenmp&amp;quot;&lt;br /&gt;
 LDFLAGS=&amp;quot;-lgomp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* ''Update'': in GRASS 7 you can now switch on OpenMP support with:&lt;br /&gt;
 ./configure --with-openmp&lt;br /&gt;
&lt;br /&gt;
This should enable OpenMP support in the libraries and ALL depending modules. &lt;br /&gt;
&lt;br /&gt;
You can test the OpenMP support when compiling the gpde and gmath tests by hand (switch into the test directories in the lib dirs and type make). The test library modules &amp;quot;test.gmath.lib&amp;quot; and &amp;quot;test.gpde.lib&amp;quot; should be available in the path after starting grass. &lt;br /&gt;
&lt;br /&gt;
The gmath lib test module &amp;quot;test.gmath.lib&amp;quot; provides additionally benchmarks for blas level 2 and 3 functions and for many solver. &lt;br /&gt;
&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib --help&lt;br /&gt;
 &lt;br /&gt;
 Description:&lt;br /&gt;
  Performs benchmarks, unit and integration tests for the gmath library&lt;br /&gt;
 &lt;br /&gt;
 Usage:&lt;br /&gt;
  test.gmath.lib [-uia] [unit=string] [integration=string] [rows=value]&lt;br /&gt;
    [solverbench=string] [blasbench=string] [--verbose] [--quiet]&lt;br /&gt;
 &lt;br /&gt;
 Flags:&lt;br /&gt;
   -u   Run all unit tests&lt;br /&gt;
   -i   Run all integration tests&lt;br /&gt;
   -a   Run all unit and integration tests&lt;br /&gt;
  --v   Verbose module output&lt;br /&gt;
  --q   Quiet module output&lt;br /&gt;
 &lt;br /&gt;
 Parameters:&lt;br /&gt;
          unit   Choose the unit tests to run&lt;br /&gt;
                 options: blas1,blas2,blas3,solver,ccmath,matconv&lt;br /&gt;
   integration   Choose the integration tests to run&lt;br /&gt;
                 options:&lt;br /&gt;
          rows   The size of the matrices and vectors for benchmarking&lt;br /&gt;
                 default: 1000&lt;br /&gt;
   solverbench   Choose solver benchmark&lt;br /&gt;
                 options: krylov,direct&lt;br /&gt;
     blasbench   Choose blas benchmark&lt;br /&gt;
                 options: blas2,blas3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I.e testing the speedup of the blas level 2 and 3 functions of the latest svn trunk of grass7, compiled with the flags mentioned above on a 8 core intel xeon system: &lt;br /&gt;
&lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 1&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas2 rows=5000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 2 benchmark ++&lt;br /&gt;
 Computation time G_math_Ax_sparse: 0.244123&lt;br /&gt;
 Computation time G_math_Ax_sband: 0.280636&lt;br /&gt;
 Computation time G_math_d_Ax: 0.134494&lt;br /&gt;
 Computation time G_math_d_Ax_by: 0.18556&lt;br /&gt;
 Computation time G_math_d_x_dyad: 0.268684&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 4&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas2 rows=5000 &lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 2 benchmark ++&lt;br /&gt;
 Computation time G_math_Ax_sparse: 0.072549&lt;br /&gt;
 Computation time G_math_Ax_sband: 0.192712&lt;br /&gt;
 Computation time G_math_d_Ax: 0.036652&lt;br /&gt;
 Computation time G_math_d_Ax_by: 0.047904&lt;br /&gt;
 Computation time G_math_d_x_dyad: 0.080534&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 1&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas3 rows=1000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 3 benchmark ++&lt;br /&gt;
 Computation time G_math_d_aA_B: 0.013263&lt;br /&gt;
 Computation time G_math_d_AB: 18.729&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
 &lt;br /&gt;
 gmath/test&amp;gt; setenv OMP_NUM_THREADS 4&lt;br /&gt;
 gmath/test&amp;gt; test.gmath.lib blasbench=blas3 rows=1000&lt;br /&gt;
 &lt;br /&gt;
 ++ Running blas level 3 benchmark ++&lt;br /&gt;
 Computation time G_math_d_aA_B: 0.006946&lt;br /&gt;
 Computation time G_math_d_AB: 4.80446&lt;br /&gt;
 &lt;br /&gt;
 -- gmath lib tests finished successfully --&lt;br /&gt;
&lt;br /&gt;
== General code structure ==&lt;br /&gt;
&lt;br /&gt;
Example cited from &amp;quot;openMP tutorial&amp;quot; (see below):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
    #include &amp;lt;omp.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    int main ()  {&lt;br /&gt;
        int var1, var2, var3;&lt;br /&gt;
    &lt;br /&gt;
        Some serial code &lt;br /&gt;
        ...&lt;br /&gt;
   &lt;br /&gt;
        /* Beginning of parallel section. Fork a team of threads. */&lt;br /&gt;
        /* Specify variable scoping */&lt;br /&gt;
   &lt;br /&gt;
       #pragma omp parallel private(var1, var2) shared(var3)&lt;br /&gt;
       {&lt;br /&gt;
   &lt;br /&gt;
        /* Parallel section executed by all threads */&lt;br /&gt;
        ...&lt;br /&gt;
   &lt;br /&gt;
        /* All threads join master thread and disband */&lt;br /&gt;
       }  /* end pragma */&lt;br /&gt;
   &lt;br /&gt;
       /* Resume serial code */&lt;br /&gt;
       ...&lt;br /&gt;
   &lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in the Makefile, add something like this:&lt;br /&gt;
&lt;br /&gt;
   #openMP support&lt;br /&gt;
   EXTRA_CFLAGS=-fopenmp&lt;br /&gt;
   EXTRA_LIBS=$(GISLIB) -lgomp $(MATHLIB)&lt;br /&gt;
&lt;br /&gt;
* Examples:&lt;br /&gt;
: https://computing.llnl.gov/tutorials/openMP/exercise.html&lt;br /&gt;
&lt;br /&gt;
== Run time ==&lt;br /&gt;
&lt;br /&gt;
The default is to create as many threads as the system has processors. If you don't want that, you can control the number with the OMP_NUM_THREADS environment variable. For example to request 3 threads from a Bourne shell:&lt;br /&gt;
&lt;br /&gt;
 OMP_NUM_THREADS=3&lt;br /&gt;
 export OMP_NUM_THREADS&lt;br /&gt;
 &lt;br /&gt;
 g.module ...&lt;br /&gt;
&lt;br /&gt;
== Candidates ==&lt;br /&gt;
&lt;br /&gt;
It is important to understand which modules are '''processor bound''', and concentrate on them. i.e. do not needlessly complicate the code of non-long running processor bound or I/O-bound modules. Almost all of the GIS libraries are not thread-safe. Regardless, these are typically I/O bound not processor bound, so not critical to parallelize. It is expected that most of the CPU-bound loops which will benefit from parallelization will be found in the modules.&lt;br /&gt;
&lt;br /&gt;
A good place to start is by running a [[Bugs#Using_a_profiling_tool|profiling tool]] to find the worst offending functions and deal with them first. Blindly parallelizing every loop you can find has the potential to slow things down due to the overheads needed to create and destroy threads.&lt;br /&gt;
&lt;br /&gt;
* v.lidar: parallelize tcholDec() in {{src|lib/lidar/TcholBand.c}} (?moved)&lt;br /&gt;
: This would speed up the CPU-bound {{cmd|v.surf.bspline|version=70}} and {{cmd|v.lidar.edgedetection|version=70}} considerably. [Partially done in the gmath lib by Soeren?]&lt;br /&gt;
&lt;br /&gt;
* (suggestion) RST library and {{cmd|v.surf.rst|version=70}} [Partially done in the gmath lib by Hamish?]&lt;br /&gt;
: Please contact and coordinate with Helena Mitasova before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.watershed|version=70}}&lt;br /&gt;
: Please contact and coordinate with Markus Metz before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{Cmd|r.viewshed|version=70}}  (C++)&lt;br /&gt;
: Please contact and coordinate with Laura Toma before starting work on this.&lt;br /&gt;
: Should fix bug described in {{trac|390}} first and once that is done move module into the main repo.&lt;br /&gt;
&lt;br /&gt;
* (in progress) {{cmd|r.sun|version=70}} [Note, OpenCL GPU support already added by Seth Price as part of his Summer of Code project; OpenCL supports multi CPU as well as GPU; ./configure GRASS 7 --with-opencl]&lt;br /&gt;
: Please contact and coordinate with Markus Neteler / Jaro Hofierka before starting work on this.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.univar|version=70}} when run with multiple input maps. Send each input map to its own thread.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.neighbors|version=70}} particularly for large neighborhood sizes.&lt;br /&gt;
&lt;br /&gt;
* (suggestion) {{cmd|r.texture|version=70}} particularly for multiple methods and/or large regions.&lt;br /&gt;
&lt;br /&gt;
== Complete ==&lt;br /&gt;
&lt;br /&gt;
* Add support to the build system in GRASS 7. (enable with `&amp;lt;tt&amp;gt;./configure --with-openmp&amp;lt;/tt&amp;gt;`)&lt;br /&gt;
:* GRASS 7 also has a &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; switch for `&amp;lt;tt&amp;gt;--with-pthread&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
* The GPDE library ({{src|lib/gpde/}}) has OpenMP support&lt;br /&gt;
&lt;br /&gt;
* The gmath library ({{src|lib/gmath/}}) has OpenMP support for grass blas level 1, 2 and 3 algorithms as well as several iterative and direct linear equation solver. This is a work in progress, and may not be very efficient currently. When finished, a parallelized LU solver will help with tasks like {{cmd|v.surf.rst|version=70}} and {{cmd|v.surf.bspline|version=70}}.&lt;br /&gt;
&lt;br /&gt;
* Experimental {{wikipedia|Pthread}} support for [http://thread.gmane.org/gmane.comp.gis.grass.devel/30313 r.mapcalc is now in GRASS 7svn]&lt;br /&gt;
&lt;br /&gt;
* Yann has added OpenMP support to {{cmd|i.atcorr|version=70}}. (not in SVN, since not working properly)&lt;br /&gt;
&lt;br /&gt;
* MarkusM has added OpenMP support to {{cmd|r.proj|version=70}} in GRASS 7 (and removed, since not working properly)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* {{wikipedia|pthreads}}&lt;br /&gt;
* [[GPU]] using {{wikipedia|OpenCL}} and {{wikipedia|CUDA}}&lt;br /&gt;
&lt;br /&gt;
* For some tasks it may be possible to easily parallelize at the module level. See [[Parallelizing Scripts]]&lt;br /&gt;
&lt;br /&gt;
; WARNING: not all GRASS modules and scripts are safe to have other things happening in the same mapset while they are running. Try at your own risk after performing a suitable safety audit. e.g. Make sure {{cmd|g.region|version=70}} is not run, externally (temporarily) changing the region settings.&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
&lt;br /&gt;
Neighborhood analysis performance using OpenMP and different compilers:&lt;br /&gt;
* [[OpenMP/Benchmarks]]&lt;br /&gt;
: http://trac.osgeo.org/grass/browser/sandbox/soeren/benchmarks/neighborhood_openmp/&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.loni.org/wiki/Introduction_to_OpenMP Introduction to OpenMP]&lt;br /&gt;
* [https://computing.llnl.gov/tutorials/openMP OpenMP tutorial]&lt;br /&gt;
* [http://developer.amd.com/Membership/Print.aspx?ArticleID=157&amp;amp;web=http%3a%2f%2fdeveloper.amd.com%2fdocumentation%2farticles Easy OpenMP tutorial showing multithreading a program by sections], as opposed to the usual loop examples.&lt;br /&gt;
* [http://developer.amd.com/documentation/articles/pages/1121200682.aspx Another, introducing loops]&lt;br /&gt;
&lt;br /&gt;
* [http://software.intel.com/en-us/articles/threading-models-for-high-performance-computing-pthreads-or-openmp/ Threading Models for High-Performance Computing: Pthreads or OpenMP?]&lt;br /&gt;
&lt;br /&gt;
* GRASS mailing list discussions:&lt;br /&gt;
** http://thread.gmane.org/gmane.comp.gis.grass.devel/16410/&lt;br /&gt;
** http://lists.osgeo.org/pipermail/grass-dev/2009-April/043375.html&lt;br /&gt;
&lt;br /&gt;
* [http://www.khronos.org/opencl/ OpenCL] ({{wikipedia|OpenCL}} Wikipedia entry)&lt;br /&gt;
&lt;br /&gt;
* idea: You ''might'' be able to run the mpd daemon and then launch jobs via &amp;lt;tt&amp;gt;[http://www.mcs.anl.gov/mpi/index.htm mpirun -np 4 &amp;lt;command&amp;gt;]&amp;lt;/tt&amp;gt; in order to make your quad-core into a mini self-contained Beowulf cluster.&lt;br /&gt;
&lt;br /&gt;
[[Category: Development]]&lt;br /&gt;
[[Category: Parallelization]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19750</id>
		<title>AddOns/GRASS7/vector</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19750"/>
		<updated>2013-09-22T15:05:09Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* v.centerpoint */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/vector/&lt;br /&gt;
&lt;br /&gt;
==== v.area.weigh ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.area.weigh|version=7}} creates a raster surface from vector areas using known cell weights and preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count with the area's population concentrated on the known location of urban areas.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.build.pg ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.build.pg|version=7}} builds PostGIS topology for feature tables linked via v.external.&lt;br /&gt;
&lt;br /&gt;
==== v.centerpoint ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.centerpoint|version=7}} calculates various center points for points, lines and areas: center of gravity, geometric median etc.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.class.mlpy ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.class.mlpy|version=7}} classifies vector features. It is an interface to the [http://mlpy.sourceforge.net mlpy library] (Machine Learning Python). Classification is supervised and based on attribute table data. Geometry is not used. A training dataset is always required.&lt;br /&gt;
&lt;br /&gt;
==== v.colors2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.colors|version=7}} is much like r.colors, but may be used for vector maps.&lt;br /&gt;
&lt;br /&gt;
==== v.concave.hull ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.concave.hull|version=7}} creates a concave hull describing the shape of point clouds.&lt;br /&gt;
&lt;br /&gt;
==== v.delaunay3d ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.delaunay3d|version=7}} creates a 3D triangulation from an input vector map containing points or centroids.&lt;br /&gt;
&lt;br /&gt;
Requires [http://www.cgal.org CGAL library].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Martin Landa&lt;br /&gt;
&lt;br /&gt;
==== v.external.all ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.external.all|version=7}} creates (using v.external) in the current mapset new pseudo-vector maps for all OGR layers from given OGR datasource (dsn option).&lt;br /&gt;
&lt;br /&gt;
==== v.in.geopaparazzi ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.geopaparazzi|version=7}} imports all elements saved into [http://code.google.com/p/geopaparazzi/ Geopaparazzi].&lt;br /&gt;
&lt;br /&gt;
==== v.in.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.ply|version=7}} is a C program that imports a PLY file and writes it as GRASS vector map.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.in.redwg ====&lt;br /&gt;
&lt;br /&gt;
: [http://lists.gnu.org/archive/html/info-libredwg/2010-08/msg00000.html v.in.redwg imports DWG files into GRASS.], see also [https://svn.osgeo.org/grass/grass-addons/grass7/vector/v.in.redwg here]&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Rodrigo Rodrigues da Silva&lt;br /&gt;
&lt;br /&gt;
==== v.in.wfs2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.wfs2|version=7}} imports OGC WFS maps (Web Feature Service) from external servers.&lt;br /&gt;
&lt;br /&gt;
==== v.median ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.median|version=7}} create the median point of a cloud of point.&lt;br /&gt;
&lt;br /&gt;
==== v.net.salesman.opt ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.net.salesman.opt|version=7}} estimates the optimal route to visit nodes on a vector network and optionally tries to improve the result.&lt;br /&gt;
&lt;br /&gt;
==== v.out.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.out.ply|version=7}} is a C program that exports a GRASS vector map as PLY file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.ply.rectify ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.ply.rectify|version=7}} imports a PLY point cloud, georeferences and exports it. The first three vertex properties must be the x, y, z coordinates with property names &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot;, in this order.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.surf.icw ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.icw|version=7}}:&lt;br /&gt;
Inverse cost weighting is like inverse distance weighted (IDW) interpolation, but uses cost instead of shortest Euclidean distance. In this way solid barriers and molasses zones may be correctly taken into account.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.surf.mass ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.mass|version=7}} creates a raster surface from vector areas, preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count. ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.surf.mass/v.surf.mass.html manual page])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19749</id>
		<title>AddOns/GRASS7/vector</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19749"/>
		<updated>2013-09-22T15:04:02Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* v.centerpoint */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/vector/&lt;br /&gt;
&lt;br /&gt;
==== v.area.weigh ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.area.weigh|version=7}} creates a raster surface from vector areas using known cell weights and preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count with the area's population concentrated on the known location of urban areas.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.build.pg ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.build.pg|version=7}} builds PostGIS topology for feature tables linked via v.external.&lt;br /&gt;
&lt;br /&gt;
==== v.centerpoint ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.centerpointversion=7}} calculates various center points for points, lines and areas: center of gravity, geometric median etc.&lt;br /&gt;
&lt;br /&gt;
==== v.class.mlpy ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.class.mlpy|version=7}} classifies vector features. It is an interface to the [http://mlpy.sourceforge.net mlpy library] (Machine Learning Python). Classification is supervised and based on attribute table data. Geometry is not used. A training dataset is always required.&lt;br /&gt;
&lt;br /&gt;
==== v.colors2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.colors|version=7}} is much like r.colors, but may be used for vector maps.&lt;br /&gt;
&lt;br /&gt;
==== v.concave.hull ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.concave.hull|version=7}} creates a concave hull describing the shape of point clouds.&lt;br /&gt;
&lt;br /&gt;
==== v.delaunay3d ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.delaunay3d|version=7}} creates a 3D triangulation from an input vector map containing points or centroids.&lt;br /&gt;
&lt;br /&gt;
Requires [http://www.cgal.org CGAL library].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Martin Landa&lt;br /&gt;
&lt;br /&gt;
==== v.external.all ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.external.all|version=7}} creates (using v.external) in the current mapset new pseudo-vector maps for all OGR layers from given OGR datasource (dsn option).&lt;br /&gt;
&lt;br /&gt;
==== v.in.geopaparazzi ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.geopaparazzi|version=7}} imports all elements saved into [http://code.google.com/p/geopaparazzi/ Geopaparazzi].&lt;br /&gt;
&lt;br /&gt;
==== v.in.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.ply|version=7}} is a C program that imports a PLY file and writes it as GRASS vector map.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.in.redwg ====&lt;br /&gt;
&lt;br /&gt;
: [http://lists.gnu.org/archive/html/info-libredwg/2010-08/msg00000.html v.in.redwg imports DWG files into GRASS.], see also [https://svn.osgeo.org/grass/grass-addons/grass7/vector/v.in.redwg here]&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Rodrigo Rodrigues da Silva&lt;br /&gt;
&lt;br /&gt;
==== v.in.wfs2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.wfs2|version=7}} imports OGC WFS maps (Web Feature Service) from external servers.&lt;br /&gt;
&lt;br /&gt;
==== v.median ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.median|version=7}} create the median point of a cloud of point.&lt;br /&gt;
&lt;br /&gt;
==== v.net.salesman.opt ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.net.salesman.opt|version=7}} estimates the optimal route to visit nodes on a vector network and optionally tries to improve the result.&lt;br /&gt;
&lt;br /&gt;
==== v.out.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.out.ply|version=7}} is a C program that exports a GRASS vector map as PLY file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.ply.rectify ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.ply.rectify|version=7}} imports a PLY point cloud, georeferences and exports it. The first three vertex properties must be the x, y, z coordinates with property names &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot;, in this order.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.surf.icw ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.icw|version=7}}:&lt;br /&gt;
Inverse cost weighting is like inverse distance weighted (IDW) interpolation, but uses cost instead of shortest Euclidean distance. In this way solid barriers and molasses zones may be correctly taken into account.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.surf.mass ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.mass|version=7}} creates a raster surface from vector areas, preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count. ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.surf.mass/v.surf.mass.html manual page])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Compile_and_Install&amp;diff=19688</id>
		<title>Compile and Install</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Compile_and_Install&amp;diff=19688"/>
		<updated>2013-09-06T16:11:32Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: AIX 64 bit, shared libs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- {{MoveToTrac}} --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disclaimer''': This page explains how to turn the GRASS GIS source code into an installable binary package (&amp;quot;compilation&amp;quot;) for different operating systems. If you just want to get ready-to-use binaries, go [http://grass.osgeo.org/download/ here], otherwise read on...&lt;br /&gt;
&lt;br /&gt;
== How to do compilation and installation of GRASS 6? ==&lt;br /&gt;
&lt;br /&gt;
Here we explain the procedure to compile GRASS from SVN, but it also applies to official GRASS 6 releases.&lt;br /&gt;
&lt;br /&gt;
''For installation of precompiled binary packages, see the main [[Installation Guide]].''&lt;br /&gt;
&lt;br /&gt;
For detailed information on compilation, please see the [http://grass.osgeo.org/grass64/source/INSTALL INSTALL] file in the source code.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
==== Extra libraries ====&lt;br /&gt;
GRASS needs at least two extra libraries: PROJ and GDAL/OGR&lt;br /&gt;
&lt;br /&gt;
''Note: if you want to have DBMS support in GDAL (subsequently in GRASS) you have to perform the &amp;quot;Optional&amp;quot; steps below as well.''&lt;br /&gt;
&lt;br /&gt;
* [http://trac.osgeo.org/proj/ PROJ4] for management of projections (with proj-datumgrid-1.3.zip support)&lt;br /&gt;
* Optional: [http://trac.osgeo.org/geos/ GEOS]&lt;br /&gt;
* Optional: [http://www.postgresql.org PostgreSQL], [http://www.mysql.org mySQL], [http://www.unixodbc.org unixODBC], [http://www.sqlite.org SQLite] (SQLite is needed for [[QGIS]])&lt;br /&gt;
* [http://www.gdal.org GDAL/OGR] for reading and writing various GIS data formats (interoperability)&lt;br /&gt;
&lt;br /&gt;
You have to install these two libraries '''first''' (see below how to get them precompiled for your system).&lt;br /&gt;
&lt;br /&gt;
It is easiest to obtain a prepackaged version of these libraries (e.g., .rpm; .deb) for your particular operating system and run the corresponding package installation (e.g., rpm -Uhv packagename.rpm; apt-get) in a terminal window. Take care to also install the development packages of these libraries (...-devel packages). If there is no prepackage version, then you will have to download the source code (see links above, source code packages usually ends in .tar.gz or .zip) and compile it (you must have a C compiler installed as part of your operating system). The Web sites show the steps to compile the libraries.&lt;br /&gt;
&lt;br /&gt;
Other libraries needed to run GRASS are listed on the {{website|grass64/source/REQUIREMENTS.html|requirements page}}.&lt;br /&gt;
&lt;br /&gt;
To compile, you will also need the respective &amp;quot;-devel&amp;quot; packages.&lt;br /&gt;
&lt;br /&gt;
==== Download GRASS GIS source code ====&lt;br /&gt;
Then [http://grass.osgeo.org/download/software/sources/ download the GRASS GIS source code] of course.&lt;br /&gt;
&lt;br /&gt;
=== Generic Compilation and installation procedure ===&lt;br /&gt;
&lt;br /&gt;
* It is wise that compilation processes are carried out as a normal user: If you want to get the source code in a place where  you do not have write permissions (e.g. in /usr/local/src/) just follow this:&lt;br /&gt;
      cd /usr/local/src/ &lt;br /&gt;
      su -c 'mkdir grass6'&lt;br /&gt;
      su -c 'chown yourlogin:yourgroup grass6'&lt;br /&gt;
&lt;br /&gt;
Otherwise if you have permissions just continue as a normal user:&lt;br /&gt;
      cd /usr/local/src/&lt;br /&gt;
      svn checkout ...&lt;br /&gt;
&lt;br /&gt;
* do a code checkout from the SVN source code repository&lt;br /&gt;
: checkout the latest GRASS 6.x from SVN (see: {{twiki|DownloadSource}})&lt;br /&gt;
&lt;br /&gt;
* in the grass6 directory, you will find the precious INSTALL file, open it with your favourite pager/editor and read it carefully!&lt;br /&gt;
&lt;br /&gt;
* run configure with parameters to adapt the compile process to your own system. To see what options can be passed to it, run:&lt;br /&gt;
 ./configure --help | less &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The minimum set of configure parameters is &lt;br /&gt;
      ./configure ### --&amp;gt;&lt;br /&gt;
It may (!) look like this:&lt;br /&gt;
 &lt;br /&gt;
      ./configure \&lt;br /&gt;
          --with-cxx \&lt;br /&gt;
          --with-sqlite \&lt;br /&gt;
          --with-postgres-libs=/usr/include/pgsql/libpq \&lt;br /&gt;
          --with-postgres-includes=/usr/include/pgsql \&lt;br /&gt;
          --with-freetype \&lt;br /&gt;
          --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
          --with-motif \&lt;br /&gt;
          --with-proj-share=/usr/share/proj&lt;br /&gt;
&lt;br /&gt;
You may have to explicitly state the path for certain packages (i.e., gdal). The Unix 'locate' command will come in handy for finding the path of the package you need (you may have to run locate as root ex: sudo locate gdal-config).&lt;br /&gt;
&lt;br /&gt;
Please note that the paths mentioned may widely vary due to the distribution used.&lt;br /&gt;
See [[Compile_and_Install#Platform_Specific_Notes|Platform Specific Notes]] below.&lt;br /&gt;
&lt;br /&gt;
Depending on your needs it may be a good idea to include debugging hooks.&lt;br /&gt;
: See [[GRASS_Debugging#Compile_Time_Setup]].&lt;br /&gt;
 CFLAGS=&amp;quot;-ggdb -Wall -Werror-implicit-function-declaration&amp;quot; ./configure ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end of configuration process you should get report not much different from this:&lt;br /&gt;
&lt;br /&gt;
GRASS is now configured for:  i686-pc-linux-gnu&lt;br /&gt;
 &lt;br /&gt;
 Source directory:            /usr/src/grass6&lt;br /&gt;
 Build directory:             /usr/src/grass6&lt;br /&gt;
 Installation directory:      /usr/local/grass-6.3.svn&lt;br /&gt;
 Startup script in directory: ${exec_prefix}/bin&lt;br /&gt;
 C compiler:                  gcc -g -O2 &lt;br /&gt;
 C++ compiler:                c++ -g -O2&lt;br /&gt;
 FORTRAN compiler:            &lt;br /&gt;
 Building shared libraries:   yes&lt;br /&gt;
 64bit support:               no&lt;br /&gt;
 &lt;br /&gt;
  NVIZ:                       yes&lt;br /&gt;
 &lt;br /&gt;
  BLAS support:               no&lt;br /&gt;
  C++ support:                yes&lt;br /&gt;
  DWG support:                no&lt;br /&gt;
  FFMPEG support:             no&lt;br /&gt;
  FFTW support:               yes&lt;br /&gt;
  FreeType support:           yes&lt;br /&gt;
  GDAL support:               yes&lt;br /&gt;
  GLw support:                no&lt;br /&gt;
  LAPACK support:             no&lt;br /&gt;
  Large File Support (LFS):   no&lt;br /&gt;
  Motif support:              no&lt;br /&gt;
  MySQL support:              no&lt;br /&gt;
  NLS support:                no&lt;br /&gt;
  ODBC support:               no&lt;br /&gt;
  OGR support:                yes&lt;br /&gt;
  OpenGL(R) support:          yes&lt;br /&gt;
  PNG support:                yes&lt;br /&gt;
  PostgreSQL support:         yes&lt;br /&gt;
  Readline support:           no&lt;br /&gt;
  SQLite support:             no&lt;br /&gt;
  Tcl/Tk support:             yes&lt;br /&gt;
  TIFF support:               yes&lt;br /&gt;
  X11 support:                yes&lt;br /&gt;
  &lt;br /&gt;
* Let's compile it (takes a little while...)!&lt;br /&gt;
      make&lt;br /&gt;
* At the end, you should get report not much different from this:&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 Following modules are missing the 'description.html' file in src code:&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 GRASS GIS compilation log&lt;br /&gt;
 -------------------------&lt;br /&gt;
 Started compilation: Ne kvě 28 13:18:43 CEST 2006&lt;br /&gt;
 --&lt;br /&gt;
 Errors in:&lt;br /&gt;
 --&lt;br /&gt;
 Finished compilation: Ne kvě 28 13:43:40 CEST 2006&lt;br /&gt;
 (In case of errors please change into the directory with error and run 'make')&lt;br /&gt;
&lt;br /&gt;
* If there is any error, change directory to directory with error and run &amp;quot;make&amp;quot; again. Report occuring bug to grass mailing list&lt;br /&gt;
* Once the installation process is finished, you're ready to install GRASS system wide.&lt;br /&gt;
      su -c 'make install'&lt;br /&gt;
* enjoy GRASS: &lt;br /&gt;
      grass64&lt;br /&gt;
&lt;br /&gt;
=== What else? ===&lt;br /&gt;
&lt;br /&gt;
If you want to use [http://www.qgis.org QGIS], then also compile the GRASS-GDAL/OGR plugin. This is also useful to access your GRASS-data&lt;br /&gt;
from other application using GDAL/OGR like [http://thuban.intevation.de thuban].&lt;br /&gt;
* [[Compile and install GRASS and QGIS with GDAL/OGR Plugin]] (enables QGIS to read GRASS data directly)&lt;br /&gt;
&lt;br /&gt;
=== Compile and install GDAL-GRASS plugin ===&lt;br /&gt;
&lt;br /&gt;
* See [[Compile and install GDAL-GRASS plugin]]&lt;br /&gt;
&lt;br /&gt;
=== Platform Specific Notes ===&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
&lt;br /&gt;
===== Debian =====&lt;br /&gt;
&lt;br /&gt;
Read the instructions here:&lt;br /&gt;
: http://trac.osgeo.org/grass/browser/grass/branches/develbranch_6/debian/README.debian&lt;br /&gt;
&lt;br /&gt;
   # first install PROJ, GDAL, etc.&lt;br /&gt;
   cd grass64/&lt;br /&gt;
   # follow instructions in debian/README.debian&lt;br /&gt;
   fakeroot buildpackage&lt;br /&gt;
&lt;br /&gt;
* Official [http://wiki.debian.org/DebianGis DebianGIS] packaging [http://svn.debian.org/viewsvn/pkg-grass/packages/grass/ control files], also accessible via svn:&lt;br /&gt;
&lt;br /&gt;
  svn co svn://svn.debian.org/svn/pkg-grass/packages/grass/trunk/&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  svn co svn://svn.debian.org/svn/pkg-grass/packages/grass/branches/&amp;lt;GRASS Version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== GRASS 6.1 on Debian Sarge ======&lt;br /&gt;
&lt;br /&gt;
* [http://hamish.bowman.googlepages.com/debiangisfiles#compile Compiling GRASS 6.1-CVS on Debian/OldStable (aka 3.1, Sarge)]&lt;br /&gt;
&lt;br /&gt;
====== GRASS 6.4 on Debian Lenny ======&lt;br /&gt;
&lt;br /&gt;
Install needed packages:&lt;br /&gt;
  apt-get install flex bison libreadline-dev libncurses5-dev lesstif2-dev debhelper dpatch libtiff4-dev \&lt;br /&gt;
          tcl-dev tk-dev libfftw3-dev libxmu-dev libfreetype6-dev autoconf2.13 autotools-dev doxygen \&lt;br /&gt;
          libmysqlclient15-dev graphviz libsqlite3-dev python-wxgtk2.8 libcairo2-dev libwxgtk2.8-dev \&lt;br /&gt;
          python-dev libgdal1-dev  libgdal1-1.5.0 libproj-dev libproj0 proj-data mysql&lt;br /&gt;
&lt;br /&gt;
Configure:&lt;br /&gt;
  ./configure \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-postgres --with-postgres-includes=/usr/include/postgresql \&lt;br /&gt;
  --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \&lt;br /&gt;
  --with-odbc \&lt;br /&gt;
  --with-cairo \&lt;br /&gt;
  --with-proj-share=/usr/share/proj \&lt;br /&gt;
  --with-tcltk-includes=/usr/include/tcl8.4/ \&lt;br /&gt;
  --with-freetype --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
  --with-motif --with-fftw --with-nls --with-python&lt;br /&gt;
&lt;br /&gt;
Compile:&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
====== GRASS 7 on Debian Squeeze ======&lt;br /&gt;
&lt;br /&gt;
Install needed packages:&lt;br /&gt;
 apt-get install flex bison debhelper dpatch autoconf2.13 autotools-dev python-dev \&lt;br /&gt;
     g++ gcc gettext graphviz libcairo2-dev libfftw3-dev libfreetype6-dev \&lt;br /&gt;
     libgdal1-1.6.0 libgdal1-dev libglu1-mesa-dev libglw1-mesa-dev \&lt;br /&gt;
     libncurses5-dev libproj-dev libreadline-dev libsqlite3-dev libtiff4-dev \&lt;br /&gt;
     libwxgtk2.8-dev libxmu-dev libxmu-headers libxt-dev mesa-common-dev \&lt;br /&gt;
     proj-bin python-numpy python-wxgtk2.8 subversion wx-common zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Download source code:&lt;br /&gt;
&lt;br /&gt;
 svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk&lt;br /&gt;
&lt;br /&gt;
Configure:&lt;br /&gt;
&lt;br /&gt;
 CFLAGS=&amp;quot;-g -Wall -Werror-implicit-function-declaration -fno-common -Wextra -Wunused&amp;quot; \&lt;br /&gt;
 CXXFLAGS=&amp;quot;-g -Wall&amp;quot;  \&lt;br /&gt;
  ./configure --prefix=/usr/local \&lt;br /&gt;
  --with-gdal --with-proj --with-proj-share=/usr/share \&lt;br /&gt;
  --with-glw --with-nls --with-readline \&lt;br /&gt;
  --without-tcltk \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-freetype --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-cairo --with-python=/usr/bin/python2.6-config --with-wxwidgets \&lt;br /&gt;
  --with-geos --with-pthread&lt;br /&gt;
&lt;br /&gt;
Compile:&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
===== Ubuntu =====&lt;br /&gt;
&lt;br /&gt;
In general, the compilation instructions for Debian (see above), apply to the Ubuntu-Linux operating system as well. However, there is a dedicated page on how to [[Compile_and_Install_Ubuntu | Compile the GRASS GIS source code &amp;amp; install it in Ubuntu]].&lt;br /&gt;
&lt;br /&gt;
===== Mandriva =====&lt;br /&gt;
&lt;br /&gt;
Installation of dependencies (urpmi will ask you a few more):&lt;br /&gt;
&lt;br /&gt;
'''Mandriva 2009:''' (take out the '64' everywhere if you are on 32bit)&lt;br /&gt;
  # as root&lt;br /&gt;
    urpmi flex bison zlib-devel tiff-devel png-devel tcl-devel tk-devel sqlite3-devel \&lt;br /&gt;
          mesagl1-devel mesaglu1-devel lib64xmu6-devel gcc-c++ gettext \&lt;br /&gt;
          lib64wxgtk2.8 lib64wxgtk2.8-devel lib64wxgtkgl2.8 wxgtk2.8 \&lt;br /&gt;
          lib64wxPythonGTK2.8 lib64wxPythonGTK2.8-devel wxPythonGTK wxPythonGTK-wxversion&lt;br /&gt;
    exit&lt;br /&gt;
&lt;br /&gt;
'''Mandriva 2010:''' (take out the '64' everywhere if you are on 32bit) - see also [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/grass/current/SPECS/ SPEC] file&lt;br /&gt;
  # as root&lt;br /&gt;
    # installation of PROJ and GDAL&lt;br /&gt;
    urpmi proj proj-devel gdal gdal-devel gcc-gfortran lib64openssl1.0.0 \&lt;br /&gt;
          lib64openssl1.0.0-devel postgresql8.4-devel lib64pq8.4&lt;br /&gt;
 &lt;br /&gt;
    # installation of compilation environment&lt;br /&gt;
    urpmi flex bison zlib-devel tiff-devel png-devel tcl-devel tk-devel sqlite3-devel \&lt;br /&gt;
          lib64mesagl1-devel lib64mesaglu1-devel lib64xmu6-devel gcc-c++ gettext \&lt;br /&gt;
          lib64wxgtk2.8 lib64wxgtk2.8-devel lib64wxgtkgl2.8 wxgtk2.8 \&lt;br /&gt;
          lib64wxPythonGTK2.8 lib64wxPythonGTK2.8-devel wxPythonGTK wxPythonGTK-wxversion&lt;br /&gt;
    exit&lt;br /&gt;
&lt;br /&gt;
Then, to configure GRASS, run (64 bit stuff optional of course):&lt;br /&gt;
  #  as user&lt;br /&gt;
  ./configure \&lt;br /&gt;
    --enable-64bit --with-libs=/usr/lib64 \&lt;br /&gt;
    --with-cxx \&lt;br /&gt;
    --with-gdal=/usr/local/bin/gdal-config \&lt;br /&gt;
    --with-sqlite \&lt;br /&gt;
    --with-nls \&lt;br /&gt;
    --with-python \&lt;br /&gt;
    --with-wxwidgets=/usr/lib/wxPython/bin/wx-config \&lt;br /&gt;
    --with-fftw \&lt;br /&gt;
    --with-ffmpeg --with-ffmpeg-includes=&amp;quot;/usr/include/libav* /usr/include/libpostproc /usr/include/libswscale&amp;quot; \&lt;br /&gt;
    --with-motif \&lt;br /&gt;
    --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib64 \&lt;br /&gt;
    --with-freetype --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
    --enable-largefile&lt;br /&gt;
&lt;br /&gt;
   # compilation (use -j2 ior -j4 parameter on multi-core CPUs to accelerate):   &lt;br /&gt;
    make&lt;br /&gt;
&lt;br /&gt;
Installation:&lt;br /&gt;
    su&lt;br /&gt;
    # this will install into /usr/local/&lt;br /&gt;
    make install&lt;br /&gt;
    exit&lt;br /&gt;
&lt;br /&gt;
===== CentOS =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: CentOS 5 comes with Python 2.4 which lacks python-config, hence two extra tweaks are needed.&lt;br /&gt;
&lt;br /&gt;
Preparation:&lt;br /&gt;
  yum install flex bison zlib-devel  tcl-devel tk-devel gcc-c++ gettext \&lt;br /&gt;
              libtiff-devel libpng-devel sqlite-devel \&lt;br /&gt;
              mesa-libGL-devel mesa-libGLU-devel mesa-libGLw-devel \&lt;br /&gt;
              mesa-libOSMesa-devel libXmu-devel python-devel gtk2-devel\&lt;br /&gt;
              ncurses-devel postgresql-devel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile and install [http://proj.osgeo.org PROJ4]:&lt;br /&gt;
&lt;br /&gt;
 # get source code and unpack:&lt;br /&gt;
 wget http://download.osgeo.org/proj/proj-4.7.0.tar.gz&lt;br /&gt;
 tar xvfz proj-4.7.0.tar.gz &lt;br /&gt;
 rm -f proj-4.7.0.tar.gz &lt;br /&gt;
 cd proj-4.7.0/&lt;br /&gt;
 &lt;br /&gt;
 # get and install datum files into right directory:&lt;br /&gt;
 cd nad/&lt;br /&gt;
 wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip&lt;br /&gt;
 unzip proj-datumgrid-1.5.zip&lt;br /&gt;
 rm -f proj-datumgrid-1.5.zip&lt;br /&gt;
 cd ..&lt;br /&gt;
 &lt;br /&gt;
 # configure and compile&lt;br /&gt;
 sh configure&lt;br /&gt;
 make -j4&lt;br /&gt;
 &lt;br /&gt;
 # install (may require &amp;quot;root&amp;quot; permissions, use &amp;quot;su&amp;quot;):&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Compile and install [http://www.gdal.org GDAL]:&lt;br /&gt;
 # get source code and unpack:&lt;br /&gt;
 wget http://download.osgeo.org/gdal/gdal-1.6.3.tar.gz&lt;br /&gt;
 tar xvfz gdal-1.6.3.tar.gz &lt;br /&gt;
 rm -f gdal-1.6.3.tar.gz &lt;br /&gt;
 cd gdal-1.6.3/&lt;br /&gt;
 &lt;br /&gt;
 # configure and compile&lt;br /&gt;
 sh configure&lt;br /&gt;
 make -j4&lt;br /&gt;
 &lt;br /&gt;
 # install (may require &amp;quot;root&amp;quot; permissions, use &amp;quot;su&amp;quot;):&lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 # add /usr/local/lib/ to LD_LIBRARY_PATH, requires &amp;quot;root&amp;quot; permissions:&lt;br /&gt;
 su - &lt;br /&gt;
 echo &amp;quot;/usr/local/lib&amp;quot; &amp;gt; /etc/ld.so.conf.d/gdal.conf&lt;br /&gt;
 ldconfig&lt;br /&gt;
 exit&lt;br /&gt;
 &lt;br /&gt;
 # test installation by running&lt;br /&gt;
 gdalinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GRASS 7 compilation and installation, here 64bit example:&lt;br /&gt;
&lt;br /&gt;
1. Download wxGTP and wxPython:&lt;br /&gt;
&lt;br /&gt;
  wget http://packages.sw.be/wxPython/wxPython-2.8.9.1-1.el5.rf.x86_64.rpm&lt;br /&gt;
  wget http://packages.sw.be/wxPython/wxPython-devel-2.8.9.1-1.el5.rf.x86_64.rpm&lt;br /&gt;
  wget http://packages.sw.be/wxGTK/wxGTK-2.8.9-1.el5.rf.x86_64.rpm&lt;br /&gt;
  wget http://packages.sw.be/wxGTK/wxGTK-devel-2.8.9-1.el5.rf.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
  # Install:&lt;br /&gt;
  rpm -Uhv wxPython-2.8.9.1-1.el5.rf.x86_64.rpm wxPython-devel-2.8.9.1-1.el5.rf.x86_64.rpm \&lt;br /&gt;
           wxGTK-2.8.9-1.el5.rf.x86_64.rpm wxGTK-devel-2.8.9-1.el5.rf.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
2. Also required is the python library python-dateutil. As root user run:&lt;br /&gt;
   &lt;br /&gt;
   yum install python-dateutil  &lt;br /&gt;
&lt;br /&gt;
3. [http://grass.osgeo.org/download/ Download] and configure GRASS 7 (suggestion: save this as script). Note that [http://proj.osgeo.org PROJ4] and [http://www.gdal.org GDAL] must be compiled first:&lt;br /&gt;
&lt;br /&gt;
 ./configure \&lt;br /&gt;
  --with-libs=/usr/lib64 \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --without-ffmpeg \&lt;br /&gt;
  --with-gdal=/usr/local/bin/gdal-config \&lt;br /&gt;
  --without-odbc \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-postgres \&lt;br /&gt;
  --without-mysql \&lt;br /&gt;
  --with-nls \&lt;br /&gt;
  --with-python \&lt;br /&gt;
  --with-cairo \&lt;br /&gt;
  --with-wxwidgets=/usr/bin/wx-config \&lt;br /&gt;
  --without-fftw \&lt;br /&gt;
  --with-freetype --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-pthread&lt;br /&gt;
&lt;br /&gt;
4. Add manually the path to the python include directory since python-config isn't there:&lt;br /&gt;
&lt;br /&gt;
   # edit include/Make/Platform.make&lt;br /&gt;
   # and add manually the line&lt;br /&gt;
 &lt;br /&gt;
   PYTHONINC           = -I/usr/include/python2.4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Compile&lt;br /&gt;
    make&lt;br /&gt;
   or on multicore (number depends of available cores):&lt;br /&gt;
    make -j4&lt;br /&gt;
&lt;br /&gt;
6. Either install with &amp;quot;make install&amp;quot; (as root user) or run directly from compile directory (substitute ARCH with i586 or x86_64):&lt;br /&gt;
&lt;br /&gt;
    bin.$ARCH/grass70 -wx&lt;br /&gt;
&lt;br /&gt;
===== Gentoo =====&lt;br /&gt;
&lt;br /&gt;
  ./configure \&lt;br /&gt;
    --with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
See also http://packages.gentoo.org/package/sci-geosciences/grass&lt;br /&gt;
&lt;br /&gt;
===== Funtoo =====&lt;br /&gt;
&lt;br /&gt;
The [http://grasswiki.osgeo.org/wiki/Compile_and_Install#Generic_Compilation_and_installation_procedure Generic Compilation &amp;amp; installation procedure] applies also for the [http://www.funtoo.org/ Funtoo] Linux meta-distribution. The following example scripts are provided as a mean to get started.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Installing dependencies ======&lt;br /&gt;
&lt;br /&gt;
'ToAdd'&lt;br /&gt;
&lt;br /&gt;
====== Example Scripts ======&lt;br /&gt;
&lt;br /&gt;
A simple configuration and compilation&lt;br /&gt;
&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;
# clean previous configuration&lt;br /&gt;
make distclean&lt;br /&gt;
&lt;br /&gt;
# update source code&lt;br /&gt;
svn up&lt;br /&gt;
&lt;br /&gt;
# renice! source: &amp;lt;http://lists.osgeo.org/pipermail/grass-user/2013-May/068229.html&amp;gt;&lt;br /&gt;
renice +17 -p $$&lt;br /&gt;
&lt;br /&gt;
# configure&lt;br /&gt;
./configure \&lt;br /&gt;
--with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
2&amp;gt;&amp;amp;1 | tee config_log.txt&lt;br /&gt;
&lt;br /&gt;
# compile&lt;br /&gt;
time make -j13&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An attempt for a complete configuration and compilation '''checking'''. In addition, this script times each of the executed commands (need for scrolling back!).&lt;br /&gt;
&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;
# clean previous configuration&lt;br /&gt;
time make distclean&lt;br /&gt;
&lt;br /&gt;
# update&lt;br /&gt;
time svn up&lt;br /&gt;
&lt;br /&gt;
# renice! source: &amp;lt;http://lists.osgeo.org/pipermail/grass-user/2013-May/068229.html&amp;gt;&lt;br /&gt;
renice +17 -p $$&lt;br /&gt;
&lt;br /&gt;
# configure&lt;br /&gt;
CFLAGS=&amp;quot;-ggdb -march=native -Wall -Werror-implicit-function-declaration&amp;quot; \&lt;br /&gt;
./configure \&lt;br /&gt;
--with-cxx \&lt;br /&gt;
--with-includes=/usr/include/ --with-libs=/usr/lib64/ \&lt;br /&gt;
--with-proj \&lt;br /&gt;
--with-proj-includes=/usr/include/ \&lt;br /&gt;
--with-proj-libs=/usr/lib64/ \&lt;br /&gt;
--with-proj-share=/usr/share/proj/ \&lt;br /&gt;
--with-geos \&lt;br /&gt;
--with-geos=/usr/bin/geos-config \&lt;br /&gt;
--with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
--with-x \&lt;br /&gt;
--with-motif \&lt;br /&gt;
--with-cairo \&lt;br /&gt;
--with-opengl-libs=/usr/include/GL \&lt;br /&gt;
--without-ffmpeg \&lt;br /&gt;
--with-python=yes --with-python=/usr/bin/python2.7-config \&lt;br /&gt;
--with-wxwidgets \&lt;br /&gt;
--with-freetype=yes --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
--with-odbc=yes \&lt;br /&gt;
--with-sqlite=yes \&lt;br /&gt;
--with-mysql=yes --with-mysql-includes=&amp;quot;/usr/include/mysql&amp;quot; --with-mysql-libs=/usr/lib/mysql \&lt;br /&gt;
--with-postgres=yes --with-postgresql=yes --with-postgres-includes=&amp;quot;/usr/include/postgresql&amp;quot; \&lt;br /&gt;
--with-opencl --with-openmp --with-pthread \&lt;br /&gt;
--with-lapack \&lt;br /&gt;
--with-fftw \&lt;br /&gt;
--with-readline \&lt;br /&gt;
--with-regex \&lt;br /&gt;
--with-nls \&lt;br /&gt;
--with-jpeg \&lt;br /&gt;
--with-tiff \&lt;br /&gt;
--with-png \&lt;br /&gt;
--with-netcdf \&lt;br /&gt;
--without-opendwg \&lt;br /&gt;
--enable-largefile=yes \&lt;br /&gt;
2&amp;gt;&amp;amp;1 | tee config_log.txt&lt;br /&gt;
&lt;br /&gt;
# check &amp;quot;make&amp;quot;&lt;br /&gt;
time make check&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Fedora =====&lt;br /&gt;
&lt;br /&gt;
'''Preparation''' for the compilation of GRASS GIS source code (F16, F17, F18):&lt;br /&gt;
&lt;br /&gt;
  yum install proj-devel gdal-devel sqlite-devel ffmpeg-devel mesa-libGL-devel \&lt;br /&gt;
              mesa-libGLU-devel libXmu-devel libX11-devel tcl-devel tk-devel \&lt;br /&gt;
              fftw-devel libtiff-devel lesstif-devel python-devel numpy wxPython wxGTK-devel \&lt;br /&gt;
              gcc gcc-c++ bison flex ncurses-devel proj-epsg proj-nad xml2 python-dateutil&lt;br /&gt;
&lt;br /&gt;
''Note 1: that currently gdal-devel has (too) many dependencies and will lead to a massive download of extra packages (200 on a fresh Fedora 16 install).''&lt;br /&gt;
&lt;br /&gt;
''Note 2: the optional ffmpeg-devel comes from the rpmfusion-free repository ([http://rpmfusion.org/Configuration/ configuration]).''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Download''' the source code:&lt;br /&gt;
* GRASS GIS 6: [http://grass.osgeo.org/download/software/sources/ release package] - [http://grass.osgeo.org/grass64/source/snapshot/ weekly snapshot] - [http://trac.osgeo.org/grass/wiki/DownloadSource#GRASS6.4 SVN repository]&lt;br /&gt;
* GRASS GIS 7: [http://grass.osgeo.org/grass70/source/snapshot/ weekly snapshot] - [http://trac.osgeo.org/grass/wiki/DownloadSource#GRASS7 SVN repository]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Configure''': This is an example how to configure the source code on a Fedora system:&lt;br /&gt;
&lt;br /&gt;
  ./configure \&lt;br /&gt;
   --with-cxx \&lt;br /&gt;
   --with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
   --with-proj --with-proj-share=/usr/share/proj \&lt;br /&gt;
   --with-sqlite \&lt;br /&gt;
   --with-nls \&lt;br /&gt;
   --with-wxwidgets=/usr/bin/wx-config \&lt;br /&gt;
   --with-fftw \&lt;br /&gt;
   --with-python=/usr/bin/python-config \&lt;br /&gt;
   --with-freetype --with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
   --enable-largefile \&lt;br /&gt;
   --without-odbc&lt;br /&gt;
&lt;br /&gt;
Note: An effective (but not fast) way of getting dependencies is to decide what to enable in the configuration, and then run ./config and see which files are missing. The package providing it can be found via:&lt;br /&gt;
&lt;br /&gt;
 yum provides */&amp;lt;name of the file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then install them with your favourite package manager frontend or yum itself.&lt;br /&gt;
&lt;br /&gt;
Extra: If you also want '''FFMPEG''' support:&lt;br /&gt;
&lt;br /&gt;
It requires 'yum install fftw-devel'. Then add to the configuration lines above:&lt;br /&gt;
&lt;br /&gt;
     --with-ffmpeg --with-ffmpeg-includes=&amp;quot;/usr/include/ffmpeg /usr/include/ffmpeg/libav* /usr/include/ffmpeg/libpostproc /usr/include/ffmpeg/libswscale&amp;quot; \&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally '''compile''' the configured source code:&lt;br /&gt;
    make&lt;br /&gt;
   or on multicore (number depends of available cores):&lt;br /&gt;
    make -j4&lt;br /&gt;
   and&lt;br /&gt;
    make install # requires root permissions unless you become owner of /usr/local/&lt;br /&gt;
&lt;br /&gt;
Then use GRASS GIS and enjoy!&lt;br /&gt;
&lt;br /&gt;
===== openSUSE =====&lt;br /&gt;
&lt;br /&gt;
To build GRASS on openSUSE:&lt;br /&gt;
&lt;br /&gt;
RPM packages to be installed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 sudo zypper install bison flex freetype2-devel fftw3-devel gcc-c++ \&lt;br /&gt;
   libgdal-devel libgeos-devel libjpeg-devel libpng-devel libtiff-devel \&lt;br /&gt;
   man proj libproj-devel readline-devel netcdf-devel ncurses-devel \&lt;br /&gt;
   mysql-devel postgresql-devel sqlite-devel unixODBC-devel \&lt;br /&gt;
   tcl-devel tk-devel xorg-x11-Mesa-devel libXmu-devel \&lt;br /&gt;
   python-numpy python-dateutil python-devel python-opengl \&lt;br /&gt;
   python-wxWidgets python-xml python-dateutil wxWidgets-devel \&lt;br /&gt;
   zlib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Source code configuration:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 ./configure \&lt;br /&gt;
 	--enable-largefile \&lt;br /&gt;
	--with-proj-share=/usr/share/proj \&lt;br /&gt;
	--with-cxx \&lt;br /&gt;
	--with-lapack=yes \&lt;br /&gt;
	--with-x \&lt;br /&gt;
	--with-motif \&lt;br /&gt;
	--with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
	--with-postgres --with-postgres-includes=/usr/include/pgsql \&lt;br /&gt;
	--with-mysql --with-mysql-includes=/usr/include/mysql \&lt;br /&gt;
	--with-fftw \&lt;br /&gt;
	--with-readline \&lt;br /&gt;
	--with-netcdf \&lt;br /&gt;
	--with-curses \&lt;br /&gt;
	--with-geos \&lt;br /&gt;
	--with-nls \&lt;br /&gt;
	--with-sqlite \&lt;br /&gt;
	--with-freetype \&lt;br /&gt;
	--with-freetype-includes=/usr/include/freetype2 \&lt;br /&gt;
	--with-wxwidgets \&lt;br /&gt;
	--with-odbc \&lt;br /&gt;
	--with-python&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then compile with &amp;quot;make [-j2]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Arch Linux =====&lt;br /&gt;
&lt;br /&gt;
The easiest/fastest way is to build GRASS GIS using AUR:&lt;br /&gt;
&lt;br /&gt;
https://aur.archlinux.org/packages/?O=0&amp;amp;K=grass (msieczka: I would recommend my set of PKBUILDs - https://aur.archlinux.org/packages/?K=czk&amp;amp;SeB=m. They are most feature-rich, up-to-date and allow to have various versions installed alongside each other without conflicts.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But if you want to compile it yourself you have to keep in mind that in Arch Linux the default Python version 3.&lt;br /&gt;
&lt;br /&gt;
 python --version&lt;br /&gt;
&lt;br /&gt;
 Python 3.3.1&lt;br /&gt;
&lt;br /&gt;
Therefore, to build GRASS GIS (version 7 in this example), we can use either use virtualenv or symlink python2 and python2-config in a given directory. &lt;br /&gt;
Let's use the latter approach&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/bin/python2 $HOME/usr/bin/python&lt;br /&gt;
 sudo ln -s /usr/bin/python2-config $HOME/usr/bin/python-config&lt;br /&gt;
&lt;br /&gt;
We can now start building GRASS 7&lt;br /&gt;
&lt;br /&gt;
 export PATH=~/usr/bin:$PATH &amp;amp;&amp;amp; \&lt;br /&gt;
 ./configure \&lt;br /&gt;
 --enable-debug \&lt;br /&gt;
 --enable-64bit \&lt;br /&gt;
 --with-libs=/usr/lib64  \&lt;br /&gt;
 --with-cxx \&lt;br /&gt;
 --with-readline \&lt;br /&gt;
 --with-zlib-includes=&amp;quot;/usr/include/&amp;quot; \&lt;br /&gt;
 --with-freetype=yes \&lt;br /&gt;
 --with-freetype-includes=&amp;quot;/usr/include/freetype2/&amp;quot; \&lt;br /&gt;
 --enable-largefile=yes \&lt;br /&gt;
 --with-gdal=/usr/bin/gdal-config \&lt;br /&gt;
 --with-proj-share=/usr/share/proj/ \&lt;br /&gt;
 --with-geos=/usr/bin/geos-config \&lt;br /&gt;
 --with-cairo \&lt;br /&gt;
 --with-odbc \&lt;br /&gt;
 --with-pthread \&lt;br /&gt;
 --with-liblas=/usr/local/bin/liblas-config  \&lt;br /&gt;
 --with-fftw-includes=&amp;quot;/usr/include/&amp;quot; \&lt;br /&gt;
 --with-fftw-libs=/usr/lib/ \&lt;br /&gt;
 --with-tcltk-includes=&amp;quot;/usr/include/&amp;quot; \&lt;br /&gt;
 --with-wxwidgets \&lt;br /&gt;
 --with-postgres=yes \&lt;br /&gt;
 --with-postgres-includes=&amp;quot;/usr/include/postgresql/internal&amp;quot; \&lt;br /&gt;
 --with-postgres-libs=&amp;quot;/usr/include/postgresql/internal/libpq&amp;quot; \&lt;br /&gt;
 --with-sqlite=yes \&lt;br /&gt;
 --with-python=yes \&lt;br /&gt;
 --with-liblas \&lt;br /&gt;
 --with-netcdf &lt;br /&gt;
&lt;br /&gt;
Now let's compile and install it&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Now the final step required to use GRASS with python2 is to create a bash script &amp;quot;grass&amp;quot; (or the name you want)&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 export PATH=~/usr/bin:$PATH&lt;br /&gt;
 python2 /usr/local/bin/grass70&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And make it executable and copy it somewhere in the PATH&lt;br /&gt;
&lt;br /&gt;
 chmod+x grass&lt;br /&gt;
 sudo cp grass /usr/local/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It's done, you can enjoy GRASS 7 in Arch, just type &amp;quot;grass&amp;quot; (or the name you gave to the script) in the terminal to launch it.&lt;br /&gt;
&lt;br /&gt;
===== RPM SPEC files =====&lt;br /&gt;
* ... can be found in the source code, rpm/ directory, &lt;br /&gt;
* or [https://build.opensuse.org/package/show?package=grass&amp;amp;project=Application%3AGeo OpenSuSe]&lt;br /&gt;
* or [https://admin.fedoraproject.org/pkgdb/acls/name/grass Fedora]&lt;br /&gt;
* or [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/grass/ Mandriva] (there are also [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/proj/ proj4], [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/geos/ geos], [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/gdal/ gdal], [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/gdal-grass/ gdal-grass-plugin], [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/qgis/ qgis] etc)&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
===== Zaurus =====&lt;br /&gt;
&lt;br /&gt;
... see [http://wiki.debian.org/?GrassGISonZaurus here] for instructions&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX ====&lt;br /&gt;
&lt;br /&gt;
* see the source/macosx readme ([http://trac.osgeo.org/grass/browser/grass/trunk/macosx/ReadMe.rtf Trac link])&lt;br /&gt;
* main page [[Compiling on MacOSX]]&lt;br /&gt;
* main page [[Packaging on MacOSX]]&lt;br /&gt;
* [http://grass.osgeo.org/download/software/mac-osx/ official download site]&lt;br /&gt;
* [http://www.kyngchaos.com/software/frameworks#build_scripts build scripts for dependencies]&lt;br /&gt;
* solving errors at starting GRASS GIS: [[MacOSX GRASS errors]]&lt;br /&gt;
&lt;br /&gt;
==== FreeBSD / NetBSD ====&lt;br /&gt;
&lt;br /&gt;
The recommended compiler tools are GCC, GNU make, GNU coreutils (for install), and flex. All are available through the respective package managing tools (pkg_add for FreeBSD and pkgin install for NetBSD) and for recent *BSD versions most likely installed by default.&lt;br /&gt;
&lt;br /&gt;
GRASS 6.x and GRASS 7 should compile on FreeBSD 8.0 or later and NetBSD 5.0 or later (maybe also on updated NetBSD 4.x).&lt;br /&gt;
&lt;br /&gt;
It is highly recommended to install GDAL/OGR and PROJ4 first. These libraries and tools are available as [http://www.freebsd.org/ports/ ports for FreeBSD] and [http://www.pkgsrc.org/ packages for NetBSD].&lt;br /&gt;
&lt;br /&gt;
Optional functionality is listed with ''./configure --help'', and related libraries and tools might need to be installed first.&lt;br /&gt;
&lt;br /&gt;
==== Solaris ====&lt;br /&gt;
&lt;br /&gt;
* ''2008 Oct 15'': see [http://lists.osgeo.org/pipermail/grass-user/2008-October/047093.html this post on the grass mailing list]&lt;br /&gt;
&lt;br /&gt;
===== 11 SPARC/i86pc =====&lt;br /&gt;
&lt;br /&gt;
The recommended compiler tools are GCC, GNU make, GNU coreutils (for install), and flex. All are available through the Solaris package manager.&lt;br /&gt;
&lt;br /&gt;
Most dependencies are available through the Solaris package manager. GDAL and proj4 can either be compiled from source or installed e.g. from [http://www.opencsw.org/ OpenCSW]. If packages are installed from OpenCSW, the linker flags need to be set with&lt;br /&gt;
&lt;br /&gt;
      LDFLAGS=&amp;quot;-Wl,-R/opt/csw/lib -L/opt/csw/lib -Wl,-R/opt/csw/gxx/lib -L/opt/csw/gxx/lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
See also the [http://www.opencsw.org/use-it/ OpenCSW documentation].&lt;br /&gt;
&lt;br /&gt;
===== 10 SPARC/i86pc =====&lt;br /&gt;
&lt;br /&gt;
* get gcc compiler and tools. There are several sources: Solaris Companion CD (SFW pkg, installs in /opt/sfw/), Blastwave ([http://www.blastwave.org], CSW pkg, installs in /opt/csw/) or Sunfreeware ([http://www.sunfreeware.com], SMC pkg, installs in /usr/local/). &lt;br /&gt;
Needed Packages from Sunfreeware: SMCbinut, SMCbison, SMCcoreu, SMCfindu, SMCflex, SMCgawk, SMCgcc, SMCgrep, SMCgzip, SMCless, SMClibt, SMClicon, SMCmake, SMCncurs, SMCproj, SMCsed, SMCtar, SMCtcl, SMCtiff, SMCtk, SMCunzip, SMCzlib. &lt;br /&gt;
&lt;br /&gt;
* compile and install fftw-library ([http://www.fftw.org]). You need to re-compile the library with: &lt;br /&gt;
&lt;br /&gt;
      ./configure --with-pic --enable-shared; make ; make install. &lt;br /&gt;
&lt;br /&gt;
The pre-built packages don't work. &lt;br /&gt;
&lt;br /&gt;
* compile and install gdal library (see documentation of gdal, [http://www.gdal.org]).&lt;br /&gt;
&lt;br /&gt;
* compile and install any additional libraries (e. g. GEOS, [http://geos.refractions.net]). &lt;br /&gt;
&lt;br /&gt;
* set compiler flags and path. e. g.: &lt;br /&gt;
&lt;br /&gt;
      # on ultra-sparc machine:&lt;br /&gt;
      CFLAGS=&amp;quot;-O3 -mcpu=v9&amp;quot;&lt;br /&gt;
      CXXFLAGS=&amp;quot;-O3 -mcpu=v9&amp;quot;&lt;br /&gt;
      PATH=&amp;quot;/usr/local/bin:/opt/sfw/bin:/usr/ccs/bin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
      export CFLAGS CXXFLAGS PATH&lt;br /&gt;
&lt;br /&gt;
Path has to be changed for the packages (Sunfreeware: /usr/local/bin, Solaris Companion: /opt/sfw/bin, Blastwave: /opt/csw/bin). &lt;br /&gt;
&lt;br /&gt;
* Next configure, e. g.: &lt;br /&gt;
&lt;br /&gt;
      ./configure --with-postgres-includes=/usr/include/pgsql/ \&lt;br /&gt;
      --with-postgres-libs=/usr/lib --with-postgres=yes \&lt;br /&gt;
      --with-includes=/usr/local/include/ncurses&lt;br /&gt;
&lt;br /&gt;
If you use n(ew)curses, you have to include the path /usr/local/include/ncurses. &lt;br /&gt;
&lt;br /&gt;
then:&lt;br /&gt;
&lt;br /&gt;
      make&lt;br /&gt;
      su&lt;br /&gt;
      make install&lt;br /&gt;
&lt;br /&gt;
If the shared libraries are not found at runtime of the modules, use 'crle' to add the paths of the libraries for the dynamic linker, e. g. as root:&lt;br /&gt;
&lt;br /&gt;
      crle -l /lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/usr/X11/lib&lt;br /&gt;
&lt;br /&gt;
Be careful not to omit a library path, the system may be unusable if you forget the /lib path.&lt;br /&gt;
&lt;br /&gt;
==== AIX ====&lt;br /&gt;
&lt;br /&gt;
A recent [ftp://ftp.gnu.org/gnu/make/ GNU make] (&amp;gt;= 3.81) and GNU coreutils are required. These are available with the [http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html IBM AIX toolbox] or through third-party AIX software repositories, e.g. [http://www.bullfreeware.com/ bullfreeware] and [http://www.perzl.org/aix/ perzl.org]. Note that 'make' does not work, only 'gmake' works. &lt;br /&gt;
&lt;br /&gt;
General instructions to compile on AIX are e.g. [http://www.perzl.org/aix/index.php?n=Main.Instructions here]&lt;br /&gt;
&lt;br /&gt;
On AIX, compilation results by default in 32 bit applications and static libraries. The [http://www.ibm.com/developerworks/aix/library/au-gnu.html IBM documentation] explains how to build 64 bit applications and shared libraries with GCC.&lt;br /&gt;
&lt;br /&gt;
'''GRASS 6: Using the IBM xlc compiler:'''&lt;br /&gt;
* ''see [http://thread.gmane.org/gmane.comp.gis.grass.user/32667 this mailing list thread]''&lt;br /&gt;
&lt;br /&gt;
Mike wrote in 2009:&lt;br /&gt;
&lt;br /&gt;
After attempting all the suggestions, I finally used&lt;br /&gt;
--disable-shared on the configure command, and all but&lt;br /&gt;
a handful of modules successfully compiled. I was able to&lt;br /&gt;
individually address the ones that failed through Makefile&lt;br /&gt;
edits and several small source code/header file edits.&lt;br /&gt;
&lt;br /&gt;
The environment variables and configure command that worked were:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# xlc compiler:&lt;br /&gt;
export PATH=/usr/local/bin:/opt/freeware/bin:$PATH&lt;br /&gt;
export OBJECT_MODE=64&lt;br /&gt;
export LIBICONV=/opt/freeware&lt;br /&gt;
export CC=&amp;quot;xlc_r -q64&amp;quot;&lt;br /&gt;
export CFLAGS=&amp;quot;-O -qstrict&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;xlC_r -q64&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;-O -qstrict&amp;quot;&lt;br /&gt;
export AR=&amp;quot;ar -X64&amp;quot;&lt;br /&gt;
export F77=&amp;quot;xlf_r -q64&amp;quot;&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I/afs/isis/pkg/libpng/include -I/usr/local/include -I$LIBICONV/include -I/usr/lpp/X11/include/X11&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L/usr/local/lib -L$LIBICONV/lib -L/usr/lib -L/usr/X11R6/lib -lc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/afs/isis/pkg/grass-6.4.0 \&lt;br /&gt;
  --enable-64bit \&lt;br /&gt;
  --disable-shared \&lt;br /&gt;
  --with-includes=&amp;quot;/usr/include/fontconfig /usr/include/X11 /usr/include/X11/Xft /usr/include/X11/ext&amp;quot; \&lt;br /&gt;
  --x-includes=/usr/include/X11 \&lt;br /&gt;
  --x-libraries=/usr/X11R6/lib \&lt;br /&gt;
  --with-fftw-includes=/afs/isis/pkg/fftw-3.2.2/include \&lt;br /&gt;
  --with-fftw-libs=/afs/isis/pkg/fftw-3.2.2/lib \&lt;br /&gt;
  --with-gdal=/afs/isis/pkg/gdal/bin/gdal-config \&lt;br /&gt;
  --with-proj-includes=/afs/isis/pkg/proj/include \&lt;br /&gt;
  --with-proj-libs=/afs/isis/pkg/proj/lib \&lt;br /&gt;
  --with-proj-share=/afs/isis/pkg/proj/share/proj \&lt;br /&gt;
  --with-tcltk-includes=/usr/local/include \&lt;br /&gt;
  --with-tcltk-libs=/usr/local/lib \&lt;br /&gt;
  --with-opengl-includes=/usr/include/GL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GRASS 7: Using the IBM xlc compiler:'''&lt;br /&gt;
&lt;br /&gt;
Get and install (in this order):&lt;br /&gt;
* [ftp://ftp.gnu.org/gnu/tar/ GNU tar]&lt;br /&gt;
* [ftp://ftp.gnu.org/gnu/make/ GNU make] (&amp;gt;= 3.81)&lt;br /&gt;
* [http://www.sqlite.org SQLite]&lt;br /&gt;
* [http://trac.osgeo.org/proj/ PROJ.4] (for ./configure parameters, see [[Talk:Compile and Install|here]])&lt;br /&gt;
* [http://www.gdal.org GDAL] (for ./configure parameters, see [[Talk:Compile and Install|here]])&lt;br /&gt;
* [http://grass.osgeo.org/grass70/source/snapshot/ GRASS GIS 7]&lt;br /&gt;
&lt;br /&gt;
The environment variables and configure command that worked:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## AIX 5.x&lt;br /&gt;
PREFIX=$HOME/private/bin&lt;br /&gt;
./configure \&lt;br /&gt;
  --prefix=$PREFIX \&lt;br /&gt;
  --disable-shared \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --with-proj-includes=$PREFIX/include/ \&lt;br /&gt;
  --with-proj-libs=$PREFIX/lib/ \&lt;br /&gt;
  --with-proj-share=$PREFIX/share/proj/ \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-sqlite-includes=$PREFIX/include/ \&lt;br /&gt;
  --with-sqlite-libs=$PREFIX/lib/ \&lt;br /&gt;
  --with-tiff=no \&lt;br /&gt;
  --with-png=no \&lt;br /&gt;
  --with-fftw=no \&lt;br /&gt;
  --with-cairo=no \&lt;br /&gt;
  --with-freetype=no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GRASS 7: Using the GNU gcc compiler:'''&lt;br /&gt;
&lt;br /&gt;
Get and install (in this order):&lt;br /&gt;
* if needed, [ftp://ftp.gnu.org/gnu/tar/ GNU tar]&lt;br /&gt;
* if needed (the name is often 'gmake' and not 'make') [ftp://ftp.gnu.org/gnu/make/ GNU make] (&amp;gt;= 3.81)&lt;br /&gt;
* [http://www.sqlite.org SQLite]&lt;br /&gt;
* [http://trac.osgeo.org/proj/ PROJ.4] (for ./configure parameters, see [[Talk:Compile and Install|here]])&lt;br /&gt;
* [http://www.gdal.org GDAL] (for ./configure parameters, see [[Talk:Compile and Install|here]])&lt;br /&gt;
* [http://grass.osgeo.org/grass70/source/snapshot/ GRASS GIS 7]&lt;br /&gt;
&lt;br /&gt;
The environment variables and configure command that worked for AIX 5.x:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## AIX 5.x&lt;br /&gt;
PREFIX=$HOME/private/bin&lt;br /&gt;
CFLAGS='-ansi -D_ALL_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=200809L -Dinline=' ./configure \&lt;br /&gt;
  --prefix=$PREFIX \&lt;br /&gt;
  --disable-shared \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --with-proj-includes=$PREFIX/include/ \&lt;br /&gt;
  --with-proj-libs=$PREFIX/lib/ \&lt;br /&gt;
  --with-proj-share=$PREFIX/share/proj/ \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-sqlite-includes=$PREFIX/include/ \&lt;br /&gt;
  --with-sqlite-libs=$PREFIX/lib/ \&lt;br /&gt;
  --with-tiff=no \&lt;br /&gt;
  --with-png=no \&lt;br /&gt;
  --with-fftw=no \&lt;br /&gt;
  --with-cairo=no \&lt;br /&gt;
  --with-freetype=no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The environment variables and configure command that worked for AIX 7.x:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## AIX 7.x&lt;br /&gt;
export CC=&amp;quot;gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;g++&amp;quot;&lt;br /&gt;
PREFIX=$HOME/bin&lt;br /&gt;
&lt;br /&gt;
LDFLAGS=&amp;quot;-Wl,-bsvr4,-R,/opt/freeware/lib -L/opt/freeware/lib&amp;quot; CPPFLAGS=&amp;quot;-I/opt/freeware/include&amp;quot; ./configure \&lt;br /&gt;
  --prefix=$PREFIX \&lt;br /&gt;
  --enable-largefile \&lt;br /&gt;
  --enable-shared \&lt;br /&gt;
  --with-includes=/opt/freeware/include --with-libs=/opt/freeware/lib \&lt;br /&gt;
  --with-cxx \&lt;br /&gt;
  --with-proj-includes=$PREFIX/include/ \&lt;br /&gt;
  --with-proj-libs=$PREFIX/lib/ \&lt;br /&gt;
  --with-proj-share=$PREFIX/share/proj/ \&lt;br /&gt;
  --with-gdal=$PREFIX/bin/gdal-config \&lt;br /&gt;
  --with-sqlite \&lt;br /&gt;
  --with-sqlite-libs=$PREFIX/lib --with-sqlite-includes=$PREFIX/include \&lt;br /&gt;
  --with-png=no \&lt;br /&gt;
  --with-tiff=no \&lt;br /&gt;
  --with-fftw=no \&lt;br /&gt;
  --with-cairo=no \&lt;br /&gt;
  --with-opengl=no \&lt;br /&gt;
  --with-freetype=no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== MS-Windows ====&lt;br /&gt;
&lt;br /&gt;
===== MS-Windows/Cygwin =====&lt;br /&gt;
&lt;br /&gt;
* See the [[Cygwin]] wiki pages&lt;br /&gt;
&lt;br /&gt;
===== MS-Windows/native =====&lt;br /&gt;
&lt;br /&gt;
====== Compile ======&lt;br /&gt;
&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/CompileOnWindows GRASS Windows Native Binary Building Guide] (GRASS 6.4.x)&lt;br /&gt;
* &amp;lt;strike&amp;gt;[http://www.webalice.it/marco.pasetti/grass/BuildFromSource.html GRASS Windows Native Binary Building Guide] (GRASS 6.3.x) &amp;lt;/strike&amp;gt;&lt;br /&gt;
* See/adapt [http://blog.qgis.org/node/124 idea] for unattended install of QGIS (et al) from [http://trac.osgeo.org/osgeo4w/ OSGeo4W] from the QuantumGIS Blog.&lt;br /&gt;
&lt;br /&gt;
See also [[WinGRASS Current Status]] for latest updates.&lt;br /&gt;
&lt;br /&gt;
=== Common problems and solutions ===&lt;br /&gt;
&lt;br /&gt;
During compilation, error can occur if certain packages are not installed. Here a list of problems with solution:&lt;br /&gt;
&lt;br /&gt;
* error: X11/Xlib.h: No such file or directory&lt;br /&gt;
** this suggests that you don't have the X headers installed&lt;br /&gt;
** Solution: Install the libx11-dev package&lt;br /&gt;
&lt;br /&gt;
* error:  g.list: error while loading shared libraries: libgdal1.6.0.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
** this error appears in the shell right after the user clicks GUI's &amp;quot;Start GRASS&amp;quot; button. The GUI shows an error about geographic extent and gets closed afterwards.&lt;br /&gt;
** It happens when you launch bin.i686 executable on 64bit system. Be careful and choose the right architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Static compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to get static rather than dynamically linked binaries, configure like this:&lt;br /&gt;
&lt;br /&gt;
  ./configure --disable-shared --enable-static&lt;br /&gt;
&lt;br /&gt;
This will however break the wxGUI and GRASS 7 completely because &amp;quot;ctypes&amp;quot; wants to link against shared libs, or there is something in the static libs that &amp;quot;ctypes&amp;quot; does not like.&lt;br /&gt;
&lt;br /&gt;
=== Optimization ===&lt;br /&gt;
&lt;br /&gt;
GCC and other compilers support [http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Optimize-Options.html#Optimize-Options optimization]&lt;br /&gt;
&lt;br /&gt;
If you would like to set compiler optimisations, for a possibly faster binary, type (don't enter a &amp;quot;;&amp;quot; anywhere):&lt;br /&gt;
&lt;br /&gt;
        CFLAGS=-O ./configure&lt;br /&gt;
or,&lt;br /&gt;
        setenv CFLAGS -O&lt;br /&gt;
        ./configure&lt;br /&gt;
&lt;br /&gt;
whichever works on your shell. Use -O2 instead of -O if your compiler supports this (note: O is the letter, not zero). Using the &amp;quot;gcc&amp;quot; compiler, you can also specify processor specific flags (examples, please suggest better settings to us):&lt;br /&gt;
&lt;br /&gt;
  CFLAGS=&amp;quot;-mcpu=athlon -O2&amp;quot; # AMD Athlon processor with code optimisations&lt;br /&gt;
  CFLAGS=&amp;quot;-march=amdfam10&amp;quot;  # AMD Phenom II X4 64bit processor with gcc &amp;gt;=4.3&lt;br /&gt;
  CFLAGS=&amp;quot;-mcpu=pentium&amp;quot;    # Intel Pentium processor&lt;br /&gt;
  CFLAGS=&amp;quot;-mcpu=pentium4&amp;quot;   # Intel Pentium4 processor&lt;br /&gt;
  CFLAGS=&amp;quot;-O2 -msse -msse2 -mfpmath=sse -minline-all-stringops&amp;quot; # Intel XEON 64bit processor&lt;br /&gt;
  CFLAGS=&amp;quot;-mtune=nocona -m64 -minline-all-stringops&amp;quot;            # Intel Pentium 64bit processor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find out optional CFLAGS for your platform, enter:&lt;br /&gt;
  gcc -dumpspecs&lt;br /&gt;
&lt;br /&gt;
See also: http://gcc.gnu.org/&lt;br /&gt;
&lt;br /&gt;
A real fast GRASS version (and small binaries) will be created with LDFLAGS set to &amp;quot;stripping&amp;quot; (but this disables debugging):&lt;br /&gt;
&lt;br /&gt;
  CFLAGS=&amp;quot;-O2 -mcpu=&amp;lt;cpu_see_above&amp;gt; -Wall&amp;quot; LDFLAGS=&amp;quot;-s&amp;quot; ./configure&lt;br /&gt;
&lt;br /&gt;
=== Configure options and their meanings ===&lt;br /&gt;
&lt;br /&gt;
For configure there are many options and some GRASS modules are built only if some options are set. Here are listed common configuration options with short explanation.&lt;br /&gt;
&lt;br /&gt;
* --prefix=/path - Sets path where GRASS will be installed. GRASS will reside in /path/grass-version.&lt;br /&gt;
* --enable-largefile - Enables large (&amp;gt;2Gb on 32bit systems) support. For current large file support status look at [[Large File Support]] page.&lt;br /&gt;
* --with-cxx - Enables compilation of C++ code. Required for r.terraflow module.&lt;br /&gt;
* --with-readline - Enables readline support. If readline is enabled, you can use its history/editing facilities when entering r.mapcalc expressions on stdin.&lt;br /&gt;
* --with-glw - Enables GLw support. The GLw library provides OpenGL &amp;quot;canvas&amp;quot; widgets for Athena and Motif. &lt;br /&gt;
 &lt;br /&gt;
 That switch is unnecessary for normal compilation. It's only&lt;br /&gt;
 required for r3.showdspf, which isn't normally built; if you &lt;br /&gt;
 want it, you have build it manually &lt;br /&gt;
 (e.g. &amp;quot;make -C raster3d/r3.showdspf&amp;quot;).&lt;br /&gt;
 As similar functionality is now provided by NVIZ, r3.showdspf&lt;br /&gt;
 is deprecated.&lt;br /&gt;
 r3.showdspf uses the Motif widget (so you also need a &lt;br /&gt;
 Motif library, e.g. Lesstif or OpenMotif).&lt;br /&gt;
 [http://grass.itc.it/pipermail/grassuser/2006-December/037475.html Glynn Clements at GRASS-user mailing list]&lt;br /&gt;
&lt;br /&gt;
=== Parallelized compilation on multi-core CPUs ===&lt;br /&gt;
&lt;br /&gt;
You can dramatically accelerate the compilation of the GRASS code with the -j flag of &amp;quot;make&amp;quot; if you have a multi-core CPU system. This determines the maximum number of jobs to have running at once, so cores don't have to sit idle waiting for jobs on other cores to complete. A good rule of thumb for this value is &amp;lt;tt&amp;gt;number_of_cores * 1.5&amp;lt;/tt&amp;gt;, but note that setting any higher than the actual number of cores will only affect the timing slightly. For example, on a dual-core processor:&lt;br /&gt;
  make -j 4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- CFLAGS=&amp;quot;-pipe&amp;quot; doesn't seem to help much --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GRASS-GDAL plugin ==&lt;br /&gt;
&lt;br /&gt;
* see [[Compile and install GRASS and QGIS with GDAL/OGR Plugin]]&lt;br /&gt;
&lt;br /&gt;
== Addons ==&lt;br /&gt;
&lt;br /&gt;
Please note that the installation of [[AddOns/GRASS_6|Addons]] can be easily done with the {{cmd|g.extension}} manager. The compile instructions below are aiming at own development.&lt;br /&gt;
&lt;br /&gt;
=== Compiled C modules ===&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&lt;br /&gt;
&lt;br /&gt;
Either:&lt;br /&gt;
* a binary GRASS package, or&lt;br /&gt;
* source code which has been prepared with:&lt;br /&gt;
    ./configure [opionally flags]&lt;br /&gt;
    make libs&lt;br /&gt;
&lt;br /&gt;
Each of the [[GRASS_AddOns|addon]] modules should come with a Makefile. To compile it, just run:&lt;br /&gt;
    make MODULE_TOPDIR=/path/to/grass64/&lt;br /&gt;
&lt;br /&gt;
If using Bash it may be useful to set that up as an alias:&lt;br /&gt;
    alias gmake64='make MODULE_TOPDIR=/path/to/grass64/'&lt;br /&gt;
&lt;br /&gt;
Installation (perhaps requires &amp;quot;sudo&amp;quot;):&lt;br /&gt;
    make MODULE_TOPDIR=/path/to/grass64/ install&lt;br /&gt;
&lt;br /&gt;
Note: Compiled addons may require a re-compilation if you changed/updated your GRASS standard binaries.&lt;br /&gt;
&lt;br /&gt;
==== If binary comes with a -dev package ====&lt;br /&gt;
&lt;br /&gt;
''(work in progress, this text states how it eventually will be :)''&lt;br /&gt;
Nowadays one does not need to the source code, nor compiling GRASS by oneself to be able to add add-ons. On Debian, you can just install the grass-dev package and then run:&lt;br /&gt;
 make MODULE_TOPDIR=/usr/lib/grass64/ INST_DIR=/usr/lib/grass64/&lt;br /&gt;
&lt;br /&gt;
The grass-dev package essentially provides GRASS's &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; header files and Make configuration files.&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
If the addon module is a script, it is sufficient to copy it into the (GRASS binaries) path somewhere. Alternatively, install addons into a separate GRASS addons binaries/scripts directory which is easier to maintain. It avoids getting clobbered every time you reinstall GRASS. To use these separately stored scripts, set and export the GRASS_ADDON_PATH environment variable before starting GRASS and it will automatically be added to the module search path (see the {{cmd|variables}} help page). To simplify this, do for example:&lt;br /&gt;
&lt;br /&gt;
 # add in $HOME/.bashrc:&lt;br /&gt;
 GRASS_ADDON_PATH=/usr/local/grass/addons/&lt;br /&gt;
 export GRASS_ADDON_PATH&lt;br /&gt;
&lt;br /&gt;
Make sure that the script is executable, then just call it in GRASS typing the filename. Python scripts need to be called writing the extension as well, like:&lt;br /&gt;
 &lt;br /&gt;
 GRASS 6.5.svn (spearfish60):~ &amp;gt; v.krige.py&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_Community_Sprint_Prague_2013&amp;diff=19276</id>
		<title>Talk:GRASS Community Sprint Prague 2013</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Talk:GRASS_Community_Sprint_Prague_2013&amp;diff=19276"/>
		<updated>2013-07-22T20:30:43Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: /* Markus Metz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Participants' reports ==&lt;br /&gt;
&lt;br /&gt;
Major achievements have been done! See below for an incomplete list...&lt;br /&gt;
&lt;br /&gt;
... and: '''30 YEARS OF GRASS GIS!''' http://tinyurl.com/30-years-of-GRASS-GIS&lt;br /&gt;
&lt;br /&gt;
[[Image:2013-07-grass-community-sprint-prague.jpg|center|400px|thumb|GRASS GIS community sprint in Prague 2013 - Celebrating 30 YEARS OF GRASS GIS! http://tinyurl.com/30-years-of-GRASS-GIS]]&lt;br /&gt;
&lt;br /&gt;
=== Joint efforts ===&lt;br /&gt;
&lt;br /&gt;
(see [[GRASS_Community_Sprint_Prague_2013#In_person|here]] for participants' names)&lt;br /&gt;
&lt;br /&gt;
* Creating 3D vector test data (for 3D interpolation) - ES, SG, MN&lt;br /&gt;
* Added [[Image_processing#General_introduction|General introduction]] (based on manual of G7/i.vi by Yann Chemin) - MN, MN, YC&lt;br /&gt;
* Discussions on Bundle Block Adjustments - YC, ST&lt;br /&gt;
* wxGUI refactoring - AP, VP&lt;br /&gt;
* Presentation of state of image processing in GRASS 7 - YC, MN&lt;br /&gt;
* Presentation of state of Temporal GIS Algebra in GRASS 7 - SG, TL&lt;br /&gt;
* ISIS-GRASS bridge port to GRASS7 - YC, VP, ML, MN&lt;br /&gt;
* Discussions on potential integration of Rasdaman software as raster data backend - SG, YC, and Jachym (virtually)&lt;br /&gt;
* Presentation on vector conflation - TF with discussion&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
=== Individual Reports ===&lt;br /&gt;
&lt;br /&gt;
(participants in random order)&lt;br /&gt;
&lt;br /&gt;
==== Martin Landa ====&lt;br /&gt;
&lt;br /&gt;
* Community Sprint organization&lt;br /&gt;
* OSGeo4W GRASS 6.4.3RC4 package published&lt;br /&gt;
* Fix {{cmd|v.pack|version=70}} on MS Windows, {{rev|57117}}&lt;br /&gt;
* Fix {{cmd|v.unpack|version=70}} on MS Windows, {{rev|57121}}&lt;br /&gt;
* Update OSGeo4W package 'msys' to 1.0.18, http://trac.osgeo.org/osgeo4w/wiki/pkg-msys&lt;br /&gt;
* Preparation of 'mingw' OSGeo4W package&lt;br /&gt;
&lt;br /&gt;
==== Helena Mitasova ====&lt;br /&gt;
&lt;br /&gt;
* Discuss compiles issues on Mac OSX - with AP, VP&lt;br /&gt;
* Discuss Temporal GIS Algebra implementation - with SG&lt;br /&gt;
&lt;br /&gt;
==== Markus Neteler ====&lt;br /&gt;
&lt;br /&gt;
* Community Sprint Budget management (available on request)&lt;br /&gt;
* r.wf Addon fixed: {{rev|57075}} and {{rev|57076}}&lt;br /&gt;
* r.ipso Addon fixed: {{rev|57077}}&lt;br /&gt;
* Draft Doxygen'iation of the CDHC [http://grass.osgeo.org/programming7/cdhclib.html library for testing normality &amp;amp; exponentiality]&lt;br /&gt;
* Added [[Image_processing#General_introduction|General introduction]] to the image processing wiki/manual page (based on manual of G7/i.vi by Yann Chemin) - MN, MN, YC&lt;br /&gt;
* Backport of i.latlong to GRASS 6 (Addon) in {{rev|57191}}.&lt;br /&gt;
* screenshots for example in new module v.surf.mass (see Markus Metz entry)&lt;br /&gt;
* Merging in translations (i18N) done by  Milena Nowotarska  and Andreea Marin&lt;br /&gt;
&lt;br /&gt;
==== Yann Chemin ====&lt;br /&gt;
&lt;br /&gt;
* ISIS-GRASS bridge port to GRASS7 (with Vaclav, Martin and MarkusN)&lt;br /&gt;
  If ISIS (http://isis.astrogeology.usgs.gov) is installed, &lt;br /&gt;
  GRASS will load it in the background,&lt;br /&gt;
  the banner and prompt will change to ISIS-GRASS.&lt;br /&gt;
  Both ISIS and GRASS commands are available at the ISIS-GRASS prompt.&lt;br /&gt;
&lt;br /&gt;
* g.isis3mt exports a ISIS3 template from current location, ported into GRASS 7&lt;br /&gt;
&lt;br /&gt;
* Tested direct access of ISIS3 data into G7, r.in.gdal and r.external both work (tested Mars MOLA and Dawn test_datasets)&lt;br /&gt;
&lt;br /&gt;
* Discussed with Soeren, Vaclav and Jachym about Rasdaman, Voxel lib and Raster handling in Grass 8, we agreed on investigating handling, interfaces and performances.&lt;br /&gt;
&lt;br /&gt;
* Went through the Bundle Block Adjustment files with Stepan&lt;br /&gt;
&lt;br /&gt;
* Landsat 7 chain processing using pyGRASS goes in testing mode with MarkusN and Soeren&lt;br /&gt;
&lt;br /&gt;
* Worked more on r.crater&lt;br /&gt;
&lt;br /&gt;
==== Margherita Di Leo ====&lt;br /&gt;
&lt;br /&gt;
* r.basin ported to G7 {{rev|57091}}, {{rev|57096}}&lt;br /&gt;
* r.basin html fixed {{rev|57110}}&lt;br /&gt;
&lt;br /&gt;
==== Markus Metz ====&lt;br /&gt;
&lt;br /&gt;
* r.stream.* modules: clean up before moving from addons to trunk {{rev|57151}}, {{rev|57152}}&lt;br /&gt;
* GRASS wiki image processing update (MM, MN, YC)&lt;br /&gt;
* standardizing options for v.db.* and db.* modules, updating respective manuals&lt;br /&gt;
* new module [[AddOns/GRASS7/vector#v.surf.mass|v.surf.mass]] for Tobler's pycnophylactic area interpolation {{rev|57172}} ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.surf.mass/v.surf.mass.html manual page])&lt;br /&gt;
* new module [[AddOns/GRASS7/vector#v.area.weigh|v.area.weigh]] for area interpolation with known cell weights, preserving area properties like Tobler's pycnophylactic area interpolation&lt;br /&gt;
* i.segment: object recognition fixed for special cases, tested with 2 billion cells&lt;br /&gt;
* v.kcv optimized (thanks to Jan Ruzicka and Jan Vandrol)&lt;br /&gt;
&lt;br /&gt;
==== Anne Ghisla aka aghisla ====&lt;br /&gt;
&lt;br /&gt;
* Google Summer of Code live discussions&lt;br /&gt;
* v.krige fixed in G7 {{rev|57146}} and following&lt;br /&gt;
&lt;br /&gt;
==== Sören Gebbert aka huhabla ====&lt;br /&gt;
&lt;br /&gt;
* Google Summer of Code Temporal Algebra presentation and implementation support&lt;br /&gt;
* Discussion of RASDAMAN GRASS integration&lt;br /&gt;
* Discussion and implementation of the new temporal module t.rast.accumulate and the use of a modified version of r.gdd (implemented by Markus Metz) instead of r.mapcalc&lt;br /&gt;
* Writing and updating of many temporal modules manual pages&lt;br /&gt;
* Implementing a prototype that uses Python multiprocessing and a new display C-library function derived from g.pnmcomp to speedup the image composition in the wx GUI&lt;br /&gt;
&lt;br /&gt;
==== Stepan Turek ====&lt;br /&gt;
&lt;br /&gt;
* Working on Google Summer of Code project &lt;br /&gt;
* Went through the Bundle Block Adjustment files with Yann&lt;br /&gt;
* Released source code of scatter plot backend to backend {{rev|57180}} and turns backend {{rev|57179}}&lt;br /&gt;
* Discussed GSoC with Martin and Soeren&lt;br /&gt;
&lt;br /&gt;
==== Thomas Leppelt ====&lt;br /&gt;
&lt;br /&gt;
* Working on GSoC Project: Temporal Algebra&lt;br /&gt;
* Discussing the algebra concept.&lt;br /&gt;
* Implemented functions for if-statements in the temporal algebra.&lt;br /&gt;
* Added several temporal functions like start_date(), end_time(), start_datetime().&lt;br /&gt;
* Implemented topological relationships for if-statements.&lt;br /&gt;
* Added topological relations for comparison operators in conditional statements.&lt;br /&gt;
* Finished to implement the hash-operator (#) for map counting.&lt;br /&gt;
* New module t.select alpha version in repository ready for testing. [http://grasswiki.osgeo.org/wiki/GRASS_GSoC_2013_Temporal_GIS_Algebra_for_raster_and_vector_data_in_GRASS GSOC-wiki]&lt;br /&gt;
&lt;br /&gt;
==== Milena Nowotarska ====&lt;br /&gt;
&lt;br /&gt;
* GUI translation to Polish {{rev|57166}}&lt;br /&gt;
* i18n fixes&lt;br /&gt;
* winGRASS testing&lt;br /&gt;
&lt;br /&gt;
==== Anna Petrasova ====&lt;br /&gt;
&lt;br /&gt;
* attempts to compile wxPython with wxGTK3/Broadway (HTML5) backend, so far not successful, see [http://wxpython-users.1045709.n5.nabble.com/wxPython-with-wxGTK3-Broadway-HTML5-based-backend-td5718030.html discussion]&lt;br /&gt;
* wxGUI refactoring&lt;br /&gt;
* wxGUI design&lt;br /&gt;
* toolboxes: discussion, adding &amp;lt;addons&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
==== Vaclav Petras ====&lt;br /&gt;
&lt;br /&gt;
* compiling wxPython with wxGTK3/Broadway with Anna&lt;br /&gt;
* discussion of Rasdaman GRASS integration&lt;br /&gt;
* wxGUI refactoring&lt;br /&gt;
* wxGUI design&lt;br /&gt;
* toolboxes&lt;br /&gt;
** discussion&lt;br /&gt;
** tests&lt;br /&gt;
** different source file for module search/tree and main menu&lt;br /&gt;
* ISIS-GRASS bridge port to GRASS7 with Yann&lt;br /&gt;
* discussing wxGUI programming with Stepan&lt;br /&gt;
* handling of translations (calls of gettext underscore function), fixes bug in wxGUI (parts remained untranslated)&lt;br /&gt;
&lt;br /&gt;
==== Eva Stopková ====&lt;br /&gt;
* debugged plotting variogram output in module v.kriging (not published yet)&lt;br /&gt;
* improved and debugged other functions of module v.kriging&lt;br /&gt;
&lt;br /&gt;
* discussion about kriging methods in GRASS GIS with Anne G.&lt;br /&gt;
* discussion about optimalization and testing modules (not published yet) v.kriging (2D/3D kriging) and v.nna (2D/3D Nearest Neighbour Analysis) with Markus N. and Soeren G.&lt;br /&gt;
* discussion about 3D kriging, 3D Nearest Neighbour Analysis and possibilities of future work on the modules with Helena M.&lt;br /&gt;
&lt;br /&gt;
* numerical testing of v.kriging: &lt;br /&gt;
** prepared inputs&lt;br /&gt;
** fixing the bugs&lt;br /&gt;
&lt;br /&gt;
==== Tereza Fiedlerová ====&lt;br /&gt;
* learning something about GRASS GIS vector modules &lt;br /&gt;
* discussion about own QGIS plugin and C++ library for vector conflation and its possible implementation to GRASS&lt;br /&gt;
* beginning to write C API for vector conflation library (needed for GRASS implementation)&lt;br /&gt;
&lt;br /&gt;
== Options to discuss with Sprint participants ==&lt;br /&gt;
&lt;br /&gt;
* [[IRC]] - chat&lt;br /&gt;
* Skype&lt;br /&gt;
* Google Hangout (see below)&lt;br /&gt;
* come to Prague :)&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
Google Hangout option:&lt;br /&gt;
&lt;br /&gt;
Q: do you have to be signed up with a Google+ social media account?&lt;br /&gt;
: ''in theory no, but in practice they strongly funnel you that way''&lt;br /&gt;
&lt;br /&gt;
Q:  is [http://www.jitsi.org Jitsi] on a desktop computer compatible with G+?&lt;br /&gt;
: ''at the text chat level, yes. video and voice via Google Talk, reported to work with Voice, not sure about video''&lt;br /&gt;
: ''It is compatible with GoogleTalk instant messaging (and most other instant messaging including the XMPP RFC like Facebook; Skype is the notable one that it doesn't work with), not sure about GoogleTalk's voice calls, I'd give that a 80% chance of working.&lt;br /&gt;
: An interesting side-project Jisti offers its own work-alike free multi-person video chat for XMPP(Jabber compatibles) which is not limited to 10 people: [https://jitsi.org/Projects/JitsiVideobridge VideoBridge]. Given enough bandwidth and a modern desktop CPU acting as the bridge server, you can have someone in a G+ hangout share their desktop to pass through the other members of the video hangout.&lt;br /&gt;
: Also there's a functional alpha-release Android client.&lt;br /&gt;
: For Jitsi &amp;lt;-&amp;gt; Jitsi video you may need a valid XMPP account. Many (federated in a single grid) providers for that, so it doesn't matter much who. Jitsi run a simple registry at  http://jit.si&lt;br /&gt;
: All quite interesting possibilities and the development is quite active -- but is it there yet? I'm not sure, probably a not far away &amp;quot;almost&amp;quot;; if so, perhaps we could run the bridge on Adhoc for a few days (can run as an unprivileged user, needs Java 6, chat &amp;quot;host&amp;quot; user needs shell access to set magic pass word and get the assigned port numbers to plug into their client), or perhaps host it at fsv.cvut.cz? (i.e. locate it at the shortest hop to max number of participants using it) --HB''&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19275</id>
		<title>AddOns/GRASS7/vector</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=AddOns/GRASS7/vector&amp;diff=19275"/>
		<updated>2013-07-22T20:30:29Z</updated>

		<summary type="html">&lt;p&gt;⚠️Mmetz: v.area.weigh&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOns}}&lt;br /&gt;
See also&lt;br /&gt;
 svn co https://svn.osgeo.org/grass/grass-addons/grass7/vector/&lt;br /&gt;
&lt;br /&gt;
==== v.area.weigh ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.area.weigh|version=7}} creates a raster surface from vector areas using known cell weights and preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count with the area's population concentrated on the known location of urban areas.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.build.pg ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.build.pg|version=7}} builds PostGIS topology for feature tables linked via v.external.&lt;br /&gt;
&lt;br /&gt;
==== v.class.mlpy ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.class.mlpy|version=7}} classifies vector features. It is an interface to the [http://mlpy.sourceforge.net mlpy library] (Machine Learning Python). Classification is supervised and based on attribute table data. Geometry is not used. A training dataset is always required.&lt;br /&gt;
&lt;br /&gt;
==== v.colors2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.colors|version=7}} is much like r.colors, but may be used for vector maps.&lt;br /&gt;
&lt;br /&gt;
==== v.concave.hull ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.concave.hull|version=7}} creates a concave hull describing the shape of point clouds.&lt;br /&gt;
&lt;br /&gt;
==== v.delaunay3d ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.delaunay3d|version=7}} creates a 3D triangulation from an input vector map containing points or centroids.&lt;br /&gt;
&lt;br /&gt;
Requires [http://www.cgal.org CGAL library].&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Martin Landa&lt;br /&gt;
&lt;br /&gt;
==== v.external.all ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.external.all|version=7}} creates (using v.external) in the current mapset new pseudo-vector maps for all OGR layers from given OGR datasource (dsn option).&lt;br /&gt;
&lt;br /&gt;
==== v.in.geopaparazzi ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.geopaparazzi|version=7}} imports all elements saved into [http://code.google.com/p/geopaparazzi/ Geopaparazzi].&lt;br /&gt;
&lt;br /&gt;
==== v.in.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.ply|version=7}} is a C program that imports a PLY file and writes it as GRASS vector map.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.in.redwg ====&lt;br /&gt;
&lt;br /&gt;
: [http://lists.gnu.org/archive/html/info-libredwg/2010-08/msg00000.html v.in.redwg imports DWG files into GRASS.], see also [https://svn.osgeo.org/grass/grass-addons/grass7/vector/v.in.redwg here]&lt;br /&gt;
&lt;br /&gt;
:'''Author:''' Rodrigo Rodrigues da Silva&lt;br /&gt;
&lt;br /&gt;
==== v.in.wfs2 ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.in.wfs2|version=7}} imports OGC WFS maps (Web Feature Service) from external servers.&lt;br /&gt;
&lt;br /&gt;
==== v.median ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.median|version=7}} create the median point of a cloud of point.&lt;br /&gt;
&lt;br /&gt;
==== v.net.salesman.opt ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.net.salesman.opt|version=7}} estimates the optimal route to visit nodes on a vector network and optionally tries to improve the result.&lt;br /&gt;
&lt;br /&gt;
==== v.out.ply ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.out.ply|version=7}} is a C program that exports a GRASS vector map as PLY file.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.ply.rectify ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.ply.rectify|version=7}} imports a PLY point cloud, georeferences and exports it. The first three vertex properties must be the x, y, z coordinates with property names &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot;, in this order.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;br /&gt;
&lt;br /&gt;
==== v.surf.icw ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.icw|version=7}}:&lt;br /&gt;
Inverse cost weighting is like inverse distance weighted (IDW) interpolation, but uses cost instead of shortest Euclidean distance. In this way solid barriers and molasses zones may be correctly taken into account.&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Hamish Bowman&lt;br /&gt;
&lt;br /&gt;
==== v.surf.mass ====&lt;br /&gt;
&lt;br /&gt;
{{AddonSrc|vector|v.surf.mass|version=7}} creates a raster surface from vector areas, preserving the value of the area attribute. For example, if the selected area attribute is the population count, the sum of all pixel values in a given area is equal to the area's population count. ([http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.surf.mass/v.surf.mass.html manual page])&lt;br /&gt;
&lt;br /&gt;
: '''Author:''' Markus Metz&lt;/div&gt;</summary>
		<author><name>⚠️Mmetz</name></author>
	</entry>
</feed>