I am planning to do a PhD in supply chain optimization. I want to solve a warehouse localization problem. I have 120 long, alt addresses in West Europe. I need to calculate distances when using a clustering algorithm, then use a grid to locate the best option for the warehouse. For this purpose I will need to calculate the distances approximately 120 thousand times. I think opensteetmap is the best option for this problem.
I would be really grateful for any advice or help, thank you in advanced asked 28 Nov '15, 18:08 ValentasG |
I'm assuming by distance, you're talking about road length distance or travel time. If you're after direct line distance, this can easily be calculated by simple math from the latitude and longitude. OSRM offers a table query which would probably reduce the number of calls you need to make. Their usage policy seems to allow you to do this with the publicly available server, but if you wanted to run your own server you could do it and you'd only need to load data for the part of Western Europe you need. answered 30 Nov '15, 17:44 pnorman Yes I am talking about the distance and travel time between. I am using now a simply, math formula, however for a correct optimization algorithm I need real distances between points. I understand that I need to do offline routing, because I will need to make requests about 120 thousand times. Otherwise, my IP should get blocked. I have finished a algorithm with Wolfram Mathematica, I am working with googlemaps API distdata = Import["http://maps.googleapis.com/maps/api/directions/json?origin=" <> from <> "&destination=" <> to <> "®ion=es&sensor=false", {"HTML", "Source"}]; roadDistance = StringSplit[StringSplit[distdata, ":"][[13]],","][[1]] travelTime = StringSplit[StringSplit[distdata, ":"][[16]], ","][[1]]" I would like similarly to googlemaps API provide longitude altitude coordinates for point A and B and receive back the distance and travel time for car/truck type vehicle. I have a recommendation to use GraphHopper with Java script. Launching a server would be difficult in this case. It is not necessary to rewrite my algorithm with Java script? Communication between Wolfram Mathematica and OSM should be possible? But how should I do it?
(30 Nov '15, 19:18)
ValentasG
1
Please note that there is no free solution based on OSM that allows you to make that many requests. It costs money to run a server with the whole planet dump and to provide bandwidth for so many requests. I think you either have to run your local server (and thus pay the cost) or pay for a geocoding solution. See Frederiks comment on https://help.openstreetmap.org/questions/46914/nominatim-alternative which states the same
(01 Dec '15, 06:09)
escada
|
There might be web routing algorithms that aren't protectd well enough to kick you out when you make 120k requests but you really shouldn't. It is much better - and it is the beauty of OSM that this is possible - to download the data and run your own routing software on it. There's Europe-only data extracts e.g. at download.geofabrik.de, and you can easily feed them into OSRM or Graphhopper - both free and open source routing engines that work with OSM data out of the box. Both have a HTTP API that you could use locally, but OSRM is in C++ with NodeJS bindings and Graphhopper is in Java, so it would probably be possible to integrate them into your application in a more direct fashion. answered 28 Nov '15, 20:59 Frederik Ramm ♦ Thank you Frederik for your replay. When I used googlemaps API, I simply provided the long and alt coordinates and the API returned the distance. As I understand I can do the same thing by hosting a local map API on my own computer? Or I will need to rewrite my algorithm with C++ or Java? I have checked graphhopper and it should be just the thing that I need, however as I understood I have still a query limit? "To increase your query limits for production you pay online within a few minutes via credit card or debit advice." As a free user I have the same amount as with googlemap api "500 per day". Or if I use a local computer the limits won't concern me? I am downloading europe-latest.osm.pbf file, so thank you again for the tips :)
(28 Nov '15, 21:35)
ValentasG
I think there's one basic Graphhopper package and one API package, and if you install the API then you can access your own local Graphhopper through a web API just like you did with Google. And no, there won't be limits other than how fast your hardware can go ;)
(29 Nov '15, 14:55)
Frederik Ramm ♦
|
See also http://forum.openstreetmap.org/viewtopic.php?pid=563563#p563563 (crosspost)