On Mon, Aug 5, 2013 at 9:04 PM, Paige M. Baldassaro <
[email protected]> wrote:
> Hello,****
>
> I am writing out GeoTiffs and am trying to embed a colormap within them.
> It is not obvious to me how to do this using Geotools. I am starting with a
> GridCoverage2D and using a GeoTiffWriter.
>
The writer won't do it for you, the image itself should start with a
IndexedColorModel.
If you have a RGB image to start with, you can use the CustomPaletteBuilder
to turn it into
a indexed one, something like:
CustomPaletteBuilder cpb=new CustomPaletteBuilder(image,
256, subsx, subsy, 1).buildPalette();
image = cpb.getIndexedImage();
If instead you start with a RGBA one and want to preserve the alpha channel
GeoServer has a
Quantizer class in the wms module that can be use to produce a palette with
RGBA entries,
but mind, that code is currently under the GPL licence (I wrote it, and
might port it back to
GeoTools changing the license, it's just that mostly have no reason to do
so right now).
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users