From the programmer's viewpoint here is an algorithm I would implement if I was faced with this problem.

1. Get an [Openstreetmap][1] database extract for the region I am interested in.
2. 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.
3. 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 ) of the route.
4. Finally, generate a GPX with only those "restaurant" POIs which are close enough (below the fixed threshold).

Alternatively, a database query for [Overpass API][2] 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][3] Q&A site. 


  [1]: https://openstreetmap.org/
  [2]: https://overpass-turbo.eu/
  [3]: https://gis.stackexchange.com/