I am preparing data for inclusion into a geonetwork node, where the maps are displayed via geoserver.
The problem is that cells that have"no data" are displaying as black in the geotiff and I am would like the color to be set to white or transparent.
I am using ArcView and do not have access to either Spatial Analyst or 3D analyst.
I would prefer not to have to assign a new sld file and am presently using "Use colormap" when exporting from ArcGIS Desktop.
Answer
In concept, you need to figure out what pixel values represent cells with no data and then edit your color table to assign the RED,GREEN,BLUE (RGB) values in the color table to be 255,255,255 for that cell value.
If you don't have the appropriate license to do this in Arc, you could use the gdal_translate tool (one of the gdal/ogr commandline tools)
export the color table for your tif as an XML file.
gdal_translate -of VRT myImage.tif outColorTable.vrt
open up the .vrt file in a text editor and find the entry for the value of your no data pixels. There isn't an index number for the cell values, so you have to count down to the correct entry.
edit this value to be
now, create a new tif based on the new color table
gdal_translate outColorTable.vrt newCorrected.tif
(example added based on comment below)
When I run the command in item #2 above and open up the .vrt file in a text editor, I see XML contents.
Part of the file includes lines that look like this, I have snipped most of them out.
No comments:
Post a Comment