RouteBoxer takes a route and a distance and returns a small set of rectangles that cover everything nearby.

A navigation app spends a lot of time answering questions about proximity. Which restaurants sit near this route? Which drivers are close to the path? Testing every candidate against a long polyline is slow, and most spatial indexes cannot help with a line shape.
RouteBoxer turns that line problem into a rectangle problem. Hand it a route and a distance, and it returns a set of bounding boxes that cover the area within that distance of the route. From there a database can filter on boxes before anything precise runs.

The merge step is where the practical value sits. Fewer rectangles means fewer lookups later, so the output is a compact cover of the corridor rather than a raw pile of grid squares.

RouteBoxer was originally a helper for maps in the browser. The authors ported it to Android because mobile developers had no equivalent, building the work on the Google Maps Android API inside Android Studio and shipping it as a library. It can be added to a project either as a compiled library file or as a source module.
One property of the algorithm deserves attention before use. The authors report that the number of generated boxes grows exponentially as the distance increases. A wider corridor is not a little more expensive, it is a lot more, so the distance parameter and the grid resolution are the two knobs to watch.

Pinandito, A., Saputra, M.C., Perdana, R.S. (2016). RouteBoxer library for Google Android platform. 2016 IEEE Asia Pacific Conference on Wireless and Mobile (APWiMob).