generic geometry function, applied to all tables