You are not logged in.

#1 2010-09-10 11:10:41

SPACESHIP
Member
Registered: 2010-09-10
Posts: 2

Calculate routes + distances automatically - possible with OSM?

Hello everyone!

I want create a little script that automatically calculates routes for multiple, imported adresses and reports the distance.

For example: I have a database with 4 adresses, called A,B,C,D and one destination (calles Z).
Now the script should automatically calculate the Routes A->Z, B->Z, C->Z, D->Z (for a car) and report back the distance for each route.

This is possible with the Google maps API, but due to license restrictions I can not use it.

I skimmed through your wiki and found out, that there are various routers. I tried some of them, but most showed poor results (e.g. didn't even find the adresses).

I would be very thankful if someone could point me in the right direction here. What tools do I need? Which router would be the best for Germany?

thanks in advance, SPACESHIP

Offline

#2 2010-09-14 13:26:49

Richard
Member
From: Charlbury, UK
Registered: 2007-04-24
Posts: 422
Website

Re: Calculate routes + distances automatically - possible with OSM?

OpenStreetMap does not have consistent good address data. Even the cleverest routing algorithm in the world can't find 57 Frog Street if no-one has tagged Frog Street with house numbers in OSM.

So if you want a complete addressing solution, you're better off looking elsewhere. The well-known Skobbler routing software, for example, uses OpenStreetMap for routing but Google for addressing.

If, however, you're happy to sacrifice addressing quality, try looking at yournavigation, MapQuest's Open API, and CloudMade as good quality routers.

Offline

#3 2010-09-14 17:12:01

Lambertus
Inactive
From: Apeldoorn (NL)
Registered: 2007-03-17
Posts: 3,269
Website

Re: Calculate routes + distances automatically - possible with OSM?

There are a number of opensource routing engines that work with OSM data, Gosmore for instance is good and versatile. But, as Richard pointed out, we're still missing a lot (well, nearly all) addresses. So if you have a private or other source that can convert an address to a point on the map then OSM has the streetnetwork information and the routing software. Most routing engines are capable of communicating using the commandline and are therefore extremely easy to integrate with scripts.

If you are satisfied with only routing to the street in question (not the housenumber, but just the street) then OSM is all you need.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#4 2010-09-15 16:22:57

stephan75
Member
Registered: 2008-05-28
Posts: 2,907

Re: Calculate routes + distances automatically - possible with OSM?

Have a look at http://openaddresses.org/

Is that helpful for you?

Offline

#5 2010-09-30 13:30:17

SPACESHIP
Member
Registered: 2010-09-10
Posts: 2

Re: Calculate routes + distances automatically - possible with OSM?

Thank you all for you answers and I'm sorry that I couldn't reply any sooner.

Routing to the street would be enough.
I tried the routers that Richard suggested but as far as I could find out only MapQuest Open Directions Service allows me to implement it into a script.
The problem here is, that the MapQuest Open doesn't seem to allow adresses, it only uses longitude/latitude coordinates.

The perfect thing for me would be a simple way to give the router my start and my end adress and then he returns the distance as response.


I'd be thankful for any ideas?

Offline

#6 2010-09-30 16:07:01

stephan75
Member
Registered: 2008-05-28
Posts: 2,907

Re: Calculate routes + distances automatically - possible with OSM?

I can give you only just one more hint to look at: (Maybe you have been there already ...)

http://wiki.openstreetmap.org/wiki/Routing  ... and there the lists for online or offline routing.

Offline

#7 2015-05-01 19:57:37

Zhinus
Member
Registered: 2015-05-01
Posts: 1

Re: Calculate routes + distances automatically - possible with OSM?

Hello everyone!
As part of my PhD research, I need to find the driving distance between origin-destination pairs based on longitude-latitude data that I have. Due to the large number of elements (about 1,500,000) and considering the time constraint of project, I cannot use the free version of Google Map API which gives me at most 2500 elements per day.

I'm wondering if I can use any of OSM APIs for doing this? and if there is a limitation on the number of queries per day?

Thanks in advance

Offline

#8 2015-05-03 15:41:07

stephan75
Member
Registered: 2008-05-28
Posts: 2,907

Re: Calculate routes + distances automatically - possible with OSM?

Zhinus wrote:

Hello everyone!
As part of my PhD research, I need to find the driving distance between origin-destination pairs based on longitude-latitude data that I have. Due to the large number of elements (about 1,500,000) and considering the time constraint of project, I cannot use the free version of Google Map API which gives me at most 2500 elements per day.

I'm wondering if I can use any of OSM APIs for doing this? and if there is a limitation on the number of queries per day?

Thanks in advance

The key word you need is "batch geocoding" ... do a search for this on http://help.openstreetmap.org and you will find some more hints about that.

Offline

#9 2015-06-16 06:20:00

pmars
Member
From: The Netherlands
Registered: 2010-10-17
Posts: 53
Website

Re: Calculate routes + distances automatically - possible with OSM?

Zhinus wrote:

Hello everyone!
As part of my PhD research, I need to find the driving distance between origin-destination pairs based on longitude-latitude data that I have. Due to the large number of elements (about 1,500,000) and considering the time constraint of project, I cannot use the free version of Google Map API which gives me at most 2500 elements per day.

I'm wondering if I can use any of OSM APIs for doing this? and if there is a limitation on the number of queries per day?

Thanks in advance

Although our route planner website interface uses GM, our route optimization API is fully OSM based. It can also be used for distance matrices up to 150 points at a time. The number of queries is "unlimited", but with a fair-use policy and rate-limited to one at a time.

Check https://www.routexl.nl/api

Offline

Board footer

Powered by FluxBB