Archive for the ‘Coding’ Category

Tweaking MoNav’s Vector Renderer

Sunday, February 27th, 2011
Rastatt in Monav (data by osm and contributors, CC-by-SA)

Rastatt in Monav (data by osm and contributors, CC-by-SA)

I could not resist the temptation to tweak the vector rendering code of MoNav.

(more…)

Converting Germany OSM data into a MoNav Map

Friday, February 25th, 2011
Karlsruhe Vector Rendering in MoNav (Data by openstreetmap.org and its contributors, CC_by-SA)

Karlsruhe Vector Rendering in MoNav (Data by openstreetmap.org and its contributors, CC_by-SA)

Today I adjusted the MoNav vector renderer a little bit, just to get more ways relevant for cyclists into the map. The renderer does not support rendering of street names as of yet, and there’s still a lot of work to do to get all the details solved that make a nice looking map. But anyway, the map already does its job.

The map data for germany converted from OSM pbf to the MoNav format requires more than 4GB of free mass storage. Of course I couldn’t resist the temptation to try it on the N900. Panning works almost as smooth as panning a raster image map. It’s really a joy, and a dream I had back in 2006 when I began to contribute to openstreetmap.org comes true:

Karlsruhe Vector Rendering N900 (Data by openstreetmap.org and its contributors, CC_by-SA)

Karlsruhe Vector Rendering N900 (Data by openstreetmap.org and its contributors, CC_by-SA)

Thanks to all who contributed to MoNav. Feels a bit like Xmas :) .

Vector Rendering in Monav SVN

Wednesday, February 23rd, 2011
Speyer Vector Rendering (Data by openstreetmap.org and its contributors, CC_by-SA)

Speyer Vector Rendering (Data by openstreetmap.org and its contributors, CC_by-SA)

Thanks to the work of James Hollingshead, MoNav SVN contains the first incarnation of a vector renderer which aims to be a high performance renderer which creates the required map tiles “on the fly”. The current SVN code is a bit awkward to compile and use, hence this posting. The info provided here is replicated by the OSM wiki. The following bash commands have been executed using Ubuntu Lucid 10.04.1 LTS. You will at least need Qt 4.5 dev packages, and probably some additional packages before MoNav will compile properly.

(more…)

Cubase MIDI Device Files released

Monday, January 10th, 2011

For my personal use, I created some Cubase MIDI Device Files (see the products section of this blog). Currently there are files for the following instruments:

  • Alesis micron
  • Access Virus C
  • Korg Z1

I’ve also added step by step installation instructions for (hopefully) painless usage. I hope it’s useful for musicians ’round the globe.

Current pet projects

Wednesday, November 10th, 2010
Cat Head (openclipart.org, public domain)

Cat Head (openclipart.org, public domain)

After a long and hard office day (we needed to recall some already released code) I needed some compensation. As always, the best recreation is working on some software :) .

I’m currently working on integrating libosmscout, a vector rendering library for osm data, into MoNav, my favorite routing application. I thus subscribed to either mailing list, modified and recompiled the Importer of libosmscout (as it didn’t finish importing germany.osm since last eve) and added MoNav as a project to the german osm community server, even setting up a first build script.

Now it’s 1AM and I’m quite tired. But it’s interesting and pleasing to see what one can achieve in one day only. Sleep well :) .

Hacking MoNav (Dreams come true)

Monday, October 25th, 2010
Travel-compass (openclipart.org, public domain)

Travel-compass (openclipart.org, public domain)

Prelude

As I started mapping and writing software for openstreetmap back in 2006, I did this mainly as I noticed that my Garmin eTrex Venture Cx for 500€ was incapable of doing proper bike routing. Map data was only available commercially, far too expensive for private use.

These days, we had no slippy map or any other maps at all. If we wanted to have maps, we grabbed a portion of data via JOSM, converted it into svg using Osmarender and looked at it in Inkscape. Soon we began to convert the data into the Garmin format using cgpsmapper, and we struggled a lot with unordered segments. We checked the maps in Qlandkarte and spent many hours to order the segments causing troubles. We did all of this as we knew that openstreetmap was extraordinary and revolutionary.

(more…)

The great QThread Mess

Saturday, October 23rd, 2010
Stone Age Detail 1 (Wiktor Michajlowitsch Wassnezow, via Wikipedia commons, public domain)

Stone Age Detail 1 (Wiktor Michajlowitsch Wassnezow, via Wikipedia commons, public domain)

When writing applications with a graphical user interface, it is important to keep the user interface snappy even while the application performs heavy duty background tasks like file processing or downloading huge files from a network. The best way to accomplish that is to use multithreading. Qt4 provides a convenient way via its QThread class.

(more…)

Usability painted on a wall

Sunday, September 19th, 2010

In Wissembourg, I came across a building of Glad, a company which sells firewood. I’m sorry for the bad picture. I just stopped the bike and took the picture ignoring all principles I know of. But anyway, here it is:

Mouse pointer on a wall

Mouse pointer on a wall

What I find amazing is the simple but clear message of the installation: »I sell firewood, and you’ll find information both in french and german languages by visiting my web presence.«. In case your job includes coping with user interface design: Can you remember the last time you found such an intuitive metaphor?

Routino Frontend published

Sunday, June 27th, 2010
RoutinoFrontend

RoutinoFrontend

I’ve just released Routino Frontend to the world wild web. The current code needs manual installation. A proper installer will be created only in case I see there’s some interest in this application.

Routino Frontend will start the GPS subsystem and allow you to get the current GPS location as departure or destination. Additionally, up to three via points are accepted.

To get the coordinates for via or destination points, go to Mappero, point the map to the desired location, press the left uppermost on-screen button, choose »Show Position« and copy it to the device’s clipboard.

After a route is calculated, the resulting file will be placed in the documents folder of the device, ready to be loaded into Mappero or Maep.

The code is in its early stages and needs refactoring. Please note that the current frontend will invoke routino in blocking mode. As soon as you process a route, Routino Frontend will not return before it finished. In case you calculate a long route, this means that Routino will eat all your CPU, memory, swap memory and battery power until it has done its job (which means that you probably need to remove the battery to quit it).

If you are more familiar with Python (and especially its subprocess module) as I am and you can help to add a nice cancel button which reliably kills Routino please drop me a line.

Osmarender rules changed to render forest parcel names

Sunday, May 9th, 2010
Forest parcel name rendered in osmarender, zoom 17

Forest parcel name rendered in osmarender, zoom 17

At crossings of tracks in the woods, you often can find up to four name plates displaying the names of the adjacent wooden parcels. I usually placed a node tagged as place=locality and added the names. Of course this leads to a situation where the names will overlap each other, and after collecting some of those plates, it was desirable to draw the parcels as areas with the name rendered at the center, not as individual nodes at the vertices. I currently add a polygon tagged as landuse=forest.

While Mapnik renders the names of natural and landuse features in zoom levels 14 through 17, Osmarender only rendered them visibly at zoom level 17. It rendered natural names at zoom levels 16 and 15, but subsequently the caption was hidden by the rather huge surrounding wood polygon. landuse was missing in those levels.

I’ve thus adjusted the render rules so the names of natural and landuse features also get displayed at zoom levels 16 and 15. I hope this won’t mess up the map in densely populated areas. If so, please drop me a line and I’ll change the additional k="landuse" v="*" to something like k="landuse" v="forest|wood".

As soon as the changes are slurped by the tiles@home clients, I’ll start to convert the locality-nodes to something like amenity=nameplate or similar to finally clean up the map.

Waypointcatcher resurrected for Maemo 5

Monday, April 12th, 2010
Waypointcatcher on Maemo 5 (aka Fremantle)

Waypointcatcher on Maemo 5 (aka Fremantle)

As the location API has changed in Fremantle from libgpsbt to liblocation, the previously released version of waypointcatcher won’t do the job on the N900.

I’ve thus updated the python code, which despite its C&P nature just »works for me«. I’ll share the application on request, until I find the time to do the necessary cleanup and to offer a proper point and click installation link.

Its main purpose is to collect waypoints for openstreetmap, as Mapper does not record marks reliably ATM.

Simple Sysexxer: »Eat your own dogfood!«

Wednesday, February 3rd, 2010
Simple Sysexxer receiving data

Simple Sysexxer receiving data

During the last days and weeks, I missed some minor features in Simple Sysexxer, so guess what I was doing…

(more…)

JOSM Presets updated

Sunday, January 17th, 2010
JOSM Logo

JOSM Logo

I rearranged the presets in JOSM and am prepared for the usual bashing :) .

Tracks and paths have been reunified into one menu entry only, so the convenience menu shortcuts to the various types of tracks and paths are past. OTOH, I have introduced dedicated menu entries for combined foot and cycleways:

JOSM presets - cleanup and additions

JOSM presets - cleanup and additions

The types have been included as popup menus into the dialogs. Besides tracktypes and hiking scales, I also included mountainbike scales, while more special tags for mountain bikers can be used by including an existing set of externally maintained presets:

JOSM - Path Preset

JOSM - Path Preset

Obviously, the dialogs are completely overcrowded. We will not be able to stuff any and all tags that will develop in the future into JOSM. Be prepared that I will do some major cleanup work some day.

External Presets in JOSM

Sunday, January 17th, 2010
JOSM Logo

JOSM Logo

JOSM provides the capability to include presets from external sources. It is the perfect mechanism for a group of mappers to maintain a specialized set of presets. This way, »Special Interest« mappers like skiers, mountain bikers or seamen can feed menu entries they need directly into JOSM without polluting the default menu space of JOSM.

Some examples are available via JOSM’s wiki pages. There’s also a page how to create and use such presets.

Sorting Sound Files using Ruby

Wednesday, November 25th, 2009

ruby-2008.png

Consider you have 2,248 files in a directory, each containing one single sound program for your favourite Z1 synth. You need to load them into the synth individually, listen to them and to sort them in directories. Painful it would be.

Fortunately, all sounds are set to one of 18 predefined categories like guitar, synth hard, synth soft, piano, organ and the like. In the SysEx files, the category is coded into the 26. byte. So it was easy to sort the files into subdirectories using a couple of lines of Ruby code (sorry for the misformatting):



#! /usr/bin/ruby

require 'fileutils.rb'

def determineCategory( filename )
file = File.open( filename, "rb:binary" )
fileContents = file.read
category = fileContents[25] + 1
# puts filename, category
unless File.directory?(category.to_s)
Dir.mkdir( category.to_s )
end
FileUtils.mv( filename, category.to_s )
end

Dir.glob( '*.[Ss][Yy][Xx]' ) do |entry|
determineCategory entry
end

This language seems to be very powerful. Need to do more with it.

XP Days Germany ahead

Wednesday, November 25th, 2009
Meeting Point Symbol (openclipart.org, public domain)

Meeting Point Symbol (openclipart.org, public domain)

The XP Days are just a couple of hours ahead. I’m curious what people will attend and expect some illuminative talks. I hope it will be possible to blog directly from the conference, either using the notebook or the N810. I’ve also set up an “extra group” :) in our “company owned” messaging system in advance.

Though it is not for free it was too tempting to attend – it’s just a five minutes walk from our office, so there was no excuse :) .

ALSA Sequencer Interface for Simple Sysexxer

Monday, November 23rd, 2009
Simple Sysexxer Icon

Simple Sysexxer Icon

The last release of Simple Sysexxer used RtMidi for MIDI input. However, some weird things happend when I tried to receive data from my beloved Korg Z1 synth. Today I have rewritten the MIDI input thread using the ALSA sequencer API.

(more…)

Switching from Linux to Windows

Friday, November 13th, 2009
Broken Windows (wikimedia commons, public domain)

Broken Windows

I run a dual boot machine, using both Linux and Windows operating systems. I rarely boot Windows but only use it once a semester or so to try out some application or to compile Gebabbel for my Windows users.
(more…)

Expense-Recorder released

Tuesday, October 13th, 2009
Expense Recorder

Expense Recorder

Admittedly, it’s just a modification of the Waypoint Catcher. For me it’s useful anyway :) .

Ruby on Rails on the Nokia N810 – sqlite lib needed

Thursday, September 17th, 2009

I’m currently playing with Ruby on Rails, just for my very own pleasure and joy. Admittedly, that’s only one half of the truth. Some ruby (respectively rails) knowledge will also help me during my “daytime job”. What I’d like to do for now is to develop some rails application for the Nokia N810.
(more…)