Χαρτογράφηση με OpenStreetMap (OSM) και Ελλάδα
Το έργο OpenStreetMap (OSM) φιλοδοξεί να φτιάξει ένα ελεύθερο χάρτη του πλανήτη. Όπως η Wikipedia είναι η μεγαλύτερη συμμετοχική εγκυκλοπέδια, έτσι το OpenStreetMap θέλει να γίνει ο μεγαλύτερος συμμετοχικός χάρτης.
Τα δεδομένα που εισάγονται στο OpenStreetMap διατίθενται με την άδεια Creative Commons Attribution-Share Alike.
Γιατί χρειαζόμαστε το OpenStreetMap αφού το Google Maps είναι δωρεάν και σχετικά ολοκληρωμένο; Το ζήτημα είναι ότι το Google Maps, για το περισσότερο κόσμο και την Ελλάδα, χρησιμοποιεί δορυφορικές εικόνες και δεδομένα χαρτογράφησης που δεν είναι διαθέσιμα με ελεύθερες άδειες. Δείτε τους περιορισμούς χρήσης των χαρτών του Google Maps, ενότητα Restrictions on Use.
Το OpenStreetMap αποτελείται από τη βάση δεδομένων που περιλαμβάνει όλο το υλικό του χάρτη μαζί με το ιστορικό των ενημερώσεων. Αυτή τη στιγμή η βάση έχει φτάσει στα 8.6GB (αν συμπιεστεί) και υπάρχει διαθέσιμο αντίγραφο ασφαλείας ολόκληρης της βάσης που παράγεται κάθε εβδομάδα. Το αρχείο, planet-latest.osm.bz2, σε συμπιεσμένη μορφή (bz2), είναι διαθέσιμο από το http://planet.openstreetmap.org/ Στην πράξη, ένας τυπικός χρήστης μπορεί να χρησιμοποιήσει ειδικά εργαλεία όπου μπορεί να εξάγει το χάρτη του τμήματος του πλανήτη που ενδιαφέρει, με πιο εύκολο και γρήγορο τρόπο.
Όπως με τη Wikipedia, έτσι και με το OpenStreetMap, κάθε εθελοντής που προσφέρει πρέπει να παράγεια τα γεωγραφικά δεδομένα. Ο τυπικός τρόπος είναι με τη χρήση συσκευής GPS, όπου καταγράφουμε τις διαδρομές (tracks) και τα σημεία αναφοράς (Point Of Interest, POI).
Άφου φτιάξουμε λογαριασμό στο www.openstreetmap.org, είμαστε σε θέση να προσθέτουμε διαδρομές (tracks). Οι συσκευές GPS γενικά παρέχουν τη δυνατότητα καταγραφής της διαδρομής μας, καθώς και τη δυνατότητα εξαγωγής της διαδρομής. Η μορφή που δέχεται το OpenStreetMap είναι το .gpx, και υπάρχουν εργαλεία για μετατροπή από άλλες μορφές προς GPX.
Από τη στιγμή που έχουμε εισάγει τις ακατέργαστες διαδρομές στο OSM, είμαστε σε θέση να δημιουργήσουμε τους δρόμους και τα σημεία αναφοράς του χάρτη. Ένας τρόπος για να το κάνουμε αυτό είναι να χρησιμοποιήσουμε την επιλογή επεξεργασίας (Edit) του χάρτη, από το δικτυακό τόπο του OSM καθώς έχετε εντοπίσει την περιοχή που θέλετε να επεξεργαστείτε. Όλα αυτά γίνονται μέσα από το Firefox σας. Αυτή η εφαρμογή για επεξεργασία του OpenStreetMap μέσω Web ονομάζεται Potlatch.
Δείτε τον οδηγό για νέους χρήστες του OpenStreetMap στα ελληνικά.
Σε επόμενα άρθρα θα αναφερθούμε στην εφαρμογή JOSM, μια εφαρμογή σε Java, που επιτρέπει τη λήψη των δεδομένων τμήματος του χάρτη του OSM. Με το JOSM είμαστε σε θέση να κάνουμε κάθε είδους τροποποίηση στο χάρτη και είναι το βασικό εργαλείο.
Επιπλέον, ο χάρτης του OSM που εμφανίζεται στο πρώτο στιγμιότυπο παραπάνω είναι μια μόνο παραδοχή του χάρτη· είναι εφικτό να παράγουμε διαφορετικές μορφές του χάρτη (για παράδειγμα, στα αγγλικά ή ελληνικά, με έμφαση τα καταστήματα, με έμφαση χώρους για περίπατο, με έμφαση μόνο τα πρατήρια, κτλ).
Ακόμα, υπάρχει εφαρμογή J2ME (εφαρμογή Java για κινητά) όπου επιτρέπει τη συλλογή δεδομένων για διαδρομής και σημεία αναφοράς.
Τέλος, υπάρχει εφαρμογή που μπορεί να εξάγει το τμήμα του χάρτη που μάς ενδιαφέρει και να το εισάγει σε μια εφαρμογή J2ME (Java για κινητά) ώστε με το κινητό μας να έχουμε ένα ελεύθερο σύστημα πλοήγησης. Ναι, και με φωνή.
GMail J2ME application for your mobile phone
We talked a couple of years ago about the Google J2ME (Java for Mobile devices such as mobile phones) application that you can download and install on your phone. With this application, you can run GMail on you mobile phone, and access your e-mails with your data plan (GPRS, EDGE or 3G).

To install the J2ME application, visit (with your mobile phone) the URL
If GMail recognises that you are using a compatible mobile phone, it will direct you to download and install the application to your phone. The current version of the application is about 260KB.
If you want to save some of your data bandwidth, you can change the User-Agent string of your Firefox (use the User Agent Switcher Firefox Extension) to one of a mobile phone, then visit with your browser. In this case, you can get the application from googlemail-nokia.jar (version 2.0.6/L2). If you can afford it however, it is better to install from gmail.com/app, because this would set a list of reasonable defaults.
Java plugin 64-bit, now available.
Sun Microsystems announced the 64-bit version of the JRE, which includes the Java Plugin.
This means that if you have a 64-bit version of a Linux distribution, you can now have Java applets running in your Firefox.
Download at https://jdk6.dev.java.net/6uNea.html
You can install in /usr/local/
Then, you need to make a symbolic link, (it’s OK if Firefox is still running)
ln -s /usr/local/jre1.6.0_12/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
Then, in Firefox, visit about:plugins and check if the new plugin is recognised. You should see the text below.
libnpjp2.so
- Όνομα αρχείου: /usr/local/jre1.6.0_12/lib/amd64/libnpjp2.so
| Τύπος MIME | Περιγραφή | Επιθέματα | Ενεργές |
|---|---|---|---|
| application/x-java-vm | Java | Ναι | |
| application/x-java-applet | Java | Ναι | |
| application/x-java-applet;version=1.1 | Java | Ναι |
Finally, test your browser with the demo applets at http://java.sun.com/applets/jdk/1.4/index.html
I do not know how well some complicated Java applications will behave. If you do not see the applet starting up (there is no loading indication), have a look at ~/.xsession-errors for any hints of a failed applet.
ANTLR grammar for XKB, and Relax NG schema (draft)
I completed the ANTLRv3 grammar for symbols/ configuration files of XKB. The grammar can parse and create the abstract syntax tree (AST) for all keyboard layouts in xkeyboard-config.
ANTLRv3 helps you create parsers for domain specific languages (DSL), an example of which is the configuration files in XKB.
Having the ANTLRv3 grammar for a configuration file allows to generate code in any of the supported target lagnuages (C, C++, Java, Python, C#, etc), so that you easily include a parser that reads those files. Essentially you avoid using custom parsers which can be difficult to maintain, or parsers that were generated with flex/bison.
On a similar note, here is the grammar to parse Compose files (such as en_US.UTF-8/Compose.pre). I am not going to be using in the project for now, but it was fun writing it. The Python target takes 18s to create the AST for the >5500 lines of the en_US.UTF-8 compose file, on a typical modern laptop.
I am also working on creating a RelaxNG schema for the XKB configuration files (those under symbols/). There is a draft available, which needs much more work.The Relax NG book by Eric van de Vlist is very useful here.
The immediate goal is to use the code generated by ANTLR to parse the XKB files and create XML files based on the Relax NG schema. I am using Python, and there are a few options; the libxml2 bindings for Python, and PyXML. The latter has more visible documentation, but I think that I should better be using the former.
Update: lxml appears to be the nice way to use libxml2 (instead of using directly libxml2).
Parsing XKB files with antlr
antlr (well, antlr3) is an amazing tool that replaces lex/flex, yacc/bison.
One would use antlr3 if they want to deal with Domain-Specific Languages (DSL), an example of which are the text configuration files.
In our case, we use antlr3 to parse some of the XKB configuration files, those found in /etc/X11/xkb/symbols/??.
Our aim is to be able to easily read and write those configuration files. Of course, once we have them read, we do all sorts of processing.
The stable version of antlr3 is 3.0.1, which happened to give lots of internal errors. It has not been very useful, so I tried a few times the latest beta version 3.1b, and eventually managed to get it to work. If I am not mistaken, 3.1 stable should be announced in a few days.
When using antlr, you have the choice of several target languages, such as Java, C, C++ and Python. I am using the Python target, and the latest version that is available from the antlr3 repository.
Here is the tree of the gb layout file,
tree = (SECTION (MAPTYPE (MAPOPTIONS partial default alphanumeric_keys xkb_symbols) (MAPNAME “basic”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 quotedbl twosuperior oneeighth)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior sterling)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign onequarter)) (TOKEN_KEY (KEYCODEX AC11) (KEYSYMS apostrophe at dead_circumflex dead_caron)) (TOKEN_KEY (KEYCODEX TLDE) (KEYSYMS grave notsign bar bar)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign asciitilde dead_grave dead_breve)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar bar brokenbar)) (TOKEN_INCLUDE “level3(ralt_switch_multikey)”))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “intl”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom – International (with dead keys)”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 dead_diaeresis twosuperior onehalf)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior onethird)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign onequarter)) (TOKEN_KEY (KEYCODEX AE06) (KEYSYMS 6 dead_circumflex NoSymbol onesixth)) (TOKEN_KEY (KEYCODEX AC11) (KEYSYMS dead_acute at apostrophe bar)) (TOKEN_KEY (KEYCODEX TLDE) (KEYSYMS dead_grave notsign bar bar)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign dead_tilde bar bar)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar bar bar)) (TOKEN_INCLUDE “level3(ralt_switch)”))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “dvorak”)) (MAPMATERIAL (TOKEN_INCLUDE “us(dvorak)”) (TOKEN_NAME Group1 (VALUE “United Kingdom – Dvorak”)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign asciitilde)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 quotedbl twosuperior NoSymbol)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior NoSymbol)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign NoSymbol)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar)) (TOKEN_KEY (KEYCODEX AD01) (KEYSYMS apostrophe at)))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “mac”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom – Macintosh”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 at EuroSign)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling numbersign)) (TOKEN_INCLUDE “level3(ralt_switch)”)))
When traversing the tree, we can then pretty-print the layout at wish:
partial default alphanumeric_keys xkb_symbols “basic” {
name[Group1] = “United Kingdom”;
include “latin”
include “level3(ralt_switch_multikey)”
key <AE02> = { [ 2 , quotedbl , twosuperior , oneeighth ] };
key <AE03> = { [ 3 , sterling , threesuperior , sterling ] };
key <AE04> = { [ 4 , dollar , EuroSign , onequarter ] };
key <AC11> = { [ apostrophe , at , dead_circumflex , dead_caron ] };
key <TLDE> = { [ grave , notsign , bar , bar ] };
key <BKSL> = { [ numbersign , asciitilde , dead_grave , dead_breve ] };
key <LSGT> = { [ backslash , bar , bar , brokenbar ] };
};
… snip …
The code is currently hosted at code.google.com (keyboardlayouteditor) and I intend to move it shortly to FDO.
thersa.org.uk, infected.
The screenshot shows the thersa.org.uk website has been infected, and users that visit it end up running in their browsers malicious JavaScript code. The code loads Javascript files from the .cn and the .la domains.
There is a reference in one of the files to a cookie named killav (Kill Antivirus?) that may disable some antivirus programs.
In addition, one of the JavaScript files checks which browser you have. If you have Internet Explorer 6 or 7, it loads some exploit which attempts to run binary code. If this succeeds, you are infected. If you have Firefox, it does not attempt to perform an infection, and it goes to the next phase.
The next phase is to open up pages to sites in China. It appears to me that the bussines plan in that case is to generate revenue from ad hits.
The worst thing however is if you get infected. Unpatched windows systems are at the mercy of these attackers.
One way to mitigate such risks is to use Mozilla Firefox, and have the NoScript add-on installed.
Update 5 June 2008:
The RSA updated their website by moving it away from Windows and ASP, to open source software. They are using Centos Linux, Apache, and an open-source CMS. Therefore, the above security risk does not apply any more.
Writing J2ME applications in Linux
Here is an interesting article on writing J2ME applications in Linux.
J2ME applications is software that runs on mobile phones that support Java applications. Most phones support such Java applications, and it’s good to get your phone to run at least your own Hello, World! program.
GMail J2ME application for your phone
Update 2010: Link to .jar file (if you want to install using phone cable or Bluetooth): http://m.google.com/mail/download/binaries/L1/2.0.6/mail_n60-3.jar
Older post continues…
Google started offering a new service for GMail users; you can download a J2ME application to your mobile phone and start browsing your mails. You do not need to connect through the web interface.
You can install the J2ME applicaiton by visiting (through your phone’s browser) the URL http://gmail.com/app/. This page will automatically detect which phone you are using (from the User-Agent string) and redirect to the correct .jad file so that the installation can take place.
If you want to install the J2ME application the traditional way, you can go directly to the URL http://gmail.com/app/v1.0.0/en/gmail-nokia-g.jar. (Of course, this URL is for a specific bunch of Nokia phones).
Quite strangely, the application gives me the error java.lang.IllegalStateException: Cause unknown, which does not help a lot.
Did anyone manage to install the thing?
Update (26Nov06): I managed to get the applet to work on my phone. Apparently my first mobile operator uses a strange proxy configuration that alters downloaded files (???).
Free Alaa!

Alaa is a young prominent Egyptian blogger that was arrested and jailed among 47 activists on 7th May 2006 during a peaceful demonstration in Cairo.
His personal website and blog, shared with his wife Manal, is http://www.manalaa.net/ has the latest news about his condition.
There is a petition by Hands Across the Mideast Support Alliance (HAMSA) to free Alaa, which I copy:
Demand Egyptian Regime Release Alaa from Tora Prison
Alaa Abd El-Fatah is one of Egypt’s most prominent bloggers and free speech advocates. He and his wife Manal run the popular blog BitBucket, which collects posts from dozens of Egyptian blogs and which won a “Best of the Blogs” award in December from Reporters Without Borders.
On Saturday (May 7), Alaa was arrested with a group of activists during a peaceful demonstration outside a Cairo courthouse. The rally denounced disciplinary hearings for two reform judges and arrests of protestors at previous demonstrations. Alaa and a group of other demonstrators were cornered by Egyptian police, and security agents then apparently handpicked individual protestors for arrest.
Alaa seems to have been targeted because of his high profile: he helps organizes the protests and spread the information through the blog aggregator he runs. He is now being held in notorious Tora Prison — and his arrest seems designed to both shut down his blog aggregator and scare other Egyptian bloggers. But you can send a message to the Egyptian government through the petition below (you can edit the petition text), which will generate an email to political leaders who can secure Alaa’s release.
The petition will be sent to:
- Egypt’s Ambassador to the US Nabil Fahmy
- Egyptian Prime Minister Ahmed Nazif
- Egypt’s Interior Minister Habib El Adly
- US Ambassador to Egypt Francis Ricciardone
- US Assistant Secretary of State David Welch
This campaign has been signed 1047[check page for latest figure] times. Click here to see who’s signed.
Join the Campaign
Alaa is speaking (has the mic) at an event about Open-Source software for NGOs in Africa.




