View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#174
Originally Posted by Wikiwide View Post
Why? I have a 137KB *.osm file (do not use anywhere yet, just downloaded to look at it). Is routing that difficult?
This could be because how the OSM XML is formated. The nodes are ordered by id not by latitude or longitude and the id don't go in a complete sequence, so they cant be used as a list index. The nodes also have no info about which ways they are part of. Ways on the other hand have have just a sequence of node ids. There is also a lot of irrelevant information like usernames and timestamps.
I think that with this structure, all operations needed for routing, like computing distance between nodes or finding which way is a node part of would be very, very slow.

My guess is, that in the binary formats:
  • they sort the nodes and ways, so that near nodes/ways can be quickly found
  • nodes have info about which ways they are part of
  • ways have complete info about their nodes
  • every item has some global id, so you can just jump on a position in the file to get relevant data
  • all unneeded items are removed
Also, country sized extracts seem to have 100MB+, for example the whole UK has 218MB.

Originally Posted by Wikiwide View Post
One possible approach:
take current coordinates;
take coordinates of destination;
generate vector of needed direction;
find the closest node (not more than 5 minutes away from current coordinates);
find the ways including this node;
for each of the ways, take this one "current" node and take the next node after it and the previous before it;
take the difference of GPS coordinates of current and next/previous node - you get two directions of the road;
of these several directions, take the one which has the direction closest to needed.
Thus, you can ask human to walk back if it seems that his destination is behind him. And no rerouting is needed because "route" is calculated incrementally.

It's no better than walking by Sun and compass, but it requires no complex algorithms, and can be done at night without moon and stars. For a pedestrian it will not be that bad; at least, it will not be a bee-line requiring to jump over fences.

Not all foot-walks are shown on a map, so no complex algorithm could give an ideal result; and this simplistic algorithm would often lead to "blind alleys" which turn out to be non-blind at all.
If I understand this correctly:
  • find nearest node that is a part of a route
  • follow the route in both directions
  • on both ends, choose the node, that is closest to the destination
  • then this for all ways joining the segment between the chosen node and closest one
  • do this for say, 10 steps maximum
  • automatically update as the current position changes
Well, this could theoretically get you to in the direction to your destination, by any means possible. At least, it could be quite an adventure.



Originally Posted by Wikiwide View Post
Just like for map tiles! But I can give an algorithm (human-readable and machine-breaking.
http://78.46.81.38/
1. Find a Wikipedia article about this place (suburb/street).
2. Take GPS coordinates from article and put them into "To which country belongs this location?".
3. In small XML file find the tag which includes the name of the place, and take its ID.
4. Put the ID into "Download an entire city".
You have the *.osm XML file with nodes, ways, relations, etc.
Yep, this could probably automated when we have something that eats OSM data.
There also seems to be a binary OSM API for mobile devices, that accepts bounding box input and also supports diffs.

Originally Posted by Wikiwide View Post
Gosmore requires Diablo dependencies. Routino website www.routino.org cannot be found. I don't have patience to solve these problems right now.
Best luck to you! If you make ModRana use either of them, I will cheerfully attempt to test it.
There seem to be no Maemo 5 packages for either but there seem to be people who succeeded in building and running them. IMHO, without a working Maemo 5 packages there is no need to start supporting them right now, as 99% of users would not be able to actually use it.
Anyone interested in packaging Gosmore and/or Routino for Maemo 5 ?

Originally Posted by eitama View Post
Modrana shows me where I am immediately, but I can't find my way to starting a navigation session.
For example, navigate from my house to my parents house.
Google maps appear, I can see where I am, move around, zoom in out, but, where do I put in my destination address and hit "Navigate"?

I tried using the "Route" option in the menu, just doesn't work.
I set the start position to me my current position, inserted some letters in the destination, press route and nothing happens, no error too.

Any ideas?
Does point to point routing work for you ? The address routing is currently quite basic and does not find many existing addresses, but this should be improved quite soon.
To start a navigation session, you first need to successfully get a route (point to point, address to address, etc.), then go to "route" -> "Current route" -> "tools" and press the "Start navigation" button.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following User Says Thank You to MartinK For This Useful Post: