From the programmer's viewpoint here is an algorithm I would implement if I was faced with this problem.
- Get an Openstreetmap database extract for the region I am interested in.
- Filter the extract file to keep only nodes/ways with tags
amenity=restaurant
,amenity=fast_food
etc. That is, only data related to the "food" category. - Write a script that takes a set of GPX points of the route, a set of the "restaurant" points, and a threshold distance value. For each POI, calculate the minimum distance to all points (or line segment, to linear segments) of the route.
- Finally, generate a GPX with only those "restaurant" POIs which are close enough (below the fixed threshold).
Alternatively, a database query for Overpass API could be constructed to do all this work. I am quite weak in its obscure language(s), but there are likely ready examples for it for finding POIs along a curve.
As such, this question is maybe more suitable for the GIS Q&A site.