mappingAS (development version)
- Network examples (
\donttest{}) skip the multi-year habitat-trend reads or use a single species, soR CMD check --as-cran, which runs them, stays as fast as before the trend was introduced.
mappingAS 1.15.0
Bug fixes
-
iucn_category_B(),iucn_category_B_range()andiucn_criterion_B()now raise the EOO to the AOO when it is smaller (IUCN Guidelines sect. 4.10), so a few clustered points no longer receive a CR B1 flag from a tiny hull. -
iucn_criterion_B()writes the code in the official notation, repeating the sub-criteria per axis ("EN B1ab(iii)+2ab(iii)"instead of"EN B1+2ab(iii)"). -
calc_locations(method_protected = "no_more_than_one")counts nested or overlapping protected areas (e.g. a park inside an APA) once, using the smallest set of areas that holds every inside occurrence. -
calc_aoh(),map_aoh()andfragment_habitat()with the defaultyear = NULLnow use the latest year of the product instead of failing silently toNAwhen nosrcis given.
Improvements
-
calc_aoo()andcalc_locations()are reproducible: grid translations follow a deterministic lattice instead ofrunif(), so no seed is needed. -
iucn_category_B()is vectorised (works on whole summary columns). - Internal grid and elevation-mask code deduplicated.
-
Continuing decline (b(iii)) is now inferred from the habitat trend.
assess_species()measures the natural area of the range at six years over the lastdecline_years(new argument, default 10) and infers a decline only when the linear slope is negative and significant (p < 0.05). Before, any converted pixel in the range triggered the inference, which madeassume_decline = FALSEineffective in converted landscapes. The slope and its p-value are returned ashabitat_trend_pct_yrandhabitat_trend_p. -
calc_aoh()reads land cover withinmax_pixels: large MapBiomas windows are decimated on read instead of streamed at native resolution, and the majority (modal) aggregation, which under-counted fragmented habitat, was replaced by unbiased nearest-neighbour sampling. - Ranges crossing the antimeridian:
laea_crs()uses the circular mean longitude andcalc_eoo()builds the hull on the short side of the globe. -
assess_species(fire = TRUE, initiative = "auto")skips fire per species outside Brazil instead of querying MapBiomas Fire for them. -
calc_aoo()andcalc_locations()now test 100 grid offsets by default (cheap with the deterministic lattice, and closer to the true minimum).
mappingAS 1.14.0
-
Full-criteria analyses assimilated from sRedList (Cazalis et al. 2024), keeping Criterion B as the focus and computed entirely from the data mappingAS already produces. Three new analyses were added, each as an exported function and a dedicated Shiny tab, and the Shiny app was reorganized so the Assessment (formerly Results) tab now comes at the end of the workflow, just before Report and Methods:
-
countries_of_occurrence()derives the countries of occurrence (each flagged Extant / Possibly Extant) and an approximate biogeographical realm by intersecting the range with the Natural Earth country base map (needs the newrnaturalearthsuggestion). These are the required / recommended Red List supporting fields. -
aoo_bounds()brackets the AOO between a lower bound (the occurrence-based occupied cells) and an upper bound (the Area of Habitat — the natural/suitable habitat within the EOO, capped at the EOO), following Brooks et al. (2019), and returns the resulting B2 category range so the diagnosis reports the uncertainty explicitly. -
assess_fragmentation()clusters occurrences into subpopulations by a user-set isolation distance and quantifies the share of the population in small subpopulations (a screening proxy after Santini et al. 2019), to guide severe fragmentation (sub-criterion a). It is never ticked automatically — the judgement stays with the assessor. -
iucn_category_B_range()combines the fixed EOO (B1) with the bracketed AOO (B2) into the plausible range of screening categories under uncertainty (size only), surfaced on the new Assessment tab.
-
-
Elevation preferences and an elevation-refined Area of Habitat. Two more functions bring the sRedList elevation step (and the AOHr-style AOH) into the package, reading a DEM only over the EOO/AOO extent (windowed) via the new optional
elevatrsuggestion (AWS Terrain Tiles, no account) or a user-supplied DEM:-
elevation_preferences()extracts the elevation of each occurrence and suggests the species’ elevation limits (min rounded down, max rounded up to the nearest 100 m, as sRedList does). -
calc_aoh()computes the Area of Habitat as the suitable (natural) land cover within the range, optionally masked to an elevation band, reusing the package’s own land-cover backends andsummarise_conversion(). On the Habitat & AOO tab the elevation-refined AOH replaces the plain natural-habitat proxy as the habitat-based upper AOO bound, sharpening the B2 category range. Both degrade gracefully toNAwhen a DEM or land cover is unavailable.
-
-
AOO upper bound at the 2 km reference scale, population size and AOH validation.
calc_aoh()now also returnsaoo_upper_km2- the AOH rescaled to the IUCN reference scale (the 2 x 2 km cells that intersect the suitable habitat, IUCN 4.10.7 condition iii) - which the Habitat & AOO tab uses as the AOO upper bound instead of the raw habitat area. It returns two validation metrics (Lumbierres et al. 2022):model_prevalence(suitable share of the range) andpoint_prevalence(occurrences inside the habitat, from a newpointsargument). The tab adds a population-size panel (AOH x density, with a density calculator: density in occupied habitat x % mature x % of suitable habitat occupied, and low-high ranges) for criteria C/D. -
Richer, guideline-aligned Area-of-Habitat definition. On the Habitat & AOO tab a ‘Choose from land cover’ window lists the land-cover classes actually present in the species’ range (with area and %), where each is marked suitable or marginal / unknown - so habitat is chosen from what is really there (IUCN 4.10.7 condition i). Marginal classes add a broader AOH, so
calc_aoh()now returns an AOH range (aoh_km2strict toaoh_max_km2) via a newmarginal_codesargument. A % of habitat occupied input scales the potential habitat down to occupied habitat for the AOO upper bound (condition ii), and a note explains conditions i/ii/iii (validation, occupancy, reference scale) for using habitat maps to inform AOO/EOO. -
Guideline-compliant severe fragmentation from habitat and density.
fragment_habitat()implements the IUCN method (Santini et al. 2019, as in sRedList): it splits the Area of Habitat into patches, groups patches closer than the isolation/dispersal distance into subpopulations, and sizes each in mature individuals (habitat area x density, dropping subpopulations below two individuals). It returns the fragmentation curve and median subpopulation size, plus the largest subpopulation’s size (Criterion C2a(i)) and its share of the population (C2a(ii)), and flags severe fragmentation when >50% of the population is in small, isolated subpopulations. On the Fragmentation tab, entering a density (mature individuals per km^2; a range like3-8is accepted) switches from the occurrence-count proxy to this habitat-and-density method, reusing the suitable classes and elevation band from the Habitat & AOO tab.assess_fragmentation()(occurrence proxy) is kept for when no density is available. -
Interactive maps for the new analyses.
map_aoh()draws the Area of Habitat (the suitable land-cover classes within the EOO, optionally masked to the elevation band) as a green Leaflet overlay with the EOO hull and the occurrence points; on the Habitat & AOO tab a class picker lets the assessor choose which land-cover classes count as habitat (default: every natural class), and both the AOH area and the map use that selection. The Fragmentation tab now maps the subpopulation clusters alongside the fragmentation curve.calc_aoh()gained asuitable_codesargument so the measured AOH can be restricted to specific classes. -
Inferred population size on the Assessment tab and in the report. The Area of Habitat times a user-supplied density (a low-high range is accepted) gives an inferred number of mature individuals; it now appears on the Assessment tab for the assessed species and, via a new optional
populationargument toassessment_report(), as a “Population size (inferred)” section of the html/text/docx report. It is framed as an inferred, screening-level figure that informs Criteria C and D. -
% of habitat occupiedderived automatically. On the Habitat tab the occupancy correction (IUCN 4.10.7 condition ii) is now read from the point prevalence (the share of occurrences falling in the suitable habitat thatcalc_aoh()returns) and shown read-only, instead of a manual field, and the suitable-class picker is collapsed into an accordion. The tab is renamed from Habitat & AOO to Habitat. - Severe fragmentation feeds the Assessment automatically. When the Fragmentation analysis suggests severe fragmentation for a species, the “Severely fragmented” box on the Assessment tab is ticked for it (feeding sub-criterion a and the report); the assessor can still override it.
- Windowed, memory-safe elevation reads. The digital elevation model is now fetched with a zoom capped by the requested area, so a wide-ranging or montane species no longer pulls a multi-gigabyte terrain mosaic that could exhaust memory. The AOH and fragmentation habitat reads reuse this bounded DEM.
-
Add-points map fixes. Clicking the Add points map now drops the point exactly under the cursor (the page-wide CSS
zoomthat desynchronised Leaflet’s click coordinates was removed; use the browser’s own zoom for a compact view), points can be dragged to reposition them, and dragging no longer also drops a spurious extra point. - Reliable interactive-map HTML download. “Download map (HTML)” now writes a genuine self-contained page: it uses pandoc when available and otherwise inlines the widget’s scripts and styles, instead of emitting an unusable stub when pandoc is missing.
- Time-series step floor. The land-cover time-series step is now a minimum of five years (a finer step is not reliably available), enforced in the UI and on the server.
- Clearer AOO-bounds chart. The lower/upper AOO bounds are shown on a labelled CR/EN/VU category ruler rather than raw log bars.
mappingAS 1.13.2
CRAN release: 2026-09-26
-
Criterion B category now tracks the number of locations (ConR-aligned).
iucn_criterion_B()was reworked so the applied category follows the same selection logic as ConR’scat_criterion_b()(Dauby et al. 2017): the estimated number of locations caps the category through sub-criterion (a), so a range whose EOO/AOO size alone would be CR or EN but that is spread over, say, eight locations is returned as VU (≤ 10 locations), not EN. The category is the less threatened of the size-implied and location-implied levels. -
Continuing decline (b) is now assumed present by default. Previously an undocumented decline was treated as not met, so a taxon that met a size threshold and had few locations still collapsed to NT unless the assessor supplied
decline = TRUE. Following ConR — and because mappingAS is built around habitat-conversion data, which is direct evidence of a continuing decline in the area/quality of habitat (sub-criterion b(iii)) — a continuing decline is now assumed when it is not documented. A small-range, few-location taxon is therefore reported at its CR/EN/VU size-and-location level instead of NT, giving a result that is more consistent with the IUCN thresholds. Set the newassume_decline = FALSE(inassess_species()oriucn_criterion_B()), ordecline = FALSE, to restore the strict “NT until a decline is documented” screening. A newdecline_assumedcolumn in the summary flags every species for which (b) was assumed rather than documented, and the report/Shiny app label the assumption honestly. -
Continuing decline (b) inferred from the measured habitat loss. When a decline is not documented,
assess_species()now infers it from the conversion data instead of merely assuming it: if land cover ran and the range holds any converted (anthropic) area, sub-criterion b(iii) (continuing decline in the area/quality of habitat) is taken as met and recorded asdecline_basis = "inferred (habitat loss)". This has explicit IUCN backing — the Guidelines (v16, §4.6 and the evidence table in §3.1) allow a continuing decline in habitat to be inferred “from rate of habitat loss” under B1b/B2b, at any rate (there is no magnitude threshold for continuing decline under Criterion B; only Criterion C1 has one). The newdecline_basiscolumn distinguishes"documented","inferred (habitat loss)","assumed"(the ConR-style global fallback, used only when no conversion is available) and"not documented"; the written report cites the inference. Disable withinfer_decline_from_habitat = FALSE. -
Proper IUCN code notation for the declining element. Following Section 6 of the guidelines (e.g. the worked example
EN B1ab(v)), the Criterion B code now carries the roman-numeral element of the continuing decline. When (b) is inferred from habitat loss the code reads e.g.EN B1ab(iii)— b(iii) being the continuing decline in the area, extent and/or quality of habitat.iucn_criterion_B()gains adecline_detailargument for this; it defaults to none, so an unqualified code such asVU B2abis unchanged. - Shiny Results tab: the sub-criteria buttons start on the automatic result. When a species is selected, the (a)/(b)/(c) checkboxes are pre-checked to match what the assessment computed, and the category badge reflects them - so the buttons show the result rather than an empty form. The assessor keeps full control: clearing a sub-criterion (e.g. continuing decline) overrides it and can drop the taxon to NT/LC live, and re-checking the automatic state restores the computed category. Overrides flow through the table, CSV, report and factsheet; a fresh assessment resets them.
-
Chart and map polish. The composition / protection bar charts use fixed 0-100 breaks with a small right-side margin so the “100” axis label is no longer clipped, and their in-bar percentage labels are now placed at each segment’s own midpoint (previously
geom_text()+position_stack()could drop the labels onto the wrong segment on a horizontal bar). The species-name box on the map is a singleinline-blockchip that stays on one line and now sits behind the whole name, and the donut download button reads “Save donut (PNG)”. - More compact app. The Shiny UI now renders at an 80% base zoom so the whole page fits without having to zoom the browser out manually (reset the browser to 100%).
-
CRAN compliance (graphical parameters). The Shiny app no longer leaves the user’s
par()state modified: the time-series PNG download handler saves and restores it withon.exit(graphics::par(oldpar)), addressing the CRAN review note aboutinst/shiny/app.R. -
CRAN compliance (options and CRAN Cookbook review). Reviewed the package against the CRAN Cookbook:
run_app()now restores the user’sshiny.maxRequestSizeoption withon.exit(options(old))when the app closes; all remaining non-ASCII characters were removed from the R source (they were in comments and one roxygen line); and the copyright-holder role (cph) was added toAuthors@R. -
Smaller package tarball. An unused 3.8 MB
man/figures/logo1.png(the README usesfeatured_Resultado.png) is now excluded from the build via.Rbuildignore, bringing the package well under the 5 MB CRAN guideline. -
No temp-directory detritus. Examples that write a file to
tempdir()(export_ranges(),map_static(),assessment_report(),factsheet_html()) now remove it again, soR CMD checkleaves no files behind. - Basemap fix (map tiles). The distribution maps (both in the app and the factsheet) switched away from the OpenStreetMap volunteer tile servers, which now block embedded use (“Access blocked”, HTTP 403). The “Light” basemap now uses key-free Esri World Street Map tiles, matching the Esri World Imagery “Satellite” layer that was already used.
-
Chart download fix (Conversion and Protected-areas PNGs). Stacked composition / protection bars that sum to exactly 100% no longer lose their top segment when saved to PNG: the x-axis is now clipped with
coord_cartesian()instead of scale limits, which was dropping the out-of-bounds segment. - Trend analysis. Dropped the “(ggtrendline)” tag from the tab heading and added per-extent PNG downloads for the EOO and AOO trend charts.
- Fire tab now covers both extents. The Fire tab evaluates the burned-area series for BOTH the EOO and the AOO (one chart above the other, plus a combined table), mirroring the Time series tab, and both series feed the report.
-
Applied Criterion B flows to the report and factsheet. The sub-criteria set on the Results tab (which determine the applied Criterion B category) are now carried into the report narrative, the
.docx, and the HTML factsheet, via newapplied_category/applied_codearguments toassessment_report()andfactsheet_html(). -
Factsheet supporting information. Replaced the “System” field with “Life Form” and “Substrate”.
factsheet_html()gainslife_formandsubstratearguments (thesystemargument is removed). -
Consistent factsheet map + crisper figures. The interactive and static factsheet maps now show the same layers (driven by the assessment settings), and embedded charts (HTML factsheet and Word report) render through a high-quality device (
ragg/ cairo when available), fixing the previously unformatted figures.
mappingAS 1.13.1
-
CRAN compliance. Addressed the CRAN reviewer feedback:
- Examples no longer use
\dontrun{}. Executable examples run directly (offline, using the bundled data withmapbiomas = FALSE); examples that read data over the network (MapBiomas, WDPA) use\donttest{}; and interactive-only entry points (run_app(),mas_plotly()) useif (interactive()){}. - No function writes to the user’s home/working directory by default:
export_ranges()now defaultsdir = tempdir()(pass an explicit path to keep the files), and every example that writes a file writes it undertempdir().
- Examples no longer use
-
Real example dataset.
inst/extdata/example_occurrences.csvnow ships 29 real herbarium/occurrence records of three campo-de-altitude species from the Serra dos Orgaos / Serra da Mantiqueira region (Prepusa hookeriana, Prepusa connata, Worsleya procera), replacing the previous synthetic points, so the examples screen a realistic multi-species dataset.
mappingAS 1.13.0
-
Estimate of number of subpopulations and number of locations. Two new exported functions,
calc_subpop()andcalc_locations(), add the remaining spatial pieces of an IUCN Criterion B screening.calc_subpop()estimates the number of subpopulations with the circular-buffer method (a circle around each occurrence, dissolved; disjoint polygons are counted), using a default radius of one tenth of the maximum distance between occurrences (Rivers et al. 2010).calc_locations()estimates the number of locations as the number of occupied cells of a 10 km grid, taking the minimum over randomly translated grids (the most conservative estimate). Both work on the same data-centred equal-area projection as the EOO/AOO.-
calc_locations()also mirrors ConR’s protected-area integration: pass a protected-area layer (e.g. fromprotected_areas()) and occurrences inside protected areas are decoupled from those outside, because a single threat is not assumed to affect both alike.method_protected ="no_more_than_one"(default) counts each protected area holding occurrences as one location;"other"grids the inside and outside groups separately and adds them. - The locations grid cell can be a fixed size (
loc_km/grid_km, default 10 km) or a species-specific sliding scale (loc_scale/cell_scale), a fraction of the maximum distance between occurrences (Rivers et al. 2010). -
assess_species()now reportsn_subpopandn_locationsin itssummary(andsubpop/locationsdetails), controlled bysubpop,subpop_resol_km,loc_km,loc_scaleandloc_method. Whenprotected = TRUEthe location count automatically decouples protected areas. The written report and the factsheet show the two estimates when available. - The Shiny app surfaces the estimates too: a Locations grid (km) control and, under Overlap with Protected areas, a protected-area method selector; the two estimates appear as columns in the results table and CSV, as a dedicated overview card, and as glossary entries.
- These methods follow the spatial rationale popularised by the ConR package (Dauby et al. 2017, Ecology and Evolution, doi:10.1002/ece3.3704, https://github.com/gdauby/ConR), which is cited for the idea. The implementation is independent, clean-room mappingAS code (ConR is GPL, mappingAS is MIT; no ConR source was used).
-
mappingAS 1.12.0
- Add occurrence points by hand (Shiny app). A new Add points tab lets you click on a map to drop occurrence points - on top of an uploaded table, or entirely from scratch with no file at all. Uploaded points show in grey for reference, added points in green; type a species name (or pick an existing one), enter coordinates directly, and undo/clear or download the added points as CSV. Pressing Assess now runs on the uploaded occurrences plus every point added by hand (or only those points when no file is uploaded). The file upload is now optional.
-
Automatic vouchers in the factsheet.
vouchers_from_occ()(exported) derives the “Examined vouchers” list from the occurrence table’s own columns: a ready-madevouchercolumn if present, otherwisecollector+collectorNumber(with a herbarium /institutionCodecode added in parentheses). In the app the vouchers box is filled automatically for the selected species and refreshed when you switch species, without overwriting text you typed yourself; a Load vouchers from table button reloads on demand. Column names are matched case-insensitively from common Darwin Core and herbarium aliases.
mappingAS 1.11.7
-
Data-driven “Threats and continuing decline”. The synthesis paragraph in the report (HTML, text and
.docx) and the factsheet no longer asserts generic drivers (“irreversible urban expansion”, “azonal habitat”). It now names the actual pressures found for the species - the dominant anthropic land-cover classes within the EOO (with their share) and, when the fire module was run, the burned fraction of the EOO - and the section is omitted when there is no such evidence to report.
mappingAS 1.11.6
-
Factsheet map, distribution map and time-series charts. The factsheet map is now the interactive Leaflet map by default (
map_interactive = TRUE) - the same self-contained widget the Maps tab downloads via Download map (HTML), inlined in an iframe - with the staticmap_static()image as a fallback (map_interactive = FALSE); toggle the whole map off withmap = FALSE. Once a land-cover / fire time series has been calculated for the species, the composition-over-time and burned-area-per-year charts are embedded too. - “Top anthropic activities” chart now covers the EOO and the AOO. The grouped bar chart shows both extents’ share for each leading anthropic land-cover class, and the same classes are listed, per extent, inside the Habitat-conversion notes.
- Land use and conservation units filled in from the package. In the factsheet these are derived automatically - land use from the anthropic land-cover classes within the EOO (Conversion), conservation units from the overlapping protected areas (Protected areas) - and can still be overridden with free text.
- Clearer factsheet charts. The habitat-composition and protection charts are drawn from the summary percentages, so both the EOO and AOO bars are always complete and every value label sits on its own colour. The assessment notes are rendered as a single block of bullet points.
-
Key-free basemap.
map_species()now uses OpenStreetMap for the light basemap (the CartoDB Positron layer had started requiring an API key) and no longer clips the species-name label at the edge of the map.
mappingAS 1.11.5
-
New species factsheet (
factsheet_html()) in the Report tab. Builds a single, self-contained HTML page - the kind hosted on a supplementary website- that combines everything the assessment already computes (EOO/AOO metrics and provisional Criterion B category, habitat conversion, fire and protected-area overlap, the composition/protection/time-series charts and the interpretive narrative) with details the package cannot know and that the user fills in: the taxonomy (Family, Genus, Authority), the supporting-information block (Countries, System, Habitat, Biome, Vegetation), free-text land use and conservation units, a list of examined vouchers and a taxonomic reference (a Reflora / POWO link, or - for a newly described taxon - the article citation). Up to four photographs are embedded, each watermarked in its lower-right corner with the owner name.
-
Distribution map and time-series charts in the factsheet. The factsheet embeds the distribution map (occurrence points, EOO, AOO and land cover) and, once a land-cover / fire time series has been calculated for the species, the composition-over-time and burned-area-per-year charts. The map is embedded as the interactive Leaflet map by default (
map_interactive = TRUE) - the same self-contained widget the Maps tab downloads via Download map (HTML), inlined in an iframe so the factsheet stays a single portable file - with the staticmap_static()image as a fallback (or viamap_interactive = FALSE). Toggle the whole map off withmap = FALSE. - “Top anthropic activities” chart. The factsheet adds a horizontal bar chart of the leading anthropic land-cover classes threatening the species (top 5 by area within the EOO by default), derived from the per-class land-cover breakdown.
-
Self-contained output. Images and charts are inlined as base64 data URIs (via a dependency-free base-R encoder), so the downloaded
.htmlopens offline and can be published as-is (e.g. on GitHub Pages). The Report tab gains a form for the fields above, photo upload (with a watermark owner name), an on-demand preview and a Download factsheet (.html) button.
mappingAS 1.11.4
-
CRAN resubmission. Single-quoted the software, service and data-product names in the
DESCRIPTION('MapBiomas','Esri','Impact Observatory','Sentinel-2','ArcGIS','GDAL','Google Earth Engine','GeoPackage'), as requested in the CRAN pretest review. No user-facing changes.
mappingAS 1.11.3
-
Time Series tab now shows EOO and AOO together. The extent radio button (choose EOO or AOO) is gone: a single Calculate series run computes both extents and stacks the two land-cover charts one above the other, each with its own altered-area (anthropic) analysis box. The results table and the Download series (CSV) export now carry both extents (tagged with a
rangecolumn), the Save image (PNG) export stacks both charts, and both series are fed into the written report automatically - so the EOO and AOO temporal trends both appear in the generated.docx/text assessment. -
New land-cover trend analysis (
plot_class_trendline()). For a chosen class or conservation group, the Time Series tab now fits and plots a regression of its percentage of area through time - with the fitted equation, R² and p-value - for each extent, using the ggtrendline package when installed (with aggplot2linear-fit fallback otherwise). A model selector (linear, quadratic, logarithmic, exponential, power) drives the fit. -
The written report now includes the per-class trends too. In addition to the EOO/AOO converted-fraction trend, the Habitat conversion section of the report (HTML, text and
.docx) now lists, per extent, the fastest-changing land-cover classes with the slope (percentage points per year), R² and p-value of a least-squares fit of class share on year - the textual counterpart of the Time Series tab’s ggtrendline analysis. - Downloadable trend table. The Time Series tab now shows a per-class regression table (slope pp/yr, R², p-value, first/last/delta, for EOO and AOO) with a Download trend table (CSV) button.
- ggtrendline is now cited in the app’s Methods tab and, when a class trend is included, in the report’s references.
-
Tidier report figures. The horizontal bar charts (composition, protection) embed shorter so they are no longer vertically stretched in the
.docx.
mappingAS 1.11.2
-
Interactive-map species label fixed. The species name shown on the map no longer wraps one character per line in a narrow control box; it is kept on a single line (
white-space: nowrap), with the genus/epithet still in italic.
mappingAS 1.11.1
-
Protected-area loading is more robust.
- The WDPA query is now downloaded with R’s own HTTP stack (curl /
download.file()) to a temporary file before being read, instead of relying onsf::st_read()opening the URL directly. Many GDAL builds (notably several Windows / older installs) lack the/vsicurlHTTP support that direct URL reading needs, so protected areas would come back empty on those machines while working on Linux/CI - this makes the fetch portable across platforms. - The reader assigns the GeoJSON default CRS (EPSG:4326) when the response leaves it unset, and discards non-spatial/empty responses instead of feeding them into
st_transform(), fixing the “cannot transform sfc object with missing crs” failure and its empty-bbox warnings. The same CRS guard is applied to localpa_srcfiles. - The Shiny app now also exposes an optional protected-area upload (GeoPackage/GeoJSON/shapefile
.zip) used instead of the online WDPA service - handy when the global service returns nothing or you are offline (e.g. a local ICMBio Conservation-Units layer for Brazil).
- The WDPA query is now downloaded with R’s own HTTP stack (curl /
-
GeoPackage download fixed. Exporting the EOO/AOO as a GeoPackage no longer fails with “more ‘from’ files than ‘to’”: the per-class breakdown is now stored as an aspatial table inside the
.gpkg(single self-contained file), andexport_ranges()returns a single path for that format. -
New “All” raster clip. The map (and every downloaded map / GeoTIFF export) can now clip the raster to
"all"- the union of the EOO and AOO - in addition to"eoo"and"aoo". -
Publishable (static) map polish. The scale bar now prints just the datum (e.g.
DATUM WGS84); the legend and scale bar are drawn without boxes; and the species name in the title is set in italic. - Scientific names are italicised consistently. Across the interactive and static maps, all charts (conversion, protection, donut, time series, fire) and the HTML/Word report, the genus and specific epithet are shown in italic while the naming authority (any word after them) stays in normal type.
mappingAS 1.11.0
-
Global Sentinel-2 fallback for ranges outside MapBiomas. When a species’ occurrences fall outside every supported MapBiomas country,
assess_species()can now quantify habitat conversion from the Esri / Impact Observatory 10 m Annual Land Use Land Cover product - the global, Sentinel-2-derived data behind the ArcGIS Living Atlas Land Cover Explorer (https://livingatlas.arcgis.com/landcoverexplorer/). Like MapBiomas, it is streamed as public Cloud-Optimized GeoTIFFs via GDAL/vsicurl/- no Google Earth Engine and no account. Two ways to use it:-
assess_species(occ, initiative = "auto")tries MapBiomas first and falls back automatically to Sentinel-2 wherever MapBiomas has no data. This is also on by default (fallback = "sentinel2") for any MapBiomas initiative, so an out-of-coverage species no longer returnsNA- setfallback = "none"to restore the old behaviour. -
assess_species(occ, initiative = "sentinel2")forces the global layer everywhere (aliases:"esri","s2","global", …). The 9-class product is mapped to the same conservation groups as MapBiomas (Trees/Rangeland/Flooded vegetation = natural; Crops/Built area = anthropic; Water excluded; Bare ground/Snow/Ice excluded as ambiguous; Clouds = not observed), so conversion percentages, per-class tables, donut charts, maps and the written report all work unchanged. New helpers:esri_legend(),s2_source_url(),s2_raster_local()ands2_years()(2017-2023). The product actually used is recorded per species in themapbiomas_initiativecolumn of$summary.
-
mappingAS 1.10.0
-
Paraguay and Uruguay added.
assess_species()(and the whole pipeline) now acceptsinitiative = "paraguay"(MapBiomas Paraguay, Collection 2, 1985-2023) andinitiative = "uruguay"(MapBiomas Uruguay, Collection 1, 1985-2022). Both are streamed as annual Cloud-Optimized GeoTIFFs from the public MapBiomas bucket via GDAL/vsicurl/- no Google Earth Engine and no Google Drive - just like the other initiatives. Paraguay uses the integration-classification layout (paraguay/collection_2/mapbiomas_paraguay_collection2_integration_v1-classification_YYYY.tif) and Uruguay the coverage layout (uruguay/collection_1/coverage/uruguay_coverage_YYYY.tif). This supersedes the note in 1.9.0: MapBiomas has since published both products as per-year GeoTIFFs on the public bucket, so they can now be streamed the same way.mb_initiatives()now lists eleven products. -
Legend reconciled with the South-America harmonisation table. Verified
mb_legend()against the official standardised legend and closed two gaps: added the generic Non Vegetated Area class (code 22, group"other"), which some products emit at the parent level, and corrected the colour of Other Non Forest Formation (code 13) to the standard#d89f5c. A few class names were also aligned to the standard wording (codes 13, 68, 83). Conservation groups for the existing classes are unchanged.
mappingAS 1.9.0
-
Six more MapBiomas countries.
assess_species()(and the whole pipeline) now acceptsinitiative = "argentina","bolivia","chile","ecuador","peru"and"venezuela", in addition to"brazil","amazonia"and"colombia". All are streamed as annual Cloud-Optimized GeoTIFFs from the public MapBiomas bucket via GDAL/vsicurl/- no Google Earth Engine and no Google Drive. The registry handles each product’s file layout (coverage/<country>_coverage_YYYY.tif, Peru/Venezuela’s..._integration_v1-classification_YYYY.tif, Argentina’s hyphenatedcollection-2, and Chile’s collection-lesschile/coverage/path). Year spans follow each product: Chile is 2000-2022 and Venezuela (Collection 2) is 1985-2023; the others run 1985-2024.mb_initiatives()lists them all. Paraguay and Uruguay are intentionally not included: their annual maps are not published as per-year GeoTIFFs on the public bucket, so they cannot be streamed the same way (they would require Earth Engine). -
Standardised legend extended to all of South America.
mb_legend()gains the country-specific classes from the pan-continental harmonisation table - primary/secondary/dwarf forest (59, 60, 67), scrubland/open shrublands/steppe/ fog oasis/peatlands (66, 77, 63, 70, 73), other crops (72), Pinus/Eucalyptus/ other forest plantations (79, 80, 83) and salt flat (61) - so a range that spans several countries is still assessed on one coherent legend. The existing Brazil/Amazonia/Colombia codes, names, colours and groups are unchanged; a code absent from a given raster contributes zero area. -
Protected areas: WDPA only. The Brazilian ICMBio/SNUC Conservation-Unit source has been removed - the exported
icmbio_wfs_base()andprotected_layers(), the WFS reader, and the bundleducs_federais.rdsdata are gone. Protected-area overlap (assess_species(protected = TRUE)) now always uses the global World Database on Protected Areas (WDPA), so it works the same way everywhere; a localpa_srcfile still overrides it for offline use.assess_species()drops thepa_source/pa_typenamearguments, andprotected_areas()now reads WDPA (or a local file) instead of the ICMBio WFS. The Shiny app drops the protected-area source selector and lists all nine initiatives, and the written report cites WDPA instead of ICMBio/INDE.
mappingAS 1.8.1
-
MapBiomas beyond Brazil: Pan-Amazon and Colombia.
assess_species()(and the whole pipeline) gains aninitiativeargument -"brazil"(default),"amazonia"(Pan-Amazon / RAISG, Collection 6, 1986-2023) or"colombia"(Collection 3, 1985-2024). All three products are streamed as annual Cloud-Optimized GeoTIFFs from the public MapBiomas bucket via GDAL/vsicurl/- no Google Earth Engine and no Google Drive download. Colombia is served per-year on the same public bucket (initiatives/colombia/collection_3/coverage/), so it reads exactly like Brazil (windowed, cached) rather than through the multi-band Drive archive. A new exportedmb_initiatives()lists the products, their default collections and year spans;mb_source_url(),mb_raster_local(),mb_years(),mb_legend(),summarise_conversion()andcover_timeseries()all take theinitiativeargument.year/collectionnow default to the initiative’s latest year and native collection when leftNULL. -
Standardised pan-MapBiomas legend.
mb_legend()now returns a single standardised legend that labels the Brazil, Amazonia and Colombia rasters consistently (same class names, colours and conservation groups), built from the cross-product harmonisation table. The Colombia/Amazonia-specific classes are added - Andinean herbaceous/shrubby formations (81, 82), Glacier (34), Other natural non-vegetated area (68) and Banana (74) - so a species whose range spans more than one country is assessed on one coherent legend. Existing Brazil codes, names, colours and groups are unchanged. -
Global protected areas via WDPA. New
wdpa_areas()reads the World Database on Protected Areas from its public ArcGIS FeatureServer (bounding-box query, GeoJSON, on-disk cached), standardised to the samepa_name/pa_category/pa_groupcolumns as the ICMBio layer, with IUCN categories mapped to strict-protection (Ia-III) vs sustainable-use (IV-VI).assess_species()gainspa_source("icmbio"or"wdpa"); it defaults to ICMBio for Brazil and WDPA for the Amazonia/Colombia initiatives, so protected-area overlap now works outside Brazil. - The assessment
summarygains amapbiomas_initiativecolumn and the storedsettingsrecord theinitiativeandpa_source; the Shiny app adds an initiative selector (with the Year list auto-updating to the product’s span) and a protected-area source selector, and threads both through the map overlay, static map, time series and raster export. MapBiomas Fire remains Brazil-only and is skipped with a warning for the other initiatives.
mappingAS 1.8.0
-
MapBiomas composition donut charts. The Conversion tab now shows, below the natural/altered bar, twin donut (ring) charts of the MapBiomas composition inside the EOO and AOO - switchable between the full per-class breakdown (
By class) and the conservation-group summary (By group) - in the official MapBiomas colours. New exportedplot_conversion_donut()function; both the interactive (plotly) view and theSave donutbutton export a transparent-background PNG. - Results tab redesign. Beyond the table, the Results tab now shows a visual overview for the selected species — stat cards with in-cell bars for EOO/AOO, provisional category badges, converted/natural, burned and protected-area percentages — plus a collapsible column glossary explaining every field (bilingual EN/PT).
-
Export MapBiomas rasters. The Map tab can now download the MapBiomas land-use and/or fire (accumulated) GeoTIFF rasters, clipped to the selected species’ EOO or AOO, bundled as a
.zip. -
Faster remote reads. Tuned the GDAL
/vsicurl/configuration (bigger block cache, HTTP/2 multiplexing, larger chunked range requests, threaded decompression) to speed up the MapBiomas streaming reads during assessment. This only affects I/O speed — pixel values and area statistics are unchanged. -
Written assessment report. New
assessment_report()builds a narrative, referenced summary of a species’ Criterion B screening (range metrics, provisional category, and — when computed — habitat conversion, fire and protected-area overlap), with the IUCN/GeoCAT/MapBiomas references. It returns HTML, plain text, or a Word.docx(via ). A new Report tab in the Shiny app (after Fire) previews the text and downloads the.docx. - The report is now interpretive, not just a restatement of numbers: it discusses the EOO/AOO composition divergence, the effectiveness of the protected-area overlap (strict-protection vs sustainable-use units and the concentration of occurrences in few units), and frames continuing decline (subcriterion b) honestly at the level of habitat quality. New
cover_series/fire_seriesarguments add a temporal-trend analysis of conversion and of the fire regime; the app passes these automatically when the matching Time series / Fire series have been calculated. - The temporal analysis covers both the EOO and the AOO and is now accumulated passively:
cover_series/fire_seriesaccept a list of per-range series (each reported separately, not summed), and the app’s Report tab collects every Time series / Fire series you calculate for the species (EOO or AOO) — no dedicated button and no extra computation on the Report tab. Withfigures = TRUE(used by the app’s.docxdownload), the report also embeds the support figures (composition, protection, and the land-cover/fire time series) via . -
Faster map overlay. The MapBiomas layer drawn on the interactive map is now read decimated via GDAL (
-outsize, using the raster overviews) instead of streaming the full 30 m window, which markedly speeds up the map for large-range species. It falls back to the previous native read on any error, and area/conversion statistics are unaffected (they still use the native read). -
Interactive charts. The conversion, protection, land-cover and fire time-series charts are now interactive in the Shiny app (hover tooltips, zoom, pan) via a new exported helper
mas_plotly(), which wraps any mappingASplot_*ggplot into a widget and preserves the chart subtitle in the title.plot_conversion()andplot_protection()now return aggplotobject (with the percentage matrix kept inattr(p, "pct")); a base-graphics fallback remains when is unavailable. - All four charts share a single minimal theme (
.mas_theme()) so the static PNG exports and their interactive versions look consistent. -
ggplot2andplotlymoved toImports(previouslyggplot2was a suggestion); PNG downloads of the conversion/protection charts now useggplot2::ggsave(). - Prettier tables. Every table in the Shiny app now uses a shared style (compact striped rows, numerics rounded to two decimals, and an in-cell colour bar on percentage columns) for quicker reading.
mappingAS 1.7.0
- Federal Conservation Units are now read from a bundled copy (
inst/extdata/ucs_federais.rds, full resolution) by default, so overlap works offline and does not depend on the (intermittent) ICMBio WFS. The WFS remains available and is used automatically as a fallback when the bundled data is not installed. Passpa_src=to use your own UC file. Source: ICMBio/INDE (PDDL). -
assess_species(protected = TRUE, mapbiomas = TRUE)reports the natural habitat that is also inside UCs (effectively protected):eoo_nat_uc_pct/aoo_nat_uc_pct(of the whole range) andeoo_nat_uc_pct_in/aoo_nat_uc_pct_in(of the UC area). Newplot_protection()charts this. - Fixed
plot_protection()failing to render in the Shiny “Conservation Units” tab on small plot areas (“invalid graphics state”): leaner margins, resilient margin annotations, and a taller plot panel.
mappingAS 1.6.0
- New module
R/protected_areas.Rintegrating Brazilian federal Conservation Units (Unidades de Conservacao, UCs) from the ICMBio geoservice on the INDE. Addedprotected_areas()(reads UCs intersecting an area of interest from the WFS, with a local-file fallback and on-disk cache),protected_layers()(lists the WFStypeNames),summarise_protected()(overlap metrics),pa_table()(per-species UC list) andicmbio_wfs_base(). -
assess_species()gainsprotected,pa_srcandpa_typename. Withprotected = TRUEthe summary now reportsocc_in_uc_pct(share of occurrences inside UCs),eoo_uc_pct,aoo_uc_pctandn_uc, and each species’detailstores the full UC overlap and layer. -
map_species()andmap_static()gainprotected/pa_srcto draw the UC polygons as a labelled layer. - New
plot_protection(): horizontal stacked bars (EOO and AOO) of the range inside vs outside UCs, mirroringplot_conversion(). - With
protected = TRUEandmapbiomas = TRUE,assess_species()also reports the natural habitat that is also inside UCs (effectively protected):eoo_nat_uc_pct/aoo_nat_uc_pct(of the whole range) andeoo_nat_uc_pct_in/aoo_nat_uc_pct_in(of the UC area).plot_protection()splits the inside-UC bar into natural vs altered when these are present. -
export_ranges()writes the UC fields (uc_pct,uc_occ_pct,n_uc) into the EOO/AOO attribute tables when available. - Shiny app: a “Overlap with Conservation Units (ICMBio)” option and a new “Conservation Units” tab (headline cards, protection chart, per-UC table and CSV/PNG downloads); the UC layer is added to the interactive map.
mappingAS 1.5.0
- Chart legends in the Shiny app (conversion, classes, time-series and fire tabs) now follow the app’s language selector. English is the default and is taken directly from the MapBiomas
class_encolumn inmb_legend(); Portuguese remains available via the selector. - Added a
langargument toplot_conversion(),plot_timeseries()andplot_fire_timeseries()(default"en"), mirroring the existing map functions. - Introduced an internal single source of truth for the conservation-group labels and colours, so a group is no longer labelled inconsistently across functions (e.g. “Altered” vs “Altered (anthropic)”).
-
read_occurrences()now fails with a clear message when every row is dropped as having missing or invalid coordinates, instead of surfacing an opaque downstream error. - Translated the remaining Portuguese runtime messages in
cover_timeseries()to English for consistency with the English package interface. - Added a test file covering legend language across all four chart tabs.
mappingAS 1.3.2
- Publishable/exported maps now honour the AOO clip selected in the app (
map_static()gained aclipargument), fixing the missing AOO layer. - Removed the redundant MapBiomas “Collection” selector from the Shiny app (only the Collection 10 legend ships with the package).
- Moved the “Download results (CSV)” button into the Results tab.
- Fixed a syntax error in the Shiny app (a stray bracket in the fire time-series reactive) that stopped the app from launching; added a test that parses the bundled app sources to prevent regressions.
- Removed the “Download map (PNG)” button (interactive-map snapshot via webshot2/Chrome); the HTML download and the publishable PNG remain. Dropped the now-unused ‘webshot2’ from Suggests.
- Refactored the time-series reactives to share a
.year_grid()helper, removing duplicated year-range logic. - App interface is now fully in English. (Map legends can still be exported in English or Portuguese.)
- All download buttons now report failures as a notification instead of a raw Shiny error.
mappingAS 1.3.1
- Shiny app: language selector (English/Português) for the MapBiomas land-cover and fire-frequency legends, on both the interactive (
map_species()) and publishable (map_static()) maps. - Shiny app: IUCN-style badges (EOO/B1 and AOO/B2) with the official Red List colours shown beside the map, reflecting each species’ provisional category.
-
map_species(): newclipargument to view the MapBiomas land-cover and fire rasters clipped to the AOO as well as the EOO; selectable in the Map tab. - Publishable map: the geographic-reference label now shows the actual CRS (projection + datum) instead of fixed wording.
- Fixed the “Publishable map (PNG)” download in the app (the handler now reports errors and validates the plot before saving).
- Silenced the
st_unionplanar-assumption warnings when dissolving AOO cells. - Reworked the app’s Methods tab with key references and the MapBiomas Land Cover and MapBiomas Fire data sources.
mappingAS 1.2.0
- Added the fire risk assessment module using MapBiomas Fire (Collection 4) data.
- Incorporated a new
fire = TRUEargument into theassess_species()function to calculate the percentage of cumulative burned area within the EOO and AOO. - Added new functions for extracting and visualizing fire timeseries:
fire_timeseries(),fire_timeseries_for_species(), andplot_fire_timeseries(). - Updated the static mapping function
map_static()to include thefire = TRUEargument, enabling the visualization of the fire recurrence layer. - Updated
export_ranges()to include the burned area (brnd_pct) and MapBiomas Fire collection (fire_col) columns in the exported polygons (Shapefile/GeoPackage).
mappingAS 1.0.3
- Maintenance release: documentation and packaging only — computed results are unchanged.
- README rewritten with a clearer description of the package and a corrected quick-start example.
- Leaner dependencies: removed the unused dplyr import. Removed the LazyData field (example data ships under
inst/extdata/, notdata/). Author and copyright metadata tidied for consistency.
mappingAS 1.0.2
-
map_static(): new publication-ready static map (MapBiomas raster clipped to the EOO, EOO outline, AOO cells, points, north arrow, scale bar and legends) on an equal-area projection; returns a ggplot forggplot2::ggsave(). -
map_species(): MapBiomas layer on the leaflet map (clipped to the EOO), with a class legend and a toggle in the layers control. -
mb_raster_local(): on-disk cache of the windowed crop (reused across the EOO/AOO/map and re-runs) and restoration of the user’s GDAL settings. - Import: separator/decimal and BOM detection for Brazilian-style CSVs.
- EOO is undefined (NA) for collinear points.
mappingAS 1.0.0
- Initial release.
- Import of occurrence points from .csv/.tsv/.txt, .xlsx/.xls and vector files (.shp, .gpkg, .geojson, .zip), with automatic detection of the species, longitude and latitude columns.
- EOO (minimum convex polygon) and AOO (2 km grid) computed on a data-centred equal-area (LAEA) projection.
- Habitat conversion (anthropic) versus natural within the EOO and AOO using MapBiomas (Collection 10), with two backends: a local windowed read (
/vsicurl/, no Google Earth Engine account) and rgee (optional).
