dot-get_pbf_extent: Get PBF Bounding Box with Fallbacks

.get_pbf_extentR Documentation

Get PBF Bounding Box with Fallbacks

Description

Tries multiple methods to extract the bounding box from an OSM PBF file:

  1. Pure R header parsing (fastest, no dependencies)

  2. osmium CLI (if available in PATH)

  3. sf sampling (if sf is installed, reads first 10 features)

Usage

.get_pbf_extent(pbf_file)

Arguments

pbf_file

Path to an .osm.pbf file

Value

Named list with center (c(lng, lat)) and bbox (c(lng_min, lat_min, lng_max, lat_max)) or NULL if bbox could not be determined


osrm.backend documentation built on April 26, 2026, 9:06 a.m.