Plugins
Insensa-GIS is built around a plugin system. Plugins extend the core with new file formats, statistical operations, viewers and complete analytical workflows. They come in two flavours: Java plugins and R plugins.
Two ways to write a plugin
Java plugin
Implement IPluginExec and friends, register the
plugin in extensions.xml, package as a JAR.
Best for tight integration with the domain model and for
performance-critical loops.
R plugin
Write an R script, declare the settings UI with
insensa::uiAddBoolean /
uiAddInputNumeric / etc. — the Swing dialog is
generated for free. Read inputs with getVar,
send outputs back with addVar.
Available plugins
The plugins below are maintained as part of the official collection at insensa-gis-plugins.
Java plugins
-
ASCIIExporter
Export raster files as ASCII with the geographic information saved in XML.
-
CumulativeFunction
Calculates a generalised density raster by assigning the mean value of surrounding pixels. Repeating increases generalisation.
-
JenksOptimalBreaks
Classification using Jenks natural breaks.
-
ScatterPlotViewer
Display scatterplots between two raster files. Drag & drop inputs, optional linear trendline and formula.
-
ShapeFileViewer
Render vector shape files.
-
ShapeToGeoTiffOption
Rasterise shape files into GeoTIFFs.
-
ViewerHtmlSortedDataTable
Combine information from different functions and files in a sorted HTML table. Save as HTML or CSV.
R plugins
-
r-climate-import
Import Worldclim climate data as GeoTIFF directly into your Insensa workspace.
-
r-gbif-occurrence-data
Pull occurrence records for a species from GBIF, ready to feed into species-distribution workflows.
-
r-maxent-sdm
Fit a MaxEnt species-distribution model on raster predictors and produce a suitability map. Pairs with
r-climate-importandr-gbif-occurrence-datafor an end-to-end SDM pipeline. -
r-crop-raster
Crop a GeoTIFF to a given extent.
-
ROpenStreetmap
Plot OpenStreetMap tiles as a base layer.
Write your own plugin
The fastest way to ship a custom analysis is an R plugin —
a single script with a few uiAdd* declarations is enough.
library(insensa)
insensa::uiAddInputNumeric("digits",
displayText = "Decimal digits",
defaultValue = 3,
global = TRUE)
insensa::uiAddBoolean("includeNA",
displayText = "Count NA",
defaultValue = FALSE)
if (!insensa::isActive()) {
rasterFile <- "/path/to/test.tif"
}
insensa::iget("raster", attach = TRUE)
r <- raster(rasterFile)
digits <- insensa::getVar("digits", default = 3)
includeNA <- insensa::getVar("includeNA", default = FALSE)
insensa::addVar(round(cellStats(r, "mean", na.rm = !includeNA), digits),
"mean_value")
The R helper package insensa lives on Bitbucket at
dbiber/r-insensa.
A CRAN release is planned (the package itself is ready) — until
then, install with
devtools::install_bitbucket("dbiber/r-insensa").
For Java plugins, see the development guide in the plugin repository.