RSS Feed icon

Blog

The other day we were asked to quickly throw together an “offline map” for laptop use by crisis responders in the Philippines. We had a couple of hours to create something that was simple and rugged, something that ideally runs on any operating system without having to install software.

We knew that you can easily use OpenLayers or Leaflet plus a directory of pre-produced tile PNG images and then access that with a “file://” type URL from your local browser. This solution can even be run from an USB stick without any software installation, and any halfway recent browser works – be it OSX, Windows, Linux, or even more exotic operating systems. There are many more sophisticated solutions – storing vector data on the device gives you more interactivity and detail at a fraction of the disk space, or if using raster tiles, storing them in MBTiles format is less clumsy because it’s just a single file. All these options require some software installation though. So we decided to go with the old-style technology – but we made one minor tweak that made our solution much more useful on certain systems.

Because our set of tiles might be used on computers that use FAT file systems – crucially, most USB sticks or external USB drives will come formatted with that -, we had to take into account that FAT allocates space in full clusters. Even a small 500-byte PNG will consume one full cluster; and the cluster size on FAT systems can go up to 32 kB. With many high-zoom tiles being near empty, this means we’re wasting a lot of space.

The area we were exporting was about 2 GB of image data. The red and orange lines in the above image show how much disk space this would have used had we stored single 256×256 pixel tiles (the standard size) on a FAT system with 8 kB or 32 kB cluster size. Zoom level 18 tiles for the area in question would have taken 25 GB on a volume with an 8kB cluster size, and almost 100 GB (shooting out of the graph) with a 32kB cluster size.

Instead, we opted for making non-standard tiles with 1024×1024 pixels, 16 times as big as standard tiles. This puts more of the map in every single image, and reduces the waste incurred by “rounding up” to the nearest cluster size dramatically. OpenLayers accepts a “tileSize” parameter and processes the non-standard tiles flawlessly.

Unpacking our tiles down to z18 now only takes 6 GB on a volume with a 32 kB cluster size, and 3 GB if the cluster size is 8 kB – perfect for a “map-on-a-stick”!

If you find yourself in a similar situation – there are probably many ways to generate tiles like these, but we used Tirex which we configured to use large tiles (config option tilesize=1024), and then converted the resulting meta tiles to simple PNGs with the meta2tile utility. Remember that when doing this, you’ll only compute tiles down to a nominal zoom level of 16 which, because each tile has 1024×1024 pixels, gives you the same amount of detail that you’d normally see at zoom level 18. Then, in OpenLayers, you’ll have something like var map = new OpenLayers.Map('map', { tileSize: new OpenLayers.Size(1024, 1024) }) to work with these tiles.

(Hat tip to Matt Amos and Ian Dees on whose ideas we based this.)

(Deutsche Version in eigenem Artikel.)

Geofabrik is a household name in OpenStreetMap circles, but even insiders often ask us: What is it that you do at Geofabrik, apart from all the handy things for the community? What’s your business model?

We like to respond like this: At Geofabrik, we’re essentially craftspeople. Something like carpenters or cabinetmakers. Clients come to us and say “can you build me a cupboard”, and then we discuss the details with them, make them an offer, and when they like what we suggest, then we’ll build the cupboard. Of course the analogy only works so far – at Geofabrik, we might be able to build a standard cupboard for a client, which makes things easier. For another client we might, after a longer discussion, suggest that they get a nightstand instead because it serves them better, or we might offer to store their stuff in one of our cupboards. Or maybe we find out that they’re rather good at woodworking themselves and we just give them a blueprint for building their own cupboard… but what we like about the analogy is the the “honest work” aspect. We’re not “in the cloud”, we’re a solid engineering company, and we’re masters of our trade.

Since its inception in 2007, Geofabrik has done lots of different projects, sold products or services, and we’ve finally come up with a web page that presents a selection of them so that you can see for yourself what it is that we do.

For those that are interested further, Frederik has held a talk at the State of the Map US with an inside view of what it is like to do business in OSM.

And no, there aren’t any cupoards on that page, or in that talk.

Was macht die Geofabrik eigentlich?

1.10.2013 | Frederik Ramm

(For an English version, see other post.)

Obwohl die Geofabrik in der OpenStreetMap-Szene weithin bekannt ist, werden wir selbst von Insidern oft gefragt: Was macht ihr eigentlich außer all den praktischen Sachen für die Community – was ist Euer Geschäftsmodell?

Wir sagen dann gern: Die Geofabrik ist im Grunde ein Handwerksbetrieb. Sowas wie eine Schreinerei – der Kunde kommt und sagt “bauen Sie mir einen Schrank”, und dann unterhält man sich über die Details, bietet ihm was an, und wenn das für den Kunden gut klingt, dann bauen wir ihm den Schrank. Natürlich trägt die Analogie nur begrenzt – für einige Kunden können wir möglicherweise einen Standard-Schrank bauen, was die Sache vereinfacht. Anderen empfehlen wir vielleicht nach einem längeren Gespräch, dass sie lieber einen Nachttisch kaufen sollen, oder dass sie ihre Sachen doch auch in einem von unseren Schränken aufbewahren können. Oder wir geben ihnen eine Bauanleitung für einen Schrank. Was uns aber an der Analogie gut gefällt, ist das Handfeste: Wir sind nicht “in der Cloud”, sondern ein solider Ingenieurbetrieb, und wir beherrschen unser Handwerk.

Seit ihrer Gründung 2007 hat die Geofabrik eine ganze Reihe verschiedener Projekte durchgeführt und Produkte oder Dienstleistungen verkauft, und wir haben jetzt endlich eine Auswahl davon auf unserer Webseite zusammengestellt, damit man leichter sehen kann, was wir eigentlich machen.

Echte Schränke sind übrigens keine dabei.

Wer sich für einen kleinen Einblick in das Tagesgeschäft der Geofabrik interessiert, dem seien die (englischen) Folien zu Frederiks Talk “Open for Business” von der State of the Map US empfohlen.

We’ve overhauled the download server (download.geofabrik.de) a couple months ago but never really wrote anything on our blog so, let me quickly mention that for a few months now we do not only have a nicer user interface with overview maps and MD5 sums, but we also have selected older versions (usually, data from the past couple of days plus the 1st of each month for the current year) for every extract, as well as incremental updates (diff files). These updates allow you, for example, keep a country extract current by downloading only a fraction of the full file every day, or update an osm2pgsql database that you run with Europe only.

Last weekend we added free daily shape files for Canada’s provinces/territories, and from today we’ll also be serving free daily shape files for all US states. (Larger shape files, e.g. for all of Canada, all of the US, other continents, or the whole world, as well as shape files with more detail or tailored to a specific use case, are made to order for a fee – see http://www.geofabrik.de/data/shapefiles.html).

Would you like to see me explaining the download server (and the technology behind it) in a 20 minute video? Then watch my talk from the SOTM-US conference on Vimeo! The slides are available as well.

OSM Inspector Routing View Update

4.04.2013 | Frederik Ramm

The OSM Inspector’s “routing” view has always been the “odd one out” among the OSMI views. It higlights potential problems for routing, and was initially sponsored by Skobbler. At first it was available only for the EU; later we rolled it out world-wide but lacked the resources to actually update the world-wide view regularly, leaving us with a daily updated “Europe” view and a less frequently updated “non-Europe” view. We were hoping to attract someone to sponsor that section of OSMI but since nobody was forthcoming we’ve now put it on a more solid footing (read: better hardware) ourselves. The routing view should now update regularly for the whole world, and is also available as one single layer.

(If you should have bookmarked the old “routing-non-eu” view, drop the “non-eu” to use the unified routing view.)

This is also a good opportunity to thank OSM’s routing experts Pascal Neis (inventor of the original openrouteservice.org, and developer of the “unconnected” and “duplicate” layers in OSMI’s routing view) and Dennis Luxen (the man behind OSRM, and supplier of the “islands” layer in OSMI’s routing view).

The new hardware will allow us to add a couple more improvements to OSMI in the coming months.