Using @SS_Rebelious very useful answer, I am trying to reclassify rasters using GDAL
and Python
.
I have a grayscale raster (with values ranging from 0 to 255) and I want to reclassify it to a binary raster.
From the answer I referenced, I'm using the following line:
# reclassify raster values equal 16 to 7 using Numpy
temp = numpy.equal(raster, 16)
numpy.putmask(raster, temp, 7)
I'm experimented with something like this:
temp = numpy.greater_equal(raster, 1)
This seems to work fine, but is this best way of reclassifying a raster using Python?
No comments:
Post a Comment