Wednesday, December 17, 2008

OpenStreetMap rendering in Silverlight part X

Last few days were spent refactoring some of the design and data models. This has yielded some pretty impressive gains. Based on the UK data the following optimizations have been gained:

  • Original OSM data: 1.3gb
  • Import data into QuadStore: 367mb
  • QuadStore as binary: 97mb
  • QuadStore as compressed binary: 48mb
Yep that's right the whole of the OSM data for the UK has been compressed from 1.3gb into 48mb, or in other words its less than 5% of the original size. And the majority of this gain has delivered a geographically clustered data set, so it's fast as well.

I've also updated the map to cache data (it caches the compressed binary) into IsolatedStorage, though the default of 1mb is not enough for a mapping application, so it now requests the user to increase it to 10mb upfront. The nice thing about using the compressed binary is that we can cache twice us much as well!

To show the effect of all these optimizations I've changed the demo to show the whole of London (alá EastEnders)  on the fly:


The main bottle neck I have now is the requirement to go via the Dispatcher for drawing UI elements, this causes the "one at a time" display of tiles. I think I can get round this, but I will have to investigate further (it may just be my own code causing this!)

Given that the code is drawing a very detailed map of the whole of London it's very fast, however for a production version I would create lower resolution tiles first and replace them with higher resolutions in the background.

3 comments:

Erik Johansson said...

you got comments on your post at blogs.openstreetmap.org

Erik Johansson said...

And the app you link to doesn't support rotation on MacOSX since ctrl-mousewheel is unavailable.

It's interesting tech, and I hope you improve it.

fe said...

I've update the application to support Mac Os X - would be good if someone could test as I don't have access to a Mac. Control-Mousewheel should now work (you may need to clear your cache to force the download of the latest version)