You are not logged in.

- Topics: Active | Unanswered

## Announcement

**NOTICE: By 30th of September 2022 the forum.openstreetmap.org will be retired**, please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators. We expect the migration of data will be finished by that date, you can follow its progress here.***

## #1 2015-11-29 08:12:08

**ValentasG****Member**- Registered: 2015-11-28
- Posts: 3

### Communication with offline OSM API with Wolfram Mathematica

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?

Offline

## #2 2015-11-29 11:55:43

**hadw****Member**- Registered: 2014-09-02
- Posts: 1,081

### Re: Communication with offline OSM API with Wolfram Mathematica

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?

Offline

## #3 2015-11-29 13:02:46

**SomeoneElse****Member**- Registered: 2010-10-13
- Posts: 1,601

### Re: Communication with offline OSM API with Wolfram Mathematica

Crosspost https://help.openstreetmap.org/question … athematica

(and mostly also a duplicate of your previous question https://help.openstreetmap.org/question … -algorithm )

Offline

## #4 2015-11-29 13:43:38

**ValentasG****Member**- Registered: 2015-11-28
- Posts: 3

### Re: Communication with offline OSM API with Wolfram Mathematica

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.

Offline