New answers tagged

1

As suggested in the comments: there is a simple solution via fetching the POIs calculating the detours and picking the best route in the end like I did with similar requirements here. Another option would be to attach the POI information directly in the graph, and do the graph search (Dijkstra or A*) until you find a set of suitable ones, then calculate the ...


1

The route method does not pass any options on to the router. You'll want to use the getRouter method to set the router options first. Then you can recalculate using route: L.easyButton('<img src="pic.png">', function(btn,map){ myRouter.getRouter().options.costing = "pedestrian"; myRouter.route(); }).addTo(map);


0

I think ArcGIS Network Analyst contains the tools that you are looking for. More specifically Make OD Cost Matrix Analysis Layer is what you are looking for considering you would like to calculate distances between thousands of origin destination pairs. Moreover, you can refine how your locations (origins, destinations) will interact with your network. I ...


0

Is there a particular reason why you want to use particle swarm optimization in this case? If what you really want is to find the least-cost paths, you may consider using Dijkstra's algorithm. Here is one possible implementation, written in MATLAB (there are many): https://www.mathworks.com/matlabcentral/fileexchange/20025-dijkstra-s-minimum-cost-path-...


0

I don't think you are allowed to use http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route In a production app. Esri has paid options for directions services to use instead.


1

About the 2nd part _routes can't be accessed directly, but you can use the routesfound event right after .addTo(map) function: routeControl.on('routesfound', function (e) { distance = e.routes[0].summary.totalDistance; time = e.routes[0].summary.totalTime; });


0

We use method 1 in our open source fleet scheduling app. We use the Graphhopper library to determine the travel time and distance matrix, between all pairs of points. We then use the jsprit project (which has now merged with Graphhopper) to solve the VRPTW (and many other routing and scheduling problem variants).



Top 50 recent answers are included