GRASS logo

NAME

v.maxent.swd - Export raster values at given point locations as text file in SWD format for input in Maxent. In addition, the addon can export the environmental raster layers as ascii files.

KEYWORDS

vector, export, Maxent

SYNOPSIS

v.maxent.swd
v.maxent.swd --help
v.maxent.swd [-teh] [species=string[,string,...]] [species_name=string] evp_maps=string[,string,...] [alias_names=string] [evp_cat=string[,string,...]] [alias_cat=string] [nbgp=number] [bgp=string] [species_output=name] [bgr_output=name] [alias_output=name] [export_rasters=name] [format=string] [nodata=number] [seed=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-t
Thin species and background points
Select this flag if you want to limit the species and background points to maximum one point per raster cell. Note that this is already the case for the background points with the nbgp option.
-e
Automatically adapt resolution
When the ns and ew resolution are not the same, nearest neighbor resampling will be used to ensure both are the same.
-h
skip header in csv
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

species=string[,string,...]
vector map(s) of species occurence
species_name=string
Alias-name(s) for species (default: map names).
evp_maps=string[,string,...] [required]
Environmental parameter map(s)
alias_names=string
Alias names for environmental parameter(s)
evp_cat=string[,string,...]
Categorial environmental parameter map(s)
alias_cat=string
Alias names for categorial parameter(s)
nbgp=number
Number or percentage of background points
bgp=string
Vector layer with background / absence points
species_output=name
Species SWD file
bgr_output=name
Background SWD file
alias_output=name
CSV file with alias and map names
export_rasters=name
Folder where to export the predictor raster layers to
format=string
Raster data format to write (case sensitive, see r.out.gdal)
Options: ascii, GeoTIFF
nodata=number
nodata value in output files
Default: -9999
seed=integer
Seed for generating random points
Default: 1

Table of contents

DESCRIPTION

The v.maxent.swd takes one or more point vector layers with the location of species presence locations (parameter: species), and a set of raster layers representing relevant environmental variables (parameter: evp_maps). For all point locations, it reads in the values of the environmental raster layers. The resulting point layers(s) are combined in one layer and this is exported as a SWD file that can be used as input for MaxEnd 3.4 or higher.

The user can also provide a point layer with background points (parameter: bgp). Alternatively, a user-defined number of background points can be generated automatically, respecting the computational region and MASK. In either case, for all point locations, the function reads in the values of the environmental raster layers. The resulting point layer is exported as a SWD file.

If alias names are used, a CSV file (alias_file) can be created with alias names in the first column and map names in the second column, separated by comma, without a header.

NOTES

The map names of both the species point layers and the environmental parameters can be replaced by alias names, which will be used by MaxEnt.

The SWD file format is a simple comma-delimited text files. The first three fields provide the species name, x-coordinate and y-coordinate, while subsequent fields contain the values of the user-selected environmental parameters. The files can be easily read in for example, R and subsequently used in other models / functions.

Maxent expects the n-s and e-w resolution to be the same. Following the grass gis convention, the resolution of an exported raster is determined by the region settings. So make sure to set the resolution of the region so that the n-s and e-w resolution match. To accomplish this, you can use (replaced the *** for the desired resolution):

g.region -a res=***

Alternatively, you can set the -e flag. This will run g.region for you, adjusting the resolution so both the ns and ew resolutionn match the smallest of the two, using nearest neighbor resampling.

This addon is a vector-based alternative to r.out.maxent_swd. It can be more efficient with sparse data points. The main difference is that with this addon you can have more than one sample point per raster cell. But note that you can use the -t flag to thin the point layer so that there is never more than 1 point per raster cell. Another difference is the option to export the predictor raster layers to a user-defined folder. This can be used in Maxent, Maxnet addon for R or other software.

EXAMPLES

The examples below use a dataset that you can download from here. It includes vector point layer with observation locations of the pale-throated sloth (Bradypus tridactylus) from GBIF, a number of bioclim raster layers from WorldClim, the IUCN RedList range map of the species, and a boundary layer of the South American countries from NaturalEarth.

The zip file contains a GRASS location. Unzip it and put it in a GRASS GIS database. Next, open GRASS GIS and go to the mapset southamerica. Download the zip file, and unzip it in a GRASS GIS database.

v.maxent.swd -t species=Bradypus_tridactylus \
 evp_maps=bio02,bio03@southamerica,bio08,bio09,bio13,bio15,bio17 \
 evp_cat=sa_eco_l2 alias_cat=landuse nbgp=10000 \
 bgr_output=maxentinput/bgrd_swd.csv \
 species_output=maxentinput/spec_swd.csv \
 export_rasters=maxentinput/envlayers

The output is a folder maxentinput with the SWD files bgrd_swd.csv and spec_swd.csv and the accompanying proj files. The latter provide information about the CRS, which might be useful if you want to import the point layers in another software tools. In addition, the example code creates the raster layers of the environmental layes in ascii format in the folder envlayers.

The created data layers can be used as input for Maxent. Alternatively, you can use it as input for the r.maxent.train addon, which provides a convenient wrapper for the Maxent software.

SEE ALSO

REFERENCES

AUTHOR

Paulo van Breugel, paulo at ecodiv.earth

HAS green academy University of Applied Sciences
Innovative Biomonitoring research group
Climate-robust Landscapes research group

SOURCE CODE

Available at: v.maxent.swd source code (history)

Latest change: Monday Jun 24 08:16:48 2024 in commit: 8939a985d18de5366340b88037ab0fe3a0814c9b


Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.1dev Reference Manual