I need to create a line between polygons (centroid) and the nearest cell of a raster dataset. The polygon and raster do not intersect. Each polygon has a UID. One cell can be linked to many polygons, but the polygon can only be linked to one cell.
To start, I'm converting the raster to point. From there, I think a Spatial Join needs to be performed using "CLOSEST" as the match option. If I can get the raster cell point to have the polygon UID, I can then use Points to Line with the UID field as the "Line Field" parameter to create an individual line between the two points to connect the polygons to the nearest raster cell.
I tested this on a small area and sample, but it was taking a long time to run each step. In the end, this needs to be performed for hundreds of polygons at a time. Can anyone tell me if I'm on the right track or offer any suggestions to make this work? Some searching has indicated using Near analysis and creating a line from the xy coordinates could be an option as well. Whatever is most efficient.
Making a grid with only values along the boundary would make the raster to point processing faster, as described here. I'm still not sure if the rest of the process is going to work correctly.