Mapping out all AEGEE locals
Update January 2007: Back in late 2006, I wrote a giant shell script in collaboration with the ITWG to make a proper map for AEGEE. It's now online here. The article below is my original "j'accuse" from May 2006, that thankfully was well received.
I've always found it a bit surprising that a large international student organisation like AEGEE fails so badly to communicate one of its core points: namely the size and extent of its network. If you go to the AEGEE homepage, you would never tell that they are represented in over 200 cities all over Europe. Instead of a clear overview map like every single budget airline, they give you an obtuse dropdown list. If you want to find out if there's a local AEGEE office near you, you really need to dig.
It's only when you go to the Network page that you get a map of all available locals – but judging by the presence of AEGEE-Den Haag, that map was last updated in 2002 or so. And I'm not even mentioning how clumsy a tiny clickmap with three kinds of unannotated symbols is.
Bringing proper mapping to AEGEE
In this article I'll ignore the fact that the AEGEE homepage is broken on so many levels (unreadable URLs, inconsistent design, sloppy, slow, buggy, incomplete, outdated, not even proper CSS) and focus on how to bring proper mapping into AEGEE. I want to promote the use of geographical information because maps are intuitive, they say a lot about AEGEE's presence, and they're done so poorly at the moment. This is probably because mapping is not a trivial thing. But it's not 1986 any more, there are plenty of computer tools to automate all the hard work.
Getting a list of all locals and their coordinates
To start off, we need a master list of all locals and their coordinates. It took me the better part of an evening to create that list (UTF-8 encoding), taking these steps:
- Fetch the AEGEE homepage with
wget; - Filter out the list of locals with
grep -o; - Cleaning up the list with
grep,sedandawk; - Converting AEGEE's country codes to those used by Heavens Above;
- Using a messy shell script to plug the country and city names into the Heavens Above Location Database one by one with
wgetand parsing the output; - Doing extensive cleaning and completion of the file by hand.
Once having obtained the master file of all locals, their unique three-letter ID and their latitude and longitude, I could start mapping all the locals.
Mapping the locals
I choose to do my mapping with the GMT (Generic Mapping Tools) suite, which is open
source, GPL'ed software. It is very powerful indeed and can create all sorts of
maps. It is widely used by the scientific community and comes with an extensive
dataset and many small utility programs. It's mature, it's great, I love it.
GMT writes postscript code, which we can rasterize using
Ghostscript.
A HTML clickmap
Let's start with the most practical example, a clickmap for use in HTML documents. It
took me quite some time to figure out how to generate a clickmap using GMT, but I
finally succeeded by translating Postscript coordinates to pixel coordinates using a
fairly messy script.
The script (last modified Wednesday, 05-Sep-2007 15:28:36 CEST)
Here's a basic Mercator projection of all the locals, with labels and clickable stars:
This map is clickable and hoverable.
Of course, given some time, this could be tweaked to include labels for all the locals, latitude/longitude lines, different symbols for contact/contact antenna/antenna status, et cetera. It's also possible to plot things like country borders, time zones, distances from one place to another, and so on.
A tiny but fully functional click map, made by changing the map width to 1 inch and the star size to 0.02 inch in the script above:
Tiny click map, fully functional.
Here's a really simple example of mapping all the Dutch locals:
#!/bin/bash
# Base map:
pscoast \
-K
-R3/8/51/54 \
-JM3i \
-P \
-G100 \
-Df > dutchmap.eps
# Make coordinate file for stars:
cat coordinates.txt | \
awk 'BEGIN{FS=":"}{ print $4 " " $3 }' > coordinates.tmp
psxy \
-R -J -O -K \
-Sa0.5c \
-Gyellow \
coordinates.tmp >> dutchmap.eps
# Close EPS file
echo "9999 9999" | psxy -J -R -O >> dutchmap.eps
epstopdf dutchmap.eps
rm dutchmap.eps
rm coordinates.tmp
Dutch locals, screenshot of this PDF.
An orthographic map
#!/bin/bash
# Make an orthographic map of all our locals
# Base map:
pscoast \
-K \
-R-12/50/30/72 \
-JG12/40/10c \
-P \
-G41/22/111 \
-S153/204/255 \
-Di > ortho.eps
# Make coordinate file for stars:
cat coordinates.txt | \
awk 'BEGIN{FS=":"}{ sub("[^0-9.-]", "", $4); print $4 " " $3 }' > coordinates.tmp
psxy \
-R -J -O -K \
-Sa0.1c \
-Gyellow \
coordinates.tmp >> ortho.eps
# Close EPS file by writing dummy coordinate pair:
echo "9999 9999" | psxy -J -R -O >> ortho.eps
# Make PDF, this corrects the bounding box:
epstopdf ortho.eps
# Rasterize with Ghostscript
gs \
-r200 \
-sDEVICE=png16m \
-dGraphicsAlphaBits=4 \
-dSAFER -dBATCH -dNOPAUSE \
-sOutputFile=ortho.png \
ortho.pdf
# Reduce colour
pngquant 16 ortho.png
mv ortho-fs8.png ortho.png
# Clean up
rm ortho.eps
rm ortho.pdf
rm coordinates.tmp
Orthographical projection of the whole network.
Also, many different kinds of maps are possible, such as equidistant azimuthal projections:
#!/bin/bash
# Make an equidistant azimuthal projection
# Tallinn, Estonia:
LAT=59.434
LON=24.728
# Base map:
pscoast \
-K \
-R0/360/0/90 \
-JE$LON/$LAT/7i \
-B15g15 \
-Dl \
-A1000 \
-G200 \
-W0.25p \
-P > equidistant.eps
# Rings:
grdmath \
-Rg \
-I1 \
$LON \
$LAT \
SDIST \
111.13 MUL \
= dist.grd
grdcontour \
dist.grd \
-A1000+v+ukm+kblack \
-Glz-/z+ \
-S8 \
-C500 \
-O \
-J \
-Wathin,red \
-Wcthinnest,red,- >> equidistant.eps
ps2pdf equidistant.eps
rm equidistant.eps
rm dist.grd
Equidistant azimuthal projection centered on Tallinn, Estonia.
Upshot: we have a file with all the coordinates of all the locals and we have examples of how to map them, so it seems that the right people could incorporate this into the AEGEE IT systems with minimal effort.
Recommendations to the ITWG:
- In the master database, there should be latitude/longitude data for every local.
- There should be a proper (and current!) map on the front page of aegee.org, to make clear what AEGEE does and where it's located.
- Use the open source
GMTpackage to generate up-to-date maps. - Automate map creation for:
- Front page
- Address Book
- SU Booklet
- Key to Europe
- Add spatial data to all event calendars, little flags or what have you.
I'm open for questions, but I don't really have the incentive to implement an entire mapping system for AEGEE because I would really need to get into the messy Lotus Notes back-end, and from what I've heard it's hell on Earth.
Written May 20th, 2006
Last modified: 2008-04-15 at 11:59:29
Contact