Skip to main content
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link

How to compare two rasters and reclass the greater value(python script)?

I am working on an assignment that requires us to reclass a raster(via python) from two rasters. We need to compare the power received at one cell(on raster1) and compare it to the same cell on raster 2.

If the value of that cell in raster1 is greater than the value in raster2, the cell would be assigned a value of "1" while a value in raster2 greater than raster1 would get a "2". We also need to reclassify certain values as "0" since they are considered out of range.

So the final raster would have three values: 0-out of range/no service 1-better value in raster1 2-better value in raster2

I can try to clarify further if needed.