Routing website using Gosmore routing engine

Hah, thanks for the writeup.

I know that YOURS isn’t very easy to setup and not everything is consistent, but it’s nice to see that someone else can make it work by fixing (mainly) a few hard-coded paths. Thanks also for the bugreports :slight_smile:

Regarding elemstyles.xml: I built the gosmore.pak twice. Once with the default elemstyles and one with only routing related info. The resulting PAK files were identical in size, so it appears not to make a difference when using Gosmore with the compiler option ROUTING_ONLY enabled.

The website seems to be out of service: http://www.yournavigation.org/

:confused:

Hi all

I am running a local copy of YOURS, and my users have noticed that my APIs don’t return ‘traveltime’, although the hosted version at http://www.yournavigation.org does.
Is there something I need to do to get this working?

Harold Ship

Also replied by email yesterday, but for completeness my answer:

The Gosmore routing engine provides an estimated time to destination on each node in it’s output. The first node in Gosmore’s output should contain the total trip time (Gosmore outputs the route in reverse order).

See the documentation of the output elements here:
http://wiki.openstreetmap.org/wiki/Gosmore#Cgi_Routing_Interface

I hope this helps.

Harold,

I had the same problem and Lambertus was kind enough to send me his version of the gosmore.php file. Note that you will need to update his local path references (shown below) to your settings:


…
// Geographic pak file selection
$pak = '';
if ($flon < -30) {
	// American continents (North and South)
	$pak = '/home/lambertus/gosmore/america/gosmore.pak';
} else {
	// Europe, Asia, Africa and Oceania continents
	$pak = '/home/lambertus/gosmore/eurasia/gosmore.pak';
}

if (file_exists($pak)) {
	$dir = '/home/lambertus/gosmore/';
…

You will also need another file called geography.class.php which needs to be in the same directory as the gosmore.php file. I’ll send you both files in an email. (i’d post them here but don’t see an option - anyone who can can help me with posting these files here…?)

  - hp -

Thanks packhamster. I’ll add that you don’t really need the geography.class.php file. The gosmore.php file also contains two alternative functions to calculate the distance between nodes, they are currently commented out. To use these simply uncomment the functions (GreatDistance and/or Haversine) and replace the call to geography class with the getDistance() function. These functions are probably a bit less accurate then the geography class although unnoticeable for short trips, but they’re slightly faster especially because the geography provides a vincenty option which is used by default but is requires more calculations. Alternatively use the query option ‘distance’ and set it to ‘gc’ or ‘h’ as documented here.

It’s nice to see how well Gosmore actually scales. While originally intended as a mobile routing engine it powers yournavigation.org with worldwide routing and handled more then 700.000 route requests on january 16th. I expect yournavigation.org will be able to scale way beyond 1 million requests per day with the addition of a new server (Core i7-4770 and 32 GB ram), courtesy of Lobo.at. I plan to show the results of some intense benchmarking shortly.

I’m still very interested in a sponsoring of (temporary) access to a server with 64 GB ram which I’d like to use for experimenting (and hopefully add as routing backend) with the OSRM routing engine.

Hi,

We use Yournavigation.org in a tourism application to get walking directions from one city attraction to another. In the walking directions, we sometimes see things like below:

Go straight ahead. Follow the road for 0.0 mi.
Turn right. Follow the road for 0.0 mi.
Turn sharp right into Piazza di Trevi. Follow the road for 0.0 mi.
Continue on Via Poli. Follow the road for 0.0 mi.

We think the reason why we see so many “0.0 mi” is that there is the short walking distance between each turn. Since the distance value shows only one digit after the decimal point, the last two digits were left off. Normally one should see “0.034 mi” or “0.045 mi”, etc.

Is there a way for us to get the distance value displayed with three digits after the decimal point in the walking directions?

Also, it seems that the distance metric is always in mile. Is there a setting to change the distance metric to kilometer, meter, or foot?

Your help will be appreciated.

Currently the units (metric of imperial) is determined by the “lang” query parameter. Please see the following examples.

Dutch: http://www.yournavigation.org/api/1.0/gosmore.php?flat=52.220412408482&flon=5.9507827564704&tlat=52.199374599827&tlon=5.949066142701&v=motorcar&fast=1&instructions=1&lang=nl

Rechtdoor op Burglaan. De weg vervolgen naar 40 m.

English (British): http://www.yournavigation.org/api/1.0/gosmore.php?flat=52.220412408482&flon=5.9507827564704&tlat=52.199374599827&tlon=5.949066142701&v=motorcar&fast=1&instructions=1&lang=en_GB

Continue on Burglaan. Follow the road for 40 m.

English (US): http://www.yournavigation.org/api/1.0/gosmore.php?flat=52.220412408482&flon=5.9507827564704&tlat=52.199374599827&tlon=5.949066142701&v=motorcar&fast=1&instructions=1&lang=en_US

Continue on Burglaan. Follow the road for 0.0 mi.

Default is en_US.

Unfortunately I have no control over the number of digits in the directions. But you may notice that the metric output changes automatically between meters and kilometers while the imperial output is always in miles, again this is behavior I don’t have control over. A simple and slightly humorous fix in your app replaces ‘0.0 mi’ with ‘a few feet’… :wink:

I’ve asked the author of RoutingInstructions to automatically change mi to feet for short distances.

Lambertus,

Thank you for the quick reply. We played with the “lang” setting in our queries and saw how the distance unit changed according to the “lang” parameter. However, we notice that the total travel distance value of the route remains the same for en_GB and en_US. So if the travel distance was 1.5 miles in en_US, it will be 1.5 kilometers in en_GB. We can make the km/mile conversion on our side, but how do we know which value is correct, 1.5 mile (based on en_US) or 1.5 km (based on en_GB)?

Hi

FYI in Britain they also use miles. You might try Canada or Australia.

That’s a good observation! The total distance is calculated by a geography class (I could just take the value from Gosmore but don’t) and is always metric (km).

I’ve updated the documentation of the parameters in the wiki which will hopefully prevent confusion for future new API users.

The RoutingInstructions applications clearly returns metric units for en_GB (and also for en_CA and en_AU).

Wikipedia says about Brittain:

Ambiguous…

Hello!
Is service supported yet?
Some bug report. Permalink to built route quite broken.
For example I have built route, it displayed correct, then I go to permalink and see: http://www.yournavigation.org/?flat=55.975663076834&flon=37.730939831517&tlat=56.087881063729&tlon=37.727506603977&v=bicycle&fast=0&layer=cycle
Seems like site provide two possible routes, first one is for car and second is for bicycle. After pushing to “Find route” button site displays only route for bicycle, correct.

Thank you for your service!

Feature request: I’d like to have a way to set my default location/zoom level. Every time I open yournavigation.org it shows the world map, I always have to search for my location (the “share location” function doesn’t work; not sure why but it seems to be an ISP level issue as no other service can get my location reliably).

Any way to have this done? In my case specifically to set it to show Hong Kong.

Does anyone know of an open source routing api to use with a GPS tracking software. Friend at http://www.crowtracker.com is interested in routing solutions but its almost all american users. I see a bunch of web based ones like http://www.yournavigation.org/ etc but needs an API.

http://project-osrm.org/

YOURS (yournavigation.org) has an open API that is used quite a lot by GPS tracking software. Documentation is here

Today I was making a route for moped. Control.
http://www.yournavigation.org/?flat=52.708675669588&flon=5.862941741907&tlat=52.710477828857&tlon=5.7758396863608&v=motorcar&fast=1&layer=mapnik

But the route proposal took the main road. fastest

On the main road, I set a moped=no 28-1-2014

The map data you used is from: Routing data from planet file: 2014-03-05

Route problem.
Moped must use the way next to the main road.

Situation:
http://mijndev.openstreetmap.nl/~allroads/mtm/?map=mopedways&zoom=18&lat=52.70794&lon=5.84486&layers=B000000TTFFFTTTTTTTTTTTTTTTTTTTTTTTF

My mistake not hit find route by switch to moped.
Now he make a other turn.
Now taken a small part of motor_vehicle=no
http://mijndev.openstreetmap.nl/~allroads/mtm/?map=mopedways&zoom=19&lat=52.70843&lon=5.84542&layers=B000000TFFFFFTFFFFFFFFFTFFFFFFFFFFFF

and de permalink
made this
http://www.yournavigation.org/?flat=52.708675669588&flon=5.862941741907&tlat=52.710477828857&tlon=5.7758396863608&v=moped&fast=1&layer=mapnik

Routing database has been updated. Usage of yournavigation.org is slowly increasing: on some days it handles more then 550.000 unique route requests.

Edit September 8th: Some users informed me about a problem with some empty routing results. This is the result of a problem with one of the servers that handles route requests for Eurasia/Africa. This has now been fixed, I’m sorry for any inconvenience.

Linked some friends to yournavigation. They noticed a bug and figured out how to reproduce it: do another route request before the old one returned/completed.

They then took this to the next level :stuck_out_tongue:
A couple creations:

http://snag.gy/zB1g9.jpg
http://snag.gy/2B2Hw.jpg
http://snag.gy/VISw6.jpg

I guess the easy fix is to check in Javascript whether a newer request already returned before showing the result of a random request. And clearing the map when the result returns instead of just when the request is made. Or we consider it art and leave it be :stuck_out_tongue: