Package 'starc'

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

Help Index


Compute spatial window for location

Description

Converts lon/lat + buffer to:

  • UTM CRS (appropriate zone)

  • Projected extent (xmin, xmax, ymin, ymax)

  • Lonlat extent (lonmin, lonmax, latmin, latmax)

Usage

compute_spatial_window(locations)

Arguments

locations

Data frame with lon, lat, radiusx, radiusy

Value

Data frame with added spatial fields


Consolidate all Parquet files with deduplication

Description

Consolidate all Parquet files with deduplication

Usage

consolidate_assets_parquet(
  parquet_dir = "_targets/assets_parquet",
  parquet_files = NULL,
  dedup_keys = c("SITE_ID", "datetime")
)

Arguments

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

Value

Tibble with consolidated, deduplicated assets


Define test location (Noville Peninsula)

Description

Define test location (Noville Peninsula)

Usage

define_test_location()

Value

Data frame with single location


Get assets from pre-built query URLs

Description

This was born as hrefs from scene

Usage

get_assets_from_urls(query_urls)

Arguments

query_urls

Query URL(s) from sds::stacit()

Value

Tibble with asset URLs and metadata


Internal: Fetch single STAC query with pagination

Description

This was born as hrefs0 from scene

Usage

get_assets_single(query_url)

Arguments

query_url

STAC query URL

Value

Tibble with assets + metadata


Determine UTM point from lon/lat

Description

Determine UTM point from lon/lat

Usage

mk_utm_centre(lon, lat)

Arguments

lon

Longitude

lat

Latitude

Value

dataframe with columns x, y in UTM


Determine UTM CRS from lon/lat

Description

Determine UTM CRS from lon/lat

Usage

mk_utm_crs(lon, lat)

Arguments

lon

Longitude

lat

Latitude

Value

EPSG code as string


Prepare STAC query

Description

Prepare STAC query

Prepare STAC query

Usage

prepare_query(spatial_window, start_date, end_date, collections, provider)

prepare_query(spatial_window, start_date, end_date, collections, provider)

Arguments

spatial_window

Spatial window with bbox

start_date

Start date

end_date

End date

Value

Query specification

Query specification


Internal: Extract assets and metadata from single feature

Description

Internal: Extract assets and metadata from single feature

Usage

process_feature(feature)

Arguments

feature

Single STAC feature (one row from features data frame)

Value

Named list with assets + metadata


Sanitize location name for filesystem

Description

Sanitize location name for filesystem

Usage

sanitize_location(location)

Write assets table to Parquet file (parallel-safe)

Description

Write assets table to Parquet file (parallel-safe)

Usage

write_assets_to_parquet(
  assets_table,
  output_dir = "_targets/assets_parquet",
  collection = NULL
)

Arguments

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

Value

Character. Path to written Parquet file


Write consolidated assets to single Parquet file

Description

Write consolidated assets to single Parquet file

Usage

write_consolidated_assets(
  assets_consolidated,
  output_path = "_targets/assets_consolidated.parquet"
)

Arguments

assets_consolidated

Consolidated assets tibble

output_path

Path to write final Parquet file

Value

Character. Path to written file