0

I have a layer on GeoServer which includes lots of organizations. Different organizations can be on the same point. SLD style for this layer:

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor
    xmlns="http://www.opengis.net/sld"
    xmlns:sld="http://www.opengis.net/sld"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
    <sld:Name>hybrid_org</sld:Name>
    <sld:NamedLayer>
        <sld:Name>firms_2gis_info</sld:Name>
        <sld:UserStyle>
            <sld:Name>Default Styler</sld:Name>
            <sld:FeatureTypeStyle>
                <sld:Name>firms_2gis_info</sld:Name>
                <sld:Title>MBStyle firms_2gis_info</sld:Title>
                <sld:Abstract>Generated for firms_2gis_info</sld:Abstract>
                <sld:Rule>
                    <sld:Name>firms_2gis_info</sld:Name>
                    <ogc:Filter>
                        <ogc:PropertyIsEqualTo>
                            <ogc:Function name="in">
                                <ogc:PropertyName>layer_id</ogc:PropertyName>
                                <ogc:Literal>poi_emergency_01</ogc:Literal>
                                <ogc:Literal>poi_culture_02</ogc:Literal>
                                <ogc:Literal>poi_culture_03</ogc:Literal>
                                <ogc:Literal>poi_leisure_02</ogc:Literal>
                                <ogc:Literal>poi_sport_04</ogc:Literal>
                                <ogc:Literal>poi_leisure_01</ogc:Literal>
                            </ogc:Function>
                            <ogc:Literal>false</ogc:Literal>
                        </ogc:PropertyIsEqualTo>
                    </ogc:Filter>
                    <sld:MinScaleDenominator>266.5911979441132</sld:MinScaleDenominator>
                    <sld:MaxScaleDenominator>17061.836668423246</sld:MaxScaleDenominator>
                    <sld:TextSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
                        <sld:Label>
                            <ogc:PropertyName>feature_name</ogc:PropertyName>
                        </sld:Label>
                        <sld:Font>
                            <sld:CssParameter name="font-family">
                                <ogc:Function name="fontAlternatives">
                                    <ogc:Literal>OpenSans-Bold</ogc:Literal>
                                </ogc:Function>
                            </sld:CssParameter>
                            <sld:CssParameter name="font-size">10</sld:CssParameter>
                            <sld:CssParameter name="font-style">normal</sld:CssParameter>
                            <sld:CssParameter name="font-weight">normal</sld:CssParameter>
                        </sld:Font>
                        <sld:LabelPlacement>
                            <sld:PointPlacement>
                                <sld:AnchorPoint>
                                    <sld:AnchorPointX>0.5</sld:AnchorPointX>
                                    <sld:AnchorPointY>1.0</sld:AnchorPointY>
                                </sld:AnchorPoint>
                                <sld:Displacement>
                                    <sld:DisplacementX>
                                        <ogc:Mul>
                                            <ogc:Literal>10</ogc:Literal>
                                            <ogc:Literal>0</ogc:Literal>
                                        </ogc:Mul>
                                    </sld:DisplacementX>
                                    <sld:DisplacementY>
                                        <ogc:Mul>
                                            <ogc:Literal>10</ogc:Literal>
                                            <ogc:Mul>
                                                <ogc:Literal>-1</ogc:Literal>
                                                <ogc:Literal>0.5</ogc:Literal>
                                            </ogc:Mul>
                                        </ogc:Mul>
                                    </sld:DisplacementY>
                                </sld:Displacement>
                            </sld:PointPlacement>
                        </sld:LabelPlacement>
                        <sld:Halo>
                            <sld:Radius>0.5</sld:Radius>
                            <sld:Fill>
                                <sld:CssParameter name="fill">#131813</sld:CssParameter>
                            </sld:Fill>
                        </sld:Halo>
                        <sld:Fill>
                            <sld:CssParameter name="fill">#FFFFFF</sld:CssParameter>
                        </sld:Fill>
                        <sld:Graphic>
                            <sld:ExternalGraphic>
                                <sld:OnlineResource
                                    xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="image"/>
                                    <sld:Format>mbsprite</sld:Format>
                                </sld:ExternalGraphic>
                                <sld:AnchorPoint>
                                    <sld:AnchorPointX>0.5</sld:AnchorPointX>
                                    <sld:AnchorPointY>0.0</sld:AnchorPointY>
                                </sld:AnchorPoint>
                                <sld:Displacement>
                                    <sld:DisplacementX>
                                        <ogc:Mul>
                                            <ogc:Literal>0.5</ogc:Literal>
                                            <ogc:Literal>0</ogc:Literal>
                                        </ogc:Mul>
                                    </sld:DisplacementX>
                                    <sld:DisplacementY>
                                        <ogc:Mul>
                                            <ogc:Literal>0.5</ogc:Literal>
                                            <ogc:Mul>
                                                <ogc:Literal>-1</ogc:Literal>
                                                <ogc:Literal>0</ogc:Literal>
                                            </ogc:Mul>
                                        </ogc:Mul>
                                    </sld:DisplacementY>
                                </sld:Displacement>
                            </sld:Graphic>
                            <sld:Priority>1000</sld:Priority>
                            <sld:VendorOption name="repeat">0</sld:VendorOption>
                            <sld:VendorOption name="conflictResolution">true</sld:VendorOption>
                            <sld:VendorOption name="graphic-resize">NONE</sld:VendorOption>
                            <sld:VendorOption name="partials">true</sld:VendorOption>
                            <sld:VendorOption name="graphic-margin">0</sld:VendorOption>
                            <sld:VendorOption name="spaceAround">25</sld:VendorOption>
                            <sld:VendorOption name="autoWrap">150.0</sld:VendorOption>
                            <sld:VendorOption name="graphicPlacement">INDEPENDENT</sld:VendorOption>
                            <sld:VendorOption name="labelObstacle">false</sld:VendorOption>
                            <sld:VendorOption name="fallbackOnDefaultMark">false</sld:VendorOption>
                        </sld:TextSymbolizer>
                    </sld:Rule>
                </sld:FeatureTypeStyle>
            </sld:UserStyle>
        </sld:NamedLayer>
    </sld:StyledLayerDescriptor>

So, in wms it looks ok: OK wms

When i try to seed and cache with help of mapproxy it gives bad results. It cuts images on tile edges. Mapproxy settings like meta_tile_size and meta_buffer helps particullary. Somwhere it helps, somewhere problems are still here.

I understand why this happens. It happens because conflict resolution is different on different tiles. Example:

On this tile the organization in red box is visible, because the neighbour organization is not visible. If we move a little bit right, neighbour organization is visible and conflict resolution hide the first irganization. It means, that the organization will be cut on the tile edge.

enter image description here enter image description here

I understand, that meta_buffer of mapproxy should do the trick, but somewhere it helps and somewhere not.

Mapproxy - v1.14.0 Geoserver - v2.17.2


After disabling conflictResolution i have this:

enter image description here

1 Answer 1

1

You need to provide an exact point for the label to be drawn, combined with partials that should work as you want. Failing that you may need to turn off conflict resolution.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.