[JT] Jochen Topf's Blog
Sat 2015-08-15 19:44

Hacking on Taginfo

The recent London OSM hack weekend gave me the incentive to work on taginfo once more and we got quite a few things done on the weekend and the days after. Taginfo now works better on mobile, is faster and we have a very cool tag list feature for the wiki. Lets look at these in turn…

Better mobile support

Together with Christopher Baines I worked on improving the taginfo web site for mobile use. There is still much to do, but it went from unusable to somewhat usable. To make it really nice I fear we have to rethink the whole interface and not just make small changes here and there. Thanks Christopher!

Taginfo-powered tag lists on the OSM wiki

The OSM wiki is full of tables of tags, most prominently on the Map features page and its many language variants. Those tables are all managed manually which is a lot of work and error prone. But taginfo has most of the information needed for those tables, so it can create them automatically.

This feature has been a long time in the making. The first work happened two and a half years ago! And then kind of stalled… Read that blog post for lots more background info. Basically for all this time the feature worked in taginfo, but we couldn’t decide how to best bring it into the wiki. Last weekend I worked together with Harry Wood, our fearless wiki admin, to make this work on the wiki. So now we can finally create all those lists automatically! Of course, this feature is rather new and there might be problems and further improvements needed, but you can start trying it out right away. See this documentation for the details. Oh, and by the way, you can get those tag lists on your own web pages, too. The wiki uses the JSON API from taginfo and you can use the same API from other pages, how is explained on that documentation page, too.

Faster, faster…

Taginfo is generally reasonably fast to use, usually the data you need shows up quickly. But there are a few exceptions, most notably the list of values for a given key took forever to load. This is especially bad for keys like name or ref which have many, many values. The reason for this is simple: There are 75 million different tags in the OSM database and therefore in the taginfo database. And it takes a while to go through them. I have finally looked into this some more and found the right combination of indexes to make this particular query and some others much faster. I was always shying away from this solution, because it only solves part of the problem and because it makes the database much bigger. It only solves part of the problem because filtering in the table is still slow, but filtering is much less used then just the plain table, so this change is still a win. And it makes the database much larger, because all the indexes have to go somewhere. In fact the database size more than doubles from about 5 GByte to about 13 GByte. Because some people download this database, this is problematic. I decided to leave the indexes out of the download version of the database, so if you are using the downloads, you have to create those indexes yourself.

Wait, there is more!

There are some other, smaller things I worked on: Some bugs are fixed, the suggestions shown when searching are much better, and I improved the parsing of the wiki pages which will allow further enhancements down the road.

And I have improved the tag list shown for projects: They now include a marker whether a tag has a wiki page and the number of objects with that tag. See for example the Nominatim project page (also shown in the screenshot on the right). This is useful for the maintainers of those projects, because they can easily see how popular the tags are that they are using.

Tags: openstreetmap · taginfo