I'm working on coding a function in ArcGIS trying to measure the number of pixels between a point (feature class) and its nearest building horizontally within a UDEM raster, then return the number.
Here is my idea:
- Execute Zonal Statistics as Table and create a cursor to see whether the value in output table equals 0(the elevation of ground in my UDEM are set to 0 while elevation of building remain the real value)
- If so(value=0), make x coordinate plus one, which means move the point 1 meter to the right(the resolution is 1×1) and refresh the coordinate of the point.
- Iterate over step2 until the value doesn't equal 0,thus showing the location of point has moved to the "boundary" and I'll know the distance.
My problem now is having no idea how to perform Step2.
I tried some code to change its location but doesn't work.