Thursday, September 27, 2012, 7:19:03 AM, you wrote: > On Mon, Sep 24, 2012 at 7:28 AM, Sebastian Graca <sgr...@ispik.pl> wrote:
>> I have created a patch for GeoTools which implements whole layer >> transparency (for layers and labels) and allows to skip label rendering >> for a layer. The patch is submitted as a github pull request >> https://github.com/geotools/geotools/pull/32 >> >> Andrea asked me to explain what I try to do, so I will try to describe >> what is being done and why. >> > I agree with Jody what you're looking for it not transparency control > (which is correctly > implemented in SLD), but composition control. > The latter sounds like something which might make sense as a vendor > parameter in > FeatureTypeStyle for example, allowing the user to specify one of the > various > composition modes Java2D allows for: > http://docs.oracle.com/javase/tutorial/2d/advanced/compositing.html > and then allow also a extra param for opacity. > In the end what you're doing in your patch does not look significantly > different > from the existing fts merging command, you are just changing the opacity > from > 1 to a different value no? > Hiding labels looks something that one could achieve also by parametrizing > the SLD > and having the Label element either pick an attribute or an empty value, or > using > your own label cache. > Adding API to hide labels seems pretty narrow use case... if we have an > interest to > go there wondering if it would be better to allow a layer to have some sort > of > style transformer that changes the style contents before rendering, in > order to > make this kind of transformation just one of the possible ones (for > example, for > web mapping one might be also interested to do the opposite, turn off > everything > but the labels to do only the vectors in tiled mode, and only the labels in > full map > mode). > This would allow to perform the change in a well centralized place without > having to > mess with the rendering code and pass everywhere the hidelabels flag like > the patch does. Unfortunately there is no support for VendorOption in FeatureTypeStyle in current GeoTools version (it is only implemented for TextSymbolizers). I think it would be nice to have it implemented for all kinds of symbolizers and FeatureTypeStyle or to have possibility of attaching userData map for org.geotools.styling.Style and related classes. Adding this and making StreamingRenderer more extensible would indeed make is possible to implement the functionality I need in a way transparent to code which uses GeoTools' renderer and MapContent. More about StreamingRendere extensibility. It is a final class which although implements GTRenderer interface is impossible to wrap in a way transparent to its clients. For example GeoServer calls methods declared in StramingRenderer and does not use GTRenderer interface at all. So it is not possible to replace it with a wrapper which implements some extra functionality configured on style/MapContent level. > I'm sorry for the negative feedback, especially since the code is otherwise > clean and > tested, but before making feature changes to the code base you should > really double check > with the GeoTools community on the direction to take. No need to worry. I was aware that it could be rejected. The patch (and several others I have recently submitted) was created a while ago as a quick way to implement some functionality I required. I had some spare time recently, so I decided to clean up/comment the code and submit it. For now I just stick to my way of doing things, as it works fine for me and eventually will try to implement it in a less intrusive way (using userData to hold additional information on layer level and wrapping StreamingRenderer to render map in several steps and compose images with require opacity). I have to use forked GeoTools version anyway as there are more changes (which are not ready for submission as a patch yet) and some bugfixes I need (GEOT-3144, GEOT-3970). Be prepared to hear from me again :) -- Sebastian Graca Institute of Spatial and Cadastral Systems tel: +48 32 301 10 74 fax: +48 32 301 10 77 e-mail: sgr...@ispik.pl http://www.ispik.pl ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel