'Helper routine for calling SpatiaLite functions and returning
their result.'

def _get_spatialite_func(self, func):

    cursor = self.connection._cursor()
    try:
        cursor.execute(('SELECT    %s' % func))
        row = cursor.fetchone()
    except:
        raise
    finally:
        cursor.close()
    return row[0]
