if (FALSE) {
# Search for records within a polygon using a shapefile
location <- sf::st_read("path/to/shapefile.shp")
galah_call() |>
identify("vulpes") |>
geolocate(location) |>
count() |>
collect()
# Search for records within the bounding box of a shapefile
location <- sf::st_read("path/to/shapefile.shp")
galah_call() |>
identify("vulpes") |>
geolocate(location, type = "bbox") |>
count() |>
collect()
# Search for records within a polygon using an `sf` object
location <- "POLYGON((142.3 -29.0,142.7 -29.1,142.7 -29.4,142.3 -29.0))" |>
sf::st_as_sfc()
galah_call() |>
identify("reptilia") |>
galah_polygon(location) |>
count() |>
collect()
# Search for records using a Well-known Text string (WKT)
wkt <- "POLYGON((142.3 -29.0,142.7 -29.1,142.7 -29.4,142.3 -29.0))"
galah_call() |>
identify("vulpes") |>
st_crop(wkt) |>
count() |>
collect()
# Search for records within the bounding box extracted from an `sf` object
location <- "POLYGON((142.3 -29.0,142.7 -29.1,142.7 -29.4,142.3 -29.0))" |>
sf::st_as_sfc()
galah_call() |>
identify("vulpes") |>
galah_geolocate(location, type = "bbox") |>
count() |>
collect()
# Search for records using a bounding box of coordinates
b_box <- sf::st_bbox(c(xmin = 143, xmax = 148, ymin = -29, ymax = -28),
crs = sf::st_crs("WGS84"))
galah_call() |>
identify("reptilia") |>
galah_geolocate(b_box, type = "bbox") |>
count() |>
collect()
# Search for records using a bounding box in a `tibble` or `data.frame`
b_box <- tibble::tibble(xmin = 148, ymin = -29, xmax = 143, ymax = -21)
galah_call() |>
identify("vulpes") |>
galah_geolocate(b_box, type = "bbox") |>
count() |>
collect()
# Search for records within a radius around a point's coordinates
galah_call() |>
identify("manorina melanocephala") |>
galah_geolocate(lat = -33.7,
lon = 151.3,
radius = 5,
type = "radius") |>
count() |>
collect()
# Search for records with a radius around an `sf_POINT` object
point <- sf::st_sfc(sf::st_point(c(-33.66741, 151.3174)), crs = 4326)
galah_call() |>
identify("manorina melanocephala") |>
galah_geolocate(point,
radius = 5,
type = "radius") |>
count() |>
collect()
}
Run the code above in your browser using DataLab