Using TileCache to connect VirtualEarth and ArcIMS 22Feb08 | 1

For the upcoming EagleOne disaster exercise we want to overlay WMS layers on top of Virtual Earth. Already we know how to overlay WMS images on top of VE using TileCache. However this approach uses the 900913 projection. Sometimes you have a WMS server which does not support 900913 and you’re not able to change that.

So here enters the cascading mapserver: UMN Mapserver, and possibly others as well, can function as a cascading mapserver. This means that it acts both as a WMS server, to you, and a WMS client, to another WMS server. This way you can use it to reproject images.

By using both TileCache’s new VMTMS service to serve QuadKey-Tiles and UMN Mapserver reprojecting cascading capabilities I was able to access an ArcIMS server which served epsg:28992 WMS through a WMSconnector and show this data tiled and cached in Virtual Earth. I drew a schema of this:

Connecting VE with ESRI ArcIMS with TileCache

As you can see two open source components are used to connect two incompatible closed source components; it’s the duct tape of the GIS world :)

TileCache on 64bit windows 22Feb08 | 0

At work we have a nice new server, which contains a smaller version of Microsoft’s Virtual Earth platform. This machine is still a hefty beast: dual quadcore with 16GB memory and about 8TB of harddisc space. Since there’s still a few TB free we decided that it would be a nice machine to serve up VE-compatible tiles using TileCache, hence my work on VE compatible TileCache classes.

This proved to be much harder then I expected. The problem is that it runs Windows Server 2003 x64, a 64bit OS. Obviously since it is a MS product it already has IIS installed and TileCache doesn’t perform well on IIS. (A side note, I just found this article by Vish and it seems that it might perform after all). So I decided to install Apache alongside it and the necessary Python and mod_python as well. Being a 64bit OS I wanted to install 64bit software.

Apache isn’t available as 64bit binary, neither is mod_python. Only python had a 64bit binary for download. So I installed apache 2.2, python 2.5 (64bit) and checked if they both worked and they did. Mod_python proved to be more difficult so I googled for 64bit mod_python and discovered this article which explained how to compile a 64bit python. There were some problems with it not finding python.exe and some DLLs but that could be solved by adding c:\pyton25 to the PATH environment variable and putting the DLLs in the same directory.

So now I had a 32bit Apache 2.2 (working) a 64bit Python (working) and a 64bit mod_python ready to work. However when I configured Apache to use mod_python it failed with a weird error that %1 was not a valid application. Some more googling revealed that python on a 64bit windows does weird things, or 64bit windows does weird things with python ;) Since 32bit Apache already worked I decided to go for 32bit Python as well which together with 32bit mod_python works flawlessly. So if you want to run TileCache on 64Bit windows: just go for the 32bit versions of the software and hope you’re not stuck with an Itanium.

TileCache on 64bit windows

‘Proof’ of TileCache running on 64bit Windows, the 6.82GB RAM usage is baffling since the machine isn’t doing anything

Plectrae menus and InkSeine 18Feb08 | 0

Microsoft Research just released it’s fabulous InkSeine application. It’s a prototype application done by a research department and as such it lacks some features and streamlining but in general it’s cool. The biggest gripe I have that it’s very Microsoft centered, but coming from MS Research I can’t blame them.

In general if you have a tablet or an UMPC, which I both have at work, you can install this application to easily write notes, organize thoughts and link them with existing dat, like email, (word) docs, (windows) desktop search and (MSN) internet search (amongst others). It does remind me a bit of a combination of Beagle, TomBoy and InkScape and it does have some neat ideas how to work with Ink, Touch (although mainly pen-focussed) and mindmapping.

I really like their swipe-menu which makes it easy to select something: you hold you pen/finger on the icon and a circular menu appears, if you move your pen/finger in the direction of one of the items it is automatically selected. Once you know where the different menu items are, you just point and swipe, without waiting for the menu. This is a really nice way to work with a pen, especially for an application which you use a lot.

MSR InkSeine swipe menu

The IE icon in the center is the actual icon the circle-ish thingy is the menu, as you can see going up from the IE icon goes to cut. In all other swipe menus going up means cut/ delete/ remove/ destroy/ kill (nice career-statement ;)

This swipe-menu does remind me of the Plectrae-menu I designed for our DiamondTouch table-top computer. (Plectrae is a pun on Plectrum and Latin plural rules, which obviously have been ignored.) A Plectrae-menu is triggered by any user touching the table and holding their finger still for a second or so, it provides the user with a set of options, which face the user in the correct orientation (more or less). This is important, since tabletop computing doesn’t have a bottom or top orientation so all information should be rotated towards the user.

Plectrae menu on the DiamondTouch

Plectrae menu in action, shot by Martijn van Exel

Lazy lady 18Feb08 | 0

My borrow-cat Bastet is starting to feel at home here. She doesn’t hide under my bed anymore, which means I can close the door of my sleeping room again. She spends most of the time in the living room and my beautiful brown lounge couch is her favorite spot. As promised by her owner she does enjoy the company of people, well … just me, haven’t introduced her to others so far.

Here a nice portait of her in full ‘action’:

Bastet on the couch

VE’s quadkey tiles and tilecache 12Feb08 | 2

Since my company acquired a real life Virtual Earth server; a hefty beast with a few TBs of data for just .nl, I decided to dive into VE. The people from Microsoft produced some excellent documents explaining how the tilescheme of VE works.

The original idea was that we could insert our own data into the server, but that seems to be difficult. So I decided to see if TileCache could do the honors. We already deploy TC in various projects and the nice bit is that the generated cache can be used outside VE, for instance with OL and/or google maps.

Of course it is possible to use OpenLayers to add your own data on top of VE, but OL doesn’t support the 3D view and AFAIK neither does it do birdseye. To show your own data in VE you need to serve the tiles using a quadkey construction. The logic of a quad key is very easy: At the lowest zoomlevel divide the world in 4 parts: 0, 1, 2, 3 (left top, right top, left bottom, right bottom) so a tile called 0.png would be in the left top at zoomlevel 0. In the next zoomlevel divide the four tiles in four parts again. And so on and so on. Stealing from msdn site:

quadkey explanation

So it is immediately clear that file 12020.jpg is at zoomlevel 5 and somewhere at the north-eastern hemisphere, actually it’s in .nl. Tilecache however works with x,y,z so you need to recalculate the quadkeys to/from xyz system. Taking into account that VE (0,0) is top left whereas TC uses bottom left for (0,0).

Tilecache has three components: client (which retrieves the data), service (which serves the tiles) and cache (which stores the tiles). I first wrote a cache which stored all tiles in a flat quad-file structure. This way you could put the entire cache online and VE could automatically place the tiles at the correct place. However as long as the cache is not complete and put online the data is not accessible by VE. Also all TC’s cachemanagement features are gone as well. So I decided to write a VETMS service instead, which takes quadkeys and turns them into any of the supported backends, be it WMS, Mapnik or whatever. This way it is easy to put your WMS data in VE. This code has been sent as a patch to the TC list so hopefully in the next TC release you can serve quadkey-tiles as well.

Whilst I was at it, I wrote the last bit: a VE-client which retrieves the tiles from a VE server and serves them as TMS, WMS-C or any other of the supported services. However since this is legally not allowed I’ve chosen to not release the code.

she talks to me! 11Feb08 | 0

When I arrived home today she was sitting on my couch and apparently was happy to see me, she started talking to me. But I guess it was mainly the food I provide which prompted her. Unlike previous times she wanted some attention, even after her food was in the bowl. So I’m making progress, however once she had had her dinner the living room was too scary so she retreated to the sleeping room. Maybe tomorrow.

On a different note; I’ve started to take photo’s again. My camera had been occupied for various longer and shorter timelapse and stop motion movies. But the beautiful weather made me go out and take black and white pictures of my city.

Lady friend 09Feb08 | 0

I’ve gotten myself a new lady friend, her name is bastet. She’s rather shy, she probably has been beaten before she was found and apparently it can take her up to two weeks before she really shows herself. Within a minute after arrival she found the empty spot behind the bookshelf and has been hiding there since. I’ve setup her litterbox and food/drink bowls right in front of it so she can find them if she decides to come out. I’ve set my camera to spy on her every half a minute so hopefully she will show herself before its memory runs out. If I’m lucky it’ll turn into a nice timelapse movie of a cat inspecting a new home. The current situation is like this, she hides behind the book which is standing in front of the shelf.

Hidden cat