OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#176 2013-02-19 20:59:45

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

Re: Routing website using Gosmore routing engine

Hello Konstantin, your browser will block cross site scripting calls because of possible security issues. Therefore you'll need to send the request to yournavigation.org via proxy script on your own server.

It would look something like this:
Var apiurl = "proxy.php?url=http://www.yournavigation.org/api/dev/"

There is an example proxy in the YOURS repository named 'transport.php'.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#177 2013-03-12 13:39:46

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

Re: Routing website using Gosmore routing engine

I've been rebuilding our Gosmore maps every month or so, but the latest updates didn't work out. I've build the program from svn and downloaded a fresh planet. The rebuild doesn't end in errors and delivers pak's, but these are much smaller than normal:

11473176 Mar 10 07:09 america.pak
45057416 Mar 10 04:56 eurasia.pak

It may very well be an error in our setup, but before I go into low-level debugging: is anyone else having trouble rebuilding Gosmore .pak's lately?

Offline

#178 2013-03-12 17:40:38

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

Re: Routing website using Gosmore routing engine

hello pmars,

may that be related to http://wiki.openstreetmap.org/wiki/64-bit_Identifiers ??

Offline

#179 2013-03-12 19:11:53

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

Re: Routing website using Gosmore routing engine

It's very possible that stephan75 is correct. Pmars, do you perform the rebuild on a 32bit or 64bit OS?


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#180 2013-03-13 08:40:23

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

Re: Routing website using Gosmore routing engine

@Lambertus I'm on 64-bit (Ubuntu 12.10)

@stephan75 Great suggestion. Checked my toolchain and most probably I need to update Osmosis, I'm currently running version 0.40.1. Will do so and report back to let you guys know.

Thanks!

Offline

#181 2013-03-15 12:21:58

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

Re: Routing website using Gosmore routing engine

Well, updating Osmosis wasn't enough. it seems that the option "idTrackerType=Bitset" in the update script is not working. Without it, Osmosis uses dynamic id-trackers and the resulting file sizes seem to explode. As a result the machine was in swapping madness this morning and I had to reboot it.

I will do another run over the weekend allowing for more runtime but if anyone found a solution I am very interested. cool

BTW: @Lambertus, how's the YOURS website routing maps update? Can we learn from that?

Offline

#182 2013-03-18 11:26:11

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

Re: Routing website using Gosmore routing engine

My toolchain ran succesfully over the weekend. I had changed the Osmosis idTrackerType to Dynamic and added some filters too:

idTrackerType=Dynamic --tf accept-ways highway=* --used-node

The resulting *.pak files have "normal" sizes again:

5989025172 Mar 18 01:43 america.pak
9802347044 Mar 17 10:13 eurasia.pak

Testing some routes went fine. So I guess my problem is solved. Thanks for you help.

smile

Offline

#183 2013-03-18 11:49:29

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

Re: Routing website using Gosmore routing engine

Hi pmars,

I just read your first post and wanted to say "I haven't ran an update because I'm afraid it breaks the routing" but you solved it in your second post. Great! I'm really glad it wasn't a Gosmore problem. smile

As an alternative to Osmosis you can use osmupdate to keep a local planet up to date. It's a bit faster and uses less resources compared to Osmosis.
As an second alternative you can use osmconvert to extract the bounding boxes for Eurasia and America's. Same as osmupdate, osmconvert is a bit faster and uses less resources compared to Osmosis.

On sarel.openstreetmap.org (which only serves Eurasia) I'm using the following update script:

wget -q -O - http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf | buffer -m 8M | ~/osmconvert - -b=-32,-89,180,89 --out-osm | buffer -m 8M | ./gosmore rebuild
mv ./gosmore.pak eurasia/

It's really quick, the buffers are used to spread the load over multiple cores and ensures that gosmore can fully utilize the core on which it runs (gosmore rebuild is single-threaded) smile


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#184 2013-03-18 14:00:41

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

Re: Routing website using Gosmore routing engine

Aargh, komt ie nu pas mee...  wink

** My apologies for using Dutch. It says: "Thank you. What a great suggestion!" **

Offline

#185 2013-04-10 21:48:27

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

Re: Routing website using Gosmore routing engine

So there are currently still only two servers available, one for the America's and one for the rest of the world (Eurasia). And the number of users are increasing. This month I've seen days with over 300.000 route requests. What a marvellous feat for a routing application (Gosmore) developed for mobile devices!

But as the load on the Eurasia server is increasing, and the unfortunate habit of Gosmore to run for long periods and consume huge amounts of RAM for long routes, there are unfortunately periods where the server starts to drop requests. To combat this while waiting for extra servers to become available a simple load balancing function is implemented that simply redirects requests to the American server when the Eurasia server is working on two or more route requests. I hope this increases the responsiveness. It will become handy when the new servers come online as well.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#186 2013-07-22 14:41:17

voschix
Member
Registered: 2013-07-22
Posts: 7

Re: Routing website using Gosmore routing engine

Tried bicycle routing on http://www.yournavigation.org  for the first time.

My test was

Padova - Vicenza (in Italy):

1) bicycle (routes) + fastest: the proposed route uses the motorway A4
2) bicyle + fastest: the proposed route uses cycle paths and cycle routes
3) bicylce + shortest: the proposed route uses the state road SR11, which has heavy traffic and very few cycle paths or lanes

(1) is illegal
(2) is a nice route, but by far the slowest and longest
(3) is the fastest and shortest

Volker

(Padova, Italien)

Offline

#187 2013-10-06 01:10:34

Andre Engels
Member
Registered: 2009-10-23
Posts: 98

Re: Routing website using Gosmore routing engine

I was doing some routing near my parents' place, and noted something odd. When choosing the 'cycling-fastest' option, it provided me with a route that was not only longer but also slower than the 'cycling-shortest' gave. Why this behaviour? (if you want to check: It's in the village of Drouwen, going from the three-way crossing Hoofdstraat-Lemenweg-Stobbenweg in the east of the village to the crossing Lemenweg-Gasselterstraat-Drouwenerstraat, further to the (north)east. The shortest route was 1.86 km, taking 307 seconds, the fastest route 2.40 km, taking 615 seconds).

Offline

#188 2013-10-09 22:02:55

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

Re: Routing website using Gosmore routing engine

' Fastest' is a different algorithm then 'shortest', as it uses time penalties to determine the fastest route instead of distance to find the shortest route.

The speeds on different road types are configured and for cars the higher the road class the higher the speed. But I did not want to do that for bicycle routing, I configured cycleways as the fastest road type, then unclassified, tertiary, secondary etc. Therefore, in bicycle mode, the router prefers cycleways and unclassified ways.

Does this explain the behaviour you're seeing?


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#189 2013-10-18 14:11:57

Andre Engels
Member
Registered: 2009-10-23
Posts: 98

Re: Routing website using Gosmore routing engine

Lambertus wrote:

' Fastest' is a different algorithm then 'shortest', as it uses time penalties to determine the fastest route instead of distance to find the shortest route.

Yes, I understand that. But based on that I find it strange that the shortest route is faster than the fastest one (as well as shorter).

The speeds on different road types are configured and for cars the higher the road class the higher the speed. But I did not want to do that for bicycle routing, I configured cycleways as the fastest road type, then unclassified, tertiary, secondary etc. Therefore, in bicycle mode, the router prefers cycleways and unclassified ways.

Does this explain the behaviour you're seeing?

Not really, the shortest route uses a tertiary road, the fastest route a (longer) track (more precise data: The shortest route is 1.1 miles of tertiary, the fastest one is 0.4 miles tertiary, 1.0 miles track, 0.1 miles tertiary). And, as said, the outcome for the fastest route was not only longer, but also slower than the one for the shortest route.

I found another strange behaviour now, by the way: In this case the fastest and the shortest route were the same, but where the shortest route was 0.34 km, taking 57 seconds, the fastest one was 0.34 km as well, but took 233 seconds. Surely when getting the same route, they should give the same data for travel time as well as length, no?

Last edited by Andre Engels (2013-10-18 14:21:47)

Offline

#190 2013-10-18 15:07:50

Andre Engels
Member
Registered: 2009-10-23
Posts: 98

Re: Routing website using Gosmore routing engine

Checking everything again, I see that apparently 'fastest route' uses a different speed determination than 'shortest route', and that my issue does indeed seem to depend on the values given to the various roads - track being much higher scaled and tertiary much lower than I would have thought. Making an estimate of the various speeds, it seems to come around something like this (precise numbers can't be given, because different trajectories give different values - I assume this is because there is something like a penalty for crossings or somesuch

cycleway: 23 km/h
track: 20 km/h
residential: 20 km/h (more unsure than the others because I have not checked any long stretches)
unclassified: 18-19 km/h
tertiary: 12 km/h
secondary: 11 km/h
primary: 10 km/h
service: 9 km/h

My second issue was probably because there was a road with "highway=pedestrian, bicycle=yes" which was calculated as if it had to be walked (5 km/h) despite the 'bicycle=yes' specification.

Some more: cycleway=lane and cycleway=track both did not seem to change the speed of the road. A road with oneway=yes, cycleway=opposite was the same speed in both directions.

I think these speeds can be a lot improved - in my opinion, the gap between tertiary and unclassified is too large, track is (much) too high, service (much) too low (I have seen excellent bicycle roads tagged as service because they were "destination only" for motor vehicles).

Offline

#191 2013-10-22 21:06:53

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

Re: Routing website using Gosmore routing engine

The server is currently not available (it's not responding). It may possibly be down because of a DoS (intentional or unintentional) as I see a huge spike in Apache accesses on the routing server before route requests stop coming through. I have no idea when the server will be back online.

For anyone who is running some sort of script against the routing server: please stop it and send me an email: osm at na1400 dot info

Edit: The server is up and running again.

Edit: Wow, on the 19th October yournavigation.org handled 625.000 unique route requests plus 100.000 cached requests, that's more then 8 requests per second on average cool

Last edited by Lambertus (2013-10-23 09:46:45)


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#192 2014-01-28 12:05:01

haroldship
Member
Registered: 2014-01-28
Posts: 12

Re: Routing website using Gosmore routing engine

Hello there. The routing service does not seem to be working in the Detroit area, and possibly the whole U.S. It does appear to be working in Europe.
Requests in the U.S. return the following as HTML:

<b>Notice</b>:  Undefined index:  content_type in <b>/home/lambertus/public_html/yours/api/dev/route.php</b> on line <b>188</b><br />

Harold Ship

Offline

#193 2014-01-28 14:14:00

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

Re: Routing website using Gosmore routing engine

Thanks for the report.

It looks like the server that was providing routing for the America's has been disabled (I get timeouts trying to login). This was a sponsored server and the server has been provided for far longer then originally agreed upon, so I'm not complaining. I've made a change so that all route requests for the America's is handled by one of the two remaining servers. The routing database for the America's on that server is quite old though...

Sorry for any inconvenience.

Anyone with a server or VM to spare that has 32 GB ram is more then welcome to contact me.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#194 2014-01-28 14:58:53

haroldship
Member
Registered: 2014-01-28
Posts: 12

Re: Routing website using Gosmore routing engine

Thanks for your quick reply! It is working now. smile

Offline

#195 2014-02-03 16:19:46

haroldship
Member
Registered: 2014-01-28
Posts: 12

Re: Routing website using Gosmore routing engine

Hi (I also posted this in gosmore topic)

I'm trying to rebuild the north american database for gosmore on Ubuntu Saucy (using the version from universe repo). How long does it take, and how do I know if it is still working?

I started it around 24 hours ago. Top shows gosmore is using 100% of CPU, but as of right now, it stopped writing to /usr/share/gosmore directory more than 12 hours ago.

The output on the console:

Building gosmore.pak using style elemstyles.xml...
Icon public.png not found
Icon public.png not found
Icon religion/synagogue.png not found
Icon religion/mosque.png not found
Icon rendering/landuse/cemetery.png not found
Icon wlan.png not found
Icon rendering/landuse/cemetery.png not found
  1 while (xmlTextReaderRead (xml) == 0
  2 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)
  3 while (fread (s, sizeof (s), 1, groupf[i + NGROUPS]) == 1)
  4 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)
  5 while (fread (s, sizeof (s), 1, groupf[i + NGROUPS]) == 1)
  6 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)
  7 while (fread (s, sizeof (s), 1, groupf[i + NGROUPS]) == 1)
  8 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)
  9 while (fread (s, sizeof (s), 1, groupf[i + NGROUPS]) == 1)
 10 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)

Offline

#196 2014-02-03 17:56:45

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

Re: Routing website using Gosmore routing engine

doublepost of haroldship ... see Q&A sub forum here.

Last edited by stephan75 (2014-02-03 17:57:13)

Offline

#197 2014-02-04 22:36:25

rayzo
Member
Registered: 2014-02-04
Posts: 1

Re: Routing website using Gosmore routing engine

Hello dear

A friend and I working in the new multimodal bus transport public maps in Bogotá city (Colombia)

We are graphic designers (no know programing)

I am testing the public transport with http://www.yournavigation.org/ and no working fine, I no understand what is doing...

I like me know it is possible send the KMLs maps we are doing and if is possible use public transport system using this maps

I think when the results show, should be show the number of bus route in the map

Thanks for your help

Offline

#198 2014-02-05 12:38:16

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

Re: Routing website using Gosmore routing engine

Public transport (i.e. bus/train/metro routes and time schedules) is not supported on yournavigation.org. The option 'public service' is just for routing over ways that allow public service. In OSM mapping speak these are the ways that are labelled: psv=* (and probably emergency=*, but I'm not sure at this moment).

The Gosmore routing engine only performs least-cost routing based on road speeds for each type of transport. It doesn't support public transport routes or time schedules. Perhaps it's possible to pre-process the data to make Gosmore work 'sort-of' but it will never be good at it. You'd better find a different routing engine that is specifically built to handle this type of transport.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#199 2014-02-05 21:09:47

haroldship
Member
Registered: 2014-01-28
Posts: 12

Re: Routing website using Gosmore routing engine

I got my local copy of YOURS up and running! I had some issues though. I opened a bug here: https://trac.openstreetmap.org/ticket/5113

Offline

#200 2014-02-06 09:48:27

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

Re: Routing website using Gosmore routing engine

Congratulations!

I don't really understand why you need a fix, for updating the whole planet works well without the patch. Have you made changes to the elemstyle.xml?


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

Board footer

Powered by FluxBB