Hey Andrea, have you had any time to take a quick look? Cheers Milton
Milton Jonathan (JIRA) wrote: > Support UOM in the rendering process (a.k.a. variable size symbolizers) > ----------------------------------------------------------------------- > > Key: GEOT-2964 > URL: http://jira.codehaus.org/browse/GEOT-2964 > Project: GeoTools > Issue Type: New Feature > Components: core render, core styling > Affects Versions: 2.6.2 > Reporter: Milton Jonathan > Assignee: Andrea Aime > Fix For: 2.6.3 > Attachments: geotools-tecgraf.2.6.x.uom_rescaling.patch > > The provided patch adds support for rescaling symbolizers according to their > Unit of Measure (UOM). This feature allows for symbolizers to have a > "real-world" size (e.g., size given in meters or feet), so that they grow as > you zoom in. > > There are several issues in the implementation that may require a discussion > before commiting: > - The approach used was to implement a UomRescaleStyleVisitor class for > rescaling Symbolizers according to their Unit Of Measure (i.e., compute their > sizes in pixels), and use that in SLDStyleFactory whenever a Style2D is > created. In order to do that, the current map scale is needed (i.e., how > screen units relate to real-world units, or how many meters are covered by > each pixel). This was extracted from the SLDStyleFactory.createStyle's > ScaleRange parameter, which was seen to be set to > (scaleDenominator,scaleDenominator) in the renderers. However, maybe it would > make more sense to pass on the scaleDenominator directly. > - Methods were added to RendererUtilities.java to help compute the pixels per > meter ratio (in order to convert sizes in meters/feet/etc to pixels). > - In SLDStyleFactory, both createStyleInternal and createDynamicStyle were > modified to rescale the given symbolizer. It was not clear whether > createDynamicStyle is needed or where it is used. > - Style2D objects created by SLDStyleFactory should always be rescaled > according to the UOM, but for one case: in Drawer.java (used for legend > icons), the rendering must be done WITHOUT rescaling the symbolizer, since a > legend has no scale. This was currently implemented adding a > createStyleNoUOMRescaling method, because as such less GeoTools code would be > changed. But maybe it would be better if SLDStyleFactory never rescaled > anything and classes such as StreamingRenderer explicitly rescaled the > symbolizer to pixels and then called SLDStyleFactory normally. > - The UomRescaleStyleVisitor could be discussed as well. For simplicity, > overriding visit() methods to add rescaling was done only on the Symbolizer > level, where the UOM parameter is available. The alternative would be to > implement visit(Graphic), visit(Stroke), etc. and have the UOM parameter be > included in the visitor's state. > > -- Milton Jonathan Grupo GIS e Meio Ambiente Tecgraf/PUC-Rio Tel: +55-21-3527-2502 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel