Opened 12 years ago

Closed 12 years ago

#753 closed defect/bug (worksforme)

Routing error, Selects a minor road a short distance.

Reported by: henrik Owned by: cp15
Priority: trivial Milestone: version 0.5.0
Component: port/android Version:
Severity: Keywords:


Error in route choice between these points: (Unnecessary detour)

From 62 30 14 N 15 29 53 E

To 62 29 57 N 15 29 5 E

Link to road in OpenStreetMap?:

I use the latest anroid version, and a new mapp from

See attached image.

Attachments (1)

wrong.png (80.6 KB) - added by henrik 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by henrik

comment:1 Changed 12 years ago by tegzed


I had a very similar problem before. This is caused by the method navit uses to assign weight to roads. Please see my forum topic:

The problem is in how navit maps osm way objects to its own road type.

These are your roads:

This is the mapping from osm type to navit's own type in maptool/osm.c

        "w      highway=secondary                       street_3_land\n"
        "w      highway=secondary,name=*,rural=1        street_3_land\n"
        "w      highway=secondary,name=*                street_3_city\n"
        "w      highway=secondary,rural=0               street_3_city\n"
        "w      highway=secondary,area=1                poly_street_3\n"
        "w      highway=secondary_link                  ramp\n"
        "w      highway=tertiary                        street_2_land\n"
        "w      highway=tertiary,name=*,rural=1         street_2_land\n"
        "w      highway=tertiary,name=*                 street_2_city\n"
        "w      highway=tertiary,rural=0                street_2_city\n"
        "w      highway=tertiary,area=1                 poly_street_2\n"
        "w      highway=tertiary_link                   ramp\n"

and this is the roadprofile in navit.xml that sets routing weights to navit road types(check the route_weight numbers):

                        <roadprofile item_types="street_3_city" speed="40" route_weight="40" maxspeed="50" >
                                        <announcement level="0" distance_metric="50"/>
                                        <announcement level="1" distance_metric="200"/>
                                        <announcement level="2" distance_metric="500"/>
                        <roadprofile item_types="street_2_land" speed="65" route_weight="65" maxspeed="90" >
                                        <announcement level="0" distance_metric="100"/>
                                        <announcement level="1" distance_metric="400"/>
                                        <announcement level="2" distance_metric="1000"/>

You can see that the main road Albyvägen is mapped to street_3_city since it has a name attribute. navit assumes that roads with name are city roads with speed 40km/h. If you set the osm attribute rural=1 the road will be mapped to street_3_land which has rote weight 70km/h by default and this should solve your problem.

Bye David Tegze

comment:2 Changed 12 years ago by henrik

  • Resolution set to worksforme
  • Status changed from new to closed

I changed the street to residential, what is more correct and the routing error is fixed for now.

Note: See TracTickets for help on using tickets.