I have two layers in ArcGIS: One is a vector point and the other is a raster layer. I want to append the value of the raster data grid to the vector point. The problem is the vector point is away from any existing raster grids with value, so the command "Sample" return no value for those vector point.
So my question is: How can I find the nearest raster cell given a vector point and extract the value from the cell?
Actually there are two things I need to do:
- Identify the outliner within a ranger (Usually 1-2 cells away from my existing raster)
- Assign a value from the nearest raster to them, if they are in a range
Edited: I have about 3000 vector points and my problem is this:
I need to append the raster value based on locations to the vector points. I used the tool "Sample" and it works well for most of the points.
However, there is a situation like this
The right point can get the value from the raster ("Sample" works) but the left point cannot due to the alignment issues.
Raster to polygon is not working because I get error message that I cannot turn them into vector because they are out of the domain. Also I have points like this
Those upper points should not get any values because they are too far away from the raster.
I thought of someways to work around:
Step 1. Do the "sample" first
Step 2. Select the null value after the "sample" operations
Step 3. construct buffer zones (within 1 decimal degree) based on the null points
Step 4. use zonal statistics??? or other tools to loop through all the raster cells in the buffer, find the nearest one, extract its value and put it in the vector point.
I am stucked at step 4. I don't know which tool in ArcSDK I can use to achieve this function.
Or else...Do you have better idea to deal with that?
I have 20 raster layers like this and I would like to make it automatically (using model builder and arcobject).