[postgis-users] PostGIS Raster: ST_ColorMap problem

Christian Yrrman yrrman at gmail.com
Thu Jul 14 01:49:27 PDT 2016


Hi All,

We are experimenting with postgis raster layers and ran into a weird
problem:

We have imported globcover2009 [0] - a global landcover map with a single
band without an internal color table - into postgis using raster2pgsql.
When we import the layer into qgis or geoserver, the resulting layer is in
grayscale (of course).

We then tried to write a view using ST_ColorMap to attach a color table
after the raster is being retrieved, something like

CREATE OR REPLACE VIEW public.vwgccolormap AS
 SELECT st_colormap(tbl_globcover2009.rast, 1, ' 0 34 99 200
1 0 255 255
2 23 45 128
14 145 34 78
210 23 45 67'::text) AS raster
   FROM tbl_globcover2009
  WHERE tbl_globcover2009.rid = 555554;


Here we just retrieve one single tile for testing purposes.

The resulting tile only contains zeros and is black. Any ideas what we are
doing wrong?
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)


Any help and advice is highly appreciated!

kind regards,


Chris



[0] http://due.esrin.esa.int/files/Globcover2009_V2.3_Global_.zip
[1]http://due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160714/c9b5789e/attachment.html>


More information about the postgis-users mailing list