Smrender — A New Renderer for OSM Data

Smrender

About two months ago we started a completely new projected, originally just as my personal intention. It is a new rendering software for OSM data, just because currently there are just two popular renderers, these are Mapnik and Osmarender.

The project is called smrender which is a short form for seamap render and is targeted for OpenSeamap but not limited to :).

Goals and Description

The primary development goal is to create a renderer which creates sea charts intended for print-out. Secondary goals are performance and memory efficency. The image on the right shows a chart rendered with smrender showing a part of the Croatian coastline. The image is scaled for a printout on A3 paper with a density of 300 dpi.

Smrender is a software which reads an OSM file, applies rules to the objects and creates a raster image. The output is projected and scaled adequately to be used as a paper sea chart (as long as neither the printing software nor the printer itself rescales it). The rules are defined as XML (OSM) file. Each rule consist of match options and an action which is carried out if an object matches. The rules currently support direct string compare, regex matching, match inversion (NOT), exclusion of specific tags, and function calls to shared objects. The latter is intended to be a modular interface to third-party modules. The actions may be text output, lines, polygons and image overlays.

A special feature is the auto-rotation of texts and images: the software tries to rotate an image or a string such that it does not interfere with other objects (as good as possible).

Smrender also closes open polygons such as segments of the coastline. The coastline is usually not a single closed way but rather a set of concatenated open ways for two reasons. First, because different tags may be attached to different parts of a coastline, and second  because usually you obviously just select a specific region from the OSM database and not the whole world. The OSM database will just return the ways which are within the selected bounding box. Closing those polygons is vital because you can’t fill open ones 😉

With all this, smrender can render a complete chart with all features at once, without any overlays or prerendered basemaps.

In the following there’s a snippet of a ruleset to give you an idea how it looks like and how it works…and code usually explains more than 1000 words. A short description is found below.


1 <node>
2 <tag k=’seamark:type’ v=”/>
3 <tag k=’_action_’ v=’func:pchar@./libsmfilter.so’/>
4 </node>
5 <node>
6 <tag k=’/^seamark:light:.*/’ v=”/>
7 <tag k=’_action_’ v=’img-auto:icons/Light_Magenta_90.png’/>
8 </node>
9 <node>
10 <tag k=’_action_’ v=’cap:/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Italic.ttf,1.4,cm,black,auto;whit
11 e,name’/>
12 <tag k=’natural’ v=’bay’/>
13 </node>
14 <way>
15 <tag k=’highway’ v=’/^(secondary|primary|residential)$/’/>
16 <tag k=’_action_’ v=’draw:black’/>
17 </way>

Lines 1 – 4 match all nodes with the tag with the key ‘seamark:type=*’ and calls the function pchar of the shared object libsmfilter.so. The library is loaded dynamically on startup.

Lines 5 – 8 match all nodes which have any tag whose key starts with ‘seamark:light:’. Smrender uses POSIX regular expressions in that case. On a match the image with the given filename is placed into the chart and in this case it uses auto-rotation. That means that smrender samples the area around the position of the node and tries to find a place where as less as other objects are in place already. Of course this does just make sense for some specific types of nodes like the magenta light flares (see sample picture above).

Lines 9 – 13 places an auto-rotated caption at the matching nodes’ positions and lines 14 – 17 renders a simple black line for all highways. Of course there are more options such as line thickness, style, and border.

Software and download

Smrender is written from scratch, completely in C. We don’t have any download location yet because the code needs some cleanup and a face lifting in places. We are also discussing licensing issues but we will probably release it under GPL within the next weeks.

Feel free to contact us if you have any questions!

28C3 useful Links

To make live easier if you’re attending the congress you may find the following information useful: Chat/IRC (yes irc is still not dead [ref. dan kaminsky’s talk day 1]): server is on freenode (use the client of your choice and issue “/server irc.freenode.net”) /join #28c3 Just in case the wiki server is down/unreachable again:

http://28c3.dhofer.com/events.ccc.de/index.html

Streaming:

`http://28c3.fem-net.de`

YouTube Channel: `http://www.youtube.com/28c3` ….

http://28c3.dhofer.com/events.ccc.de/index.html http://28c3.fem-net.de`: http://28c3.fem-net.de

http://www.youtube.com/28c3

28C3 News — Day 2.541

Day 2 hat super begonnen mit einem sehr interessanten und unterhaltsam aufbereiteten Talk zum Thema Politik hacken, ein Danke an die beiden Speaker Alexander und Montserat. Etwas überrascht hat mich die Sache mit dem Bundestrojaner (der mit der ausgefeilten Crypto und dem genial Netzwerkprotokoll…), der auch in Österreich eingesetzt wurde. Naja, bei uns läuft der politische Hacktivismus leider noch etwas ruhiger ab als in Deutschland. Liegt das vielleicht daran, dass hier im Hintergrund mit mehr Schmiergeldern zwischen Medien und Politik gearbeitet wird?

Bin schon gespannt wie es weitergeht zum Thema Netzneutralität gleich im Anschluss, dann Wep-App-DoS von @Alech und dann noch einiges aus der Sparte Society and Politics. Zur Prime Time gibts dann Roger Dingledine und Martin Haase.

Gestern Abend an Day 1 gabs dann noch Dan Kaminisky, immer wieder Spitze zum Zuhören.

 

28C3 News — Day 1.808

Nachdem wir gestern Abend angereist und noch ausgiebig das nicht enden wollende Sortiment an verschiedenen Biersorten in der Hostel-Bar getestet hatten, sind wir heute Vormittag im BCC angekommen. Die klassische Ticket-Warteschlange war nicht besonders lang und die Abfertigung ging ziemlich schnell, da anscheinend alle Kassen funktionierten und auch die QR-Code Scanner.

Wie jedes Jahr am Day 1 mussten wir uns einmal richtig akklimatisieren, d.h. unseren Projekttisch im Hackcenter in Beschlag nahmen, Switch verkabeln, Netzwerkkabel festgaffern, Notebooks auspacken, anschließen, Netzwerk testen, Smartphones vernetzen, Eventphone-SIM-Karte wieder aktivieren und Extension registrieren — sind unter 92900 erreichbar — und was man halt noch alles tun muss.
Hase hat seine SIM-Karte vergessen, naja, macht auch nix, ein Eventhandy reicht auch für uns. Ich habe meine Kongressschlapfen im Hostel vergessen, Hos hat sich neue gekauft, das Headset liegt auch noch in der Reisetasche…

Das CCC-Wiki ist anfangs gleich mal für mehrere Stunden ausgefallen, mittlerweile geht es aber wieder. War aber kein Problem, denn in Zeiten von Smartphones gibt es ja die äußerst geniale 28C3-Fahrplan-App. Der ganze Tag verlief bisher mit sehr angenehm mit einer Reihe guter Talks, im Zeichen des Überwachunsstaates. Sehr interessant und gut zusammengefasst war die Causa “0zapftis“.

Ansonsten ist der Kongress in Bezug auf die Menschenmenge sehr verträglich und angenehm, liegt vermutlich an der neuen Methode der Ticketverteilung. Besonderer Hit ist natürlich der Falling-Mate-Ringtone und der Falling-Mate-Notification-Tone, auch wurde gleich im ersten Talk der  28C3 early bottle adaptor award vergeben.

Phenoelit-Area wurde nach draußen verlegt, der Raum im Keller wurde u.a. fürs Hardware-Hacking umfunktioniert. In der Kantine wird heuer Döner verkauft, auch mit Originalbedienung. Wer sich zum ersten Mal in der Kantine anstellt ist sofort durch planloses herumirren entlarvt, es gibt nämlich drei Schlangen, deren Anfang jedoch nicht so eindeutig zu erkennen ist, insbesonders wenn gerade Saalwechsel ist. Eine Queue für die Getränke, eine für die warmen Speisen und eine für den Dönerverkauft. Getränke gibt’s jedoch wie immer auch bei den Speisen, wo man heuer Tickets für die Burger bekommt, nachdem man sie bezahlt hat.

Eine ganze Menge Hardware-Hacking gibt es heuer auf dem Kongress, viele coole Projekte. Besonders interessant fand ich auch den alten Fernschreiber, dessen Schnittstelle auf RS232 umgebaut wurde und dem man SMS über das Event-GSM schicken kann. Sehr Schade dass die Nummer des Event-GSM-Netzes nicht von österreichischen Mobil-Netzen erreichbar ist.

Sonst bisher alles sehr cool hier.

Waiting for 28C3

 

After a 10 hours trip with the train we arrived in Berlin to attend teh 28C3. For the few days we live in the great Sunflower hostel near Warschauer Straße. Now, we are warming up our  computers and smartphones. Fahrplan app installed *g*

Get an impression from the picture.

We, this is creo, fhasex20, and me (aka Rahra), members of the Austrian nerd association cyperpunk.at.

We hope that we got a desk in the hackcenter, because unfortunately we missed the deadline for project registrion in the 28C3 wiki. Well, shit happens, but maybe we’re lucky.

 

We will be around in the BCC, just contact as somehow (Email, Twitter, Facebook, what ever), or just have a look in the hackcenter or in the Phoenlit area.

Projects that we are currently working on is Anonymous DNS, and a completely new rendering software for OSM data.

Downloading Android Apps Part II — The 28C3 Fahrplan

Download Android apps (APK files) with your computer always sucks — again.
Today we arrived in Berlin to attend the 28C3, one of the best nerd congresses in Europe. And there’s a great app for Android by tuxmobil. Unfortunately, it’s just available in the Android market which requires registration 🙁

So, if you want to install it directly with ADB after downloading it from the Internet, just use this link:

http://www.cypherpunk.at/download/nerd.tuxmobil.fahrplan.congress-1.apk

Have fun!

HP-Compaq 2510p – soft keys not working

Since 2007 I own a HP 2510p Notebook. It is a great device. It’s very light, has good 12″ display, and it has a very low power consumption. I ever ran Debian Linux on it, currently Debian Squeeze, Kernel 2.6.32-5-amd64 and KDE 4 desktop.

The soft keys did work also but at any time they stopped to work. I’m not sure but I think that this is some kind of software bug because the the LEDs still work if the keys are pressed, and for whatever reason they do work sometimes. However, there’s a big problem. If you close the lid the notebook will go into standby mode. For whatever reason the touchpad will be disabled. And this is really bad because you cannot activate it again if the soft keys do not work.

Usually I don’t close the lid since standby mode doesn’t work reliably, anyway. IMO standby mode sucks on most notebooks.

One time I deactivated the Wifi by pressing the “RF kill switch” (wireless soft key) but I was unable to activate it again because the key didn’t work later. Maybe there’s just a loose contact inside.

However, it is a pain in the ass without Wifi and a touchpad 😉

I updated the BIOS but it didn’t solve the problem. I also didn’t find any software which lets me enable it again. Thus I think that the enable/disable function is built-in into hardware. The solution was easy but it was hard to find it.

Reboot the notebook and enter the BIOS setup by pressing F10. Now go to “System Configuration > Built-in Device Options” and disable all devices. Save the changes and exit the setup and reenter it again after reboot. Go again into the Built-in Device Options menu and enable all devices again. That’s all!

Note that the touchpad is not listed in the menu but this trick does work, anyway. Probably there’s a software bug behind or the software is written unclean.

 

Anonymous DNS FAQ

Yesterday evening we did our first public talk about our AEON project at the ITsecx conference. AEON stands for Anonymity Enhanced Onion Nameservice which means it is a nameservice which provides anonymity by utilizing onion routing.

There have been some questions from the audience after this talk and I would like to repeat them here since they may come up again.

Q: Isn’t Tor able to do DNS lookups itself?

A: Yes, basically it is but there are some constraints. It just works if the follow-up protocol is TCP-based, such as HTTP or SMTP and it requires that the request was properly “intercepted”. This works with e.g. the Tor browser bundle in respect to HTTP or with other application like ssh or similar if they are “socksified” explicitly with e.g. tsocks. It does not work in other cases and of course it does not work if you don’t use Tor.

 

Q: If you hook gethostbyname() then Chrome will not use AEON because it uses its own resolver library.

A: Yes, but we did never say that we hook gethostbyname(;-).

 

Q: If there is a limitation in message size why don’t you use the EDSN0 extension?

A: Because the limitation occurs not due to the packet size limit but due to the maximum domain name length which is still limited to 255 bytes, even with EDSN0.

 

Q: But won’t the DNS server operator will be set up if somebody misuses them in such a way?

A: No, because we do not misuse somebody’s name server. AEON is a standalone software and is run on your own choice. Internet name servers are used in the same protocol conforming way as they are used today.

 

Q: What about the current state of your SW development?

A: We have “something” running in our lab that does “something”. But be sure, you will be the first one being informed once our SW is ready.

 

SDCard/USB-Stick write-protected on Windows 7

Have you ever had the problem that you tried to delete something on your SDcard and your operating system told you that it is not possible because the removable disk is write-protected?

Well, it never happened to me because I use Linux, hence, things usually work and if not, there is always a reason which can be debugged 😉

Unfortunately, people in my neighborhood think that I am a general problem solver concering computers just because they know that I know a lot about computers that they do not know 😉

Thus, everybody contacts me if something goes wrong with his computer…and I love this, in particular if it is Windows…duh.

Yesterday, a friend came to me with two problems. First, something is wrong with his SDcards, they are write protected, although the mechanical lock is in the right position. Second, “something” is wrong with his notebook.

I checked the SDcards on my Linux computer. Nothing actually wrong. I freshly formatted them. Now let’s look at the computer; Windows 7 installed. I did some updates and some housekeeping jobs; everything alright again. Finally, I followed my intuition and tested the SDcards on the system and — surprise! They are write-protected.

My first guess was the virus scanner — Kaspersky. I temporarily deactivated it — no success. I tried to find any option at the disk properties from the context menu from Windows explorer — no suitable options available. I tried to find any option in Windows management console (mmc); no options found. I tried to recreate the partition, reformat; no success: “Windows is unable….write-protected.”.

Ok, let’s jfgi. And there is the solution: it is easy but I just ask myself how any non-export should ever solve this problem? The solution is — as always on Windows — a registry entry.

Set the key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePoliciesWriteProtect to “0“. If it does not exist just add it yourself (and don’t forget to remount the SDcard).

Multiple Bibliographies with Latex

I am currently working on a book which is a compilation of various articles dealing with virtualization techniques. All articles are written in Latex and have the same template in common which makes it much easier to combine them into a single document. There are about 20 articles with four to five pages each. In total there are about 150 references.

Although Latex is designed to layout large text documents such as articles, reports, and  books, I encountered some troubles in this case. The challenge was to have several separate bibliography sections, one at the end of each chapter. There are packages available to accomplish this. The first package I tried is multibib. It is easy to use and it seems to work fine. Unfortunately, after including several of my articles, latex failed to compile the document with following error message:

No room for a new write newcites{.....}

After an intensive search for solutions it turns out that this is due to an internal limitation of Tex without a solution (without changing the source code of Tex). It is a limitation of file handles and the implementation of multibib exhausts them. There is a thread (http://mrunix.de/forums/showthread.php?t=69304) which redefines several commands and it basically works but there are still limitations. I extended the code but finally it turned out to be too much effort.

I decided to use a different package: bibunits. And this works as expected. Thanks to Thorsten Hansen for this package.