A couple of helper functions to query the OSM database.