Hello all,This is a follow-up to: https://sourceforge.net/p/geoserver/mailman/geoserver-users/thread/9c182de7-da6d-7ba8-0689-a4ecd29e3381%40camptocamp.com/#msg37788010 The issue was initially reported to us by a customer for rotated markers (ESRI font) with margins. For non-rotated symbols (as in my initial message), it seems the problem is visible only for certain resolutions (for me: when working with a very large screen, or by adding the parameter "&FORMAT_OPTIONS=dpi:96" to the GetMap request).
After locally debugging the code, it appears that the margin between symbols is not taken into account when creating the 3x3 grid and when clipping the subimage from it (that is, the central symbol that will be used for tiling). The margin is added afterwards (outside the markToTilableImage() function) thus resulting in broken up symbols.
I have a branch which addresses the issue and hopefully does not introduce any regression (the unit tests are passing and I also did some manual testing): https://github.com/vuilleumierc/geotools/commit/e9af35eeaf5984e7f6b6514c5f9c03a6846e5aaa
I am also attaching two images (actual result and result with proposed solution) and the corresponding SLD file. Would you consider a PR for this, and if yes do we need a JIRA ticket to open one? If more info is needed, let me know.
Thanks in advance for your consideration and best regards, Cécile -- *camptocamp* INNOVATIVE SOLUTIONS BY OPEN SOURCE EXPERTS *Cécile Vuilleumier * Geospatial developer * * *Camptocamp SA* Route de la Chaux 4 Bâtiment A (Feuille) 1030 Bussigny Switzerland +41 62 544 03 77 (direct) +41 21 619 10 10 (central) www.camptocamp.com <http://www.camptocamp.com>
<?xml version="1.0" encoding="UTF-8"?> <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- a Named Layer is the basic building block of an SLD document --> <NamedLayer> <Name>default_polygon</Name> <UserStyle> <!-- Styles can have names, titles and abstracts --> <Title>Polygon</Title> <Abstract>A sample style that draws a polygon</Abstract> <!-- FeatureTypeStyles describe how to render different features --> <!-- A FeatureTypeStyle for rendering polygons --> <FeatureTypeStyle> <Rule> <Name>rule1</Name> <Title>Marker fill</Title> <PolygonSymbolizer> <VendorOption name="graphic-margin">5</VendorOption> <Fill> <GraphicFill> <Graphic> <Mark> <WellKnownName>triangle</WellKnownName> <Fill> <CssParameter name="fill">#4e4e4e</CssParameter> <CssParameter name="fill-opacity">1.0</CssParameter> </Fill> <Stroke> <CssParameter name="stroke">#000000</CssParameter> <CssParameter name="stroke-width">0</CssParameter> <CssParameter name="stroke-opacity">1.0</CssParameter> </Stroke> </Mark> <Opacity>1.0</Opacity> <Size>24</Size> <Rotation>45</Rotation> </Graphic> </GraphicFill> </Fill> </PolygonSymbolizer> <PolygonSymbolizer> <Stroke> <CssParameter name="stroke">#4e4e4e</CssParameter> <CssParameter name="stroke-width">1</CssParameter> <CssParameter name="stroke-opacity">1.0</CssParameter> </Stroke> </PolygonSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel