[Marble-devel] Routino router

Dennis Nienhüser earthwings at gentoo.org
Tue Aug 3 09:49:26 CEST 2010


Forgot to CC the list.

@Niko: Also forgot to mention that the reviewboard URL is
http://reviewboard.kde.org/, you can create an account at 
http://reviewboard.kde.org/account/register/ if you have none yet. Thanks.

Dennis

Hi Niko,

On 31.07.2010 18:35, Niko Sams wrote:
> On Sat, Jul 31, 2010 at 17:11, Dennis Nienhüser<earthwings at gentoo.org>  wrote:
>
>> Hi Niko,
>>
>> thanks for the patch, great work :-)
>>
>> On 31.07.2010 10:42, Niko Sams wrote:
>>
>> Hi,
>>
>> I started writing a router plugin using routino[1], basically it's just
>> copying the gosmore plugin and adapting a few things.
>> My motivation behind this is that routino allows defining custom profiles
>> in an xml file, so I can use my own bicycle specific profiles.
>> Please review the attached code.
>>
>> Looks good, only needs some coding style adjustments.
>>
> I'll try my best improving on that :D
>
>
It's not much, mostly some Marble specific things mentioned in [1]:
- a space inside opening and closing parenthesis, e.g. 
file.open(QIODevice::ReadOnly); becomes file.open( QIODevice::ReadOnly );
- as little abbreviation as possible. QStringList p; => QStringList 
routinoParameters;
- TempraryDir => TemporaryDir
- setName, setDescription and setGuiString in RoutinoPlugin need tr() calls
- The if statement that strips comments in parseRoutinoOutput needs 
curly braces

>> Usage:
>> copy generated nodes.mem, segments.mem, ways.mem and profiles.xml,into
>> ~/.local/share/marble/maps/earth/routino and make the router binary callable
>> in
>> PATH trough routino-router.
>>
>> Tried it, worked out of the box. Routino seems to be a bit faster than
>> gosmore (using the same osm data origin).
>>
> faster? cool - I can't compare as gosmore crashes for me when importing data.
>
>
Does it crash when generating a gosmore map from osm data or when 
reading a gosmore map? Did you generate the gosmore data using the 
installed gosmore application and its rebuild parameter? The file format 
seems to have changed in between gosmore releases and it does not seem 
to detect if map data generated with a different gosmore version is used.

>> One issue I have now is that with the current interface is that it's
>> not possible to have
>> router dependent settings. Like the custom profiles I'd like to
>> support for routino.
>> Any ideas how this could be solved?
>>
>>
>> I plan to keep the current (user) interface pretty clean: Some important
>> preferences should be changeable immediately (e.g. major transport types
>> like it is now). More complex settings (e.g. speed mappings or seldomly used
>> transport types) should go to a plugin specific config dialog.
>>
>> For routino, you could extend the code like this to support the currently
>> available transport types and preferences:
>>
>> switch( route->routePreference() ) {
>> case RouteSkeleton::CarFastest:
>>      params<<  "--transport=motorcar";
>>      break;
>> case RouteSkeleton::CarShortest:
>>      params<<  "--transport=motorcar";
>>      params<<  "--shortest";
>>      break;
>> case RouteSkeleton::Bicycle:
>>      params<<  "--transport=bicycle";
>>      break;
>> case RouteSkeleton::Pedestrian:
>>      params<<  "--transport=foot";
>>      break;
>> }
>>
>> if ( route->avoidFeatures()&  RouteSkeleton::AvoidHighway ) {
>>      params<<  "--highway-motorway=0";
>> }
>>
>> GeoDataLineString* wayPoints = d->retrieveWaypoints( params );
>>
>> The last line shows the entry point to the current code.
>>
>> Currently runner plugins can not show a settings dialog in Marble, but I
>> plan to extend that in the near future. With that implemented, you could add
>> a settings dialog for the routino plugin where the user can select mappings
>> between transport types and routino profiles. You might even add a UI to
>> customize the speed mappings and other preferences there.
>>
> Yeah, that would work.
>
> But let me explain my personal use case:
> I want to plan bicycle routes, using different profiles like racing
> fastest with lots
> of car traffic, racing with cycleways preferred, mtb. Opening an
> routino configuration dialog
> that changes profile used for bicycle would work, but is not so easy to use.
> Although I see your point of keeping the interface clean - I just
> wanted to explain my use case.
>
>
We could extend the runner/routing plugin interface to let plugins 
specify which type of transports (which could be profiles and added by 
the user) it handles. The UI could use that to show all available 
transport types to the user to select among. However, that needs to be 
done carefully to avoid a cluttered UI.

>> I had a look at the routino output and was pleasantly surprised by the
>> amount of information it delivers. There are no direct turn instructions,
>> but enough information to calculate them. Actually the problem is very
>> similar to generating turn instructions from gosmore instructions, which is
>> implemented in [2]. I think I'll incorporate that in Marble and generalize
>> it such that it can calculate turn instructions from routino as well. Moving
>> the code into Marble would also mean free translations, which is a big plus.
>>
> Ah, interesting - yes a general solution would be great.
>
>
>> To sum it up, I'd like to
>>    - (1) add your patch with the extension above to Marble
>>
> Great :D I have an svn account, I can commit myself. What commit
> policies do you have?
>
>
Preferably non-trivial things should go through reviewboard with the 
marble group as reviewers. Can you make a review request from the patch, 
please?

Thanks,
Dennis

[1] http://websvn.kde.org/trunk/KDE/kdeedu/marble/CODING?view=markup

>>    - (2) extend the Marble plugin interface to support configuration dialogs
>> for all type of plugins
>>    - (3) incorporate gosmore-instructions into Marble to get translations and
>> be able to use it without adding a dependency
>>    - (4) use it to generate turn instructions for both gosmore and routino
>> output.
>>
>> With (2) done you could work on a settings dialog for the routino plugin
>> that supports the kind of customization you are looking for. Sounds like a
>> good plan to me, do you agree? ;-)
>>
> Yeah, sounds great!
>
> thanks,
> Niko
>
>



More information about the Marble-devel mailing list