You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The convention for operations on a raster is that a new raster gets returned with the operation chained to it. Thus:
newband = band * 5
where (band * 5) returns a new GeoRaster with a x5 function added to it's chain.
In contrast, some GeoImage functions (eg AddMask) actually operate on *this, which is then returned. This is not consistent.
I think the best way is to always return a new object, that way any previous references will still contain the original GeoImage without the processing applied, which would be desirable.
Somewhat related is the various Set functions: SetGain, SetBandNames which return void and operate on *this as well, however I think with a 'Set' functions this would be the expected behavior. Although, at least returning *this from these would allow those functions to be included in a chain, e.g.,
image2 = image.SetGain(1.0).autoscale(args)
The text was updated successfully, but these errors were encountered:
The convention for operations on a raster is that a new raster gets returned with the operation chained to it. Thus:
newband = band * 5
where (band * 5) returns a new GeoRaster with a x5 function added to it's chain.
In contrast, some GeoImage functions (eg AddMask) actually operate on *this, which is then returned. This is not consistent.
I think the best way is to always return a new object, that way any previous references will still contain the original GeoImage without the processing applied, which would be desirable.
Somewhat related is the various Set functions: SetGain, SetBandNames which return void and operate on *this as well, however I think with a 'Set' functions this would be the expected behavior. Although, at least returning *this from these would allow those functions to be included in a chain, e.g.,
image2 = image.SetGain(1.0).autoscale(args)
The text was updated successfully, but these errors were encountered: