if (FALSE) {
# Search for records within a polygon using a shapefile
location <- sf::st_read("path/to/shapefile.shp")
galah_call() |>
galah_identify("vulpes") |>
galah_geolocate(location) |>
atlas_counts()
# Search for records within the bounding box of a shapefile
location <- sf::st_read("path/to/shapefile.shp")
galah_call() |>
galah_identify("vulpes") |>
galah_geolocate(location, type = "bbox") |>
atlas_counts()
# 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() |>
galah_identify("reptilia") |>
galah_polygon(location) |>
atlas_counts()
# 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() |>
galah_identify("vulpes") |>
galah_geolocate(wkt) |>
atlas_counts()
# 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() |>
galah_identify("vulpes") |>
galah_geolocate(location, type = "bbox") |>
atlas_counts()
# 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() |>
galah_identify("reptilia") |>
galah_geolocate(b_box, type = "bbox") |>
atlas_counts()
# 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() |>
galah_identify("vulpes") |>
galah_geolocate(b_box, type = "bbox") |>
atlas_counts()
}
Run the code above in your browser using DataLab