% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/street_network_bbox.R
\name{street_network_bbox}
\alias{street_network_bbox}
\title{Extract the geographic bounding box of the transport network}
\usage{
street_network_bbox(
  r5r_network,
  output = c("polygon", "bbox", "vector"),
  r5r_core = deprecated()
)
}
\arguments{
\item{r5r_network}{A routable transport network created with \code{\link[=build_network]{build_network()}}.}

\item{output}{A character string specifying the desired output format. One of
\code{"polygon"} (the default), \code{"bbox"}, or \code{"vector"}.}

\item{r5r_core}{The \code{r5r_core} argument is deprecated as of r5r v2.3.0.
Please use the \code{r5r_network} argument instead.}
}
\value{
By default (\code{output = "polygon"}), an \code{sf} object with a single \code{POLYGON}
geometry. If \code{output = "bbox"}, an \code{sf} \code{bbox} object. If \code{output = "vector"},
a named numeric vector with \code{xmin}, \code{ymin}, \code{xmax}, \code{ymax} coordinates.
All outputs use the WGS84 coordinate reference system (EPSG: 4326).
}
\description{
Extracts the geographic bounding box of the street network layer from a
routable transport network built with \code{\link[=build_network]{build_network()}}). It is a fast and
memory-efficient alternative to \code{sf::st_bbox(street_network_to_sf(r5r_net))}.
}
\examples{
\dontshow{if (identical(tolower(Sys.getenv("NOT_CRAN")), "true")) withAutoprint(\{ # examplesIf}
library(r5r)
library(sf)

data_path <- system.file("extdata/poa", package = "r5r")
r5r_network <- build_network(data_path)

# Get the network's bounding box as an sf polygon (default)
poly <- street_network_bbox(r5r_network, output = "polygon")
plot(poly)

# Get an sf bbox object (order is xmin, ymin, xmax, ymax)
box <- street_network_bbox(r5r_network , output = "bbox")
box

# Get a simple named vector (order now also xmin, ymin, xmax, ymax)
vec <- street_network_bbox(r5r_network , output = "vector")
vec

stop_r5(r5r_network)
\dontshow{\}) # examplesIf}
}
\seealso{
Other network functions: 
\code{\link{find_snap}()},
\code{\link{street_network_to_sf}()},
\code{\link{transit_network_to_sf}()}
}
\concept{network functions}
