lib/gdal/dataset_extensions.rb in ffi-gdal-1.0.0.beta1 vs lib/gdal/dataset_extensions.rb in ffi-gdal-1.0.0.beta3
- old
+ new
@@ -470,16 +470,16 @@
private
# @param ndvi [NArray]
# @return [NArray]
def calculate_ndvi_byte(ndvi)
- (ndvi + 1) * (127.5)
+ (ndvi + 1) * (255.0 / 2)
end
# @param ndvi [NArray]
# @return [NArray]
def calculate_ndvi_uint16(ndvi)
- (ndvi + 1) * (2**15 - 1)
+ (ndvi + 1) * (65535.0 / 2)
end
# Sets any negative values in the NArray to 0.
#
# @param narray [NArray]