Learn R Programming

rvertnet (version 0.3.0)

spatialsearch: Find records within some distance of a point given latitude and longitude.

Description

Searches by decimal latitude and longitude to return any occurrence record within the input distance (radius) of the input point.

Usage

spatialsearch(lat, long, radius, limit = 1000, compact = TRUE,
  verbose = TRUE, ...)

Arguments

lat
Latitude of the central point, in decimal degrees (numeric) Required.
long
Longitude of the central point, in decimal degrees (numeric) Required.
radius
Radius to search, in meters (numeric). There is no default value for this parameter. Required.
limit
(numeric) Limit on the number of records returned. Up to 1000. We'll incorporate paging later for higher limits. See bigsearch to get larger result sets in a text file via email.
compact
Return a compact data frame (logical)
verbose
Print progress and information messages. Default: TRUE
...
Curl arguments passed on to GET

Value

  • A data frame of search results

Details

spatialsearch finds all records of any taxa having decimal lat/long coordinates within a given radius (in meters) of your coordinates.

References

https://github.com/VertNet/webapp/wiki/The-API-search-function

Examples

Run this code
res <- spatialsearch(lat = 33.529, long = -105.694, radius = 2000, limit = 10)

# Pass in curl options for curl debugging
library("httr")
out <- spatialsearch(lat = 33.529, long = -105.694, radius = 2000, limit = 10, config=verbose())

Run the code above in your browser using DataLab