bioRxiv Science⌕ 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

Phenotypic diversity acts as a higher-order functional trait of populations

Functional traits are usually assigned to individuals, yet some properties exist only as differences among population members. Whether such higher-order properties predict collective performance remains unclear. Here we used the aquatic plant Spirodela polyrhiza to test whether phenotypic and genetic differences among genotypes predict non-additive population growth. We grew twelve Japanese strains alone and in all pairwise mixtures and quantified their growth dynamics. Mixtures sometimes outperformed the mean of their component monocultures, and some exceeded the better-performing monoculture, although diversity effects were negative on average. Positive effects were most strongly associated with between-strain differences in frond colour and morphology, identifying specific dimensions of phenotypic diversity as population-level predictors of synergistic growth. Genome-wide higher-level association mapping identified loci where between-strain diversity was associated with growth effects, implicating stress responses, secondary metabolism and frond morphology. Loci associated with reduced performance implicated chemical perception and self/non-self recognition, whereas those associated with positive effects reflected functional differentiation in stress responses and physiological niches. Our findings suggest that some traits generate new functions at the population level through variation among individuals, making diversity itself a higher-order functional property.

ecology↗

Developmental cold exposure increases the ability to maintain body temperature during future cold challenges in a free-living altricial bird

Developing in suboptimal temperatures can have widespread negative effects in organisms, but early exposure to thermal challenges can also trigger increased investment in thermoregulatory capacity. Within birds, the effects of cold exposure during incubation may differ between precocial and altricial species due to differences in the ontogeny of thermoregulation. To date, most of the evidence showing that embryonic cold exposure shapes future thermoregulatory capacity comes from a few precocial species in laboratory settings. Less is known about sensitivity to low-temperature incubation in altricial species which only become fully endothermic after hatching. In this study, we tested the effects of cold temperatures during embryonic development by temporarily cooling the nest boxes of free-living tree swallows (Tachycineta bicolor) during late incubation and subsequently exposing nestlings to an acute cold challenge. Cold exposure during early development made nestlings better at maintaining their body temperatures during the acute challenge. Developmentally cold-exposed birds also had higher thyroxine (T4) levels when sampled at lower ambient temperatures, whereas control birds showed the opposite relationship. Among nestlings that failed to maintain their body temperature during the acute cold challenge, developmentally cold-exposed nestlings secreted more corticosterone during the acute cold challenge than control nestlings. Despite these changes, cold-exposed birds did not differ from controls in cold-induced metabolic rates, body mass, or bacteria killing ability. These results are, to our knowledge, the first to show that developmental cold exposure increases the capacity to maintain body temperature during future cold challenges in a songbird. These findings suggest that experiencing even a mild decline in ambient temperatures during embryonic development could prime birds to cope more effectively with harsh or variable environmental conditions later in life.

ecology↗

Winter-run Chinook salmon juvenile recruitment and early life history response to flow in a heavily altered tailwater

Diverse life history strategies allow species to spread risk across a mosaic of habitat conditions. In Chinook Salmon (Oncorhynchus tshawytscha), particularly in the Central Valley of California, this is expressed through varied adult run timings and juvenile outmigration strategies. Anthropogenic impacts, particularly dams, disrupt these fundamental life stage transitions, often forcing managed populations to adapt to homogenized, less stochastic hydrologic regimes. This is exemplified in the Sacramento River, where the conservation of endangered Sacramento River winter run Chinook salmon requires balancing complex water operations with the ecological needs of a population confined to a short stretch of suitable habitat downstream of Shasta Reservoir. Using a 23 year dataset (2002 to 2024), we evaluated the combined effects of flow, temperature, and spawner abundance on juvenile production and life history expression in this habitat. We found that flow and spawner abundance best predicted juvenile abundance at Red Bluff Diversion Dam while temperature had considerably less support. The proportion of juveniles migrating as smolts exhibited significant density dependence that was negatively correlated to both female spawner abundance and peak flows. These results suggest focusing on temperature management alone may be insufficient. Effective management strategies should consider flow variability and habitat restoration to facilitate varying migration strategies and expand upstream rearing capacity. By addressing these physical and hydrologic constraints, managers can better support the full suite of life history strategies necessary for the resilience of winter run Chinook salmon.

ecology↗