I believe that you need to do this in a two-step process:
The first step is to compute a polyline representing the route between A and B (as you say, this is obvious). You can do this using BEST-REST (http://msdn.microsoft.com/en-us/library/ff701717.aspx) or SOAP (http://msdn.microsoft.com/en-us/library/cc966826 .aspx), for example.
When you request a route from any of these services, be sure to indicate that you want the entire route path to be included in the results (rpo parameter for REST parameter or RoutePathType.Points for SOAP). This will give you an array of all the points that are used to build the routing - otherwise you just get a summary of the waypoints (i.e. only those points on the route where you need to do something), change the roads, etc. ),
As soon as you get an array of points, the second step is to determine all those places that lie at a distance x of the path drawn between these points. Despite the fact that there are many web services that allow you to request places located within x distance from a single point (including the Bing Maps search service and the geonames findNearby search service, for example), I do not know any web services that provide this function, so you have to provide it yourself.
One way to do this is to use SQL Server 2008 or SQL Server Azure, loaded with a geonames allCountries data dump from http://download.geonames.org/export/dump/ . Then you can build LineString geometry from the points of your route and request a list of places in the database with the request, for example:
SELECT * FROM allCountries WHERE Location.STDistance (@RoutePath) <= 1000;
Johannes Kebeck posted an example using this approach based on the Bing SOAP Route and SQL Azure service, which you can find here: http://jkebeck.wordpress.com/2010/06/26/find-near-route-for-bing -maps-powered-by-sql-azure-spatial /
source share