[JT] Jochen Topf's Blog
Sun 2014-05-18 13:12

Taginfo Updates

I spent a few days working on taginfo again. I fixed some bugs and refactored code here and there and added a heap of new features.

Maps for Tags

Taginfo has had maps that show the distribution of tag keys for a while. But for full tags (key-value-combinations) those maps weren’t available. The reason was that for the currently about 50,000 different keys it isn’t a problem to create those maps, but for the over 70 million tags it is. The limiting factor is the main memory needed. Each map needs about 8 kBytes, so 70 million maps need over 500 GBytes. We could probably reduce the size of the maps in memory with some tricks, but it would still cost us about 10 GByte for the PNG files we need to create. All of this for maps most of which nobody ever looks at.

But those maps can be really useful and so I came up with a different approach: Maps are only created for the tags that appear at least 1000 times. For each of those tags, two maps are created, one for nodes, one for ways. That is still a manageable amount of maps (currently about 75,000). And for those tags used less than 1000 times you can get a map in reasonable amount of time from the Overpass Turbo site. The number 1000 is, of course, configurable, and might change in the future.

Here are a few examples that show the new feature: You can see where natural=coastline is used and that source=PGS is a data source for a lot of that coastline. Or have a look where the glaciers are in the world.

Comparing Keys and Tags

Based on an idea of Andy Mabbett (Issue #46). I added a function to compare keys and tags on a single page. A new menu on key and tag pages allows you to add those keys or tags to a comparison list and then compare the items on the list. This can be useful for instance when you want to decide which of several similar tags is more popular.

This maxspeed comparison for example allows you to see how different maxspeed values are distributed over the world.

Here is another example that shows how you can compare keys with key-value-combinations: You can see how diligently mappers have been mapping the different railway gauges throughout the world. As you can see many railway lines are tagged with the gauge. 1435 is the standard gauge used in about 60% of the global rail network, 1520 is the gauge used in Russia and some neighboring countries. Spain uses 1668 for normal train lines and the standard 1435 gauge for high speed lines. If you want to know more about track gauges, see the Wikipedia entry.

Add Link to Level0 Editor

Ilya Zverev’s Level0 online editor allows easy editing of OSM tags. There is a new link on taginfo key and tag pages that sends you to this editor. This makes it very easy to, for instance, correct misspelled tags. It is much faster than going into iD or JOSM. When you click this button, the Overpass API is used in the background the get the IDs of all objects with the given key or tag and then the editor is called with those IDs. To not overload the Overpass API or the Level0 editor only keys/tags with less than 50 occurrances can be edited this way.

Improve Overpass Turbo Integration

Taginfo links to Overpass Turbo pages, but it was always a bit cumbersome to use. You have to click on the Overpass Turbo button, then zoom and pan the map somewhere and click “Run”. If a key/tag occures less than 100 times, this is now simpler: Just click on the button and Overpass Turbo will zoom to the right area and show all objects. This functionality uses the new Overpass Turbo Query Wizard.

I am not entirely happy with the way this works, because the different behaviour depending on the number of objects with a key/tag can be confusing. But I don’t have a really good idea how to handle this. Suggestions welcome.

API Changes

Taginfo has an API that allows access from programs to most of the data it holds. In fact the API is used extensively by the taginfo web user interface itself. For over a year now the current API version was version 4. To simplify the code I have removed all lower API versions now.

To make the API more visible and maybe get more people to build on it, I have added an “API” link to the documentation in the footer of all pages and all the dynamic tables now have a “JSON” button that opens a new window with the same data that is currently shown in the table. To make it easier to read, this JSON is pretty-printed with spaces and newlines using the new format=json_pretty parameter.


Quite a few translations have shown up in the last months. I keep the English and German up to date and others have supplied French, Italian, Polish, Portuguese, Russian, and Ukrainian translations. After the newest changes those translations are all incomplete. If you know any of those languages, please send me updates. Information about the translations is on the OSM wiki. You can see all translations texts on this overview. Missing translations are marked in red as “MISSING” there.

Tags: openstreetmap · taginfo