Author: Brian Maitner
Date: 2026-04-29

# GVS R package

#### Brian Maitner

#### 2026-04-29

# Geocoordinate Validation Service

The package `GVS` is designed to interact with the Geocoordinate Validation Service API of the Botanical Information and Ecology Network. The GVS accepts a point of observation (PO; pair of latitude, longitude coordinates in decimal degrees) and returns the country, state and county in which the point is located. It also calculates the distance between the OP and six different types of centroids for each of the three political divisions (see Centroid Types) and indicates for each political division if it is small enough for the OP itself to potentially be a centroid (see Distance Thresholds. Finally, the GVS indicates which of the three potential political division centroids is the most likely, if any, based on the threshold parameter MAX_DIST (distance to the actual centroid) and MAX_DIST_REL (relative distance: distance to actual centroid / distance from actual centroid to the farthest point in the political division). In addition, the GVS validates the submitted coordinates and reports errors such as non-numeric values and values out of bounds. Valid coordinates which do not join to any political division are flagged as “Point in ocean”.

## Installation

    library(devtools)
    install_github("EnquistLab/RGVS")

## Using the GVS

The GVS takes as input a dataframe consisting of two columns: latitude and longitude (in that order). We provide an example dataset, `gvs_testfile`.

    library(GVS)

    # Load the sample dataset

    gvs_data <- gvs_testfile

    # View the structure
    head(gvs_data)

    ##      latitude    longitude
    ## 1   36.580435    -96.53331
    ## 2 39.80818224 -91.62289157
    ## 3          46           25
    ## 4    52.92755       4.7864
    ## 5    52.54731     -2.49544
    ## 6      -23.62       -65.43

To run data through the GVS, we use the function `GVS`

    gvs_results <- GVS(occurrence_dataframe = gvs_data)

    # The resulting output has a lot of information that can be used in data cleaning.

    colnames(gvs_results)

    ## character(0)

The contents of some of these columns may not be immediately clear. In this case, we can consult the data dictionary.

    dd <- GVS_data_dictionary()

    ## Problem with the API: HTTP Status 500

We can now use these metadata to exclude questionable data (or try to fix it). For example, we’ll certainly want to exclude coordinates that are non-numeric or impossible! Depending on our purposes, we may also want to exclude coordinates that correspond to centroids or those that fall into the ocean.

## Additional information about the GVS

In addition to the coordinate resolution, the GVS offers metadata responses describing current code and database versions, and formatted citations. For a quick overview, you can use the function `GVS_metadata`. If you use the GVS in a publication and need to cite it, proper attribution information is available with `GVS_citations`.

    cites <- GVS_citations()

    ## Problem with the API: HTTP Status 500

    # The citation column provides Bibtex format citations that can be pasten into a reference manager (e.g., EndNote, PaperPile, Zotero)

    cites$citation

    ## NULL