Target cells often come from rasterized polygons with important attributes. An option for costDist() to return a rast with cell IDs of the nearest target would be extremely helpful to link back to these features. This is similar to the values flag added from issue 1243.