I am doing a supply chain optimization algorithm with Wolfram Mathematica. In this algorithm I am communicating with googlemaps API and providing it longitude and altitude coordinates, then I return the shortest distance between them for “truck/car” type vehicles. However googlemaps API has a daily limit 2500 requests. I want to use OSM API offline on my local computer. I found that I can do this by downloading the Europe OSM file and to use JOSM - JAVA openstreetmap editor to do this.
However, I did not find any information how to make a request to the editor from another software.
Is it possible to do this, if yes how? is there any script example or plugin?
It’s not clear how you are using JOSM. You can’t use it to download the data, as the APIs it uses have limits that correspond to a small town, and it wouldn’t be able to store the whole of Europe, even if loaded by other means.
Also, although there is probably no technical enforcement of this, you should not download the whole of Europe frequently, but rather take a feed of the changes and merge them locally.
You are basically putting a load onto free of charge resources that cannot be justified, so, if you want to use live data, a significant part of your project has to relate to how to use the available resources in a way that minimises the cost to the suppliers of those resources.
For the initial download, I would expect you to directly download the data, parse the XML, and load it into a database that is optimised for your application.
If you want it keep it up to date, you should read http://wiki.openstreetmap.org/wiki/Planet.osm/diffs
Isn’t the travelling salesman problem NP-Complete?
Thank you for your replay. I am new to OSM so maybe I am not asking correctly.I got some feedback already, but it is still not clear to me how should I solve this problem.
I have about a 100 addresses in West Europe (Longitude, Altitude coordinates). I am solving a warehouse localization problem. In the first part I am using a clustering algorithm, to form preliminary warehouses locations based on the selected number of warehouse. During the second part I form a grid and optimize the optimal warehouse location.
The optimization is done by evaluating the transportation cost based on pallet quantity and distance. I have finished the algorithm with Wolfram Mathematica and the distance is computed by accessing google maps API, however the map has a 2500 daily request limit.
I don’t know if OSM can help me in this case. But as I understood I should use GraphHopper to run OSM offline map and to communicate with it with Wolfram Mathematica.
Firstly, I am asking if this is possible to do so? If yes, how can I communicate with GraphHopper? Do I need a script for wolfram that can work with “local computer Java software” or can GraphHopper create a HTTP API and I can provide the information directly to it (similarly googlemap API works).
To put it simply, I expect that I can provide longitude altitude coordinates for points A and B to Graphhooper (or other software that works with OSM) and return back the distance between these points to wolfram.
If this is not possible to do, I will need to rewrite my warehouse localization algorithm in Java or C++.
I hope this information will help to better understand my question.
Thank you and sorry for the inconvenience.