2

See bug report filed here:

http://hub.qgis.org/issues/10236

Note the initial bug report got 'fixed' but that fix introduced this new error, so the issue was reopened a few days ago.

Anyway, it looks like the team might have bigger fish to fry at the moment - thanks to anyone who does find time to work on it - but in the meantime, can someone suggest a good workaround? I was hoping to just edit the geotiff in gimp and do a color map from #000000 to #000001 or something, so that the 'almost-black' areas are no longer picked up as transparent in qgis - but, the file is too big (it's a labels layer from a USTopo) and gimp crashes in addition to complaining about some data fields on reading the file which kind of indicates the output may be dodgy anyway.

Is there a gdal tool to map colors in a geotiff? Or, some other script or program that anyone could recommend?

Thanks in advance.

3

You can enforce real nodata on the file using GDAL translate utility, look in your QGIS install location bin\ folder.

GDAL_Translate -of GTIFF -a_nodata value InTiff OutTiff

Substitute your own value for value. NoData does not have to be the highest or lowest value in the file you can set it to any value. Only one value is supported though so if you have multiple values that you want to be nodata then you will have to use the raster calculator to change their values.

| improve this answer | |
0

Thanks Michael, basically the same as what you pointed out - I hadn't looked at the full list of gdal tools. I used:

gdal_edit -a_nodata 50

which is documented here.

(50 is an arbitrary value)

This seems to do the trick as long as the raster in question doesn't have valuable data on RGB=50,50,50.

Still a bug in qgis but this workaround seems to do the trick. Thanks

| improve this answer | |
  • Hi Tom, the reason that I use translate over edit is because it creates a copy, which can sometimes be important. That way there is one that works and one in the original state. If you're not concerned about retaining the pristine state then edit works fine (and saves some space too). – Michael Stimson Jun 24 '14 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.