<div dir="ltr"><div><div><div><div>Hi All,<br><br></div>We are experimenting with postgis raster layers and ran into a weird problem:<br><br></div>We have imported globcover2009 [0] - a global landcover map with a single band without an internal color table - into postgis using raster2pgsql.<br></div>When we import the layer into qgis or geoserver, the resulting layer is in grayscale (of course).<br><br></div>We then tried to write a view using ST_ColorMap to attach a color table after the raster is being retrieved, something like<br><br>CREATE OR REPLACE VIEW public.vwgccolormap AS <br> SELECT st_colormap(tbl_globcover2009.rast, 1, ' 0 34 99 200<br>1 0 255 255<br>2 23 45 128<br>14 145 34 78<br>210 23 45 67'::text) AS raster<br>   FROM tbl_globcover2009<br>  WHERE tbl_globcover2009.rid = 555554;<br><br><div><div><div><div><br></div><div>Here we just retrieve one single tile for testing purposes.<br><br></div><div>The resulting tile only contains zeros and is black. Any ideas what we are doing wrong? <br></div><div>There is also a globcover tif file available with a color table attached [1]  - we also imported this one but the color table information also seems to get lost on import (i.e. greyscale when we import it into qgis)<br></div><div><br><br>Any help and advice is highly appreciated!<br><br></div><div>kind regards,<br><br><br></div><div>Chris<br></div><div><br><br></div><div><br>[0] <a href="http://due.esrin.esa.int/files/Globcover2009_V2.3_Global_.zip">http://due.esrin.esa.int/files/Globcover2009_V2.3_Global_.zip</a><br>[1]<code><span class="">http</span><span class="">:</span><span class="">//<a href="http://due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif">due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif</a></span></code></div></div></div></div></div>