Opened 19 years ago
Closed 14 years ago
#1318 closed defect (wontfix)
SCALE can cause maxvalues to be transparent.
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | GDAL Support | Version: | 4.4 |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
In mapdrawgdal.c, the computation for dfScaleRatio on line 1147 can cause pixels with values of "dfScaleMax" to be mapped to 256. If NoDataValue is -1, this causes the pixels to be transparent. Change to dfScaleRatio = 255.0/(dfScaleMax - dfScaleMin);
Attachments (3)
Change History (6)
comment:2 by , 19 years ago
Frank. I've attached files which demonstrate the problem. The original tif image (gzipped) has NoVal =-1, and Float64 data values in the range of [0.0,1.0]. After using SCALE = 0,1 the data with value of 1.0 become transparent which confuses them with those pixels with NoVal. Please note, I'm using the python bindings to produce the image and inserted a mapObj.save() method call to produce the mapfile. I'm a rookie and don't really know if this mapfile can be used to replicate the problem. If you change the SCALE to 0,1.1 then the white values come out "white enough". I believe they are actually valued 253 or so. Kevin
comment:3 by , 14 years ago
Description: | modified (diff) |
---|---|
Resolution: | → wontfix |
Status: | assigned → closed |
Oddly the mapfile does not include a layer definition so it is not to clear how to reproduce the problem.
However, it is clear that scaling of end values is not very dependable. So a "SCALE=0,1" should not be trusted to treat 0 or 1 as being in the range. Where this is important, a small epsilon value should be added/subtracted to ensure end values are in range.
Note:
See TracTickets
for help on using tickets.