fix database queries (geometric types)