Add function to extract values along a transect