This would be much easier to do using python/arcpy...
Anyhow, here is a model builder approach (with a python snippet in field calculator [couldn't help it])
Build a model that looks something like this:
The model uses the following tools.
- Con - set all raster cells to a single value
- Raster to Polygon - Converts raster extent to polygon
- Get Raster Properties - used to retrieve row count, column count, cell size, lower left corner coordinates.
- Calculate Values - creates an origin point using lower left coordinates. Set Data Type to Point. Output gets fed into Grid Index Features.
- Grid Index Features - creates a grid based on raster extent, column count, row count and lower left coordinates. Set polygon width/height to be the same as input raster cell size
- Add Field - Add two fields CELL_ROW and CELL_COL to the output from grid index features.
- Calculate Field - Calculates values for CELL_ROW and CELL_COL
Row and column positions are calculated using values from the PageNumber field generated by the Grid Index Features tool.
To get cell row position, divide PageNumber by the total number of rows then add 1, for rows where the PageNumber is not a multiple of total rows. Where PageNumber is a multiple of the total rows, cell row position is found by dividing the PageNumber by the row count. See graphic below.
Cell column position is given by PageNumber%column_count. if the modulus expression evaluates to zero, then cell column position = row_count.
The steps above yield (tested on a 100*100 grid, 1m cell size):
At this stage, you can plug in the rest of your processing steps. Use your polyline to select overlapping cells and take it from there..