Routing website using Gosmore routing engine

I’ve been looking over your code, and I noticed this in gosmore.php

echobig($kml, 1024);

Which would possibly be self defeating if the server uses deflate/gzip compression etc.

Also you don’t need the ?> at the end of the file, this just leads to problems if there is trailing blanks, better to not have it.

Thanks for reporting this. The echobig thing was hearsay and I just copied it… :slight_smile: Anyway, I replaced the whole echobig thing with just ‘echo $kml;’. I also enabled standard gzip compression to the .htaccess file and confirmed that the output is now gzipped when the client requests it.

I always thought that, when you ‘open’ the PHP code with ‘<?php' you'd always have to add the 'close' as well ('?>’). But I searched it up and found this. So, yes, you actually have to omit the closing php tag.

Thanks again.

North South America is up-to-date again. I’ll try to make backups first before copying new (and possibly corrupted) databases over older working ones :wink:

There is a limit of about 1280 usable byte per packet most of the time, however the TCP stack/NIC deals with this just fine all on it’s own you don’t need to do a thing about it.

As the link says, it’s optional if you have a closing tag or not, but they said the same thing I did, you don’t end up with problems of trailing white spaces which can cause issues if you don’t have the closing tag.

I finally fixed the GPX export function so that it uses a HTTP POST query instead of HTTP GET. This makes the export function to work even with long routes.

Two major things changed:

  1. Routing can now use waypoints.

  2. The routing API can return the route results in geoJSON format.

Also an IE 6.0 bug has been fixed.

The Gosmore database update for this week has been reversed because of weird routing results (at least in Europe): Gosmore seemed more interested in very small roads then motorways.

Possibly no database updates in the coming two weeks while trying to sort the problem.

Someone from a server in Denmark was hammering the API for days (or weeks, who knows) with about 20 requests per second on an automated manner. This interfered with normal users requests so I’ve blocked the source IP.

A new version of YOURS is released after a lot of work with large contributions from Milo van der Linden (thanks!) rewriting almost everything. This release brings a new -much better looking- interface, calculation of all route segments in parallel, additional transport types and a nice logo.

Screenshot of YOURS

Hi Lambertus,
The interface is very nicely done! Great improvement!

Does YOURS support housenumbers? I am looking for an free software routing service on OSM to check the housenumbers I entered. I also wrote a little tutorial on entering housenumbers and would like to cite your service as an example who would benefit from housenumbers.
http://wiki.openstreetmap.org/wiki/User:Longbow4u/Hausnummern_eintragen

Until now my housenumber queries have failed on yours.

Perhaps you could add a statistics page. It would be interesting to know how many route requests were delivered. Perhaps this would lead to more people contributing (as they see its worthwile).

Another idea would be a simple report mechanism for wrong routing instructions. For example: sometimes when I enter start and endpoint I get a wrong route. I would like to send a short bug report to the designer of the routing algorithm. This report should contain the permalink to my query, (start address, end address), version and date of the OSM-data used, version of the routing software used, date of the routing request, and a short description what went wrong (did not use this motorway but that primary road, did route on forest track instead of available main road etc.). The answers and links could be posted to a message board so that the algorithm designers could improve their software. I think feedback could be very helpful to them.

I would like to help you, but unfortunately I am not a programmer.
Thank you for your great work.

Longbow4u

Thank you :slight_smile:

No, because of two things:

  1. The OpenStreetMap Gazetteer does not support housenumbers (Gazetteer does the name to location conversion when you search by text).
  2. Gosmore (the routing engine) has the tendency to start/stop a route segment on the beginning or end of an OSM way. So it does not address position interpolation.

Yes, it’s on my todo list, but not very high atm.

I hope the developers of Gosmore welcome this, but they would get swamped with reports I’m afraid. There are so many parameters involved that a route is seldom perfect for anyone. There is a wiki page where weird routes could be reported, but reports got in so quickly that you can’t develop fast enough to keep up.

I agree that it would be useful, but I doubt that a special interface (as opposed to the wiki page) would give the developers much better information. There is already an extensive list of routes that pose some difficulty, the devs can check against that list first and ask for more (I could put up a link on the website then).

Hi Lambertus,
The new interface looks great! A few remarks:

  1. the behaviour of dragging the waypoints on the map and moving them is a bit difficult, sometimes it works, sometimes not
  2. by adding more waypoints the left windowframe becomes longer, but there is no slider to move downwards. So the find route button dissapears from the screen and cannot be reached (Firefox 3.5, screensize 1280x800 on my 15.6inch laptop)

You can activate a waypoint by clicking the icon and then click again on the map to place the icon. Dragging the icon is not possible.

Ah, yes that correct. I’m busy fixing the CSS and behavior of the site so it works in IE too and try to fix this at the same time.

Thanks for the feedback.

This looks FANTASTIC. Very promising, and already quite useful for me (I’m bicycle-only).
I am having an issue getting our greenway trail (gravel, foot & bike only, connects to other roads) to route both foot traffic (works great when bike is selected). the osm wiki says highway=cycleway should read this correctly, and have even tried putting in foot=yes. Is this a bug or a mistake on my part?

Lambertus, thanks for your code. Nice work. We are developing on it as well. I’d like to add some code contributions myself. How can I help?

The server, on which you host yournavigation.org, is it a standalone server, or a server with a control panel (like directadmin)? If you host only yournavigation.org and you have full control over it, please use varnish cache in front of the apache server. This can improve the speed of your API dramaticly, because those requests will be cached. I can help you if you want. The current code you are using for the API can be improved in speed much more, that it currently does. Currently every request is send through gosmore, but that isn’t necessary.

By the way, please use json_encode instead of building your own json code, in /dev/gosmore.php. Because that won’t generate faulty JSON code.

It’s most likely because the database for routing is getting very old. I’m having big problems with latest Gosmore versions to compile and run correctly under Linux AMD64. There is little time to work on it as well. There has been some back and forward mailing with the Karlsruhe uni about implementing their routing algo, but it has died slowly somehow, I really should spend more time on YOURS…

The server is a sponsored virtual machine with directadmin CP, I don’t have too much control over it but the sponsor’s IT fella has an interest in OSM and is always willing to help out.

Regarding the caching: I’ve been checking logs for a while and re-occuring routes with all parameters identical are very very rare. IMHO. not worth the trouble in configuring and maintaining a caching server. Linux itself is already helping by caching the section of the routing database that are in demand. Subsequent queries in the same area are much quicker then the first (you can see this already by requesting the same route a few times, the first is slow but subsequent queries are much faster (usually few hundreds of a second). Maintainability and ease of use is a big plus for someone who doesn’t have much time so unless you have some numbers showing a huge effect I’d rather not use a caching server. However you can use a caching server for your own instance ofcourse.

As you might have noticed, I’m not a webdeveloper by profession, so I’m sure there will be many possible improvements to be made. I hadn’t heard of the json_encode() function before, it seems useful indeed. I believe the faulty JSON code is already fixed earlier this week, or is it still broken?

You ask if you can help: well sure, you are welcome to! As you probably know, YOURS is in the OSM SVN which has a TRAC interface through which feature requests, bugs and other improvements can be coordinated. If you have some bits of code on specific issues you can post them there, mail them to me (osm [monkeytail] na1400 [dot] info) or start a branch in SVN. We can discuss things using e.g. osm or osm-dev IRC channels. Btw, do you have an example of ‘We are developing on it as well’? I’d like to see what others have made of it… :slight_smile:

Hi,
What’s the difference between options “bicycle” and “bicycle Route” ?

Are Turn-Restrictions working ?

Chris

Bicycle is the same as car routing or pedestian routing etc. Bicycle Route is preferring routes mapped with a bicycle route relations.

There is some basic turn-restriction support. The Gosmore wiki page used to point to a specific version of the relation:restriction wiki page, but that has changed so I don’t know exactly which types and configurations.

Yes, that was my guess, but it don’t seems to work:

The way over the routes (left) is only little longer than the calculated route, so I expected
another calculation.

Chris

Yes, that’s not optimal obviously …

I just had a quick look at the request logs and it appears that a cycleroute request is treated as a normal bicycle routing request. Clearly a bug and I’ll fix it asap.

Thanks for reporting this!