% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/output_trips.R
\name{process_filter_by_shape}
\alias{process_filter_by_shape}
\title{Filters trips_table(from \link{read_output_trips}) by location using a shapefile}
\usage{
process_filter_by_shape(trips_table, shape_table, crs, spatial_type = "inside")
}
\arguments{
\item{trips_table}{tibble of trips_output (from \link{read_output_trips})}

\item{shape_table}{sf object(data frame with geometries), can be created using st_read()}

\item{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}

\item{spatial_type}{boolean, defines trips to conclude (see description)}
}
\value{
tibble, with filtered trips depending on shape_table and spatial types (see description)
}
\description{
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:\cr
if spatial_type="inside" returns a table that contains trips inside given shape\cr
if spatial_type="originating" returns a table that contains trips which start inside  the shape and end outside of the shape\cr
if spatial_type="destinating" returns a table that contains trips which end inside shape and start outside of the shape\cr
if spatial_type="outside" returns a table that contains trips which start and end outside of the given shape
}
