Spaces:
Sleeping
Sleeping
selectors
Browse files- selectors.R +27 -0
selectors.R
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
# type <- "region" # "county", "locality"
|
5 |
+
# gdf <- overture::get_division("United States", type = type, as_sf = FALSE)
|
6 |
+
|
7 |
+
|
8 |
+
duckdbfs::duckdb_secrets(key = "", secret = "",
|
9 |
+
endpoint = "s3.amazonaws.com",
|
10 |
+
bucket = "overturemaps-us-west-2")
|
11 |
+
|
12 |
+
options("overture-bucket" = "overturemaps-us-west-2",
|
13 |
+
"overture-release" = "2025-07-23.0")
|
14 |
+
|
15 |
+
us <- overture::overture("divisions", "division_area") |>
|
16 |
+
dplyr::filter(country == "US") |>
|
17 |
+
dplyr::mutate(name = struct_extract(names, "primary")) |>
|
18 |
+
dplyr::distinct(id, name, subtype, region) |>
|
19 |
+
collect()
|
20 |
+
|
21 |
+
states <- us |> filter(subtype == "region") |> pull(name)
|
22 |
+
|
23 |
+
|
24 |
+
duckdbfs::duckdb_secrets()
|
25 |
+
sci <- duckdbfs::open_dataset("s3://public-inat/taxonomy/taxa.parquet", recursive = FALSE)
|
26 |
+
common <- duckdbfs::open_dataset("s3://public-inat/taxonomy/vernacular/VernacularNames-english.csv", format = "csv", recursive = FALSE) |> select(id, vernacularName)
|
27 |
+
taxa <- left_join(sci, common, by = "id")
|