Select to view content in your preferred language

Natural Neighbor - unexpected results

2893
4
Jump to solution
08-21-2014 06:59 AM
BenLeslie1
Frequent Contributor

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?

results mockup.jpg

0 Kudos
1 Solution

Accepted Solutions
NeilAyres
MVP Alum

Use a Euclidian distance function on a line feature. Then you can rescale this to go from 0 to 1.

Good luck,

Neil

View solution in original post

0 Kudos
4 Replies
JorgeOrellana
Deactivated User

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

0 Kudos
BenLeslie1
Frequent Contributor

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

0 Kudos
NeilAyres
MVP Alum

Use a Euclidian distance function on a line feature. Then you can rescale this to go from 0 to 1.

Good luck,

Neil

0 Kudos
curtvprice
MVP Esteemed Contributor

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.

0 Kudos