Answers to: Limits per day problem - supply chain optimization algorithmhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm<p>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. </p>
<ol>
<li>
<p>Can anybody provide some information from what to start? For now I have an algorithm made with Wolfram Mathematica, However I didn’t find any openstreetmap scripts that would work with this software. </p>
</li>
<li>
<p>Is there any finished application that I could use and communicate with it easily? E.g. googlemap api works, however it has a 2500 day limit and extra calculations would cost a lot.</p>
</li>
<li>
<p>Is it possible to use simply a web link, that wouldn’t have any limitations? Maybe someone could provide it and for a few days turn off the limits for my IP address? </p>
</li>
<li>
<p>If no, how should I use openstreetmap to solve this problem? Do I need to download the osm planet file and write the code to return the distance between A and B, or is there any completed solutions? I would need to remake the algorithm with another programming language in this case.</p>
</li>
</ol>
<p>I would be really grateful for any advice or help,</p>
<p>thank you in advanced</p>enTue, 01 Dec 2015 06:09:13 +0000Comment by escada on pnorman's answerhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46916<p>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.</p>
<p>See Frederiks comment on <a href="https://help.openstreetmap.org/questions/46914/nominatim-alternative">https://help.openstreetmap.org/questions/46914/nominatim-alternative</a> which states the same</p>escadaTue, 01 Dec 2015 06:09:13 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46916Comment by ValentasG on pnorman's answerhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46911<p>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.</p>
<p>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 <> "&region=es&sensor=false", {"HTML", "Source"}];
roadDistance = StringSplit[StringSplit[distdata, ":"][[13]],","][[1]]
travelTime = StringSplit[StringSplit[distdata, ":"][[16]], ","][[1]]"</p>
<p>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?</p>ValentasGMon, 30 Nov 2015 19:18:53 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46911Answer by pnormanhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm/46910<p>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.</p>
<p>OSRM offers a <a href="https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-table">table</a> query which would probably reduce the number of calls you need to make. Their <a href="https://github.com/Project-OSRM/osrm-backend/wiki/API%20Usage%20Policy">usage policy</a> 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.</p>pnormanMon, 30 Nov 2015 17:44:17 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm/46910Comment by Frederik Ramm on Frederik Ramm's answerhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46893<p>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 ;)</p>Frederik RammSun, 29 Nov 2015 14:55:17 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46893Comment by scai on Frederik Ramm's answerhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46885<p>The limit doesn't apply for a local installation, of course.</p>scaiSun, 29 Nov 2015 09:06:22 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46885Comment by ValentasG on Frederik Ramm's answerhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46878<p>Thank you Frederik for your replay. </p>
<p>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?</p>
<p>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?</p>
<p>I am downloading europe-latest.osm.pbf file, so thank you again for the tips :)</p>ValentasGSat, 28 Nov 2015 21:35:05 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46878Answer by Frederik Rammhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm/46877<p>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.</p>Frederik RammSat, 28 Nov 2015 20:59:51 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm/46877Comment by SomeoneElse on ValentasG's questionhttps://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46874<p>See also <a href="http://forum.openstreetmap.org/viewtopic.php?pid=563563#p563563">http://forum.openstreetmap.org/viewtopic.php?pid=563563#p563563</a> (crosspost)</p>SomeoneElseSat, 28 Nov 2015 20:03:03 +0000https://help.openstreetmap.org/questions/46873/limits-per-day-problem-supply-chain-optimization-algorithm#46874