AddOns: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
 
(673 intermediate revisions by 70 users not shown)
Line 1: Line 1:
This page contains references to user contributions and add-ons
This page contains references to user contributions and add-ons (the original GRASS GIS software can be downloaded [http://grass.osgeo.org/download/ here]).


==Copyright and licensing information==
__TOC__
 
== Overview ==
 
'''[http://grass.osgeo.org/grass8/manuals/addons/ GRASS GIS 8 Addons Manual pages] - a complete overview of available Addons'''
 
== Building and installing AddOns ==
 
=== Common users ===
 
'''Graphical user interface:'''<br>
We recommend to use the [[wxGUI]] [[WxGUI#Extension Manager|Extension Manager]] (''Settings -> Addon extensions -> Install extensions from addons'') to install Addons.
 
'''Command line:'''<br>
You can also use the {{cmd|g.extension}} module, e.g. to install <tt>r.fuzzy.system</tt> run:
 
g.extension extension=r.fuzzy.system
 
To remove installed AddOns run
 
g.extension extension=r.fuzzy.system operation=remove
 
=== Power users (not recommended for Windows users) ===
 
For manual compiling see the [[Compile and Install#Addons|compile and install]] wiki page.
 
== AddOns source code repository ==
 
The AddOns source code is hosted in [https://github.com/osgeo/grass-addons GRASS-AddOns Github repository].
 
== Adding something new ==
 
=== How to obtain write-access ===
While read access is granted to the public, for submissions you best fork this repository, insert your addon or fix an existing one in a new branch and finally open a [https://github.com/OSGeo/grass-addons/pulls pull request].
 
Please announce your add-on to the GRASS users' mailing list so that others may be aware of your work. Also please consider adding your module to one of the [[Applications]] pages.
 
=== Copyright and licensing information ===


''Please be sure to include copyright and licensing information in the header comments of your code so that others may know how they can use, extend, modify, and redistribute your work.''
''Please be sure to include copyright and licensing information in the header comments of your code so that others may know how they can use, extend, modify, and redistribute your work.''


e.g. at the top of a shell script:
e.g. at the top of a shell script:
<pre>
<source lang=bash>
#!/bin/sh
#!/bin/sh
############################################################################
############################################################################
Line 29: Line 66:


[script follows]
[script follows]
</pre>
</source>
 
 
==Shell script coding standards==
 
Please have a look at our [http://grass.itc.it/grass61/source/SUBMITTING_SCRIPTS Shell script coding standards] before submitting here.
 
 
==Miscellaneous Add-ons==
 
* [http://bambi.otago.ac.nz/hamish/grass/utm_which_zone.sh utm_which_zone.sh] is a shell script to determine UTM zone from Lat/Lon input. Requires [http://www.octave.org Octave] to be installed. A shell-only version is [http://dcalvelo.free.fr/grass/utm_which_zone_sh.sh available] which only requires awk.
 
'''Authors''': Hamish Bowman (Octave part), Markus Neteler (shell script wrapper), Daniel Calvelo (sh+awk version)
 
* Perl scripts for converting data forth and back between Excel files and PostgreSQL: [http://dcalvelo.free.fr/grass/pg2xls.pl pg2xls.pl] reads data from PostgreSQL and produces an excel workbook; [http://dcalvelo.free.fr/grass/xls2sql.pl xls2sql.pl] reads excel files and outputs SQL statements to be fed into an RDBMS. Both scripts need modules from [http://www.cpan.org CPAN], especially [http://search.cpan.org/dist/Spreadsheet-ParseExcel/  Spreadsheet::ParseExcel] for xls2sql.pl and [http://search.cpan.org/~tmtm/Spreadsheet-WriteExcel-FromDB Spreadsheet::WriteExcel::FromDB] and its dependencies for pg2sql.pl. Check the source headers for more info.
 
'''Authors:''' Daniel Calvelo (xls2sql.pl), Markus Neteler (pg2xls.pl)
 
 
* [http://www.igc.usp.br/pessoais/guano/downloads/azimuth2.c azimuth2.c] is a small C programm to calculate the azimuth and length of vector lines exported by GRASS-GIS as ASCII files (like this: v.out.ascii input=vector output=ascii format=standard). It is useful for create rose diagrams of lineament maps. Improvements on the original code after suggestions by Örs Téglásy, Hungary.
 
'''Author:''' Carlos Henrique Grohmann
 
==GRASS 5.x==
 
===Vector add-ons for GRASS 5===
 
* See here: http://grass.itc.it/download/addons.php
 
===Raster add-ons for GRASS 5===
 
* See here: http://grass.itc.it/download/addons.php
 
==GRASS 6.x==
 
===Vector add-ons===
 
* [http://les-ejk.cz/programs/trees.html v.trees3d] is module for making 3D trees from input vector point file.
 
'''Author:''' Jachym Cepicky
 
* [http://www.public.asu.edu/~cmbarton/files/grass_scripts/vector/v.lda v.lda] is a shell script for calculating Ian Johnson's (U. Sidney) Local Density Analysis values to measure clustering of point data at different neighborhood radii. There is an option to create a simple line graph of the results. There have been reports of problems creating the line graph on Cygwin installations of GRASS.
 
'''Author:''' Michael Barton
   
* [http://www.public.asu.edu/~cmbarton/files/grass_scripts/vector/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.
 
'''Author:''' Michael Barton
 
* [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.
 
'''Author:''' Cedric Shock
 
* [http://bambi.otago.ac.nz/hamish/grass/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.
 
'''Author:''' Hamish Bowman
* [http://www.fle.czu.cz/~jachym/programs/v.rasterbounds 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 < 6.1, you  have to be in the same mapset as your raster maps are from.
 
'''Author:''' Jachym Cepicky
 
* [http://www.fle.czu.cz/~jachym/programs/v.3Dtin v.3Dtin] is a shell script for making 3D-vector of the 2D ouput from ''v.delauny''.
 
'''Author:''' Jachym Cepicky
 
* [http://www.clubwebcanada.ca/twiens/v.sample.buffer.tgz 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.
 
'''Author:''' Trevor Wiens
     
* [http://www.unipg.it/~ivanm/v.variogram.tar.gz v.variogram] is a script that create an omnidirectional experimental semi-variogram. This scripts require R-statistics software installed on your machine.
 
'''Author:''' Ivan Marchesini, Pierluigi De Rosa
 
* [http://www.unipg.it/~ivanm/v.krige.tar.gz v.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 desumed from the experimental semi variogram produced by v.variogram.
 
'''Author:''' Ivan Marchesini, Pierluigi De Rosa
     
* [http://ngeo.de/grassstuff/v.lmeasure v.lmeasure] and [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.
 
'''Author:''' Mats Schuh
 
* [http://david.p.finlayson.googlepages.com/v.swathwidth v.swathwidth] creates a vector map representing the sea bottom coverage of a multibeam (swath) sonar survey.
 
'''Author:''' David Finlayson
 
===Raster add-ons===
 
* http://www.fle.czu.cz/~jachym/programs/grass/r.gauss.tgz r.gauss] is Gaussian and Laplacian of Gaussian filter for GRASS. It is written in C language.
 
'''Author:''' Jachym Cepicky
 
* [http://www.fle.czu.cz/~jachym/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.
 
'''Author:''' Jachym Cepicky
 
* [http://www.fle.czu.cz/~jachym/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.
 
'''Author:''' Jachym Cepicky
 
* [http://www.fle.czu.cz/~jachym/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 <em>very</em> simple, the edges don't need to be really on that pixel, where they are detected, no interpolation is performed.
 
    '''Usage:'''
    zc.pl -i input -o output |r.mapcalc
 
'''Author:''' Jachym Cepicky
 
* [http://www.fle.czu.cz/~jachym/programs/local_max.pl Local maxima] is a Perl script for <code>r.mapcalc</code>. It detects local maxima of the image.
 
    '''Usage:'''
    local_maxima.pl -i input -o output -s matrix_size|r.mapcalc
 
'''Author:''' Jachym Cepicky
 
* [http://bambi.otago.ac.nz/hamish/grass/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)
 
'''Authors:''' Hamish Bowman, Dylan Beaudette
 
* [http://bambi.otago.ac.nz/hamish/grass/r.pack r.pack] and [http://bambi.otago.ac.nz/hamish/grass/r.unpack r.unpack] are two GRASS scripts for transfering raster maps to another computer as a single file.
 
'''Author:''' Hamish Bowman
 
* [http://bambi.otago.ac.nz/hamish/grass/dominant_dir.m dominant_dir.m] and [http://bambi.otago.ac.nz/hamish/grass/calc_terraflow_dir.m 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.
 
'''Author:''' Hamish Bowman
 
* [http://www-pool.math.tu-berlin.de/~soeren/grass/modules/ r.in.onearth] for download and import satellite images direct from the NASA onearth WMS server into GRASS.
 
'''Author:''' Soeren Gebbert
 
* [http://www.shockfamily.net/cedric/grass/r.tileset r.tileset] generates a list of tiles and sizes in a source projection that cover the region in the current database with appropriate resolution. The size of individual tiles can be constrained. Only tiles intersecting the current region are returned. These tilings are appropriate for requesting data from another projection to meet the specifications of the current region. For example, it could be used to generate tile requests to a latitude / longitude WMS server like this <code>r.tileset -w sourceproj="+init=epsg:4326"</code>.
 
'''Author:''' Cedric Shock


* http://grass.gdf-hannover.de/twiki/pub/GRASS/GrassAddOns/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. Output colored, shaded-relief rasters can optionally be exported to tiff format and archived using tar with gzip/bzip2 compression if appropriate flags are given. Shading parameters can be modified, though useful defaults are given.
=== Coding standards ===


'''Author:''' Eric Patton
Please have a look at our [https://github.com/OSGeo/grass/blob/main/CONTRIBUTING.md CONTRIBUTING] documentation before submitting here.
 
* http://grass.gdf-hannover.de/twiki/pub/GRASS/GrassAddOns/r.fragment fragments a raster into a user-defined set of smaller tiles according to an input number of rows and columns. Optionally, a null value threshold can be set to filter out candidate tiles that would have a large percentage of null cells.


'''Author:''' Eric Patton
=== Documenting your code ===


* [http://david.p.finlayson.googlepages.com/r.eucdist r.eucdist] creates a raster map estimating the eucledian distance from known cells
You can have an help page template auto-generated by using the GRASS [[module command line parser | command line parser]] with the <tt>--html-description</tt> command line option. Please, see also the {{cmd|g.parser}} help page.


'''Author:''' David Finlayson
== Miscellaneous Add-ons ==
   
* [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.


'''Author:''' David Finlayson
* [http://trac.osgeo.org/grass/browser/grass-addons/grass6/misc/utm_which_zone utm_which_zone.sh] is a shell script to determine UTM zone from Lat/Lon input. Requires [http://www.octave.org Octave] or Matlab to be installed. A shell-only version is [http://dcalvelo.free.fr/grass/utm_which_zone_sh.sh available] which only requires awk.<BR>'''Authors''': Hamish Bowman (Octave part), Markus Neteler (shell script wrapper), Daniel Calvelo (sh+awk version)


===General add-ons===


* [http://www.gdf-hannover.de/dassau/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.
* Perl scripts for converting data forth and back between Excel files and PostgreSQL: [http://dcalvelo.free.fr/grass/pg2xls.pl pg2xls.pl] reads data from PostgreSQL and produces an excel workbook; [http://dcalvelo.free.fr/grass/xls2sql.pl xls2sql.pl] reads excel files and outputs SQL statements to be fed into an RDBMS. Both scripts need modules from [http://www.cpan.org CPAN], especially [http://search.cpan.org/dist/Spreadsheet-ParseExcel/  Spreadsheet::ParseExcel] for xls2sql.pl and [http://search.cpan.org/~tmtm/Spreadsheet-WriteExcel-FromDB Spreadsheet::WriteExcel::FromDB] and its dependencies for pg2sql.pl. Check the source headers for more info.<BR>'''Authors:''' Daniel Calvelo (xls2sql.pl), Markus Neteler (pg2xls.pl)


'''Author:''' Otto Dassau


* 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.
* [http://dream.lrrl.arch.tu-muenchen.de/~wqual/perl/dbf2sql.tgz dbf2sql] is a Perl script for translating dbf-tables into a sql-command. dbf-tables are read using dbfdump-command from dbd-xbase-perl module ([http://search.cpan.org/~janpaz/DBD-XBase-0.241/ dbd::xbase] and [http://search.cpan.org/~jv/Getopt-Long-2.35/lib/Getopt/Long.pm getopt::long] have to be installed from CPAN first). There are problems, if the last column of the table contains characters. Suggestions for improvements welcome! <BR>'''Author:'''Wolfgang Qual


'''Author:''' Alexandre Sorokine (grass-complete), Daniel Calvelo (grass_rlcompleter.sh)


===Display add-ons===
* [http://www.igc.usp.br/pessoais/guano/downloads/azimuth2.c azimuth2.c] is a small C program to calculate the azimuth and length of vector lines exported by GRASS-GIS as ASCII files (like this: v.out.ascii input=vector output=ascii format=standard). It is useful for create rose diagrams of lineament maps. Improvements on the original code after suggestions by Örs Téglásy, Hungary.<BR>'''Author:''' Carlos Henrique Grohmann


====IconSymbols====


* [http://www.wgug.org/index.php?option=com_content&view=article&id=56&Itemid=9 ann.*] is the set of GRASS modules (in python) which implements artificial neural network using FANN library. The package requires Fast Artificial Neural Network Library ([http://leenissen.dk/fann/wp/ FANN]) v2.x. <BR>'''Author:''' Pawel Netzel


''d.out.gpsdrive'' - moved into GRASS CVS.


* [http://bambi.otago.ac.nz/hamish/grass/d.stations d.stations] is a shell script that quickly displays vector points (or sites for GRASS
* [http://trac.osgeo.org/grass/browser/grass-addons/tools/csv_dequote.pl csv_dequote.pl] is a Perl script to convert comma separated .csv files (including "quoted" text strings containing commas) into a form ready for {{Cmd|v.in.ascii}}. Comma separators are converted to pipes (|), commas in quoted strings are preserved, and "quotes" are removed where it is appropriate to do so. It doesn't need GRASS to run, but it does need the Text::CSV Perl Module (<tt>apt-get install libtext-csv-perl</tt>).<BR>'''Author''': Hamish Bowman
5.4 and below).


'''Author:''' Hamish Bowman
==GRASS 8.x (current)==


http://grass.gdf-hannover.de/twiki/pub/GRASS/GrassAddOns/d.hyperlink.tar.gz 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.
* See [https://grass.osgeo.org/grass8/manuals/addons/ AddOns/GRASS 8]


'''Author: '''Eric Patton
==GRASS 7.x (old)==
 
* [http://bambi.otago.ac.nz/hamish/grass/d.varea d.varea] is a shell script that quickly displays vector areas.


'''Author:''' Hamish Bowman
* See [[AddOns/GRASS 7]]


===Postscript add-ons===
== GRASS 6.x (very old) ==


* [http://les-ejk.cz/programs/grass/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.
* See [[AddOns/GRASS 6]]


'''Author:''' Jachym Cepicky
==GRASS 5.x (historical)==


ps.map samples/templates: are people willing to include these here? PsMapScripts
* See [[AddOns/GRASS 5]]


==GRASS 4.x (very historical)==


===GRASS and UMN Mapserver===
* See [[AddOns/GRASS 4]]


* [http://www.mail-archive.com/mapserver-users@lists.umn.edu/msg00086.html See interesting posting]
{{AddOns}}

Latest revision as of 10:59, 7 March 2024

This page contains references to user contributions and add-ons (the original GRASS GIS software can be downloaded here).

Overview

GRASS GIS 8 Addons Manual pages - a complete overview of available Addons

Building and installing AddOns

Common users

Graphical user interface:
We recommend to use the wxGUI Extension Manager (Settings -> Addon extensions -> Install extensions from addons) to install Addons.

Command line:
You can also use the g.extension module, e.g. to install r.fuzzy.system run:

g.extension extension=r.fuzzy.system

To remove installed AddOns run

g.extension extension=r.fuzzy.system operation=remove

Power users (not recommended for Windows users)

For manual compiling see the compile and install wiki page.

AddOns source code repository

The AddOns source code is hosted in GRASS-AddOns Github repository.

Adding something new

How to obtain write-access

While read access is granted to the public, for submissions you best fork this repository, insert your addon or fix an existing one in a new branch and finally open a pull request.

Please announce your add-on to the GRASS users' mailing list so that others may be aware of your work. Also please consider adding your module to one of the Applications pages.

Copyright and licensing information

Please be sure to include copyright and licensing information in the header comments of your code so that others may know how they can use, extend, modify, and redistribute your work.

e.g. at the top of a shell script:

#!/bin/sh
############################################################################
#
# MODULE:       v.in.e00
#
# AUTHOR(S):    Markus Neteler, Otto Dassau
#
# PURPOSE:      Import E00 data into a GRASS vector map
#               Imports single and split E00 files (.e00, .e01, .e02 ...)
#
# COPYRIGHT:    (c) 2004, 2005 GDF Hannover bR, http://www.gdf-hannover.de
#
#               This program is free software under the GNU General Public
#               License (>=v2). Read the file COPYING that comes with GRASS
#               for details.
#
#############################################################################
#
# REQUIREMENTS:
#      -  avcimport: http://avce00.maptools.org

[script follows]

Coding standards

Please have a look at our CONTRIBUTING documentation before submitting here.

Documenting your code

You can have an help page template auto-generated by using the GRASS command line parser with the --html-description command line option. Please, see also the g.parser help page.

Miscellaneous Add-ons

  • utm_which_zone.sh is a shell script to determine UTM zone from Lat/Lon input. Requires Octave or Matlab to be installed. A shell-only version is available which only requires awk.
    Authors: Hamish Bowman (Octave part), Markus Neteler (shell script wrapper), Daniel Calvelo (sh+awk version)


  • Perl scripts for converting data forth and back between Excel files and PostgreSQL: pg2xls.pl reads data from PostgreSQL and produces an excel workbook; xls2sql.pl reads excel files and outputs SQL statements to be fed into an RDBMS. Both scripts need modules from CPAN, especially Spreadsheet::ParseExcel for xls2sql.pl and Spreadsheet::WriteExcel::FromDB and its dependencies for pg2sql.pl. Check the source headers for more info.
    Authors: Daniel Calvelo (xls2sql.pl), Markus Neteler (pg2xls.pl)


  • dbf2sql is a Perl script for translating dbf-tables into a sql-command. dbf-tables are read using dbfdump-command from dbd-xbase-perl module (dbd::xbase and getopt::long have to be installed from CPAN first). There are problems, if the last column of the table contains characters. Suggestions for improvements welcome!
    Author:Wolfgang Qual


  • azimuth2.c is a small C program to calculate the azimuth and length of vector lines exported by GRASS-GIS as ASCII files (like this: v.out.ascii input=vector output=ascii format=standard). It is useful for create rose diagrams of lineament maps. Improvements on the original code after suggestions by Örs Téglásy, Hungary.
    Author: Carlos Henrique Grohmann


  • ann.* is the set of GRASS modules (in python) which implements artificial neural network using FANN library. The package requires Fast Artificial Neural Network Library (FANN) v2.x.
    Author: Pawel Netzel


  • csv_dequote.pl is a Perl script to convert comma separated .csv files (including "quoted" text strings containing commas) into a form ready for v.in.ascii. Comma separators are converted to pipes (|), commas in quoted strings are preserved, and "quotes" are removed where it is appropriate to do so. It doesn't need GRASS to run, but it does need the Text::CSV Perl Module (apt-get install libtext-csv-perl).
    Author: Hamish Bowman

GRASS 8.x (current)

GRASS 7.x (old)

GRASS 6.x (very old)

GRASS 5.x (historical)

GRASS 4.x (very historical)