[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] PostGIS Raster: ST_ColorMap problem
From:       Christian Yrrman <yrrman () gmail ! com>
Date:       2016-07-14 8:49:27
Message-ID: CAJ79dQqNY+=Pg90FES2PEq9Da-er6pS32s0qMrQc3WF-oqGAxg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

<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, &#39; 0 34 99 200<br>1 0 255 \
255<br>2 23 45 128<br>14 145 34 78<br>210 23 45 67&#39;::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.es \
rin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif</a></span></code></div></div></div></div></div>



[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic