| Title: | Obtain 'SpatioTemporal Asset Catalog' (STAC) Assets |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Michael Sumner [aut, cre] (ORCID: <https://orcid.org/0000-0002-2471-7511>) |
| Maintainer: | Michael Sumner <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-02 10:42:24 UTC |
| Source: | https://github.com/hypertidy/starc |
Converts lon/lat + buffer to:
UTM CRS (appropriate zone)
Projected extent (xmin, xmax, ymin, ymax)
Lonlat extent (lonmin, lonmax, latmin, latmax)
compute_spatial_window(locations)compute_spatial_window(locations)
locations |
Data frame with lon, lat, radiusx, radiusy |
Data frame with added spatial fields
Consolidate all Parquet files with deduplication
consolidate_assets_parquet( parquet_dir = "_targets/assets_parquet", parquet_files = NULL, dedup_keys = c("SITE_ID", "datetime") )consolidate_assets_parquet( parquet_dir = "_targets/assets_parquet", parquet_files = NULL, dedup_keys = c("SITE_ID", "datetime") )
parquet_dir |
Directory containing Parquet files |
parquet_files |
Character vector of Parquet file paths (from targets) |
dedup_keys |
Character vector of columns to deduplicate on |
Tibble with consolidated, deduplicated assets
Define test location (Noville Peninsula)
define_test_location()define_test_location()
Data frame with single location
This was born as hrefs from scene
get_assets_from_urls(query_urls)get_assets_from_urls(query_urls)
query_urls |
Query URL(s) from sds::stacit() |
Tibble with asset URLs and metadata
This was born as hrefs0 from scene
get_assets_single(query_url)get_assets_single(query_url)
query_url |
STAC query URL |
Tibble with assets + metadata
Determine UTM point from lon/lat
mk_utm_centre(lon, lat)mk_utm_centre(lon, lat)
lon |
Longitude |
lat |
Latitude |
dataframe with columns x, y in UTM
Determine UTM CRS from lon/lat
mk_utm_crs(lon, lat)mk_utm_crs(lon, lat)
lon |
Longitude |
lat |
Latitude |
EPSG code as string
Prepare STAC query
Prepare STAC query
prepare_query(spatial_window, start_date, end_date, collections, provider) prepare_query(spatial_window, start_date, end_date, collections, provider)prepare_query(spatial_window, start_date, end_date, collections, provider) prepare_query(spatial_window, start_date, end_date, collections, provider)
spatial_window |
Spatial window with bbox |
start_date |
Start date |
end_date |
End date |
Query specification
Query specification
Internal: Extract assets and metadata from single feature
process_feature(feature)process_feature(feature)
feature |
Single STAC feature (one row from features data frame) |
Named list with assets + metadata
Sanitize location name for filesystem
sanitize_location(location)sanitize_location(location)
Write assets table to Parquet file (parallel-safe)
write_assets_to_parquet( assets_table, output_dir = "_targets/assets_parquet", collection = NULL )write_assets_to_parquet( assets_table, output_dir = "_targets/assets_parquet", collection = NULL )
assets_table |
Tibble with assets for ONE location (from get_assets) Should have: SITE_ID, location_id, solarday, scene_id, datetime, cloud_cover, red, green, blue, nir, scl, etc. |
output_dir |
Directory to write Parquet files |
collection |
Optional collection name for subfolder |
Character. Path to written Parquet file
Write consolidated assets to single Parquet file
write_consolidated_assets( assets_consolidated, output_path = "_targets/assets_consolidated.parquet" )write_consolidated_assets( assets_consolidated, output_path = "_targets/assets_consolidated.parquet" )
assets_consolidated |
Consolidated assets tibble |
output_path |
Path to write final Parquet file |
Character. Path to written file