Your problems is lacking a few details so I'm going to assume that:
- This goes on a screen of some form which has a width and height, so the bare minimum required to the area covered by the screen when moved along the path.
- The number of requests doesn't matter as much as the amount of data transmitted.
So with that what you can do is a divide and conquer approach. You start with the enclosing rectangle. At each step you figure out if:
- The rectangle is within the region of interest for one segment. That is the rectangle is only contains pixels that you want to download.
- The rectangle is completely outside the region of interest.
- There's some overlap with regions of interest.
- There's some overlap but the rectangle is sufficiently small.
If the rectangle is completely in or out then it's easy, request the rectangle if it is in ignore if it is out.
If there's some overlap but the rectangle is small (case 4) you can just download it to ease on the computation. You can go down to the pixel but that's probably overkill.
The tricky case is if there's some overlap and the rectangle is large. In this case you divide the rectangle into 4 smaller ones (half along each side) and call recursively for the 4 smaller ones. One tiny optimization: If the algorithm decides to fetch all 4 smaller ones entirely, you should fetch the larger one instead of the 4 small ones.
To decide on the inclusion overlap, you can take each piece of the path, and for each you take the view rectangle place it at each end, link the corresponding corners and take the convex hull. Then compute the intersection/overlap of the convex hull with the rectangle you are testing.
While this seems a bit complicated it should cover well a bunch of corner cases (like very small path segments, or self intersecting path).