Search bioRxiv⌕ Search

bioRxiv · 10.64898/2026.08.16.745083

An R-Based Adaptive Quadtree Spatial Tiling Workflow for Boundary-Exact GBIF Species Occurrence Mining within User-Defined KML Polygons

Abstract

Global Biodiversity Information Facility (GBIF) occurrence retrievals for an irregularly shaped region are limited by the API spatial query capabilities - rectangular envelopes or size/vertex-limited WKT polygons - neither of which conform to protected areas, sacred groves, wetlands, panchayat or municipal boundaries or any other arbitrary KML polygon of interest queried by users. This paper presents and validates an open, self-contained, adaptive spatial-tiling protocol that (i) ingests any KML polygon of any shape, size and location on earth, breaks it into a set of GBIF API-compatible rectangular tiles, (ii) queries, cleans and clips the individual records to the target polygon, and (iii) summarises the inventory with a generic diversity-completeness-rarefaction module, with minimal manual re-parameterisation between sites. The protocol implements an iterative quadtree refinement algorithm that adapts tile number, size and location to the target polygon geometry, is combined with a fault-tolerant pagination/retry query system, a boundary-exact two-step clipping procedure and a Chao1-based completeness assessment to ensure statistical comparability between sites of different spatial extent and sampling intensity. The algorithm is implemented in open R source (sf, terra, rgbif, tidyverse) with the tiling algorithm controlled by the four parameters only (initial cell size, area floor, tile overlap threshold, recursion limit), with default settings on a new site by simply changing the input file path. This paper describes in detail its five main components - (i) polygon input and validation, (ii) quadtree adaptive tiling, (iii) polygon coverage verification, (iv) tile-wise GBIF query with retry/shrink pagination and partial data retention, (v) boundary-exact deduplication, clipping and diversity estimation. A downstream generic module estimates diversity, Chao1 richness/completeness and Hurlbert rarefaction, for each taxonomic rank and generates rank-ordered diversity tables as output. The generalisability of algorithm to multiple sites has been demonstrated with second polygon (Sonamukhi Sal forest dominated stretch, Bankura district, West Bengal; approx. 610 sq km) that differs from the first (Bishnupur Sal forest dominated stretch; 938 sq km) in both size and complexity (10 vs 34 KML vertices) and report the tiling and diversity metrics comparable results across the two polygons. With no parameter changes, the algorithm generated 135 adaptive query tiles for Sal forest dominated stretch adjoining Bishnupur, and 86 tiles for Sal forest dominated stretch Sonamukhi SDFP, covering completely the area of both polygons. The number of tiles per 100 sq km is comparable between the two runs (14.4 vs 14.1 tiles) despite the 35% difference in polygon size and 3.4x vertex count. The tile-wise querying with retry/shrink pagination retrieved 6,169 GBIF records (excluding errors) with boundary-exact clipping across 404 species for Bishnupur and 1,222 GBIF records (excluding errors) across 271 species for Sonamukhi; the generic diversity module processed the records without further parameter changes and generated comparable metrics for each rank at both sites. The protocol addresses a general bioinformatic challenge in polygon-based GBIF queries, is provided as an open, reusable, documented method which has been validated on two sites. Because the protocol has so far been validated on only two polygons that differ markedly in size, shape and observer regime, it may be regarded as an initial cross-site validation rather than a comprehensive benchmark, and recommend testing on a broader, globally distributed set of polygons before the approach is treated as a general-purpose standard.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Pradhan, P.. 2026-08-20. An R-Based Adaptive Quadtree Spatial Tiling Workflow for Boundary-Exact GBIF Species Occurrence Mining within User-Defined KML Polygons. https://doi.org/10.64898/2026.08.16.745083

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related preprints

Wildfires drive trade-offs in ammonia-oxidizing groups and promote denitrification to increase soil emissions of nitric oxide (NO) and nitrous oxide (N2O) in California chaparral

Wildfires can promote trade-offs in soil nitrifier and denitrifier communities that affect post-fire nitrogen (N) cycling and emissions of nitric oxide (NO), nitrous oxide (N2O), and dinitrogen (N2). For example, by increasing soil pH and ammonium (NH4+), wildfires could increase the abundance of ammonia-oxidizing bacteria (AOB) over archaea (AOA). Because AOB and AOA process N differently, nitrifier trade-offs may affect N emissions and nitrate (NO3-) supply with downstream effects on denitrifier activity, leading us to ask: Do trade-offs between AOA and AOB abundance and shifts in denitrifying processes influence N emissions over time after wildfire? We selectively inhibited AOA and AOB communities from soil collected over four seasonal time points one year before and after a chaparral wildfire and used stable isotopes to parse denitrifier contributions to N2O emissions. Over one year after the wildfire, soil pH increased from 6.1 to 7.0, soil extractable NH4+ increased 30-fold, NO3- increased 5-fold, and NO2- increased 9-fold. AOB amoA gene copy numbers increased 20-fold one year after fire, while AOA abundance remained unchanged. Post-fire soil NO emissions increased 63-fold over one year, with varied contributions from all nitrifier groups. Soil N2O emissions peaked eight months after fire (2271 {+/-} 634 ng N2O-N g-1 soil), with increased contributions from AOA. Wildfire increased {delta}15NSPN2O and {delta}15NbulkN2O values, suggesting increased N2O reduction to N2. Overall, wildfire increased AOB abundance relative to AOA, promoting nitrification activity and providing intermediates to denitrifiers to increase emissions of NO and N2O for up to one year after fire.

ecology↗

Global urban forest cover and nature access is insufficient for human wellbeing and worsening

Target 12 of the Global Biodiversity Framework urges governments to enhance human access to nature to improve human wellbeing. Here, we study nature access using several metrics for a globally representative sample of 140 large Functional Urban Areas, examining variation among regions and over time. We find most urbanites globally do not reach common benchmarks for urban forest cover and nature access. Globally, 3.3 billion people (76% of urbanites) live in urban areas that do not have at least 30% tree canopy cover. Moreover, 1.1 billion people (23% of urbanites) are farther than 1 km from a park as identified in Open Street Map, and 1.5 billion people (36% of all urbanites) are more than 1 km from a green patch as defined by land cover. Over time, urban nature access has declined. Between 1992 and 2020, most urban residents had an increase in the distance to green patches (63% of urbanites increased, average increase 680 m). Similarly, between 1992 and 2020, 31% of urbanites had a decrease in percent natural cover, while only 1.3% had an increase. We show that the variation among cities or regions in the amount of nature access depends on the metric used and the context. On average, mesic climates have more tree cover than do arid climates, and cities with lower GDP or higher population density tend to have lower natural share than other cities. Our results suggest that global urban nature access is insufficient for supporting human health and worsening over time.

ecology↗

Exploring soil microbes' potential to assess Atlantic Forest restoration trajectories

Soil microbe communities are key indicators of ecosystem recovery, yet their integration into operational restoration monitoring remains limited. We evaluated the potential for benchmarking early Atlantic Forest restoration with reference site-based comparisons using bacteria and fungi. Samples were collected from three geographic clusters and spanned a pasture-restoration-forest land-use gradient. Using metabarcoding, we assessed whether soil microbe community diversity, structure, and functional profiles respond to restoration progress considering influences from spatial arrangement and/or successional stage (determined using NDVI). We found that OTU alpha diversity was not explained by either predictor, whereas the Shannon diversity of bacterial functions declined significantly with increasing NDVI. Bacterial and fungal OTU composition (Bray-Curtis) responded significantly to both NDVI and geographic cluster, as did microbe functional profiles, although only NDVI proved both marginally and conditionally significant. We also found that soil chemical parameters were primarily structured by geographic cluster but not by NDVI, suggesting that many abiotic edaphic conditions reflect soil history rather than current vegetation status. These findings suggest that both microbe taxonomic and functional metrics track revegetation progress and validate eDNA as a scalable, sensitive restoration monitoring framework. Importantly, our results also support the use of reference site-based monitoring for Atlantic Forest restoration.

ecology↗