I'm trying to create a smooth raster gradient between 1 and 0 that I can then use in Raster Calculator.
See attached (this is a mockup drawn in photoshop - my actual data is offline)
I have input a series of points with value = 1 (red)
and a series with value = 0 (blue)
I expect a nice smooth gradient between the points but I actually get a kind of salt and pepper effect (as shown).
I have found that the effect is very much reduced (but not totally) by using the default cell size however the default it too large, I need a nice small cell size for my RasterCalculator step.
Anyone know what's going on here and how I can completely eliminate these defects?
Solved! Go to Solution.
Use a Euclidian distance function on a line feature. Then you can rescale this to go from 0 to 1.
Good luck,
Neil
try making your grid with "contours" evenly spaced at a nice interval say 0.1 instead of points, that should help make your surface smoother
Hi Jorge
What tool do you use to convert contours into a raster? I tried TopoToRaster without luck.
By-the-way I only want to define areas of height=1 and height=0, in between I want it to be a smooth computer generated slope.
Cheers
Ben
Use a Euclidian distance function on a line feature. Then you can rescale this to go from 0 to 1.
Good luck,
Neil
I really miss $$ROWMAP and $$COLMAP for making test data like this. You can still get at it in the Python window if you're crafty.
Make sure to turn on Spatial Analyst (Customize > Extensions) first.
>>> arcpy.env.extent = arcpy.Extent(0, 0, 100, 100)
>>> arcpy.env.cellSize = 1
>>> arcpy.env.workspace = "C:\\TEMP" # must be a folder
>>> arcpy.gp.MultiOutputMapAlgebra_sa("scalegrd = $$ROWMAP * 1.0 / ( $$NROWS - 1 )")
You can then add scalegrd to your map from the Catalog window. MOMA only works on Esri grid format.