The task of the “Taxi Ride Cleansing” exercise is to cleanse a stream of TaxiRide events by removing events that do not start or end in New York City.
GeoUtils utility class provides a static method
isInNYC(float lon, float lat) to check if a location is within the NYC area.
This series of exercises is based a stream of taxi ride events. The Taxi Data Stream instructions show how to setup the
TaxiRideSource which generates a stream of
The result of the exercise should be a
DataStream<TaxiRide> that only contains events of taxi rides which start and end in the New York City area as defined by
The resulting stream should be printed to standard out.
TaxiRideSourceand requires a single transformation to filter all events that do not start and end within the New York City area.
DataStream<TaxiRide>is generated using the
TaxiRideSourceas described in the Taxi Data Stream instructions.
DataStream.filter(FilterFunction)transformation to filter events from a data stream. The
GeoUtils.isInNYC()function can be called within a
FilterFunctionto check if a location is in the New York City area.
Reference solutions are available at GitHub: