[JT] Jochen Topf's Blog
Thu 2013-01-10 13:09

Taginfo News

It has been nearly a year since I did some serious work on taginfo. Taginfo works well, but there has been and still is a backlog of todo items. And I get new ideas on how to improve it all the time. So I spent the first days of the new year doing some work on it. A lot of this work has been “behind the scenes”, improving code here or there, so there isn’t actually that much to see. (If you are taking a look remember that you might have to clear your browser cache for all the goodies to show up properly.) But here are the larger improvements:


Switch from Protovis to D3

Taginfo had been using the Protovis Javascript library for the graphs you can see on some pages. But Protovis is not developed any further. Instead the author started from scratch and created D3 which is even more awesome!

I switched all the graphs over to the new library. This took some work without much visual change, but should make it easier to build on in the future.

I also introduced a new and improved shiny colorful tag cloud on the front page based on D3 and the supercool D3 Wordcloud code. See the image above.


Support for Images from Wiki

The pages on the OSM wiki describing keys and tags often have an image on them depicting what this key or tag is about. I now properly get the meta data about these images from the wiki and show the images in the user interface. Where images are available they are shown on the key and tag pages in the Overview tab and if you mouse over the image links in the Wiki tab they are also shown.

I added support for the images because of a question from Tom MacWright on osm-dev. He wants to use those images in the new iD Javascript editor. This is now easy to do as the image links etc. are also exported via the taginfo API. Which brings me to the next chapter…


New API Version

Taginfo always had an API that allows everybody to get at all the juicy data in taginfo. I internally use this API to show most of the information you see on the site. But the API was organized badly and never fully documented. So now I have re-organized the API a bit, given it the new version 4 and documented every call. The changes for users aren’t really that great, so it should be easy to change your code. In most cases you will only need to change the URL. The API documentation optionally shows deprecated API calls, too, and tells you which new call you should use instead of the old calls.

The old API versions will be around for a while so you have some time to switch. But they will disappear at some point, so if you are using the API, consider switching sooner than later.


Caching of Wiki Pages

Taginfo reads thousands of wiki pages to get its information. This takes a lot of time and it strains the wiki server. The new version now caches the wiki pages and only reloads them if they have changed.

Tags: openstreetmap · taginfo