Extracting values from raster against list containing xy coordinates

362
0
11-20-2019 04:51 AM
SibghatUllah1
Occasional Contributor

I am trying to extract values from raster for my stored list value.

inLineFeatures = arcpy.GetParameterAsText(0)
inRaster = arcpy.GetParameterAsText(1)

layer=arcpy.Densify_edit(inLineFeatures, "DISTANCE","", "", "1")

with arcpy.da.SearchCursor(layer, ["SHAPE@", "FID"]) as lcursor:
for lrow in lcursor:
   polygon = lrow[0]
   objId = lrow[1]
   for pnt in part:
      print "X: " + str(pnt.X) + " Y: " + str(pnt.Y)
      value= str(pnt.X), str(pnt.Y)
      arcpy.AddMessage(value)

del lcursor

i am stuck here how to search for value= str(pnt.X), str(pnt.Y) in raster to get pixel value against XY

rows = arcpy.SearchCursor("inRaster","Pixel value")
for row in rows:

val = row.getValue("Pixel value")

0 Kudos
0 Replies