Filters trips_table(from read_output_trips) by location using a shapefile
Source:R/output_trips.R
process_filter_by_shape.Rd
takes output_trips and an sf object (can be created using the function st_read()),
transforms both objects to match a mutual coordinate system (crs)
and filters the trips from output_trips depending on their spatial type:
if spatial_type="inside" returns a table that contains trips inside given shape
if spatial_type="originating" returns a table that contains trips which start inside the shape and end outside of the shape
if spatial_type="destinating" returns a table that contains trips which end inside shape and start outside of the shape
if spatial_type="outside" returns a table that contains trips which start and end outside of the given shape
Arguments
- trips_table
tibble of trips_output (from read_output_trips)
- shape_table
sf object(data frame with geometries), can be created using st_read()
- crs
numeric representation of the EPSG code or proj4string for the corresponding coordinate system of the trip coordinates, can be found in network file from output directory of MATSim simulation
- spatial_type
boolean, defines trips to conclude (see description)