Published by breki on 18 Jul 2008 at 10:12 pm
Kosmos 2.1
New version of Kosmos is here. Since I’ve neglected the rendering engine during the implementation of 2.0 release, I decided to do most of the work for this release on improving the rendering.
You can download the 2.1 version from the standard place: http://downloads.igorbrejc.net/osm/kosmos/
UPDATE (July 19th): I discovered a small bug in the new release – generated contours were not shown on the map. This has been fixed now, please download a new package.
So what has been improved?
Relations
Kosmos can now render relations. I’ve added a sample rule in general purpose rules Wiki page for rendering cycle routes:
| Rule Name | Targets | Selector | Template | Options | Comment |
|---|---|---|---|---|---|
| RouteCycle | type=route route=bicycle | Polyline (MinZoom=7, Color=#50FF0718, Width=7:1;17:18, Curved=true) |
will produce a pinkish half-transparent cycle route:
Note that rules ignore roles of members in a relation – currently I don’t see how the roles could be incorporated into the rendering rules.
Text Rendering
There is a new TextMode called WayCenter which draws the text (roughly) in the center of a way:
There are also two new parameters which enable rendering of outlined text: OutlineColor and OutlineWidth, example (sorry for the odd formatting):
PlaceTown
place=town Text (MinZoom=10, MaxZoom=15, Color=black, TagToUse=name, FontName=Trebuchet MS, FontStyle=bold, FontSize=10:10;17:25, OutlineColor=white, OutlineWidth=20%)
will produce something like this:
Kosmos now knows how to wrap labels:
The wrapping is done using the “Text label wrap factor” preferences setting. It is a ratio of (roughly) maximum line length compared to the line height. Normal values are somewhere from 4 to 10, I guess.
Map Scale Indicator
… is now shown on the map:
You can turn it off. You can also switch from metric to U.S. Customary units in Preferences dialog (“Use metric units“).
Rendering Engine Speed-Up
I’ve refactored quite a large piece of rendering engine code to increase the rendering speed and lower the memory consumption. Basically, in previous versions each rendered map element had all its settings (color name, width, …) stored by itself. Now the settings shared by multiple elements are stored in one place (a “style”). This also allows caching of GDI+ objects for each style without the need to recreate them for each map element.
There are also a number of bugfixes in this release (basically every bug that was reported has been fixed).
Source Code
I’ve also published the sources here: http://downloads.igorbrejc.net/osm/kosmos/source/ . I’ll prepare a special Wiki page with some information about the source code and what one can and what one cannot expect from it. So please be patient before starting to send me hate notes about not being able to compile the source code



BeginnerT6 on 22 Jul 2008 at 10:32 #
Hi Breki,
Another great renderer – relation! Does Kosmos 2.1 able to render the road directions, represent by –> <– (either one way or two ways). I believe this road direction info is given in the way tag from the osm map data.
Regards, BeginnerT6
breki on 22 Jul 2008 at 18:43 #
Thanks. No, currently there isn’t a template to draw the road direction, but this will be added in the future.
Dave on 23 Jul 2008 at 14:41 #
Hi, for which OS is Kosmos 2.1 programmed? Does it run on MacOSX? greetings, Dave.
breki on 23 Jul 2008 at 16:12 #
Hi Dave,
Windows only, unfortunately.
Santalaus on 23 Jul 2008 at 17:18 #
Hello,
great work. Is it possible to get the Rendered Features like Highways, Railways and so one, switched on and off in an Future Version? I also have very much Interesed in an Information which shows more Entered Points like great Places/Buildings, Elektric-Lines, Firedepartments and so on. This could be very usedful as an digital map, while managing an Dessaser. Also if I have an layer where I could insered my own Grafiks. We did this here in Top25, but there where just Raod Information no Places and so on. So this could be real great.
breki on 23 Jul 2008 at 18:53 #
You can edit the rendering rules and add or delete any rules you like (see http://wiki.openstreetmap.org/index.php/Kosmos_Rendering_Help). In future versions this will be possible to do inside the GUI application.
As for other types of information, I suggest you visit the OpenStreetMap Wiki (http://wiki.openstreetmap.org/index.php/Main_Page) and learning about OSM start from there. The community is very active and will be glad to help you. I recommend subscribing to some OSM mailing list (http://wiki.openstreetmap.org/index.php/Mailing_lists) – talk-de would be a good start for you, since you’re coming from Germany.
GustavF on 24 Jul 2008 at 22:36 #
This is a wonderful tool to play aorund with rendering rules, without having to set up all the infrastructure needed for the high end renderers.
When surveying I try to get the reality to fit with the data model of OSM. With Kosmos, i can also experiment with the data, and try to get useful information out of it and make all kind of maps for my personal usage.
Keep ut the good work!