Hi, in middle of 
http://docs.geotools.org/latest/userguide/tutorial/raster/image.html page there 
is some code which is nice, but do not tell me who wrote it and where he live...

have look at it:

        // We need at least three bands to create an RGB style
        int numBands = cov.getNumSampleDimensions();
        if (numBands < 3) {
            return null;
        }


I have lost best time of my life (oki, just a few hours) while replacing 
"return null" with this:

                        // Now we create a RasterSymbolizer using colormap
                        ColorMap colorMap;
                        colorMap = sf.createColorMap();
                        RasterSymbolizer sym = sf.getDefaultRasterSymbolizer();
                        sym.setColorMap(colorMap);
                        return SLD.wrapSymbolizers(sym);

I do not know it it is good way, but it is working. Please improve that sample 
on web for future generations of coders...

PS: I had problem with slow rendering of small map (~3000x1500 px). I have 
tried png (800kB, 24bit color), bmp (not working, because of not supported by 
image-ext - 
http://java.net/downloads/imageio-ext/Documentation/gdalsupportedformats.html), 
tif and horrible jpg (450kB). Best was my final solution, 16 color png (118kB) 
file. Second was tiff without compression (37MB) and third tiff with 
compression LZW (1.5MB). For my need of simple map it is now working fast.

If it would not hurt website, please try to write there some recommendation for 
people that not full color png is good option for small home projects...

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to