Skip to contents

This function helps extract a road network graph in a simple and light weight format. In the background, it uses the power of the osmium library in C++, and copies the data in graph format locally as 2 .csv files, one with nodes and their coordinates, with with segments and optional values.

Usage

extract_graph(filename)

Arguments

filename

a local osm extract file with .osm or .osm.pbf extension.

Value

this function returns the value 1 to the R environment when it's completed. It writes out 2 files containing nodes and segments. The files are written in the current directory and are called: nodes.csv,road_segments.csv.