Opened 7 years ago

Last modified 7 years ago

#1065 new enhancement/feature request

road profile depend zoom function

Reported by: r kr maier Owned by: KaZeR
Priority: minor Milestone: version 0.6.0
Component: core Version: git master
Severity: Keywords:
Cc: kr-maier@…

Description

Hi I have developed a small road profile depend zoom function. It is similar to the autozoom function based on vehicle speed, but uses the street attribute to apply a zoom factor.

I did the new function based on svn 5214

I have modified 4 files. navit.c attr_def.h roadprofile.h roadprofile.c

The function checks while vehicle is activ the current attribute of the street and and applies the zoomfactor defined within navit.xml in the roadprofile section.

Example (extract from navit.xml):

<vehicleprofile name="car" flags="0x4000000" flags_forward_mask="0x4000002" flags_reverse_mask="0x4000001" maxspeed_handling="0" route_mode="0" static_speed="5" static_distance="25">

<roadprofile item_types="street_0,street_1_city,living_street,street_service,track_gravelled,track_unpaved" speed="10" route_weight="10" zoom_scale="32">

<announcement level="0" distance_metric="25"/> <announcement level="1" distance_metric="100"/> <announcement level="2" distance_metric="200"/>

</roadprofile> <roadprofile item_types="street_2_city,track_paved" speed="30" route_weight="30" zoom_scale="32">

<announcement level="0" distance_metric="50"/> <announcement level="1" distance_metric="200"/> <announcement level="2" distance_metric="500"/>

</roadprofile>

All parts I have modified I marked with * Rainer *

I tried and it works fine :-) Next idea for this functionality is to move from current zoom factor while rooting is active to the zoom factor of target road short before next maneuver, maybe with same distance as announcement level. But this is not done jet.

I would appreciate feedack best regards Rainer

Attachments (12)

attr_def.h (9.7 KB) - added by r kr maier 7 years ago.
navit.c (91.3 KB) - added by r kr maier 7 years ago.
roadprofile.c (2.4 KB) - added by r kr maier 7 years ago.
roadprofile.h (1.5 KB) - added by r kr maier 7 years ago.
attr_def.h.diff (1.1 KB) - added by r kr maier 7 years ago.
navigation.c.diff (1.2 KB) - added by r kr maier 7 years ago.
navigation.h.diff (632 bytes) - added by r kr maier 7 years ago.
navit.c.diff (6.5 KB) - added by r kr maier 7 years ago.
roadprofile.c.diff (836 bytes) - added by r kr maier 7 years ago.
roadprofile.h.diff (473 bytes) - added by r kr maier 7 years ago.
vehicleprofile.c.diff (868 bytes) - added by r kr maier 7 years ago.
vehicleprofile.h.diff (668 bytes) - added by r kr maier 7 years ago.

Download all attachments as: .zip

Change History (14)

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

Changed 7 years ago by r kr maier

comment:1 Changed 7 years ago by r kr maier

Hi all,

I just add an additional feature to this function to apply a given zoom scale for maneuvers while routing. Navit zooms from the distance to the next maneuver depend on given announcement level="2" in roadprofile in steps by factor 2 from the current zoom scale to the target zoom scale applied for maneuvers.

Here is an example how to configure in navit.xml (extract from navit.xml):


<vehicleprofile name="car" flags="0x4000000" flags_forward_mask="0x4000002" flags_reverse_mask="0x4000001" maxspeed_handling="0" route_mode="0" static_speed="5" static_distance="25" manuever_scale="16">

<roadprofile item_types="street_0,street_1_city,living_street,street_service,track_gravelled,track_unpaved" speed="10" route_weight="10" zoom_scale="32">

<announcement level="0" distance_metric="25"/> <announcement level="1" distance_metric="100"/> <announcement level="2" distance_metric="200"/>

</roadprofile>


After the maneuver, Navit zooms out smoothly to the scale applied for the current street type.

I have attached the changes of all files.

Best regards Rainer

comment:2 Changed 7 years ago by usul

  • Milestone changed from To be discussed - Give your opinion! to version 0.6.0
Note: See TracTickets for help on using tickets.