How YOURS works?

Hi All,

YOURS is really great…I have configure YOURS on my Local machine,it working fine.
Now I want to understand the flow of its working if any one know how it works then reply me.

I know its basic flow that is
“When we click on map transport.php is call it gives an lat-long for starting location and same for destination.After that gosmore.php is call and its a main engine which gives route”.

Now I want to know in which javascript file “transport.php” and “gosmore.php” is call and how?

transport.php & gosmore.php are called from yours.js. This javascript file has all the client side functionality required for a routing application. Yournavigation.js contains the website specific javascript functions (initialize the map, connect the UI to the yours.js functions.

transport.php is needed to make cross-site calls to nominatim (it is a proxy). So if you click on the map or type a streetname then the call to nominatim for the geolookup is routed through transport.php.

gosmore is indeed called to give the routing result.

The main functionality is all contained in a javascript class called “yours”. This class manages the list of route sections (the route between two markers). When a section is complete (i.e. 2 markers have been placed or one marker is moved) then the class member function “draw” is called. This function calls gosmore.php to give the route. The route result is then parsed by “parseKML” (or in a future version “parseJSON”) which will load the route in OpenLayers.

PS. please post new questions about YOURS in this thread. No need to create a new thread for every question. Thanks!

Why isn’t yours.js in the yours svn? Is it available elsewhere or do I have to get it from the web page?
http://svn.openstreetmap.org/applications/routing/yours/branches/version-1.0-via/www/

A question about the .htaccess file. There’s “php_value output_handler ob_gzhandler”, is this a standard handler of PHP or where does it come from?

Wyo

Yours.js is actually in the api/dev/ directory

The value in the htaccess file is about compressing output if the browser supports it. Compression really speeds communication up (especially the bloated XML files).

Thanks now i got it.

But the new problem arises I hade changed some code in the gosmore.php(kml format so i can read it properly by using C#) and yours is not working now.
I debugg i found everything working fine except draw line.

This problem arises exactly at the time when i am giving the demo.Its my bad luck…

Please help me.

Hey I have solved the problem …
I make stupid mistake i commented this two lines in gosmore.php

  1. $kml .= ‘’.“\n”;

Ah, yes that would break things badly :smiley:

Great that you found the problem yourself!

Hi…Thanks for ur solutions I developed my routing apps, its working fine.
Now i am searching for the Route Suggestions algorithm.
So i just check www.yoursnavigation.org and i found the driving direction(Route Suggestions) is implemented.
Whether i get this code? Or its on svn?

It has only been implemented this week and the code is not yet suitable for uploading to SVN (I will do that in due time ofcourse). As you’ve probably noticed: the website doesn’t handle long instructions well (they fall outside the browser window), which is a CSS issue and there are other things to work out better first.

I’m trying to find out if the route instructions application is available for download somewhere and report back.

Thanks.I will wait
Quite excited to see the Driving Directions.

Driving directions documentation.

This is how the instructions is currently implemented in gosmore.php ($showInstructions is configured from the gosmore.php parameters):

if ($showInstructions) {
    $command = $query." ./gosmore ".$pak. " 2>/dev/null | sed 'y/\"/_/' | ".
        "(cd ../routing-instructions/src/tools/translations; LANG=".$lang." ../../../build/src/routing-instructions/routing-instructions --dense 2>/dev/null)";
} else {
    $command = $query." ./gosmore ".$pak. " 2>/dev/null";
}

Test the results by calling e.g. http://www.yournavigation.org/api/dev/route.php?flat=43.917983006&flon=12.86139500&tlat=43.91087897&tlon=12.87468910&fast=1&v=bicycle&instructions=1

Note: route.php is a new script that functions as a proxy for route requests. There are currently two servers running the Gosmore route engine (one provided by yournavigation.org and one provided by Nic Roets - the author of Gosmore). Based on some simple decision rules the requests are relayed to any of the available servers (I could add more servers when they become available, even alternative routing engines if available).

The updated files should appear in SVN soon, but need some cleaning up first. The YOURS wiki page will also be updated accordingly ofcourse.

Was the route.php and updated yours.js ever added to svn?

There is no route.php in svn and if I open the source for yours.js at yournavigation.org and compare it to yours.js in svn they are different.

Where can I get route.php and/or the complete update source for the yournavigation website.

Cheers
Ross