Opened 12 years ago

Closed 12 years ago

#4805 closed defect (invalid)

gdaldem color-relief text-based color configuration file interpretation error

Reported by: YellowBeard Owned by: warmerdam
Priority: low Milestone:
Component: Utilities Version: unspecified
Severity: normal Keywords: color-relief gdaldem
Cc:

Description

When using FWTools 2.4.7 and the gdaldem color-relief utility and reading from a color-mapping file, the output can be incorrect. When using a very simple relatively-scaled schema like

100% 0 0 255 0% 0 255 0

then the output is nicely blended between the two color values.

When using a more specific file (attached) like:

...

1535 95 5 255 1280 95 5 0 1279 95 4 255 1024 95 4 0 1023 95 3 255

768 95 3 0 767 95 2 255 512 95 2 0 511 95 1 255 256 95 1 0 255 95 0 255

1 95 0 1 0 95 0 0

-1 94 255 255

-256 94 255 0 -257 94 254 255 -512 94 254 0 -513 94 253 255 -768 94 253 0 -769 94 252 255

-1024 94 252 0 -1025 94 251 255 -1280 94 251 0 ...

(continued in both directions), there is a step jump in the color output. In this case, it seems to jump from (approximately) 0x9501FF up to 0x96.... for the next highest value. The intention was to have each color (in binary) reflect a height.

Attachments (1)

colourTextFile.txt (66.8 KB ) - added by YellowBeard 12 years ago.
Color schema file that fails

Download all attachments as: .zip

Change History (5)

by YellowBeard, 12 years ago

Attachment: colourTextFile.txt added

Color schema file that fails

comment:1 by YellowBeard, 12 years ago

comment:2 by YellowBeard, 12 years ago

Wait - I have removed the '100% 0 0 255' line from the color file, and am re-rendering my data. So far, I can't see any errors, so perhaps I didn't understand how the mapping of values to colours worked. I'll change the stauss of this ticket upon the end of rendering in a few hours..

comment:3 by YellowBeard, 12 years ago

Priority: normallow
Severity: majornormal

Render finished - and no errors in color map.

I either didn't understand how to specify the color map, or there is an error when using a 100% value in the color file. It would be nice to have the 100% automatically take over when above the maximum specified height value.

So overall, I'm not sure this is a defect or not.

Thanks..

comment:4 by Even Rouault, 12 years ago

Resolution: invalid
Status: newclosed

If the statistics are not up to date, it might be possible that the 100% doesn't match the highest elevation of your DEM. Otherwise, if the stats are up to date, this should work. I should also underline that if you have 2 lines in the file, one with "100% xxxxx" and another one with "YYYY xxxxx" where YYYY is the elevation value that matches 100%, which ones will win over the other one is undefined.

All in all, I don't think there's a remaining defect and I'm closing the ticket.

Note: See TracTickets for help on using tickets.