[GIS] Assign nearest raster cell value to point

arcgis-desktopcoordinate systemraster

I came across to a similar issue described in Finding nearest raster cell value based on vector point?

I understand the proposed solution with Raster to Point and then Spatial Join with (for example) Closest Geodesic option. However, is not clear how to use the coordinate formula described by @whuber:

(x',y') = ( min(max(x,x0),x1), min(max(y,y0),y1 )

For example on my global raster x0=-180, x1=180, y0=-90 and y1=90
If I apply the above formula for each given (x,y) then I get no difference (no shift). That is obvious, because all the (x,y) points for which I want to extract value from raster are within the extent of the raster, just that they fall in NoData cells. I presume the formula makes sense when knowing the x0,x1,y0,y1 of the nearest cell that contains any valid value different from NoData (which I need to find in the first place).

Best Answer

you could create thiessen polygons around each raster value (using euclidian allocation tool). Then you can extract the value for each point using extract value to point.

Note that distance analysis at global scale has two problems: 1) there is a rupture in the map (usually between -180 and + 180) and the scale is not constant.

Related Question