Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4764 closed defect (fixed)

Artifacts in gdaldem color-relief output

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

Description

Using the command

gdaldem color-relief K:\1secSRTM_DEM_DSM\e113s22dem1_0\w001001.adf colourTextFile.txt K:\1secSRTM_DEM_DSM\e113s22.png -of PNG

with the color specification file

100%	255 255 255

2048	95 8 0
2047	95 7 255
1792	95 7 0
1791	95 6 255
1536	95 6 0
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 254 0
-257	94 253 255
-512	94 253 0
-513	94 252 255
-768	94 252 0

nv     255 255 255

The results all come out with odd artifacts on the right-hand edge. An image is attached.

These files do not appear corrupted when viewing in various GIS packages.

Attachments (1)

Artifacts.png (71.1 KB ) - added by YellowBeard 12 years ago.
Right-hand section of PNG output of color-relief utility

Download all attachments as: .zip

Change History (7)

by YellowBeard, 12 years ago

Attachment: Artifacts.png added

Right-hand section of PNG output of color-relief utility

comment:1 by Even Rouault, 12 years ago

I'd need a source raster file that exhibits the issue to investigate (as .adf isn't very convenient due to the number of files, if you can convert it into geotiff first, that would be better)

When you say "These files do not appear corrupted when viewing in various GIS packages.", which files are you talking about : the input or output files ?

comment:2 by YellowBeard, 12 years ago

I'll keep working on getting a source file - My .adfs are around 50MB - 60MB each. I'm not currently able to convert into a tif using openEV as a part of FWTools for some reason. I'll keep tying to create something smaller.

The *input files* appear perfectly normal, and the data seems valid in OpenEV when hovering over it.

comment:3 by Even Rouault, 12 years ago

You can zip the .adf if you prefer. (TIFF was just a suggestion. You should be able to do the translation with gdal_translate)

comment:4 by YellowBeard, 12 years ago

The zipped source files are in a FileFactory repository.

comment:5 by Even Rouault, 12 years ago

Milestone: 1.9.2
Resolution: fixed
Status: newclosed
Version: 1.9.1

ok, I managed to reproduce. Here's the fix :

r24722 /trunk/gdal/apps/gdaldem.cpp: gdaldem: fix color-relief output with driver that has only CreateCopy() capability, and when the source block dimensions are not multiple of the raster dimension (#4764)

r24723 /branches/1.9/gdal/apps/gdaldem.cpp: gdaldem: fix color-relief output with driver that has only CreateCopy() capability, and when the source block dimensions are not multiple of the raster dimension (#4764)

comment:6 by YellowBeard, 12 years ago

Wow - that was quick! Thanks so much for looking into this.

Note: See TracTickets for help on using tickets.