I am trying to run Cell Statistics to combine multiple raster layers but the output misaligns the raster cells of the output raster (see image below). Environments have been set to same coordinate system, preserved cell size and output extent of the AOI. If Snap to Raster is chosen, you can select one input raster layer and it will snap to that layer but not any others. The second image shows the environments.
You could probably achieve this iteratively, do cell stats for 2 rasters (choosing one of those as a snap raster), then cell stats on the next raster (input initial result + next raster / snap raster = intial result) and so on..
Thanks for the reply, Dave. So I think I have already tried that and effectively you just end up chasing your tail snapping to the new raster and misaligning everything else. So you do your first cell stats, which is snapped to the input raster, do another cell stats, add another raster and snap to that new raster, which misaligns from the first cell stats.
Model example below;
This is the output, Cell_Stats_1, snapped to A_Road_Single_Rec_1, so doesn't show any misalignment;
This is the output, Cell_Stats_2, which add Motorway_Rec_1 to the Cell_Stats_1 and is snapped to Motorway_Rec_1. Here it is snapped perfectly to the Motorway cells but has now become misaligned from the original Cell_Stats_1;
The blue is the snapped motorway, the red is the original Cell_Stats_1 raster and the green is the now misaligned cells from the output of Cell_Stats_2.
Hopefully that makes sense.
Gotcha, resampling everything to a smaller cell size would minimise the offset, or better yet adjust the output cell size when you rasterized the road buffers.
But I think it might just be solved by rasterizing all those roads at the same time? I'm assuming there's been a buffer of each road then feature to raster?
modify the model to merge those buffers then run a single feature to raster, they should all have the same matrix origin then.
Geoo
So cell size is an issue, too big and I don't get the detail I require, too small and processing over a large area becomes unworkable.
I haven't tried your buffering suggestion, I had simply rasterized from the vector feature. I have added a column to distinguish between the different road types I require, so I will try rasterizing the original vector feature, with the field set to my road classification attribute.
I'll give it a go and let you know if it gives me the results I require.
Thanks for your help.
So I tried with rasterizing based on the Road Classification I had designated to the varying road types, then reclassified and ran cell stats.
This got rid of the alignment issue but because it was one raster throughout, the cells were classified according to the original feature to raster process. So when it comes to Cell Stats and wanting to ensure the lowest value is considered, I have no control because the cell's value has already been determined in the original feature to raster process.
Does that make sense?
Are we talking about an overlap not being controlled? e.g. a pretty random assignment of the raster cell value if they occupy the same space? Dependant on the infrastructure would there not be considerations such as z order etc with flyovers? I guess I'm not grasping the problem entirely well.
Also you could solve it in your original workflow when you create the raster for each road. Zoom to the full extent of all of your data, and when you rasterise each line, ensure the cell size is the same and that your extent is 'same as display'.
That should solve the initial problem of putting them into Cell Stat, as they will all have the snap origin of the display (top left or bottom left or whatever).
So I think I've solved the issue by running through your suggestion of rasterizing all road classification together.
This then enabled me to select a raster to snap to that covered everything at once, as opposed to individual road classifications. Thanks again, Dave.