R/extendr-wrappers.R

Defines functions rs_closeness rs_betweenness rs_distance_matrix rs_k_shortest_paths rs_connected_components rs_simplify_paths rs_bearings rs_orientation_entropy rs_dijkstra rs_shortest_path rs_basic_stats

Documented in rs_basic_stats rs_bearings rs_betweenness rs_closeness rs_connected_components rs_dijkstra rs_distance_matrix rs_k_shortest_paths rs_orientation_entropy rs_shortest_path rs_simplify_paths

# Generated by extendr: Do not edit by hand
# nolint start

#' @usage NULL
#' @useDynLib osmnxr, .registration = TRUE
NULL

#' Basic network statistics from edge endpoints (0-based) and weights.
#' @keywords internal
rs_basic_stats <- function(from, to, weight, n_nodes) .Call(wrap__rs_basic_stats, from, to, weight, n_nodes)

#' Shortest path (0-based node indices) between `source` and `target`.
#' Returns an empty vector when the target is unreachable.
#' @keywords internal
rs_shortest_path <- function(from, to, weight, n_nodes, source, target) .Call(wrap__rs_shortest_path, from, to, weight, n_nodes, source, target)

#' Single-source shortest distances (length `n_nodes`); `Inf` if unreachable.
#' @keywords internal
rs_dijkstra <- function(from, to, weight, n_nodes, source) .Call(wrap__rs_dijkstra, from, to, weight, n_nodes, source)

#' Shannon entropy of binned edge bearings (degrees).
#' @keywords internal
rs_orientation_entropy <- function(bearings, num_bins) .Call(wrap__rs_orientation_entropy, bearings, num_bins)

#' Initial compass bearings (degrees) for parallel coordinate vectors.
#' @keywords internal
rs_bearings <- function(lat1, lon1, lat2, lon2) .Call(wrap__rs_bearings, lat1, lon1, lat2, lon2)

#' Simplified node chains between topological endpoints. Returns a list of
#' 0-based node-index vectors, one per merged edge.
#' @keywords internal
rs_simplify_paths <- function(from, to, n_nodes) .Call(wrap__rs_simplify_paths, from, to, n_nodes)

#' Connected-component label (0-based root index) for each node, given
#' undirected `a`--`b` adjacency pairs.
#' @keywords internal
rs_connected_components <- function(a, b, n_nodes) .Call(wrap__rs_connected_components, a, b, n_nodes)

#' Yen's k loopless shortest paths. Returns a list with `paths` (a list of
#' 0-based node-index vectors) and `costs` (numeric).
#' @keywords internal
rs_k_shortest_paths <- function(from, to, weight, n_nodes, source, target, k) .Call(wrap__rs_k_shortest_paths, from, to, weight, n_nodes, source, target, k)

#' Row-major shortest-distance matrix from each source to each target
#' (0-based indices). Length is `sources * targets`.
#' @keywords internal
rs_distance_matrix <- function(from, to, weight, n_nodes, sources, targets) .Call(wrap__rs_distance_matrix, from, to, weight, n_nodes, sources, targets)

#' Betweenness centrality (Brandes) for every node.
#' @keywords internal
rs_betweenness <- function(from, to, weight, n_nodes, normalized) .Call(wrap__rs_betweenness, from, to, weight, n_nodes, normalized)

#' Closeness centrality for every node.
#' @keywords internal
rs_closeness <- function(from, to, weight, n_nodes, normalized) .Call(wrap__rs_closeness, from, to, weight, n_nodes, normalized)

# nolint end

Try the osmnxr package in your browser

Any scripts or data that you put into this service are public.

osmnxr documentation built on Oct. 20, 2026, 1:07 a.m.