Great bug hunting there Andreas, we are in a bit of a crunch time with the code freeze coming up. Reviewing now...
-- Jody Garnett On 13 September 2016 at 18:42, Andreas Watermeyer < andreas.waterme...@its-telco.de> wrote: > Dear GeoTools-Community, > > as you might have seen, I have created GEOT-5519 > (https://osgeo-org.atlassian.net/browse/GEOT-5519), with the following > contents: > > Currently graphics using real-world units as size are rendered too > small when a custom DPI is requested via WMS vendor parameter. > > Consider the following CSS rule: > > * { > mark: url("svg/image.svg"); > mark-mime: "image/svg+xml"; > mark-size: [strConcat(LOC_SCALE, 'm')]; > } > > What happens is the following: > > A style visitor rescales the size due to the DPI vendor parameter, but > as a result the unit of the size is omitted > (GraphicsAwareDpiRescaleStyleVisitor) > Another style visitor rescales the size due the real world unit, > calculates the pixel size. However, the result is wrong because 1) has > omitted the unit. > > In my opinion the problem is > RescaleMode.Pixels.rescaleToStringInternal(), which should > conditionally return the unit. > RescaleMode.Pixels.rescaleToExpression() already behaves like this. > > I did some research in the code and found a unit test for the > DpiRescaleStyleVisitorTest. > However, it tests RescaleMode.Pixels.rescaleToExpression() only. > > I have extended the test to exercise > RescaleMode.Pixels.rescaleToStringInternal(), too, extended > RescaleMode.Pixels.rescaleToStringInternal() and added a more complex > test for this issue in GraphicsAwareDpiRescaleStyleVisitorTest. > > I have also provided a pull request as proposed solution > (https://github.com/geotools/geotools/pull/1305). > I would be glad if somebody could review and hopefully merge it. > > With best regards, > Andreas > > BTW: The GeoTools functionality is pretty impressive. Good job and may > thanks! > > ------------------------------------------------------------ > ------------------ > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel >
------------------------------------------------------------------------------
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel