Skip to contents

Transforms the data frame trips_output (from read_output_trips) into an sf object using start_x, end_x, start_y, end_y as geometry features.
If geometry.type = st_multipoint() or geometry.type = st_linestring() it adds one geometry column (wkt format),
if geometry.type = st_point() it adds the geometry columns start_wkt and end_wkt.
Added column/columns are projected to given CRS (coordinate reference system).
The columns start_x, end_x, start_y, end_y are deleted from the resulting data frame.

Usage

process_convert_table_to_sf(table, crs, geometry.type = st_multipoint())

Arguments

table

tibble trips_output (from read_output_trips)

crs

numeric, coordinate system in the form of the EPSG code or proj4string, can be found in the MATSim network file

geometry.type

type of sf transformation, default is st_multipoint(), geometry.type can be:
!!!st_point()- resulting table contains two geometry columns: start_wkt and end_wkt, representing start and end points as POINTS!!! or
!!!st_multipoint()- resulting table contains one geometry column, representing start and end points as MULTIPOINT!!! or
!!!st_linestring() - resulting table contains one geometry column, representing the line between start and end points as LINESTRING!!!

Value

sf object (data frame with geometries depending on geometry.type)