I have an application that shows the route from one location to another. And I implemented it using Leaflet Routing Machine with OSRM routing engine. Following is a google map image showing some routes,
What I need is I need to get all Zip Codes which fall on that particular Route (Between Two Locations ex. New York to Livingston). I need to get all the Zip Codes in between those two places (in the given route. It may be the alternative route or the main route). And the zip codes can be within a 2-mile radius from the route.
I have downloaded the 2020 ZCTA shapefiles from Census.
I used QGIS to view this shapefile and I saved this to the Postgres database. I need to know how can I get the zip codes which intersect the given route within a 2-mile radius. Basically, the zip codes are in that route.
Here is an example,
From New York, USA to Livingston, New Jersey, USA following are the zip codes fell within a 2-mile radius.
07039, 07052, 07107, 07029, 07306, 10002
Can anybody help me?