Skip to contents

Data sources

Open files for lazy query execution

tbl()
Create a lazy table reference from a .vtr file
tbl_csv()
Create a lazy table reference from a CSV file
tbl_sqlite()
Create a lazy table reference from a SQLite database
tbl_tiff()
Create a lazy table reference from a GeoTIFF raster
tbl_xlsx()
Create a lazy table reference from an Excel (.xlsx) file

Data sinks

Write query results or data.frames to disk

write_vtr()
Write data to a .vtr file
write_csv()
Write query results or a data.frame to a CSV file
write_sqlite()
Write query results or a data.frame to a SQLite table
write_tiff()
Write query results to a GeoTIFF file
st_write(<vectra_node>)
Stream a vectra node's geometry to a vector file

Single-table verbs

Transform, filter, and reshape

filter()
Filter rows of a vectra query
select()
Select columns from a vectra query
mutate()
Add or transform columns
transmute()
Keep only columns from mutate expressions
rename()
Rename columns
relocate()
Relocate columns
arrange()
Sort rows by column values
desc()
Mark a column for descending sort order
distinct()
Keep distinct/unique rows
slice_head() slice_tail() slice_min() slice_max()
Select first or last rows
slice()
Select rows by position
pull()
Extract a single column as a vector
head(<vectra_node>)
Limit results to first n rows

Grouping and aggregation

group_by()
Group a vectra query by columns
summarise() summarize()
Summarise grouped data
ungroup()
Remove grouping from a vectra query
count() tally()
Count observations by group
reframe()
Summarise with variable-length output per group
across()
Apply a function across multiple columns

Joins

left_join() inner_join() right_join() full_join() semi_join() anti_join()
Join two vectra tables
cross_join()
Cross join two vectra tables
fuzzy_join()
Fuzzy join two vectra tables by string distance

Star schema

Define linked dimension tables and look up columns without explicit joins

vtr_schema()
Create a star schema over linked vectra tables
link()
Define a link between a fact table and a dimension table
lookup()
Look up columns from linked dimension tables

Combining tables

bind_rows() bind_cols()
Bind rows or columns from multiple vectra tables

Block operations

In-memory materialization and lookup

materialize()
Materialize a vectra node into a reusable in-memory block
block_lookup()
Probe a materialized block by column value
block_fuzzy_lookup()
Fuzzy-match query keys against a materialized block

Streaming consumption

Reduce or feed a query one batch at a time, for larger-than-RAM results

collect_chunked()
Fold a function over a query, one batch at a time
chunk_feeder()
Turn a query into a resettable chunk generator

Offloading

Spill a query to disk and stream it back, for out-of-core fits

offload()
Spill a query to disk and stream it back (the offload functor)
group_map() group_modify()
Apply a function to each shard of a partition

File operations

Incremental updates to .vtr files

append_vtr()
Append rows to an existing .vtr file
delete_vtr()
Logically delete rows from a .vtr file
diff_vtr()
Compute the logical diff between two .vtr files
create_index()
Create a hash index on a .vtr file column
has_index()
Check if a hash index exists for a .vtr column

Diagnostics

explain()
Print the execution plan for a vectra query
collect()
Execute a lazy query and return a data.frame
glimpse()
Get a glimpse of a vectra table
print(<vectra_node>)
Print a vectra query node

Raster data cubes

Read and write .vec rasters and time cubes out of core

vec_open_raster()
Open a .vec raster
vec_close_raster()
Close a .vec raster handle
vec_raster_layout()
Tile layout of an open .vec raster
vec_raster_times()
Distinct time stamps stored in a .vec time cube
vec_read_window()
Read a window of pixels from a .vec raster
vec_read_time_slice()
Read a single time slice from a .vec time cube
vec_read_pixel_series()
Read the full time series at a single pixel from a .vec time cube
vec_extract_points()
Extract band values at (x, y) points from a .vec raster
vec_build_overviews()
Build overview pyramids for a .vec raster
vec_write_raster()
Write a raster matrix or 3D array to a .vec raster file
vec_write_time_cube()
Write a 4D time-cube raster to .vec
vec_to_tiff()
Export a .vec raster to GeoTIFF

GeoTIFF helpers

Metadata and point-sampling for GeoTIFF rasters

tiff_extract_points()
Extract raster values at point coordinates
tiff_metadata()
Read GDAL_METADATA from a GeoTIFF
tiff_band_names()
Read per-band names from a GeoTIFF
tiff_crs()
Read CRS metadata from a GeoTIFF

Spatial operations

Stream sf vector operations one batch at a time, for vector data larger than RAM

spatial_map()
Stream a query through an sf transform
spatial_join()
Spatial join a streamed query against a resident sf object
grid()
Define a uniform grid for a partitioned spatial join
spatial_filter()
Keep streamed rows by their spatial relation to a resident layer
spatial_clip()
Clip or erase a streamed layer against a resident mask
spatial_dissolve()
Dissolve geometries by group
spatial_overlay()
Self-overlay a polygon layer into disjoint pieces (QGIS-style Union)
rasterize()
Rasterize a streamed point layer onto a fixed grid
polygonize()
Vectorise a raster into polygons
contours()
Extract contour iso-lines from a streamed raster
zonal()
Summarise raster values within zones
focal()
Moving-window (focal) statistics over a streamed raster
terrain()
Terrain derivatives from a streamed elevation raster
warp()
Resample or reproject a streamed raster onto a target grid
mask()
Mask a streamed raster to a polygon layer
mosaic()
Merge aligned rasters onto a common grid
rast_calc()
Cellwise calculation over aligned rasters (map algebra)
proximity()
Euclidean distance to the nearest feature (proximity)
collect_sf()
Materialize a spatial query as an sf object
geom_expressions
Geometry functions inside mutate(), filter(), and summarise()

Geometry construction and cleaning

Reshape, repair, simplify, and snap streamed vector geometry

spatial_construct()
Build a set-wise geometry construction, optionally per group
spatial_explode()
Explode multipart geometries into single-part features
spatial_line_merge()
Merge contiguous line segments into maximal lines
spatial_simplify()
Simplify a polygon coverage without tearing shared edges
spatial_smooth()
Smooth streamed line and polygon geometry
spatial_snap()
Snap a streamed layer toward a resident reference layer
spatial_snap_grid()
Snap a streamed layer's coordinates to a fixed grid
spatial_eliminate()
Merge sliver polygons into a neighbour
spatial_split()
Split a streamed layer by a resident blade, or return its crossing points
spatial_centerline()
Trace the centerline (medial axis) of streamed polygons

Coverage and topology

Shared-edge topology and polygonal faces of polygon coverages

spatial_topology()
Build the shared-edge topology of a polygon coverage
spatial_polygonize()
Build polygonal faces from a line network

Spatial networks

Build routable graphs and solve shortest paths over line layers

spatial_network()
Build a routable network graph from a line layer
spatial_route()
Shortest paths and origin-destination costs over a network
spatial_service_area()
Service areas and isochrones over a network

Spatial queries

Nearest neighbours and linear referencing

spatial_knn()
k nearest neighbours of a streamed layer, with distances
spatial_locate()
Locate streamed points along a resident line layer