Seems to me that one solution could be to have a per-layer 'cache' of a representative color-map.
I.e., on the first request of a particular layer, a full color-reduction (using an expensive algorithm) is used. Then the calculated color-map is attached to that layer and cached. For future requests, the cached color-map is used. This idea could be expanded in a number of ways. 1) Rather than simply using the *first* request to generate the sample color-map, you could have a "learning mode" and a "production mode". When a layer is in "learning mode", its color-map is constantly refined, based on each image...resulting in as accurate a static color-map as possible for all viewed maps. In "production mode", the static color-map is used for all requests. Note that for most vector layers styled with SLD, you don't need to do learning-mode at all, as all colors are available for pre-populating the color-map. (although anti-aliasing would need to be 'learned'). 2) It's possible that for many geoserver instances, most layers are repeatedly requested in a particular 'stack' (i.e, most clients are map-oriented, not layer-oriented). You could expand the color-reduction caching to include one map for a particular SET of layers, rather than just one layer. This way commonly used combinations of layers (for particular clients) get the biggest speed boosts, while less-frequently used combos aren't optimized and don't waste space with their cached color-maps. Thoughts? --saul Andrea Aime wrote: > David Blasby ha scritto: >> I thought about this problem before -- the main issue is that the >> anti-aliasing causes a lot of "extra" colours to be created. >> >> The original colour reduction algorithm was to find the first 256 >> colours in the image and use those colours in the colour map. This >> completely failed to work after antialiasing was turned on - images >> went from 16 colours to 6,000! >> > > Another problem occurs when you add a coverage on the background, SLD > won't tell you which colors are there in a satellite image. > > Cheers > Andrea > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Geoserver-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/geoserver-devel > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
