How to crop polylines between nearby coordinates?

I am developing an Android application that displays routes of buses. They are stored in polylines, and I want to crop them to show within selected bus stops.
However the locations of the stops aren’t an element of the polyline, and they don’t fall inside the line, they are off by approx. 2.5 meters.

Is there an efficient way of doing this, since each of the lines contain approx. 700 unique coordinates?