Mi blog lah! Το ιστολόγιό μου

23May/101

Μετατροπή συντεταγμένων μεταξύ WGS 84 (π.χ. GPS) και ΕΓΣΑ87 (GGRS87, GR87, ελληνικό σύστημα)

Οι συντεταγμένες που γνωρίζουμε από τους χάρτες και τα συστήματα GPS ακολουθούν το πρότυπο WGS 84.

Στην Ελλάδα σε κάποιες υπηρεσίες γίνεται χρήση του ΕΓΣΑ87 (GGRS87).

Πως κάνουμε τη μετατροπή μεταξύ WGS 84 και ΕΓΣΑ87 (GGRS87, GR87);

  1. Επιβεβαιώνουμε ότι έχουμε εγκαταστήσει το πακέτο proj (sudo apt-get install proj).
  2. Για το proj, ο κωδικός για WGS84 είναι epsg:4326 και για ΕΓΣΑ87 είναι epsg:2100, οπότε
    1. cs2cs +init=epsg:4326 +to +init=epsg:2100
    2. cs2cs +init=epsg:2100 +to +init=epsg:4326

Για παράδειγμα, για μετατροπή των συντεταγμένων WGS 84 για την πλατεία Ομονοίας σε ΕΓΣΑ87,

$ echo "23.72826 37.98414" | cs2cs +init=epsg:4326 +to +init=epsg:2100
475987.12    4203802.23 -31.28
$ _

Στα έντυπα οι παραπάνω συντεταγμένες γράφονται τυπικά ως

 004 75 987Α
 042 03 802Β

Υπάρχουν Python bindings για το πακέτο proj, με το πακέτο python-pyproj. Είναι εφικτό να γράψει κάποιος μια εφαρμογή γραφικού περιβάλλοντος σε Python που να επιτρέπει την εύκολη μετατροπή συντεταγμένων μεταξύ των δύο συστημάτων. Από αναζήτησή στο Διαδίκτυο διαπίστωσα ότι δεν υπάρχει λογισμικό γραφικού περιβάλλοντος που να μην είναι shareware ή trialware για τη μετατροπή αυτή.

Πηγή το άρθρο του Αντώνη Χριστοφίδη «Introduction to geographical co-ordinate systems» και επικοινωνία με τον Στέφανο Κοζάνη (βιβλιοθήκη icoordtrans, public domain).

5May/100

Χαρτογράφηση με OpenStreetMap (OSM) και Ελλάδα

Το έργο OpenStreetMap (OSM) φιλοδοξεί να φτιάξει ένα ελεύθερο χάρτη του πλανήτη. Όπως η Wikipedia είναι η μεγαλύτερη συμμετοχική εγκυκλοπέδια, έτσι το OpenStreetMap θέλει να γίνει ο μεγαλύτερος συμμετοχικός χάρτης.

Τμήμα χάρτη Ηλακλείου Κρήτης (OpenStreetMap)

Τα δεδομένα που εισάγονται στο OpenStreetMap διατίθενται με την άδεια Creative Commons Attribution-Share Alike.

Τμήμα χάρτη από το Ηράκλειο Κρήτης (Google Maps)

Γιατί χρειαζόμαστε το 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 για κινητά) ώστε με το κινητό μας να έχουμε ένα ελεύθερο σύστημα πλοήγησης. Ναι, και με φωνή.

29Feb/081

FOSDEM ’08, summary and comments

I attended FOSDEM '08 which took place on the 23rd and 24th of February in Brussels.

Compared to other events, FOSDEM is a big event with over 4000 (?) participants and over 200 lectures (from lightning talks to keynotes). It occupied three buildings at a local university. Many sessions were taking place at the same time and you had to switch from one room to another. What follows is what I remember from the talks. Remember, people recollect <8% of the material they hear in a talk.

The first keynote was by Robin Rowe and Gabrielle Pantera, on using Linux in the motion picture industry. They showed a huge list of movies that were created using Linux farms. The first big item in the list was the movie Titanic (1997). The list stopped at around 2005 and the reason was that since then any significant movie that employs digital editing or 3D animation is created on Linux systems. They showed trailers from popular movies and explained how technology advanced to create realistic scenes. Part of being realistic, a generated scene may need to be blurred so that it does not look too crisp.

Next, Robert Watson gave a keynote on FreeBSD and the development community. He explained lots of things from the community that someone who is not using the distribution does not know about. FreeBSD apparently has a close-knit community, with people having specific roles. To become a developer, you go through a structured mentoring process which is great. I did not see such structured approach described in other open-source projects.

Pieter Hintjens, the former president of the FFII, talked about software patents. Software patents are bad because they describe ideas and not some concrete invention. This has been the view so that the target of the FFII effort fits on software patents. However, Pieter thinks that patents in general are bad, and it would be good to push this idea.

CMake is a build system, similar to what one gets with automake/autoconf/makefile. I have not seen this project before, and from what I saw, they look quite ambitious. Apparently it is very easy to get your compilation results on the web when you use CMake. In order to make their project more visible, they should make effort on migration of existing projects to using CMake. I did not see yet a major open-source package being developed with CMake, apart from CMake itself.

Richard Hughes talked about PackageKit, a layer that removes the complexity of packaging systems. You have GNOME and your distribution is either Debian, Ubuntu, Fedora or something else. PackageKit allows to have a common interface, and simplifies the workflow of managing the installation of packages and the updates.

In the Virtualisation tracks, two talks were really amazing. Xen and VirtualBox. Virtualisation is hot property and both companies were bought recently by Citrix and Sun Microsystems respectively. Xen is a Type 1 (native, bare metal) hypervisor while VirtualBox is a Type 2 (hosted) hypervisor. You would typically use Xen if you want to supply different services on a fast server. VirtualBox is amazingly good when you want to have a desktop running on your computer.

Ian Pratt (Xen) explained well the advantages of using a hypervisor, going into many details. For example, if you have a service that is single-threaded, then it makes sense to use Xen and install it on a dual-core system. Then, you can install some other services on the same system, increasing the utilisation of your investment.

Achim Hasenmueller gave an amazing talk. He started with a joke; I have recently been demoted. From CEO to head of virtualisation department (name?) at Sun Microsystems. He walked through the audience on the steps of his company. The first virtualisation product of his company was sold to Connectix, which then was sold to Microsoft as VirtualPC. Around 2005, he started a new company, Innotek and the product VirtualBox. The first customers were government agencies in Germany and only recently (2007) they started selling to end-users.

Virtualisation is quite complex, and it becomes more complex if your offering is cross platform. They manage the complexity by making VirtualBox modular.

VirtualBox comes in two versions; an open-source version and a binary edition. The difference is that with the binary edition you get USB support and you can use RDP to access the host. If you installed VirtualBox from the repository of your distribution, there is no USB support. He did not commit whether the USB/RDP support would make it to the open-source version, though it might happen since Sun Microsystems bought the company. I think that if enough people request it, then it might happen.

VirtualBox uses QT 3.3 as the cross platform toolkit, and there is a plan to migrate to QT 4.0. GTK+ was considered, though it was not chosen because it does not provide yet good support in Win32 (applications do not look very native on Windows). wxWidgets were considered as well, but also rejected. Apparently, moving from QT 3.3 to QT 4.0 is a lot of effort.

Zeeshan Ali demonstrated GUPnP, a library that allows applications to use the UPnP (Universal Plug n Play) protocol. This protocol is used when your computer tells your ADSL model to open a port so that an external computer can communicate directly with you (bypassing firewall/NAT). UPnP can also be used to access the content of your media station. The gupnp library comes with two interesting tools; gupnp-universal-cp and gupnp-network-light. The first is a browser of UPnP devices; it can show you what devices are available, what functionality they export, and you can control said devices. For example, you can use GUPnP to open a port on your router; when someone connects from the Internet to port 22 on your modem, he is redirected to your server, at port 22.

You can also use the same tool to figure out what port mapping took place already on your modem.

The demo with the network light is that you run the browser on one computer and the network light on another, both on the local LAN (this thing works only on the local LAN). Then, you can use the browser to switch on/off the light using the UPnP protocol.

Dimitris Glezos gave a talk on transifex, the translation management framework that is currently used in Fedora. Translating software is a tedious task, and currently translators spent time on management tasks that have little to do with translation. We see several people dropping from translations due to this. Transifex is an evolving platform to make the work of the translator easier.

Dimitris talked about a command-line version of transifex coming out soon. Apparently, you can use this tool to grab the Greek translation of package gedit, branch HEAD. Do the translation and upload back the file.

What I would like to see here is a tool that you can instruct it to grab all PO files from a collection of projects (such as GNOME 2.22, UI Translations), and then you translate with your scripts/tools/etc. Then, you can use transifex to upload all those files using your SVN account.

The workflow would be something like

$ tfx --project=gnome-2.22 --collection=gnome-desktop --action=get
Reading from http://svn.gnome.org/svn/damned-lies/trunk/releases.xml.in... done.
Getting alacarte... done.
Getting bug-buddy... done.
...
Completed in 4:11s.
$ _

Now we translate any of the files we downloaded, and we push back upstream (of course, only those files that were changed).

$ tfx --project=gnome-2.22 --collection=gnome-desktop --user=simos --action=send
 Reading local files...
Found 6 changed files.
Uploading alacarte... done.
...
Completed uploading translation files to gnome-2.22.
$ _

Berend Cornelius talked about creating OpenOffice.org Wizards. You get such wizards when you click on File/Wizards..., and you can use them to fill in entries in a template document (such as your name, address, etc in a letter), or use to install the spellchecker files. Actually, one of the most common uses is to get those spellchecker files installed.

A wizard is actually an OpenOffice.org extension; once you write it and install it (Tools/Extensions...), you can have it appear as a button on a toolbar or a menu item among other menus.

You write wizards in C++, and one would normally work on an existing wizard as base for new ones.

When people type in a word-processor, they typically abuse it (that's my statement, not Berend's) by omitting the use of styles and formatting. This makes documents difficult to maintain. Having a wizard teach a new user how to write a structured document would be a good idea.

Perry Ismangil talked about pjsip, the portable open-source SIP and media stack. This means that you can have Internet telephony on different devices. Considering that Internet Telephony is a commodity, this is very cool. He demonstrated pjsip running two small devices, a Nintendo DS and an iPhone. Apparently pjsip can go on your OpenWRT router as well, giving you many more exciting opportunities.

Clutter is a library to create fast animations and other effects on the GNOME desktop. It uses hardware acceleration to make up for the speed. You don't need to learn OpenGL stuff; Clutter is there to provide the glue.

Gutsy has Clutter 0.4.0 in the repositories and the latest version is 0.6.0. To try out, you need at least the clutter tarball from the Clutter website. To start programming for your desktop, you need to try some of the bindings packages.

I had the chance to spend time with the DejaVu guys (Hi Denis, Ben!). Also met up with Alexios, Dimitris x2, Serafeim, Markos and others from the Greek mission.

Overall, FOSDEM is a cool event. In two days there is so much material and interesting talks. It's a recommended technical event.

   

Switch to our mobile site