Utility to select closest feature. Based on the tutorial Getting Started Writing QGIS Python Plugins by Lutra Consulting.